Re: [PATCH v4 09/16] target/i386: Cleanup and use the EPYC mode topology functions

2020-03-02 Thread Babu Moger
On 2/25/20 1:49 AM, Igor Mammedov wrote: > On Mon, 24 Feb 2020 11:29:37 -0600 > Babu Moger wrote: > >> On 2/24/20 2:52 AM, Igor Mammedov wrote: >>> On Thu, 13 Feb 2020 12:17:25 -0600 >>> Babu Moger wrote: >>> >>>> Use the new functions

[PATCH v5 00/16] APIC ID fixes for AMD EPYC CPU model

2020-03-03 Thread Babu Moger
re.kernel.org/qemu-devel/20190731232032.51786-1-babu.mo...@amd.com/ --- Babu Moger (16): hw/i386: Rename X86CPUTopoInfo structure to X86CPUTopoIDs hw/i386: Introduce X86CPUTopoInfo to contain topology info hw/i386: Consolidate topology functions machine: Add SMP Sockets in C

[PATCH v5 03/16] hw/i386: Consolidate topology functions

2020-03-03 Thread Babu Moger
Now that we have all the parameters in X86CPUTopoInfo, we can just pass the structure to calculate the offsets and width. Signed-off-by: Babu Moger Reviewed-by: Igor Mammedov --- include/hw/i386/topology.h | 68 ++-- target/i386/cpu.c | 23

[PATCH v5 01/16] hw/i386: Rename X86CPUTopoInfo structure to X86CPUTopoIDs

2020-03-03 Thread Babu Moger
Rename few data structures related to X86 topology. X86CPUTopoIDs will have individual arch ids. Next patch introduces X86CPUTopoInfo which will have all topology information(like cores, threads etc..). Signed-off-by: Babu Moger Reviewed-by: Eduardo Habkost --- hw/i386/pc.c

[PATCH v5 04/16] machine: Add SMP Sockets in CpuTopology

2020-03-03 Thread Babu Moger
Store the smp sockets in CpuTopology. The socket information required to build the apic id in EPYC mode. Right now socket information is not passed to down when decoding the apic id. Add the socket information here. Signed-off-by: Babu Moger Reviewed-by: Eduardo Habkost Reviewed-by: Igor

[PATCH v5 07/16] hw/i386: Rename apicid_from_topo_ids to x86_apicid_from_topo_ids

2020-03-03 Thread Babu Moger
For consistancy rename apicid_from_topo_ids to x86_apicid_from_topo_ids. No functional change. Signed-off-by: Babu Moger Reviewed-by: Igor Mammedov --- hw/i386/pc.c |2 +- include/hw/i386/topology.h |6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a

[PATCH v5 02/16] hw/i386: Introduce X86CPUTopoInfo to contain topology info

2020-03-03 Thread Babu Moger
X86MachineState. There is no functional changes. Signed-off-by: Babu Moger --- hw/i386/pc.c | 12 ++-- hw/i386/x86.c | 32 include/hw/i386/topology.h | 38 -- include/hw/i386/x86.h |3

[PATCH v5 05/16] hw/i386: Remove unnecessary initialization in x86_cpu_new

2020-03-03 Thread Babu Moger
The function pc_cpu_pre_plug takes care of initialization of CPUX86State. So, remove the initialization here. Suggested-by: Igor Mammedov Signed-off-by: Babu Moger --- hw/i386/x86.c |4 1 file changed, 4 deletions(-) diff --git a/hw/i386/x86.c b/hw/i386/x86.c index 03b8962c98

[PATCH v5 09/16] target/i386: Cleanup and use the EPYC mode topology functions

2020-03-03 Thread Babu Moger
Use the new functions from topology.h and delete the unused code. Given the sockets, nodes, cores and threads, the new functions generate apic id for EPYC mode. Removes all the hardcoded values. Signed-off-by: Babu Moger --- target/i386/cpu.c | 162

[PATCH v5 06/16] hw/i386: Update structures to save the number of nodes per package

2020-03-03 Thread Babu Moger
Update structures X86CPUTopoIDs and CPUX86State to hold the number of nodes per package. This is required to build EPYC mode topology. Signed-off-by: Babu Moger --- hw/i386/pc.c |1 + hw/i386/x86.c |1 + include/hw/i386/topology.h |1 + target/i386/cpu.c

[PATCH v5 08/16] hw/386: Add EPYC mode topology decoding functions

2020-03-03 Thread Babu Moger
are available in Processor Programming Reference (PPR) for AMD Family 17h Model 01h, Revision B1 Processors. The revision guides are available from the bugzilla Link below. Link: https://bugzilla.kernel.org/show_bug.cgi?id=206537 Signed-off-by: Babu Moger Acked-by: Igor Mammedov --- include/hw

[PATCH v5 13/16] target/i386: Add EPYC model specific handlers

