From 0533ef5f2089f4f12a0ec5c8035e5e15ba0b5556 Mon Sep 17 00:00:00 2001 From: Tao Xu Date: Thu, 5 Sep 2019 16:32:38 +0800 Subject: numa: Introduce MachineClass::auto_enable_numa for implicit NUMA node Add MachineClass::auto_enable_numa field. When it is true, a NUMA node is expected to be created implicitly. Acked-by: David Gibson Suggested-by: Igor Mammedov Suggested-by: Eduardo Habkost Reviewed-by: Igor Mammedov Signed-off-by: Tao Xu Message-Id: <20190905083238.1799-1-tao3.xu@intel.com> Signed-off-by: Eduardo Habkost --- hw/core/numa.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'hw/core') diff --git a/hw/core/numa.c b/hw/core/numa.c index 4dfec5c..038c96d 100644 --- a/hw/core/numa.c +++ b/hw/core/numa.c @@ -378,11 +378,17 @@ void numa_complete_configuration(MachineState *ms) * guest tries to use it with that drivers. * * Enable NUMA implicitly by adding a new NUMA node automatically. + * + * Or if MachineClass::auto_enable_numa is true and no NUMA nodes, + * assume there is just one node with whole RAM. */ - if (ms->ram_slots > 0 && ms->numa_state->num_nodes == 0 && - mc->auto_enable_numa_with_memhp) { + if (ms->numa_state->num_nodes == 0 && + ((ms->ram_slots > 0 && + mc->auto_enable_numa_with_memhp) || + mc->auto_enable_numa)) { NumaNodeOptions node = { }; parse_numa_node(ms, &node, &error_abort); + numa_info[0].node_mem = ram_size; } assert(max_numa_nodeid <= MAX_NODES); -- cgit v1.1