From: Joao Martins <joao.m.martins@oracle.com>
To: babu.moger@amd.com, John Allen <john.allen@amd.com>
Cc: yazen.ghannam@amd.com, michael.roth@amd.com,
qemu-devel@nongnu.org, william.roche@oracle.com,
Paolo Bonzini <pbonzini@redhat.com>,
Richard Henderson <richard.henderson@linaro.org>,
Eduardo Habkost <eduardo@habkost.net>
Subject: Re: [PATCH 1/2] i386: Add support for SUCCOR feature
Date: Thu, 6 Jul 2023 22:07:04 +0100 [thread overview]
Message-ID: <df7f0910-a872-f764-5f15-ade4d6ef77f8@oracle.com> (raw)
In-Reply-To: <10122c07-3c46-3aa4-890a-0ae6e5a51900@amd.com>
+x86 qemu folks
On 06/07/2023 21:22, Moger, Babu wrote:
> Hi John,
> Thanks for the patches. Few comments below.
>
> On 7/6/23 14:40, John Allen wrote:
>> Add cpuid bit definition for the SUCCOR feature. This cpuid bit is required to
>> be exposed to guests to allow them to handle machine check exceptions on AMD
>> hosts.
>>
>> Reported-by: William Roche <william.roche@oracle.com>
>> Signed-off-by: John Allen <john.allen@amd.com>
>> ---
>> target/i386/cpu.c | 2 +-
>> target/i386/cpu.h | 4 ++++
>> 2 files changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/target/i386/cpu.c b/target/i386/cpu.c
>> index 06009b80e8..09fae9337a 100644
>> --- a/target/i386/cpu.c
>> +++ b/target/i386/cpu.c
>> @@ -5874,7 +5874,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
>> break;
>> case 0x80000007:
>> *eax = 0;
>> - *ebx = 0;
>> + *ebx = env->features[FEAT_8000_0007_EBX] | CPUID_8000_0007_EBX_SUCCOR;
>
> This is adding this feature unconditionally which does not seem right.
> Couple of things.
> 1. Add the feature word for SUCCOR. Users can add this feature using the
> feature word "+succor".
>
The feature requires no specific SVM/KVM support, it's really just a bit
enumerated to the guest that's used to tell whether AMD MCE handling is
supported, instead of blantly crashing outright. So I think the thinking here is
that GET_SUPPORTED_CPUID won't return SUCCOR and the feature gets filtered out
if it's declared as a regular named feature like you do in the CPU models.
Making it relevant for any hypervisor kernel.
> 2. Also define CPUID_8000_0007_EBX_SUCCOR : In this case, we can add this
> feature as part of the EPYC Model update.
>
how would you set CPUID regardless of the hypervisor enumerates should it not
require active emulation by the host? I am sort of interested on what is the
right way to do this, as it would be better to do this regardless of the gets
advertised by ioctls alike.
> Thanks
> Babu
>
next prev parent reply other threads:[~2023-07-06 21:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-06 19:40 [PATCH 0/2] Fix MCE handling on AMD hosts John Allen
2023-07-06 19:40 ` [PATCH 1/2] i386: Add support for SUCCOR feature John Allen
2023-07-06 20:22 ` Moger, Babu
2023-07-06 21:07 ` Joao Martins [this message]
2023-07-07 14:25 ` Paolo Bonzini
2023-07-12 19:11 ` John Allen
2023-07-20 13:29 ` Joao Martins
2023-07-06 19:40 ` [PATCH 2/2] i386: Fix MCE support for AMD hosts John Allen
2023-07-06 21:07 ` Joao Martins
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=df7f0910-a872-f764-5f15-ade4d6ef77f8@oracle.com \
--to=joao.m.martins@oracle.com \
--cc=babu.moger@amd.com \
--cc=eduardo@habkost.net \
--cc=john.allen@amd.com \
--cc=michael.roth@amd.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=william.roche@oracle.com \
--cc=yazen.ghannam@amd.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).