2020-03-03 Thread Babu Moger
mplex ID • ApicId[2:0]= (SMT) ? {LogicalCoreID[1:0],ThreadId} : {1'b0,LogicalCoreID[1:0]} Signed-off-by: Babu Moger --- target/i386/cpu.c |4 1 file changed, 4 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index f33d8b77f5..f870f7c55b 100644 --- a/target/i386

[PATCH v5 10/16] hw/i386: Introduce apicid functions inside X86MachineState

2020-03-03 Thread Babu Moger
Introduce model specific apicid functions inside X86MachineState. These functions will be loaded from X86CPUDefinition. Signed-off-by: Babu Moger --- hw/i386/x86.c |5 + include/hw/i386/x86.h |9 + 2 files changed, 14 insertions(+) diff --git a/hw/i386/x86.c b/hw

[PATCH v5 14/16] hw/i386: Move arch_id decode inside x86_cpus_init

2020-03-03 Thread Babu Moger
this time smp parameter is already completed and numa node information is available. Signed-off-by: Babu Moger --- hw/i386/x86.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/hw/i386/x86.c b/hw/i386/x86.c index d46dd4ad9e..66998b065c 100644 --- a/hw/i386

[PATCH v5 11/16] target/i386: Load apicid model specific handlers from X86CPUDefinition

2020-03-03 Thread Babu Moger
Load the model specific handlers if available or else default handlers will be loaded. Add the model specific handlers if apicid decoding differs from the standard sequential numbering. Signed-off-by: Babu Moger --- target/i386/cpu.c | 34 ++ target/i386/cpu.h

[PATCH v5 12/16] hw/i386: Use the apicid handlers from X86MachineState

2020-03-03 Thread Babu Moger
Check and Load the apicid handlers from X86CPUDefinition if available. Update the calling convention for the apicid handlers. Signed-off-by: Babu Moger --- hw/i386/pc.c |6 +++--- hw/i386/x86.c | 11 +++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/hw/i386/pc.c

[PATCH v5 15/16] i386: Fix pkg_id offset for EPYC cpu models

2020-03-03 Thread Babu Moger
If the system is numa configured the pkg_offset needs to be adjusted for EPYC cpu models. Fix it calling the model specific handler. Signed-off-by: Babu Moger --- hw/i386/pc.c |1 + target/i386/cpu.c |4 ++-- target/i386/cpu.h |1 + 3 files changed, 4 insertions(+), 2 deletions

[PATCH v5 16/16] tests: Update the Unit tests

2020-03-03 Thread Babu Moger
Since the topology routines have changed, update the unit tests to use the new APIs. Signed-off-by: Babu Moger --- tests/test-x86-cpuid.c | 115 1 file changed, 68 insertions(+), 47 deletions(-) diff --git a/tests/test-x86-cpuid.c b/tests/test

Re: [PATCH v5 00/16] APIC ID fixes for AMD EPYC CPU model

2020-03-09 Thread Babu Moger
On 3/8/20 8:25 AM, Michael S. Tsirkin wrote: > On Tue, Mar 03, 2020 at 01:56:51PM -0600, Babu Moger wrote: >> This series fixes APIC ID encoding problem reported on AMD EPYC cpu models. >> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.redhat.com%2Fsh

Re: [PATCH v5 04/16] machine: Add SMP Sockets in CpuTopology

2020-03-09 Thread Babu Moger
On 3/9/20 9:17 AM, Igor Mammedov wrote: > On Tue, 03 Mar 2020 13:57:18 -0600 > Babu Moger wrote: > >> Store the smp sockets in CpuTopology. The socket information required to >> build the apic id in EPYC mode. Right now socket information is not passed >> to dow

Re: [PATCH v5 11/16] target/i386: Load apicid model specific handlers from X86CPUDefinition

2020-03-09 Thread Babu Moger
On 3/9/20 9:49 AM, Igor Mammedov wrote: > On Tue, 03 Mar 2020 13:58:03 -0600 > Babu Moger wrote: > >> Load the model specific handlers if available or else default handlers >> will be loaded. Add the model specific handlers if apicid decoding >> differs from the st

Re: [PATCH v5 12/16] hw/i386: Use the apicid handlers from X86MachineState

2020-03-09 Thread Babu Moger
On 3/9/20 10:01 AM, Igor Mammedov wrote: > On Tue, 03 Mar 2020 13:58:10 -0600 > Babu Moger wrote: > >> Check and Load the apicid handlers from X86CPUDefinition if available. >> Update the calling convention for the apicid handlers. >> >> Signed-off-by: Bab

Re: [PATCH v5 13/16] target/i386: Add EPYC model specific handlers

2020-03-09 Thread Babu Moger
On 3/9/20 10:03 AM, Igor Mammedov wrote: > On Tue, 03 Mar 2020 13:58:16 -0600 > Babu Moger wrote: > >> Add the new EPYC model specific handlers to fix the apicid decoding. >> >> The APIC ID is decoded based on the sequence sockets->dies->cores->threads.

RE: [PATCH v3 2/3] hw/i386: Add a new check to configure smp dies for EPYC

2020-08-13 Thread Babu Moger
2/3] hw/i386: Add a new check to configure smp dies for > EPYC > > On Tue, 11 Aug 2020 16:03:58 -0500 > Babu Moger wrote: > > > On 8/7/20 2:11 PM, Igor Mammedov wrote: > > > On Fri, 7 Aug 2020 17:52:22 +0100 > > > Daniel P. Berrangé wrote: > >

[PATCH v4 0/3] Modify AMD topology to use socket/dies/core/thread model

2020-08-15 Thread Babu Moger
later. v1: https://lore.kernel.org/qemu-devel/159164739269.20543.3074052993891532749.st...@naples-babu.amd.com Babu Moger (3): i386: Simplify CPUID_8000_001E for AMD hw/i386: Update the EPYC topology to use socket/dies/core/thread model hw/i386: Remove node_id, nr_nodes and nodes_pe

[PATCH v4 2/3] hw/i386: Update the EPYC topology to use socket/dies/core/thread model

