[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RESEND PATCH v3 5/5] spapr: move memory/cpu less check to spapr_numa_FO
From: |
Daniel Henrique Barboza |
Subject: |
[RESEND PATCH v3 5/5] spapr: move memory/cpu less check to spapr_numa_FORM1_affinity_init() |
Date: |
Wed, 25 Aug 2021 11:39:43 -0300 |
FORM2 NUMA affinity is prepared to deal with memory/cpu less
NUMA nodes. This is used by the DAX KMEM driver to locate a
PAPR SCM device that has a different latency than the original
NUMA node from the regular memory.
Move this verification to FORM1 affinity code.
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
hw/ppc/spapr.c | 33 ---------------------------------
hw/ppc/spapr_numa.c | 33 +++++++++++++++++++++++++++++++++
2 files changed, 33 insertions(+), 33 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 7ea7605abf..3605472445 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2795,39 +2795,6 @@ static void spapr_machine_init(MachineState *machine)
/* init CPUs */
spapr_init_cpus(spapr);
- /*
- * check we don't have a memory-less/cpu-less NUMA node
- * Firmware relies on the existing memory/cpu topology to provide the
- * NUMA topology to the kernel.
- * And the linux kernel needs to know the NUMA topology at start
- * to be able to hotplug CPUs later.
- */
- if (machine->numa_state->num_nodes) {
- for (i = 0; i < machine->numa_state->num_nodes; ++i) {
- /* check for memory-less node */
- if (machine->numa_state->nodes[i].node_mem == 0) {
- CPUState *cs;
- int found = 0;
- /* check for cpu-less node */
- CPU_FOREACH(cs) {
- PowerPCCPU *cpu = POWERPC_CPU(cs);
- if (cpu->node_id == i) {
- found = 1;
- break;
- }
- }
- /* memory-less and cpu-less node */
- if (!found) {
- error_report(
- "Memory-less/cpu-less nodes are not supported (node
%d)",
- i);
- exit(1);
- }
- }
- }
-
- }
-
spapr->gpu_numa_id = spapr_numa_initial_nvgpu_numa_id(machine);
if ((!kvm_enabled() || kvmppc_has_cap_mmu_radix()) &&
diff --git a/hw/ppc/spapr_numa.c b/hw/ppc/spapr_numa.c
index bba5a984e4..98740c732d 100644
--- a/hw/ppc/spapr_numa.c
+++ b/hw/ppc/spapr_numa.c
@@ -162,6 +162,39 @@ static void
spapr_numa_FORM1_affinity_init(SpaprMachineState *spapr,
MachineState *machine)
{
bool using_legacy_numa = spapr_machine_using_legacy_numa(spapr);
+ int i;
+
+ /*
+ * check we don't have a memory-less/cpu-less NUMA node
+ * Firmware relies on the existing memory/cpu topology to provide the
+ * NUMA topology to the kernel.
+ * And the linux kernel needs to know the NUMA topology at start
+ * to be able to hotplug CPUs later.
+ */
+ if (machine->numa_state->num_nodes) {
+ for (i = 0; i < machine->numa_state->num_nodes; ++i) {
+ /* check for memory-less node */
+ if (machine->numa_state->nodes[i].node_mem == 0) {
+ CPUState *cs;
+ int found = 0;
+ /* check for cpu-less node */
+ CPU_FOREACH(cs) {
+ PowerPCCPU *cpu = POWERPC_CPU(cs);
+ if (cpu->node_id == i) {
+ found = 1;
+ break;
+ }
+ }
+ /* memory-less and cpu-less node */
+ if (!found) {
+ error_report(
+ "Memory-less/cpu-less nodes are not supported (node
%d)",
+ i);
+ exit(1);
+ }
+ }
+ }
+ }
/*
* Legacy NUMA guests (pseries-5.1 and older, or guests with only
--
2.31.1