* [PATCH 2/2] numa: properly check if numa is supported
@ 2019-12-12 12:48 ` Igor Mammedov
0 siblings, 0 replies; 17+ messages in thread
From: Igor Mammedov @ 2019-12-12 12:48 UTC (permalink / raw)
To: qemu-devel
Cc: Peter Maydell, Radoslaw Biernacki, Eduardo Habkost, Tao Xu,
qemu-stable, Leif Lindholm, qemu-arm
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>
---
CC: Radoslaw Biernacki <radoslaw.biernacki@linaro.org>
CC: Peter Maydell <peter.maydell@linaro.org>
CC: Leif Lindholm <leif.lindholm@linaro.org>
CC: qemu-arm@nongnu.org
CC: qemu-stable@nongnu.org
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 27046cc..c6261d4 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 1689ad3..aa63231 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.7.4
^ permalink raw reply related [flat|nested] 17+ messages in thread* Re: [PATCH 2/2] numa: properly check if numa is supported
2019-12-12 12:48 ` Igor Mammedov
@ 2019-12-13 1:33 ` Tao Xu
-1 siblings, 0 replies; 17+ messages in thread
From: Tao Xu @ 2019-12-13 1:33 UTC (permalink / raw)
To: Igor Mammedov, qemu-devel@nongnu.org
Cc: Peter Maydell, Radoslaw Biernacki, Eduardo Habkost,
qemu-stable@nongnu.org, Leif Lindholm, qemu-arm@nongnu.org,
Marcel Apfelbaum
On 12/12/2019 8:48 PM, Igor Mammedov wrote:
> 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>
> ---
> CC: Radoslaw Biernacki <radoslaw.biernacki@linaro.org>
> CC: Peter Maydell <peter.maydell@linaro.org>
> CC: Leif Lindholm <leif.lindholm@linaro.org>
> CC: qemu-arm@nongnu.org
> CC: qemu-stable@nongnu.org
>
>
> 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 27046cc..c6261d4 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 1689ad3..aa63231 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);
> }
I am wondering if @numa_mem_supported is unused here, it is unused for
QEMU, because the only usage of @numa_mem_supported is to initialize
@numa_state. Or there is other usage? So should it be removed from
struct MachineClass?
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH 2/2] numa: properly check if numa is supported
@ 2019-12-13 1:33 ` Tao Xu
0 siblings, 0 replies; 17+ messages in thread
From: Tao Xu @ 2019-12-13 1:33 UTC (permalink / raw)
To: Igor Mammedov, qemu-devel@nongnu.org
Cc: Peter Maydell, Radoslaw Biernacki, Eduardo Habkost,
qemu-stable@nongnu.org, Leif Lindholm, qemu-arm@nongnu.org
On 12/12/2019 8:48 PM, Igor Mammedov wrote:
> 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>
> ---
> CC: Radoslaw Biernacki <radoslaw.biernacki@linaro.org>
> CC: Peter Maydell <peter.maydell@linaro.org>
> CC: Leif Lindholm <leif.lindholm@linaro.org>
> CC: qemu-arm@nongnu.org
> CC: qemu-stable@nongnu.org
>
>
> 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 27046cc..c6261d4 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 1689ad3..aa63231 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);
> }
I am wondering if @numa_mem_supported is unused here, it is unused for
QEMU, because the only usage of @numa_mem_supported is to initialize
@numa_state. Or there is other usage? So should it be removed from
struct MachineClass?
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH 2/2] numa: properly check if numa is supported
2019-12-13 1:33 ` Tao Xu
@ 2019-12-13 9:12 ` Igor Mammedov
-1 siblings, 0 replies; 17+ messages in thread
From: Igor Mammedov @ 2019-12-13 9:12 UTC (permalink / raw)
To: Tao Xu
Cc: Peter Maydell, Radoslaw Biernacki, Eduardo Habkost,
qemu-devel@nongnu.org, Leif Lindholm, qemu-stable@nongnu.org,
qemu-arm@nongnu.org, Marcel Apfelbaum
On Fri, 13 Dec 2019 09:33:10 +0800
Tao Xu <tao3.xu@intel.com> wrote:
> On 12/12/2019 8:48 PM, Igor Mammedov wrote:
> > 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>
> > ---
> > CC: Radoslaw Biernacki <radoslaw.biernacki@linaro.org>
> > CC: Peter Maydell <peter.maydell@linaro.org>
> > CC: Leif Lindholm <leif.lindholm@linaro.org>
> > CC: qemu-arm@nongnu.org
> > CC: qemu-stable@nongnu.org
> >
> >
> > 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 27046cc..c6261d4 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 1689ad3..aa63231 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);
> > }
>
> I am wondering if @numa_mem_supported is unused here, it is unused for
> QEMU, because the only usage of @numa_mem_supported is to initialize
> @numa_state. Or there is other usage? So should it be removed from
> struct MachineClass?
You are wrong, it's not intended for numa_state initialization,
read doc comment for it in include/hw/boards.h
(for full story look at commit cd5ff8333a3)
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH 2/2] numa: properly check if numa is supported
@ 2019-12-13 9:12 ` Igor Mammedov
0 siblings, 0 replies; 17+ messages in thread
From: Igor Mammedov @ 2019-12-13 9:12 UTC (permalink / raw)
To: Tao Xu
Cc: Peter Maydell, Radoslaw Biernacki, Eduardo Habkost,
qemu-devel@nongnu.org, Leif Lindholm, qemu-stable@nongnu.org,
qemu-arm@nongnu.org
On Fri, 13 Dec 2019 09:33:10 +0800
Tao Xu <tao3.xu@intel.com> wrote:
> On 12/12/2019 8:48 PM, Igor Mammedov wrote:
> > 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>
> > ---
> > CC: Radoslaw Biernacki <radoslaw.biernacki@linaro.org>
> > CC: Peter Maydell <peter.maydell@linaro.org>
> > CC: Leif Lindholm <leif.lindholm@linaro.org>
> > CC: qemu-arm@nongnu.org
> > CC: qemu-stable@nongnu.org
> >
> >
> > 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 27046cc..c6261d4 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 1689ad3..aa63231 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);
> > }
>
> I am wondering if @numa_mem_supported is unused here, it is unused for
> QEMU, because the only usage of @numa_mem_supported is to initialize
> @numa_state. Or there is other usage? So should it be removed from
> struct MachineClass?
You are wrong, it's not intended for numa_state initialization,
read doc comment for it in include/hw/boards.h
(for full story look at commit cd5ff8333a3)
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH 2/2] numa: properly check if numa is supported
2019-12-13 9:12 ` Igor Mammedov
@ 2019-12-16 1:03 ` Tao Xu
-1 siblings, 0 replies; 17+ messages in thread
From: Tao Xu @ 2019-12-16 1:03 UTC (permalink / raw)
To: Igor Mammedov
Cc: Peter Maydell, Radoslaw Biernacki, Eduardo Habkost,
qemu-devel@nongnu.org, Leif Lindholm, qemu-stable@nongnu.org,
qemu-arm@nongnu.org, Marcel Apfelbaum
On 12/13/2019 5:12 PM, Igor Mammedov wrote:
> On Fri, 13 Dec 2019 09:33:10 +0800
> Tao Xu <tao3.xu@intel.com> wrote:
>
>> On 12/12/2019 8:48 PM, Igor Mammedov wrote:
>>> 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>
>>> ---
>>> CC: Radoslaw Biernacki <radoslaw.biernacki@linaro.org>
>>> CC: Peter Maydell <peter.maydell@linaro.org>
>>> CC: Leif Lindholm <leif.lindholm@linaro.org>
>>> CC: qemu-arm@nongnu.org
>>> CC: qemu-stable@nongnu.org
>>>
>>>
>>> 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 27046cc..c6261d4 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 1689ad3..aa63231 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);
>>> }
>>
>> I am wondering if @numa_mem_supported is unused here, it is unused for
>> QEMU, because the only usage of @numa_mem_supported is to initialize
>> @numa_state. Or there is other usage? So should it be removed from
>> struct MachineClass?
> You are wrong, it's not intended for numa_state initialization,
> read doc comment for it in include/hw/boards.h
> (for full story look at commit cd5ff8333a3)
>
I understand.
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH 2/2] numa: properly check if numa is supported
@ 2019-12-16 1:03 ` Tao Xu
0 siblings, 0 replies; 17+ messages in thread
From: Tao Xu @ 2019-12-16 1:03 UTC (permalink / raw)
To: Igor Mammedov
Cc: Peter Maydell, Radoslaw Biernacki, Eduardo Habkost,
qemu-devel@nongnu.org, Leif Lindholm, qemu-stable@nongnu.org,
qemu-arm@nongnu.org
On 12/13/2019 5:12 PM, Igor Mammedov wrote:
> On Fri, 13 Dec 2019 09:33:10 +0800
> Tao Xu <tao3.xu@intel.com> wrote:
>
>> On 12/12/2019 8:48 PM, Igor Mammedov wrote:
>>> 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>
>>> ---
>>> CC: Radoslaw Biernacki <radoslaw.biernacki@linaro.org>
>>> CC: Peter Maydell <peter.maydell@linaro.org>
>>> CC: Leif Lindholm <leif.lindholm@linaro.org>
>>> CC: qemu-arm@nongnu.org
>>> CC: qemu-stable@nongnu.org
>>>
>>>
>>> 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 27046cc..c6261d4 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 1689ad3..aa63231 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);
>>> }
>>
>> I am wondering if @numa_mem_supported is unused here, it is unused for
>> QEMU, because the only usage of @numa_mem_supported is to initialize
>> @numa_state. Or there is other usage? So should it be removed from
>> struct MachineClass?
> You are wrong, it's not intended for numa_state initialization,
> read doc comment for it in include/hw/boards.h
> (for full story look at commit cd5ff8333a3)
>
I understand.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 2/2] numa: properly check if numa is supported
2019-12-12 12:48 ` Igor Mammedov
(?)
(?)
@ 2019-12-19 17:57 ` Eduardo Habkost
-1 siblings, 0 replies; 17+ messages in thread
From: Eduardo Habkost @ 2019-12-19 17:57 UTC (permalink / raw)
To: Igor Mammedov
Cc: Peter Maydell, Radoslaw Biernacki, Tao Xu, qemu-devel,
Leif Lindholm, qemu-stable, qemu-arm
On Thu, Dec 12, 2019 at 01:48:56PM +0100, Igor Mammedov wrote:
> 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>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
I'm queueing this and plan to submit a pull request soon.
--
Eduardo
^ permalink raw reply [flat|nested] 17+ messages in thread