2020-08-15 Thread Babu Moger
simple to program. Add a new check to error out when smp dies are not provided when EPYC model is numa configured. Next task is to remove node_id, nr_nodes and nodes_per_pkg from EPYC topology which will be done in next patch. Signed-off-by: Babu Moger --- hw/i386/x86.c |8 1 file

[PATCH v4 3/3] hw/i386: Remove node_id, nr_nodes and nodes_per_pkg from topology

2020-08-15 Thread Babu Moger
://bugzilla.redhat.com/show_bug.cgi?id=1828750 Signed-off-by: Babu Moger --- hw/i386/pc.c |1 - hw/i386/x86.c |1 - include/hw/i386/topology.h | 40 +--- target/i386/cpu.c | 11 +++ target/i386/cpu.h |1

[PATCH v4 1/3] i386: Simplify CPUID_8000_001E for AMD

2020-08-15 Thread Babu Moger
Link below. Signed-off-by: Babu Moger Reviewed-by: Igor Mammedov --- target/i386/cpu.c | 77 + 1 file changed, 36 insertions(+), 41 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 588f32e136..c892432cae 100644 --- a

RE: [PATCH v4 2/3] hw/i386: Update the EPYC topology to use socket/dies/core/thread model

2020-08-19 Thread Babu Moger
2/3] hw/i386: Update the EPYC topology to use > socket/dies/core/thread model > > On Fri, 14 Aug 2020 16:39:33 -0500 > Babu Moger wrote: > > > Update the EPYC topology to use socket/dies/core/thread model. The > > EPYC model does not use the smp dies to build the topolo

Re: [PATCH v4 3/3] hw/i386: Remove node_id, nr_nodes and nodes_per_pkg from topology

2020-08-19 Thread Babu Moger
On 8/19/20 7:18 AM, Igor Mammedov wrote: > On Fri, 14 Aug 2020 16:39:40 -0500 > Babu Moger wrote: > >> Remove node_id, nr_nodes and nodes_per_pkg from topology. Use >> die_id, nr_dies and dies_per_pkg which is already available. >> Removes the confusion over two va

Re: [PATCH v4 3/3] hw/i386: Remove node_id, nr_nodes and nodes_per_pkg from topology

2020-08-20 Thread Babu Moger
On 8/20/20 7:57 AM, Igor Mammedov wrote: > On Wed, 19 Aug 2020 17:42:58 -0500 > Babu Moger wrote: > >> On 8/19/20 7:18 AM, Igor Mammedov wrote: >>> On Fri, 14 Aug 2020 16:39:40 -0500 >>> Babu Moger wrote: >>> >>>> Remove node_id, nr_

Re: [PATCH v5 14/16] hw/i386: Move arch_id decode inside x86_cpus_init

