Linux-CXL Archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Gregory Price <gregory.price@memverge.com>
Cc: Liu Jingqi <jingqi.liu@intel.com>, <qemu-devel@nongnu.org>,
	<ankita@nvidia.com>, "Michael S . Tsirkin" <mst@redhat.com>,
	Igor Mammedov <imammedo@redhat.com>,
	Ani Sinha <anisinha@redhat.com>, <linuxarm@huawei.com>,
	Markus Armbruster <armbru@redhat.com>,
	Daniel Black <daniel@linux.ibm.com>, <linux-cxl@vger.kernel.org>
Subject: Re: [PATCH 1/2] hmat acpi: Do not add Memory Proximity Domain Attributes Structure targetting non existent memory.
Date: Thu, 29 Feb 2024 17:52:32 +0000	[thread overview]
Message-ID: <20240229175232.000017d2@Huawei.com> (raw)
In-Reply-To: <ZeC7EO/fQKScG8Rb@memverge.com>

On Thu, 29 Feb 2024 12:28:51 -0500
Gregory Price <gregory.price@memverge.com> wrote:

> On Thu, Feb 29, 2024 at 04:25:44PM +0000, Jonathan Cameron wrote:
> > If qemu is started with a proximity node containing CPUs alone,
> > it will provide one of these structures to say memory in this
> > node is directly connected to itself.
> > 
> > This description is arguably pointless even if there is memory
> > in the node.  If there is no memory present, and hence no SRAT
> > entry it breaks Linux HMAT passing and the table is rejected.
> > 
> > https://elixir.bootlin.com/linux/latest/source/drivers/acpi/numa/hmat.c#L444
> >   
> 
> Nit: This link becomes out of date pretty much immediately, consider
> using a versioned link.
Good point.

https://elixir.bootlin.com/linux/v6.7/source/drivers/acpi/numa/hmat.c#L444

> 
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > ---
> >  hw/acpi/hmat.c | 7 +++++++
> >  1 file changed, 7 insertions(+)
> > 
> > diff --git a/hw/acpi/hmat.c b/hw/acpi/hmat.c
> > index 3042d223c8..723ae28d32 100644
> > --- a/hw/acpi/hmat.c
> > +++ b/hw/acpi/hmat.c
> > @@ -204,6 +204,13 @@ static void hmat_build_table_structs(GArray *table_data, NumaState *numa_state)
> >      build_append_int_noprefix(table_data, 0, 4); /* Reserved */
> >  
> >      for (i = 0; i < numa_state->num_nodes; i++) {
> > +        /*
> > +         * Linux rejects whole HMAT table if a node with no memory
> > +         * has one of these structures listing it as a target.
> > +         */
> > +        if (!numa_state->nodes[i].node_mem) {
> > +            continue;
> > +        }
> >          flags = 0;
> >  
> >          if (numa_state->nodes[i].initiator < MAX_NODES) {
> > -- 
> > 2.39.2
> > 
> >   


  reply	other threads:[~2024-02-29 17:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-29 16:25 [PATCH 0/2 qemu] hw/acpi/hmat: Misc fixes Jonathan Cameron
2024-02-29 16:25 ` [PATCH 1/2] hmat acpi: Do not add Memory Proximity Domain Attributes Structure targetting non existent memory Jonathan Cameron
2024-02-29 17:28   ` Gregory Price
2024-02-29 17:52     ` Jonathan Cameron [this message]
2024-02-29 16:25 ` [PATCH 2/2] hmat acpi: Fix out of bounds access due to missing use of indirection Jonathan Cameron

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=20240229175232.000017d2@Huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=anisinha@redhat.com \
    --cc=ankita@nvidia.com \
    --cc=armbru@redhat.com \
    --cc=daniel@linux.ibm.com \
    --cc=gregory.price@memverge.com \
    --cc=imammedo@redhat.com \
    --cc=jingqi.liu@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).