qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: Babu Moger <babu.moger@amd.com>
Cc: pbonzini@redhat.com, richard.henderson@linaro.org, qemu-devel@nongnu.org
Subject: Re: [PATCH] i386: Add the support for AMD EPYC 3rd generation processors
Date: Mon, 1 Feb 2021 17:16:27 -0500	[thread overview]
Message-ID: <20210201221627.GH3872207@habkost.net> (raw)
In-Reply-To: <161133338780.27536.17735339269843944966.stgit@bmoger-ubuntu>

On Fri, Jan 22, 2021 at 10:36:27AM -0600, Babu Moger wrote:
> Adds the support for AMD 3rd generation processors. The model
> display for the new processor will be EPYC-Milan.
> 
> Adds the following new feature bits on top of the feature bits from
> the first and second generation EPYC models.
> 
> pcid    : Process context identifiers support
> ibrs    : Indirect Branch Restricted Speculation
> ssbd    : Speculative Store Bypass Disable
> erms    : Enhanced REP MOVSB/STOSB support
> fsrm    : Fast Short REP MOVSB support
> invpcid : Invalidate processor context ID
> pku     : Protection keys support
> 
> Signed-off-by: Babu Moger <babu.moger@amd.com>
[...]
> @@ -4130,6 +4180,61 @@ static X86CPUDefinition builtin_x86_defs[] = {
>          .model_id = "AMD EPYC-Rome Processor",
>          .cache_info = &epyc_rome_cache_info,
>      },
> +    {
> +        .name = "EPYC-Milan",
[...]
> +        .features[FEAT_8000_0008_EBX] =
> +            CPUID_8000_0008_EBX_CLZERO | CPUID_8000_0008_EBX_XSAVEERPTR |
> +            CPUID_8000_0008_EBX_WBNOINVD | CPUID_8000_0008_EBX_IBPB |
> +            CPUID_8000_0008_EBX_IBRS | CPUID_8000_0008_EBX_STIBP |
> +            CPUID_8000_0008_EBX_AMD_SSBD,

This breaks query-cpu-model-expansion, see:
https://gitlab.com/ehabkost/qemu/-/jobs/1000347471#L350

20:11:28 ERROR| Reproduced traceback from: /builds/ehabkost/qemu/build/tests/venv/lib64/python3.6/site-packages/avocado/core/test.py:767
20:11:28 ERROR| Traceback (most recent call last):
20:11:28 ERROR|   File "/builds/ehabkost/qemu/build/tests/acceptance/cpu_queries.py", line 31, in test
20:11:28 ERROR|     self.assertNotIn('', c['unavailable-features'], c['name'])
20:11:28 ERROR|   File "/usr/lib64/python3.6/unittest/case.py", line 1096, in assertNotIn
20:11:28 ERROR|     self.fail(self._formatMessage(msg, standardMsg))
20:11:28 ERROR|   File "/builds/ehabkost/qemu/build/tests/venv/lib64/python3.6/site-packages/avocado/core/test.py", line 953, in fail
20:11:28 ERROR|     raise exceptions.TestFail(message)
20:11:28 ERROR| avocado.core.exceptions.TestFail: '' unexpectedly found in ['fma', 'pcid', 'avx', 'f16c', 'avx2', 'invpcid', 'rdseed', 'sha-ni', 'umip', 'rdpid', 'fsrm', 'fxsr-opt', 'misalignsse', '3dnowprefetch', 'osvw', 'topoext', 'perfctr-core', 'clzero', 'xsaveerptr', 'wbnoinvd', 'ibpb', '', 'amd-stibp', 'amd-ssbd', 'nrip-save', 'xsavec', 'xsaves'] : EPYC-Milan-v1

The root cause is the lack of name for CPUID_8000_0008_EBX_IBRS at
feature_word_info[CPUID_8000_0008_EBX_IBRS].feat_names[14].

I'm applying the following fixup.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 06c92650a17..8d4baf72e5b 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -1033,7 +1033,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
             "clzero", NULL, "xsaveerptr", NULL,
             NULL, NULL, NULL, NULL,
             NULL, "wbnoinvd", NULL, NULL,
-            "ibpb", NULL, NULL, "amd-stibp",
+            "ibpb", NULL, "ibrs", "amd-stibp",
             NULL, NULL, NULL, NULL,
             NULL, NULL, NULL, NULL,
             "amd-ssbd", "virt-ssbd", "amd-no-ssb", NULL,

-- 
Eduardo



  reply	other threads:[~2021-02-01 22:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-22 16:36 Babu Moger
2021-02-01 22:16 ` Eduardo Habkost [this message]
2021-02-01 22:29   ` Babu Moger
2021-02-01 22:38     ` Eduardo Habkost

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=20210201221627.GH3872207@habkost.net \
    --to=ehabkost@redhat.com \
    --cc=babu.moger@amd.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --subject='Re: [PATCH] i386: Add the support for AMD EPYC 3rd generation processors' \
    /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

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).