2020-03-09 Thread Babu Moger
On 3/9/20 10:21 AM, Igor Mammedov wrote: > On Tue, 03 Mar 2020 13:58:24 -0600 > Babu Moger wrote: > >> Apicid calculation depends on knowing the total number of numa nodes >> for EPYC cpu models. Right now, we are calculating the arch_id while >> parsing the numa(pa

Re: [PATCH v5 14/16] hw/i386: Move arch_id decode inside x86_cpus_init

2020-03-10 Thread Babu Moger
On 3/10/20 3:35 AM, Igor Mammedov wrote: > On Mon, 9 Mar 2020 14:31:31 -0500 > Babu Moger wrote: > >> On 3/9/20 10:21 AM, Igor Mammedov wrote: >>> On Tue, 03 Mar 2020 13:58:24 -0600 >>> Babu Moger wrote: >>> >>>> Apicid calcula

Re: [PATCH v5 00/16] APIC ID fixes for AMD EPYC CPU model

2020-03-10 Thread Babu Moger
On 3/10/20 3:40 AM, Igor Mammedov wrote: > On Tue, 03 Mar 2020 13:56:51 -0600 > Babu Moger wrote: > >> This series fixes APIC ID encoding problem reported on AMD EPYC cpu models. >> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.redhat.co

[PATCH v6 00/13] APIC ID fixes for AMD EPYC CPU model

2020-03-10 Thread Babu Moger
make things are working as expected. 5. TODO : Setting the epyc feature bit needs to be worked out. This feature is supported only on AMD EPYC models. I may need some guidance on that. v1: https://lore.kernel.org/qemu-devel/20190731232032.51786-1-babu.mo...@amd.com/ --- Babu M

[PATCH v6 01/13] hw/i386: Introduce X86CPUTopoInfo to contain topology info

2020-03-10 Thread Babu Moger
X86MachineState. 3. Update x86 unit tests for new calling convention with parameter X86CPUTopoInfo There is no functional changes. Signed-off-by: Babu Moger --- hw/i386/pc.c | 12 ++-- hw/i386/x86.c | 32 include/hw/i386/topology.h

[PATCH v6 07/13] hw/386: Add EPYC mode topology decoding functions

2020-03-10 Thread Babu Moger
are available in Processor Programming Reference (PPR) for AMD Family 17h Model 01h, Revision B1 Processors. The revision guides are available from the bugzilla Link below. Link: https://bugzilla.kernel.org/show_bug.cgi?id=206537 Signed-off-by: Babu Moger Acked-by: Igor Mammedov Acked-by: Michael S

[PATCH v6 02/13] hw/i386: Consolidate topology functions

2020-03-10 Thread Babu Moger
Now that we have all the parameters in X86CPUTopoInfo, we can just pass the structure to calculate the offsets and width. Signed-off-by: Babu Moger Reviewed-by: Igor Mammedov Acked-by: Michael S. Tsirkin --- include/hw/i386/topology.h | 68 +-- target

[PATCH v6 03/13] machine: Add SMP Sockets in CpuTopology

2020-03-10 Thread Babu Moger
Store the smp sockets in CpuTopology. The socket information required to build the apic id in EPYC mode. Right now socket information is not passed to down when decoding the apic id. Add the socket information here. Signed-off-by: Babu Moger Reviewed-by: Eduardo Habkost Reviewed-by: Igor

[PATCH v6 08/13] target/i386: Cleanup and use the EPYC mode topology functions

2020-03-10 Thread Babu Moger
Use the new functions from topology.h and delete the unused code. Given the sockets, nodes, cores and threads, the new functions generate apic id for EPYC mode. Removes all the hardcoded values. Signed-off-by: Babu Moger Acked-by: Michael S. Tsirkin --- target/i386/cpu.c | 162

[PATCH v6 06/13] hw/i386: Rename apicid_from_topo_ids to x86_apicid_from_topo_ids

2020-03-10 Thread Babu Moger
For consistancy rename apicid_from_topo_ids to x86_apicid_from_topo_ids. No functional change. Signed-off-by: Babu Moger Reviewed-by: Igor Mammedov Acked-by: Michael S. Tsirkin --- hw/i386/pc.c |2 +- include/hw/i386/topology.h |6 +++--- 2 files changed, 4 insertions

[PATCH v6 09/13] hw/i386: Introduce apicid functions inside X86MachineState

2020-03-10 Thread Babu Moger
Introduce model specific apicid functions inside X86MachineState. These functions will be loaded from X86CPUDefinition. Signed-off-by: Babu Moger Reviewed-by: Igor Mammedov Acked-by: Michael S. Tsirkin --- hw/i386/x86.c |6 ++ include/hw/i386/x86.h | 11 +++ 2 files

[PATCH v6 13/13] i386: Fix pkg_id offset for EPYC cpu models

2020-03-10 Thread Babu Moger
If the system is numa configured the pkg_offset needs to be adjusted for EPYC cpu models. Fix it calling the model specific handler. Signed-off-by: Babu Moger Reviewed-by: Igor Mammedov Acked-by: Michael S. Tsirkin --- hw/i386/pc.c |1 + target/i386/cpu.c |4 ++-- target/i386

[PATCH v6 04/13] hw/i386: Remove unnecessary initialization in x86_cpu_new

2020-03-10 Thread Babu Moger
The function pc_cpu_pre_plug takes care of initialization of CPUX86State. So, remove the initialization here. Suggested-by: Igor Mammedov Signed-off-by: Babu Moger Reviewed-by: Igor Mammedov Acked-by: Michael S. Tsirkin --- hw/i386/x86.c |4 1 file changed, 4 deletions(-) diff

[PATCH v6 11/13] target/i386: Enable new apic id encoding for EPYC based cpus models

2020-03-10 Thread Babu Moger
ApicId[5:4] = Node ID. • ApicId[3] = Logical CCX L3 complex ID • ApicId[2:0]= (SMT) ? {LogicalCoreID[1:0],ThreadId} : {1'b0,LogicalCoreID[1:0]} The new apic id encoding is enabled for EPYC and EPYC-Rome models. Signed-off-by: Babu Moger Acked-by: Michael S. Tsirkin --- target/i386/cpu.c |

[PATCH v6 10/13] i386: Check for apic id encoding

2020-03-10 Thread Babu Moger
Check X86CPUDefinition if use_epyc_apic_id_encoding is enabled. If enabled update X86MachineState with EPYC mode apic_id encoding handlers. Also update the calling convention to use apic_id handlers from X86MachineState. Signed-off-by: Babu Moger Acked-by: Michael S. Tsirkin --- hw/i386/pc.c

[PATCH v6 05/13] hw/i386: Update structures to save the number of nodes per package

2020-03-10 Thread Babu Moger
Update structures X86CPUTopoIDs and CPUX86State to hold the number of nodes per package. This is required to build EPYC mode topology. Signed-off-by: Babu Moger Reviewed-by: Igor Mammedov Acked-by: Michael S. Tsirkin --- hw/i386/pc.c |1 + hw/i386/x86.c |1

[PATCH v6 12/13] hw/i386: Move arch_id decode inside x86_cpus_init

2020-03-10 Thread Babu Moger
this time smp parse is already completed and numa node information is available. Signed-off-by: Babu Moger Acked-by: Michael S. Tsirkin --- hw/i386/x86.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/hw/i386/x86.c b/hw/i386/x86.c index ad85347142

Re: [PATCH v6 01/13] hw/i386: Introduce X86CPUTopoInfo to contain topology info

2020-03-11 Thread Babu Moger
On 3/11/20 6:39 AM, Igor Mammedov wrote: > On Tue, 10 Mar 2020 21:33:25 -0500 > Babu Moger wrote: > >> This is an effort to re-arrange few data structure for better readability. >> >> 1. Add X86CPUTopoInfo which will have all the topology informations >>r

Re: [PATCH v6 10/13] i386: Check for apic id encoding

2020-03-11 Thread Babu Moger
On 3/11/20 7:17 AM, Igor Mammedov wrote: > On Tue, 10 Mar 2020 21:34:25 -0500 > Babu Moger wrote: > >> Check X86CPUDefinition if use_epyc_apic_id_encoding is enabled. If enabled >> update X86MachineState with EPYC mode apic_id encoding handlers. >> >> Also upd

Re: [PATCH v6 12/13] hw/i386: Move arch_id decode inside x86_cpus_init

2020-03-11 Thread Babu Moger
On 3/11/20 7:29 AM, Igor Mammedov wrote: > On Tue, 10 Mar 2020 21:34:39 -0500 > Babu Moger wrote: > >> Apicid calculation depends on knowing the total number of numa nodes >> for EPYC cpu models. Right now, we are calculating the arch_id while >> parsing the numa(pa

Re: [PATCH v6 10/13] i386: Check for apic id encoding

2020-03-11 Thread Babu Moger
On 3/11/20 10:48 AM, Igor Mammedov wrote: > On Wed, 11 Mar 2020 09:50:04 -0500 > Babu Moger wrote: > >> On 3/11/20 7:17 AM, Igor Mammedov wrote: >>> On Tue, 10 Mar 2020 21:34:25 -0500 >>> Babu Moger wrote: >>> >>>> Check X86CPUDefiniti

[PATCH v7 01/13] hw/i386: Introduce X86CPUTopoInfo to contain topology info

2020-03-11 Thread Babu Moger
X86MachineState. 3. Update x86 unit tests for new calling convention with parameter X86CPUTopoInfo There is no functional changes. Signed-off-by: Babu Moger --- hw/i386/pc.c | 12 ++-- hw/i386/x86.c | 32 include/hw/i386/topology.h

[PATCH v7 00/13] APIC ID fixes for AMD EPYC CPU model

2020-03-11 Thread Babu Moger
I may need some guidance on that. v1: https://lore.kernel.org/qemu-devel/20190731232032.51786-1-babu.mo...@amd.com/ --- Babu Moger (13): hw/i386: Introduce X86CPUTopoInfo to contain topology info hw/i386: Consolidate topology functions machine: Add SMP Sockets in CpuTopolo

[PATCH v7 06/13] hw/i386: Rename apicid_from_topo_ids to x86_apicid_from_topo_ids

2020-03-11 Thread Babu Moger
For consistency rename apicid_from_topo_ids to x86_apicid_from_topo_ids. No functional change. Signed-off-by: Babu Moger Reviewed-by: Igor Mammedov Acked-by: Michael S. Tsirkin --- hw/i386/pc.c |2 +- include/hw/i386/topology.h |6 +++--- 2 files changed, 4 insertions

[PATCH v7 05/13] hw/i386: Update structures to save the number of nodes per package

2020-03-11 Thread Babu Moger
Update structures X86CPUTopoIDs and CPUX86State to hold the number of nodes per package. This is required to build EPYC mode topology. Signed-off-by: Babu Moger Reviewed-by: Igor Mammedov Acked-by: Michael S. Tsirkin --- hw/i386/pc.c |1 + hw/i386/x86.c |1

[PATCH v7 11/13] hw/i386: Move arch_id decode inside x86_cpus_init

2020-03-11 Thread Babu Moger
x86_cpus_init. At this time, smp parse is already completed and numa node information is available. Override the handlers if use_epyc_apic_id_encoding is enabled in cpu model definition. Also replace the calling convention to use handlers from X86MachineState. Signed-off-by: Babu Moger --- hw/i386

[PATCH v7 02/13] hw/i386: Consolidate topology functions

2020-03-11 Thread Babu Moger
Now that we have all the parameters in X86CPUTopoInfo, we can just pass the structure to calculate the offsets and width. Signed-off-by: Babu Moger Reviewed-by: Igor Mammedov Acked-by: Michael S. Tsirkin --- include/hw/i386/topology.h | 68 +-- target

[PATCH v7 12/13] target/i386: Enable new apic id encoding for EPYC based cpus models

2020-03-11 Thread Babu Moger
ApicId[5:4] = Node ID. • ApicId[3] = Logical CCX L3 complex ID • ApicId[2:0]= (SMT) ? {LogicalCoreID[1:0],ThreadId} : {1'b0,LogicalCoreID[1:0]} The new apic id encoding is enabled for EPYC and EPYC-Rome models. Signed-off-by: Babu Moger Acked-by: Michael S. Tsirkin Acked-by: Igor Mammedov

[PATCH v7 08/13] target/i386: Cleanup and use the EPYC mode topology functions

2020-03-11 Thread Babu Moger
Use the new functions from topology.h and delete the unused code. Given the sockets, nodes, cores and threads, the new functions generate apic id for EPYC mode. Removes all the hardcoded values. Signed-off-by: Babu Moger Acked-by: Michael S. Tsirkin Acked-by: Igor Mammedov --- target/i386

[PATCH v7 03/13] machine: Add SMP Sockets in CpuTopology

2020-03-11 Thread Babu Moger
Store the smp sockets in CpuTopology. The socket information required to build the apic id in EPYC mode. Right now socket information is not passed to down when decoding the apic id. Add the socket information here. Signed-off-by: Babu Moger Reviewed-by: Eduardo Habkost Reviewed-by: Igor

[PATCH v7 13/13] i386: Fix pkg_id offset for EPYC cpu models

2020-03-11 Thread Babu Moger
If the system is numa configured the pkg_offset needs to be adjusted for EPYC cpu models. Fix it calling the model specific handler. Signed-off-by: Babu Moger Reviewed-by: Igor Mammedov Acked-by: Michael S. Tsirkin --- hw/i386/pc.c |1 + target/i386/cpu.c |4 ++-- target/i386

[PATCH v7 04/13] hw/i386: Remove unnecessary initialization in x86_cpu_new

2020-03-11 Thread Babu Moger
The function pc_cpu_pre_plug takes care of initialization of CPUX86State. So, remove the initialization here. Suggested-by: Igor Mammedov Signed-off-by: Babu Moger Reviewed-by: Igor Mammedov Acked-by: Michael S. Tsirkin --- hw/i386/x86.c |4 1 file changed, 4 deletions(-) diff

[PATCH v7 10/13] i386: Introduce use_epyc_apic_id_encoding in X86CPUDefinition

2020-03-11 Thread Babu Moger
Add a boolean variable use_epyc_apic_id_encoding in X86CPUDefinition. This will be set if this cpu model needs to use new EPYC based apic id encoding. Override the handlers with EPYC based handlers if use_epyc_apic_id_encoding is set. This will be done in x86_cpus_init. Signed-off-by: Babu Moger

[PATCH v7 07/13] hw/386: Add EPYC mode topology decoding functions

2020-03-11 Thread Babu Moger
are available in Processor Programming Reference (PPR) for AMD Family 17h Model 01h, Revision B1 Processors. The revision guides are available from the bugzilla Link below. Link: https://bugzilla.kernel.org/show_bug.cgi?id=206537 Signed-off-by: Babu Moger Acked-by: Igor Mammedov Acked-by: Michael S

[PATCH v7 09/13] hw/i386: Introduce apicid functions inside X86MachineState

2020-03-11 Thread Babu Moger
Introduce model specific apicid functions inside X86MachineState. These functions will be loaded from X86CPUDefinition. Signed-off-by: Babu Moger Reviewed-by: Igor Mammedov Acked-by: Michael S. Tsirkin --- hw/i386/x86.c |5 + include/hw/i386/x86.h |9 + 2 files

Re: [PATCH v7 07/13] hw/386: Add EPYC mode topology decoding functions

2020-03-12 Thread Babu Moger
On 3/12/20 7:39 AM, Igor Mammedov wrote: > On Wed, 11 Mar 2020 17:53:34 -0500 > Babu Moger wrote: > >> These functions add support for building EPYC mode topology given the smp >> details like numa nodes, cores, threads and sockets. >> >> The new apic id deco

Re: [PATCH v7 00/13] APIC ID fixes for AMD EPYC CPU model

2020-03-12 Thread Babu Moger
Eduardo, Can you please queue the series if there are no concerns. Thanks On 3/11/20 5:52 PM, Babu Moger wrote: > This series fixes APIC ID encoding problem reported on AMD EPYC cpu models. > https://bugzilla.redhat.com/show_bug.cgi?id=1728166 > > Currently, the APIC ID is decoded

[PATCH] target/i386: Remove core_id assert check in CPUID 0x8000001E

2020-06-19 Thread Babu Moger
ort more than 255 cores we need x2apic support. In that case topology is coming from CPUID 0xB which appears to work fine. Remove the assert check and fix the problem. Fixes the bug: Link: https://bugzilla.redhat.com/show_bug.cgi?id=1834200 Signed-off-by: Babu Moger --- target/i386/cpu.c |

RE: [PATCH] target/i386: Remove core_id assert check in CPUID 0x8000001E

2020-06-19 Thread Babu Moger
> -Original Message- > From: no-re...@patchew.org > Sent: Friday, June 19, 2020 9:46 AM > To: Moger, Babu > Cc: pbonz...@redhat.com; r...@twiddle.net; ehabk...@redhat.com; qemu- > de...@nongnu.org > Subject: Re: [PATCH] target/i386: Remove core_id assert check in CPUID > 0x801E >

RE: [PATCH 1/2] hw/386: Fix uninitialized memory with -device and CPU hotplug

2020-06-24 Thread Babu Moger
mory with -device and CPU > hotplug > > On Tue, 16 Jun 2020 12:18:56 -0500 > Babu Moger wrote: > > > > -Original Message- > > > From: Igor Mammedov > > > Sent: Tuesday, June 16, 2020 5:59 AM > > > To: Moger, Babu > > > Cc:

RE: [PATCH v2 1/3] hw/i386: Initialize topo_ids from CpuInstanceProperties

2020-07-13 Thread Babu Moger
stanceProperties > > On Wed, 01 Jul 2020 12:31:01 -0500 > Babu Moger wrote: > > > This is in preparation to build the apic_id from user provided > > topology information. > > > > Signed-off-by: Babu Moger > > --- > > include/hw/i386/

RE: [PATCH v2 2/3] hw/i386: Build apic_id from CpuInstanceProperties

2020-07-13 Thread Babu Moger
rties > > On Wed, 01 Jul 2020 12:31:08 -0500 > Babu Moger wrote: > > > Build apic_id from CpuInstanceProperties if numa configured. > > Use the node_id from user provided numa information. This will avoid > > conflicts between numa information and apic_id generat

Re: [PATCH v2 1/3] hw/i386: Initialize topo_ids from CpuInstanceProperties

2020-07-13 Thread Babu Moger
On 7/13/20 11:17 AM, Igor Mammedov wrote: > On Mon, 13 Jul 2020 10:02:22 -0500 > Babu Moger wrote: > >>> -Original Message- >>> From: Igor Mammedov >>> Sent: Monday, July 13, 2020 4:08 AM >>> To: Moger, Babu >>> Cc: pbonz...@r

RE: [PATCH v2 1/3] hw/i386: Initialize topo_ids from CpuInstanceProperties

2020-07-13 Thread Babu Moger
t; CpuInstanceProperties > > On Mon, 13 Jul 2020 11:43:33 -0500 > Babu Moger wrote: > > > On 7/13/20 11:17 AM, Igor Mammedov wrote: > > > On Mon, 13 Jul 2020 10:02:22 -0500 > > > Babu Moger wrote: > > > > > >>> -Original Message-

RE: [PATCH v2 1/3] hw/i386: Initialize topo_ids from CpuInstanceProperties

2020-07-14 Thread Babu Moger
t; CpuInstanceProperties > > On Mon, 13 Jul 2020 14:30:29 -0500 > Babu Moger wrote: > > > > -Original Message- > > > From: Igor Mammedov > > > Sent: Monday, July 13, 2020 12:32 PM > > > To: Moger, Babu > > > Cc: pbonz...@redhat.com; r...

RE: [PATCH v2 1/3] hw/i386: Initialize topo_ids from CpuInstanceProperties

2020-07-27 Thread Babu Moger
stanceProperties > > On Mon, 13 Jul 2020 14:30:29 -0500 > Babu Moger wrote: > > > > -Original Message- > > > From: Igor Mammedov > > > Sent: Monday, July 13, 2020 12:32 PM > > > To: Moger, Babu > > > Cc: pbonz...@redhat.com; r...

RE: [PATCH v2 1/3] hw/i386: Initialize topo_ids from CpuInstanceProperties

2020-07-27 Thread Babu Moger
stanceProperties > > On Mon, 27 Jul 2020 10:49:08 -0500 > Babu Moger wrote: > > > > -Original Message- > > > From: Igor Mammedov > > > Sent: Friday, July 24, 2020 12:05 PM > > > To: Moger, Babu > > > Cc: qemu-devel@nongnu.org; pbo

RE: [PATCH v2 1/3] hw/i386: Initialize topo_ids from CpuInstanceProperties

2020-07-29 Thread Babu Moger
: Initialize topo_ids from > CpuInstanceProperties > > On Mon, 27 Jul 2020 18:59:42 -0500 > Babu Moger wrote: > > > > -Original Message- > > > From: Igor Mammedov > > > Sent: Monday, July 27, 2020 12:14 PM > > > To: Moger, Babu > > &g

[PATCH v3 1/3] i386: Simplify CPUID_8000_001E for AMD

2020-08-07 Thread Babu Moger
Link below. Signed-off-by: Babu Moger --- target/i386/cpu.c | 77 + 1 file changed, 36 insertions(+), 41 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 588f32e136..c892432cae 100644 --- a/target/i386/cpu.c +++ b/target

[PATCH v3 3/3] hw/i386: Remove node_id, nr_nodes and nodes_per_pkg from topology

2020-08-07 Thread Babu Moger
Remove node_id, nr_nodes and nodes_per_pkg from topology. Use die_id, nr_dies and dies_per_pkg which is already available. Removes the confusion over two variables. Signed-off-by: Babu Moger --- hw/i386/pc.c |1 - hw/i386/x86.c |1 - include/hw/i386/topology.h

[PATCH v3 2/3] hw/i386: Add a new check to configure smp dies for EPYC

2020-08-07 Thread Babu Moger
Adding a new check to warn the users to configure 'dies' when topology is numa configured. It makes it easy to build the topology for EPYC models. Signed-off-by: Babu Moger --- hw/i386/x86.c |7 +++ 1 file changed, 7 insertions(+) diff --git a/hw/i386/x86.c b/hw/i386/x

[PATCH v3 0/3] Fix couple of issues with AMD topology

2020-08-07 Thread Babu Moger
apic_id suggested by Igor. - Also did some minor code re-aarangement to take care of changes. - Dropped the patch "Simplify CPUID_8000_001E" from v1. Will send it later. v1: https://lore.kernel.org/qemu-devel/159164739269.20543.3074052993891532749.st...@naples-babu.amd.com Bab

Re: [PATCH v3 2/3] hw/i386: Add a new check to configure smp dies for EPYC

2020-08-07 Thread Babu Moger
On 8/7/20 11:52 AM, Daniel P. Berrangé wrote: > On Fri, Aug 07, 2020 at 11:32:51AM -0500, Babu Moger wrote: >> Adding a new check to warn the users to configure 'dies' when >> topology is numa configured. It makes it easy to build the >> topology for EPYC models.

RE: [PATCH v3 2/3] hw/i386: Add a new check to configure smp dies for EPYC

2020-08-11 Thread Babu Moger
to configure smp dies for > EPYC > > On Fri, 07 Aug 2020 11:32:51 -0500 > Babu Moger wrote: > > > Adding a new check to warn the users to configure 'dies' when > s/warn .../error out .../ > > > topology is numa configured. It makes it easy to build t

Re: [PATCH v3 2/3] hw/i386: Add a new check to configure smp dies for EPYC

2020-08-11 Thread Babu Moger
On 8/7/20 2:11 PM, Igor Mammedov wrote: > On Fri, 7 Aug 2020 17:52:22 +0100 > Daniel P. Berrangé wrote: > >> On Fri, Aug 07, 2020 at 11:32:51AM -0500, Babu Moger wrote: >>> Adding a new check to warn the users to configure 'dies' when >>> topology is

RE: [PATCH 1/2] hw/386: Fix uninitialized memory with -device and CPU hotplug

2020-06-25 Thread Babu Moger
d memory with -device and CPU > hotplug > > On Wed, 24 Jun 2020 12:35:59 -0500 > Babu Moger wrote: > > > > -Original Message- > > > From: Igor Mammedov > > > Sent: Wednesday, June 24, 2020 8:48 AM > > > To: Moger, Babu > >

Re: [PATCH 1/2] hw/386: Fix uninitialized memory with -device and CPU hotplug

2020-06-25 Thread Babu Moger
On 6/25/20 1:32 PM, Igor Mammedov wrote: > On Thu, 25 Jun 2020 11:41:25 -0500 > Babu Moger wrote: > >> Igor, >> >>> -Original Message- >>> From: Igor Mammedov >>> Sent: Thursday, June 25, 2020 10:19 AM >>> To: Moger, Babu

RE: [PATCH 1/2] hw/386: Fix uninitialized memory with -device and CPU hotplug

2020-06-26 Thread Babu Moger
mory with -device and CPU > hotplug > > > > On 6/25/20 1:32 PM, Igor Mammedov wrote: > > On Thu, 25 Jun 2020 11:41:25 -0500 > > Babu Moger wrote: > > > >> Igor, > >> > >>> -Original Message- > >>> From: Ig

RE: [PATCH 1/2] hw/386: Fix uninitialized memory with -device and CPU hotplug

2020-06-29 Thread Babu Moger
mory with -device and CPU > hotplug > > > > On 6/25/20 1:32 PM, Igor Mammedov wrote: > > On Thu, 25 Jun 2020 11:41:25 -0500 > > Babu Moger wrote: > > > >> Igor, > >> > >>> -Original Message- > >>> From: Ig

[PATCH v2 1/3] hw/i386: Initialize topo_ids from CpuInstanceProperties

2020-07-01 Thread Babu Moger
This is in preparation to build the apic_id from user provided topology information. Signed-off-by: Babu Moger --- include/hw/i386/topology.h | 19 +++ 1 file changed, 19 insertions(+) diff --git a/include/hw/i386/topology.h b/include/hw/i386/topology.h index 07239f95f4

[PATCH v2 2/3] hw/i386: Build apic_id from CpuInstanceProperties

2020-07-01 Thread Babu Moger
-by: Babu Moger --- hw/i386/pc.c |6 +- hw/i386/x86.c | 19 +-- include/hw/i386/topology.h | 14 +++--- include/hw/i386/x86.h |6 -- tests/test-x86-cpuid.c | 39 --- 5 files

[PATCH v2 3/3] hw/386: Fix uninitialized memory with -device and CPU hotplug

2020-07-01 Thread Babu Moger
=1828750 Signed-off-by: Babu Moger --- hw/i386/pc.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index e613b2299f..aa9fb48834 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1553,6 +1553,15 @@ static void pc_cpu_pre_plug(HotplugHandler *hotplug_dev

[PATCH v2 0/3] Fix couple of issues with AMD topology

2020-07-01 Thread Babu Moger
the apic_id suggested by Igor. - Also did some minor code re-aarangement to take care of changes. - Dropped the patch "Simplify CPUID_8000_001E" from v1. Will send it later. v1: https://lore.kernel.org/qemu-devel/159164739269.20543.3074052993891532749.st...@naples-babu.amd.co

Re: [PATCH v2 0/2] Add support for 2nd generation AMD EPYC processors

2020-01-24 Thread Babu Moger
ype-based CPU > compatibility (commented by Eduardo). > > Babu Moger (2): > i386: Add missing cpu feature bits in EPYC model > i386: Add 2nd Generation AMD EPYC processors > > > target/i386/cpu.c | 119 > +++

[Bug 1915063] Re: Windows 10 wil not install using qemu-system-x86_64

2021-04-07 Thread Babu Moger
I remember seeing something similar before. This was supposed to be fixed by the linux kernel commit. commit 841c2be09fe4f495fe5224952a419bd8c7e5b455 Author: Maxim Levitsky Date: Wed Jul 8 14:57:31 2020 +0300 kvm: x86: replace kvm_spec_ctrl_test_value with runtime test on the host # git descr

[Bug 1915063] Re: Windows 10 wil not install using qemu-system-x86_64

2021-04-08 Thread Babu Moger
@Christian, Yes. This following patch fixes the problem https://lists.gnu.org/archive/html/qemu-devel/2021-03/msg01020.html I saw your ping on the patch. I am not sure why it is not picked up. I am going ping them today. >If I might ask - how does the kernel fix you referenced interact with th

RE: [PATCH v2] i386: Add missing cpu feature bits in EPYC-Rome model

2021-04-08 Thread Babu Moger
86: Add missing cpu feature bits in EPYC-Rome > model > > On Wed, Mar 3, 2021 at 5:24 PM wrote: > > > > On Wednesday, 2021-03-03 at 09:45:30 -06, Babu Moger wrote: > > > > > Found the following cpu feature bits missing from EPYC-Rome model. > > > ibrs

Re: [PATCH v2] i386: Add the support for AMD EPYC 3rd generation processors

2021-03-02 Thread Babu Moger
issue at my end, Sorry! for the confusion. > Can you please post the official patch for inclusion. > > Best regards, > Pankaj > > On Mon, Mar 1, 2021 at 9:38 PM Babu Moger wrote: >> >> >> >>> -Original Message- >>> From: Pankaj Gupt

[PATCH] i386: Add missing cpu feature bits in EPYC-Rome model

2021-03-02 Thread Babu Moger
machine type) x86 EPYC-Rome-v1 AMD EPYC-Rome Processor x86 EPYC-Rome-v2 AMD EPYC-Rome Processor Reported-by: Pankaj Gupta Signed-off-by: Babu Moger Signed-off-by: Pankaj Gupta --- target/i386/cpu.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/target

<    1   2   3   4   5   >