qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Verma, Vishal L" <vishal.l.verma@intel.com>
To: "imammedo@redhat.com" <imammedo@redhat.com>
Cc: "lvivier@redhat.com" <lvivier@redhat.com>,
	"thuth@redhat.com" <thuth@redhat.com>,
	"xiaoguangrong.eric@gmail.com" <xiaoguangrong.eric@gmail.com>,
	"mst@redhat.com" <mst@redhat.com>,
	"Liu, Jingqi" <jingqi.liu@intel.com>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"ehabkost@redhat.com" <ehabkost@redhat.com>,
	"pbonzini@redhat.com" <pbonzini@redhat.com>,
	"Williams, Dan J" <dan.j.williams@intel.com>,
	"rth@twiddle.net" <rth@twiddle.net>
Subject: Re: [PATCH v2 2/3] hw/acpi-build: account for NVDIMM numa nodes in SRAT
Date: Thu, 28 May 2020 16:05:22 +0000	[thread overview]
Message-ID: <7bbbc2706e7b886d55aa23b5ae67200a363f7b6f.camel@intel.com> (raw)
In-Reply-To: <20200528131946.3a09cd20@redhat.com>

On Thu, 2020-05-28 at 13:19 +0200, Igor Mammedov wrote:

[..]
> > @@ -1334,6 +1335,31 @@ static void nvdimm_build_ssdt(GArray *table_offsets, GArray *table_data,
> >      free_aml_allocator();
> >  }
> >  
> > +void *nvdimm_build_srat(GArray *table_data)
> > +{
> > +    AcpiSratMemoryAffinity *numamem = NULL;
> > +    GSList *device_list = nvdimm_get_device_list();
> > +
> > +    for (; device_list; device_list = device_list->next) {
> > +        DeviceState *dev = device_list->data;
> I'd use Object here with OBJECT() cast and drop casts beolw in property getters
> 
Done, that makes it much cleaner.

> > diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> > index 2e15f6848e..1461d8a718 100644
> > --- a/hw/i386/acpi-build.c
> > +++ b/hw/i386/acpi-build.c
> > @@ -2428,6 +2428,16 @@ build_srat(GArray *table_data, BIOSLinker *linker, MachineState *machine)
> >                                MEM_AFFINITY_ENABLED);
> >          }
> >      }
> > +
> > +    if (machine->nvdimms_state->is_enabled) {
> > +        void *ret;
> > +
> > +        ret = nvdimm_build_srat(table_data);
> > +        if (ret != NULL) {
> > +            numamem = ret;
> > +        }
> 
> why do we need return value here and a test condition and assign 'ret' to numamem?

Ah I thought numamem was propagated through the different parts of the
build_srat flow, but I misread. You're right it is not needed, removing.


  reply	other threads:[~2020-05-28 16:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-28  5:48 [PATCH v2 0/3] account for NVDIMM nodes during SRAT generation Vishal Verma
2020-05-28  5:48 ` [PATCH v2 1/3] diffs-allowed: add the SRAT AML to diffs-allowed Vishal Verma
2020-05-28  5:48 ` [PATCH v2 2/3] hw/acpi-build: account for NVDIMM numa nodes in SRAT Vishal Verma
2020-05-28 11:19   ` Igor Mammedov
2020-05-28 16:05     ` Verma, Vishal L [this message]
2020-05-28  5:48 ` [PATCH v2 3/3] tests/acpi: update expected SRAT files Vishal Verma
2020-05-28  6:43 ` [PATCH v2 0/3] account for NVDIMM nodes during SRAT generation no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7bbbc2706e7b886d55aa23b5ae67200a363f7b6f.camel@intel.com \
    --to=vishal.l.verma@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=jingqi.liu@intel.com \
    --cc=lvivier@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=thuth@redhat.com \
    --cc=xiaoguangrong.eric@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).