mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
virtio, pci, pc: fixes, features
Bugfixes all over the place. HMAT support. New flags for vhost-user-blk utility. Auto-tuning of seg max for virtio storage. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> -----BEGIN PGP SIGNATURE----- iQFDBAABCAAtFiEEXQn9CHHI+FuUyooNKB8NuNKNVGkFAl4TaMEPHG1zdEByZWRo YXQuY29tAAoJECgfDbjSjVRpvzgH/2LyDAzCa9h93ikSJjmyUk5FUaqve38daEb3 S3JYjwKxQx7u1ydooKhvBQnBCZ2i3S+k62gfYyKB+nBv8xvjs0Eg5D1YJ5E8hciy lf5OFGWWtX2iPDjZwQwT13kiJe0o3JRGxJJ6XqTEG+1EYOp7cky/FEv4PD030b9m I2wROZ/Am+onB9YJX8c0Vv1CG+AryuJNXnvwQzTXEjj4U7bEYUyJwVZaCRyAdWQ3 uYXIZN9VwjVX6BFvy9ZAJbEsUVJvOM1/aQaDqcrLz+VlzRT7bRkKHi2G3vakrm1I r5OpgyLo84132awCncbSykKDH5o8WaxLaJBjGmuBfasMz9wPzAg= =uL1o -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging virtio, pci, pc: fixes, features Bugfixes all over the place. HMAT support. New flags for vhost-user-blk utility. Auto-tuning of seg max for virtio storage. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Mon 06 Jan 2020 17:05:05 GMT # gpg: using RSA key 5D09FD0871C8F85B94CA8A0D281F0DB8D28D5469 # gpg: issuer "mst@redhat.com" # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" [full] # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" [full] # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17 0970 C350 3912 AFBE 8E67 # Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA 8A0D 281F 0DB8 D28D 5469 * remotes/mst/tags/for_upstream: (32 commits) intel_iommu: add present bit check for pasid table entries intel_iommu: a fix to vtd_find_as_from_bus_num() virtio-net: delete also control queue when TX/RX deleted virtio: reset region cache when on queue deletion virtio-mmio: update queue size on guest write tests: add virtio-scsi and virtio-blk seg_max_adjust test virtio: make seg_max virtqueue size dependent hw: fix using 4.2 compat in 5.0 machine types for i440fx/q35 vhost-user-scsi: reset the device if supported vhost-user: add VHOST_USER_RESET_DEVICE to reset devices hw/pci/pci_host: Let pci_data_[read/write] use unsigned 'size' argument hw/pci/pci_host: Remove redundant PCI_DPRINTF() virtio-mmio: Clear v2 transport state on soft reset ACPI: add expected files for HMAT tests (acpihmat) tests/bios-tables-test: add test cases for ACPI HMAT tests/numa: Add case for QMP build HMAT hmat acpi: Build Memory Side Cache Information Structure(s) hmat acpi: Build System Locality Latency and Bandwidth Information Structure(s) hmat acpi: Build Memory Proximity Domain Attributes Structure(s) numa: Extend CLI to provide memory side cache information ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
973d306dd6
45 changed files with 1796 additions and 133 deletions
|
@ -29,11 +29,15 @@
|
|||
|
||||
GlobalProperty hw_compat_4_2[] = {
|
||||
{ "virtio-blk-device", "x-enable-wce-if-config-wce", "off" },
|
||||
{ "virtio-blk-device", "seg-max-adjust", "off"},
|
||||
{ "virtio-scsi-device", "seg_max_adjust", "off"},
|
||||
{ "vhost-blk-device", "seg_max_adjust", "off"},
|
||||
};
|
||||
const size_t hw_compat_4_2_len = G_N_ELEMENTS(hw_compat_4_2);
|
||||
|
||||
GlobalProperty hw_compat_4_1[] = {
|
||||
{ "virtio-pci", "x-pcie-flr-init", "off" },
|
||||
{ "virtio-device", "use-disabled-flag", "false" },
|
||||
};
|
||||
const size_t hw_compat_4_1_len = G_N_ELEMENTS(hw_compat_4_1);
|
||||
|
||||
|
@ -429,6 +433,20 @@ static void machine_set_nvdimm(Object *obj, bool value, Error **errp)
|
|||
ms->nvdimms_state->is_enabled = value;
|
||||
}
|
||||
|
||||
static bool machine_get_hmat(Object *obj, Error **errp)
|
||||
{
|
||||
MachineState *ms = MACHINE(obj);
|
||||
|
||||
return ms->numa_state->hmat_enabled;
|
||||
}
|
||||
|
||||
static void machine_set_hmat(Object *obj, bool value, Error **errp)
|
||||
{
|
||||
MachineState *ms = MACHINE(obj);
|
||||
|
||||
ms->numa_state->hmat_enabled = value;
|
||||
}
|
||||
|
||||
static char *machine_get_nvdimm_persistence(Object *obj, Error **errp)
|
||||
{
|
||||
MachineState *ms = MACHINE(obj);
|
||||
|
@ -556,6 +574,7 @@ void machine_set_cpu_numa_node(MachineState *machine,
|
|||
const CpuInstanceProperties *props, Error **errp)
|
||||
{
|
||||
MachineClass *mc = MACHINE_GET_CLASS(machine);
|
||||
NodeInfo *numa_info = machine->numa_state->nodes;
|
||||
bool match = false;
|
||||
int i;
|
||||
|
||||
|
@ -625,6 +644,17 @@ void machine_set_cpu_numa_node(MachineState *machine,
|
|||
match = true;
|
||||
slot->props.node_id = props->node_id;
|
||||
slot->props.has_node_id = props->has_node_id;
|
||||
|
||||
if (machine->numa_state->hmat_enabled) {
|
||||
if ((numa_info[props->node_id].initiator < MAX_NODES) &&
|
||||
(props->node_id != numa_info[props->node_id].initiator)) {
|
||||
error_setg(errp, "The initiator of CPU NUMA node %" PRId64
|
||||
" should be itself", props->node_id);
|
||||
return;
|
||||
}
|
||||
numa_info[props->node_id].has_cpu = true;
|
||||
numa_info[props->node_id].initiator = props->node_id;
|
||||
}
|
||||
}
|
||||
|
||||
if (!match) {
|
||||
|
@ -845,6 +875,13 @@ static void machine_initfn(Object *obj)
|
|||
|
||||
if (mc->cpu_index_to_instance_props && mc->get_default_cpu_node_id) {
|
||||
ms->numa_state = g_new0(NumaState, 1);
|
||||
object_property_add_bool(obj, "hmat",
|
||||
machine_get_hmat, machine_set_hmat,
|
||||
&error_abort);
|
||||
object_property_set_description(obj, "hmat",
|
||||
"Set on/off to enable/disable "
|
||||
"ACPI Heterogeneous Memory Attribute "
|
||||
"Table (HMAT)", NULL);
|
||||
}
|
||||
|
||||
/* Register notifier when init is done for sysbus sanity checks */
|
||||
|
@ -912,6 +949,32 @@ static char *cpu_slot_to_string(const CPUArchId *cpu)
|
|||
return g_string_free(s, false);
|
||||
}
|
||||
|
||||
static void numa_validate_initiator(NumaState *numa_state)
|
||||
{
|
||||
int i;
|
||||
NodeInfo *numa_info = numa_state->nodes;
|
||||
|
||||
for (i = 0; i < numa_state->num_nodes; i++) {
|
||||
if (numa_info[i].initiator == MAX_NODES) {
|
||||
error_report("The initiator of NUMA node %d is missing, use "
|
||||
"'-numa node,initiator' option to declare it", i);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (!numa_info[numa_info[i].initiator].present) {
|
||||
error_report("NUMA node %" PRIu16 " is missing, use "
|
||||
"'-numa node' option to declare it first",
|
||||
numa_info[i].initiator);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (!numa_info[numa_info[i].initiator].has_cpu) {
|
||||
error_report("The initiator of NUMA node %d is invalid", i);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void machine_numa_finish_cpu_init(MachineState *machine)
|
||||
{
|
||||
int i;
|
||||
|
@ -952,6 +1015,11 @@ static void machine_numa_finish_cpu_init(MachineState *machine)
|
|||
machine_set_cpu_numa_node(machine, &props, &error_fatal);
|
||||
}
|
||||
}
|
||||
|
||||
if (machine->numa_state->hmat_enabled) {
|
||||
numa_validate_initiator(machine->numa_state);
|
||||
}
|
||||
|
||||
if (s->len && !qtest_enabled()) {
|
||||
warn_report("CPU(s) not present in any NUMA nodes: %s",
|
||||
s->str);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue