[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 09/78] numa: properly check if numa is supported
From: |
Michael Roth |
Subject: |
[PATCH 09/78] numa: properly check if numa is supported |
Date: |
Tue, 16 Jun 2020 09:14:38 -0500 |
From: Igor Mammedov <imammedo@redhat.com>
Commit aa57020774b, by mistake used MachineClass::numa_mem_supported
to check if NUMA is supported by machine and also as unrelated change
set it to true for sbsa-ref board.
Luckily change didn't break machines that support NUMA, as the field
is set to true for them.
But the field is not intended for checking if NUMA is supported and
will be flipped to false within this release for new machine types.
Fix it:
- by using previously used condition
!mc->cpu_index_to_instance_props || !mc->get_default_cpu_node_id
the first time and then use MachineState::numa_state down the road
to check if NUMA is supported
- dropping stray sbsa-ref chunk
Fixes: aa57020774b690a22be72453b8e91c9b5a68c516
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <1576154936-178362-3-git-send-email-imammedo@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
(cherry picked from commit fcd3f2cc124600385dba46c69a80626985c15b50)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/arm/sbsa-ref.c | 1 -
hw/core/machine.c | 4 ++--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c
index 27046cc284..c6261d44a4 100644
--- a/hw/arm/sbsa-ref.c
+++ b/hw/arm/sbsa-ref.c
@@ -791,7 +791,6 @@ static void sbsa_ref_class_init(ObjectClass *oc, void *data)
mc->possible_cpu_arch_ids = sbsa_ref_possible_cpu_arch_ids;
mc->cpu_index_to_instance_props = sbsa_ref_cpu_index_to_props;
mc->get_default_cpu_node_id = sbsa_ref_get_default_cpu_node_id;
- mc->numa_mem_supported = true;
}
static const TypeInfo sbsa_ref_info = {
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 1689ad3bf8..aa63231f31 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -958,7 +958,7 @@ static void machine_initfn(Object *obj)
NULL);
}
- if (mc->numa_mem_supported) {
+ if (mc->cpu_index_to_instance_props && mc->get_default_cpu_node_id) {
ms->numa_state = g_new0(NumaState, 1);
}
@@ -1102,7 +1102,7 @@ void machine_run_board_init(MachineState *machine)
{
MachineClass *machine_class = MACHINE_GET_CLASS(machine);
- if (machine_class->numa_mem_supported) {
+ if (machine->numa_state) {
numa_complete_configuration(machine);
if (machine->numa_state->num_nodes) {
machine_numa_finish_cpu_init(machine);
--
2.17.1
- [PATCH 00/78] Patch Round-up for stable 4.2.1, freeze on 2020-06-22, Michael Roth, 2020/06/16
- [PATCH 09/78] numa: properly check if numa is supported,
Michael Roth <=
- [PATCH 10/78] backup-top: Begin drain earlier, Michael Roth, 2020/06/16
- [PATCH 11/78] arm/arm-powerctl: set NSACR.{CP11, CP10} bits in arm_set_cpu_on(), Michael Roth, 2020/06/16
- [PATCH 12/78] arm/arm-powerctl: rebuild hflags after setting CP15 bits in arm_set_cpu_on(), Michael Roth, 2020/06/16
- [PATCH 13/78] hw/i386/pc: fix regression in parsing vga cmdline parameter, Michael Roth, 2020/06/16
- [PATCH 14/78] tests/ide-test: Create a single unit-test covering more PRDT cases, Michael Roth, 2020/06/16
- [PATCH 15/78] ide: Fix incorrect handling of some PRDTs in ide_dma_cb(), Michael Roth, 2020/06/16
- [PATCH 16/78] target/arm: Set ISSIs16Bit in make_issinfo, Michael Roth, 2020/06/16
- [PATCH 17/78] virtio: update queue size on guest write, Michael Roth, 2020/06/16
- [PATCH 18/78] virtio-mmio: update queue size on guest write, Michael Roth, 2020/06/16
- [PATCH 19/78] virtio: add ability to delete vq through a pointer, Michael Roth, 2020/06/16