qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: Babu Moger <babu.moger@amd.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"pbonzini@redhat.com" <pbonzini@redhat.com>,
	"ehabkost@redhat.com" <ehabkost@redhat.com>,
	"rth@twiddle.net" <rth@twiddle.net>
Subject: Re: [PATCH v2 1/3] hw/i386: Initialize topo_ids from CpuInstanceProperties
Date: Mon, 13 Jul 2020 18:17:40 +0200	[thread overview]
Message-ID: <20200713181740.16a357a6@redhat.com> (raw)
In-Reply-To: <78809d9f-a491-8c99-3f35-7f012c7d75bf@amd.com>

On Mon, 13 Jul 2020 10:02:22 -0500
Babu Moger <babu.moger@amd.com> wrote:

> > -----Original Message-----
> > From: Igor Mammedov <imammedo@redhat.com>
> > Sent: Monday, July 13, 2020 4:08 AM
> > To: Moger, Babu <Babu.Moger@amd.com>
> > Cc: pbonzini@redhat.com; rth@twiddle.net; ehabkost@redhat.com; qemu-
> > devel@nongnu.org
> > Subject: Re: [PATCH v2 1/3] hw/i386: Initialize topo_ids from
> > CpuInstanceProperties
[...]
> > > +
> > > +/*
> > > + * Initialize topo_ids from CpuInstanceProperties
> > > + * node_id in CpuInstanceProperties(or in CPU device) is a sequential
> > > + * number, but while building the topology  
> >   
> > >we need to separate it for
> > > + * each socket(mod nodes_per_pkg).  
> > could you clarify a bit more on why this is necessary?  
> 
> If you have two sockets and 4 numa nodes, node_id in CpuInstanceProperties
> will be number sequentially as 0, 1, 2, 3.  But in EPYC topology, it will
> be  0, 1, 0, 1( Basically mod % number of nodes per socket).

I'm confused, let's suppose we have 2 EPYC sockets with 2 nodes per socket
so APIC id woulbe be composed like:

 1st socket
   pkg_id(0) | node_id(0)
   pkg_id(0) | node_id(1)

 2nd socket
   pkg_id(1) | node_id(0)
   pkg_id(1) | node_id(1)
  
if that's the case, then EPYC's node_id here doesn't look like
a NUMA node in the sense it's usually used
(above config would have 4 different memory controllers => 4 conventional NUMA nodes).

I wonder if linux guest actually uses node_id encoded in apic id for
configuring/checking numa structures, or it just uses whatever ACPI SRAT
table provided.
 
> > > + */
> > > +static inline void x86_init_topo_ids(X86CPUTopoInfo *topo_info,
> > > +                                     CpuInstanceProperties props,
> > > +                                     X86CPUTopoIDs *topo_ids) {
> > > +    topo_ids->smt_id = props.has_thread_id ? props.thread_id : 0;
> > > +    topo_ids->core_id = props.has_core_id ? props.core_id : 0;
> > > +    topo_ids->die_id = props.has_die_id ? props.die_id : 0;
> > > +    topo_ids->node_id = props.has_node_id ?
> > > +                        props.node_id % MAX(topo_info->nodes_per_pkg, 1) : 0;
> > > +    topo_ids->pkg_id = props.has_socket_id ? props.socket_id : 0; }
> > >  /*
> > >   * Make APIC ID for the CPU 'cpu_index'
> > >   *
> > >  
> 



  reply	other threads:[~2020-07-13 16:18 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-01 17:30 [PATCH v2 0/3] Fix couple of issues with AMD topology Babu Moger
2020-07-01 17:31 ` [PATCH v2 1/3] hw/i386: Initialize topo_ids from CpuInstanceProperties Babu Moger
2020-07-13  9:08   ` Igor Mammedov
2020-07-13 15:02     ` Babu Moger
2020-07-13 16:17       ` Igor Mammedov [this message]
2020-07-13 16:43         ` Babu Moger
2020-07-13 17:32           ` Igor Mammedov
2020-07-13 19:30             ` Babu Moger
2020-07-14 16:41               ` Igor Mammedov
2020-07-14 17:26                 ` Babu Moger
2020-07-14 18:26                   ` Igor Mammedov
2020-07-24 17:05               ` Igor Mammedov
2020-07-27 15:49                 ` Babu Moger
2020-07-27 17:14                   ` Igor Mammedov
2020-07-27 23:59                     ` Babu Moger
2020-07-29 14:12                       ` Igor Mammedov
2020-07-29 21:22                         ` Babu Moger
2020-07-30 11:27                           ` Igor Mammedov
2020-07-01 17:31 ` [PATCH v2 2/3] hw/i386: Build apic_id " Babu Moger
2020-07-13  9:15   ` Igor Mammedov
2020-07-13 15:00     ` Babu Moger
2020-07-01 17:31 ` [PATCH v2 3/3] hw/386: Fix uninitialized memory with -device and CPU hotplug Babu Moger
2020-07-27 16:36   ` Igor Mammedov

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=20200713181740.16a357a6@redhat.com \
    --to=imammedo@redhat.com \
    --cc=babu.moger@amd.com \
    --cc=ehabkost@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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).