qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Xiaoyao Li <xiaoyao.li@intel.com>, qemu-devel@nongnu.org
Cc: John Allen <john.allen@amd.com>,
	William Roche <william.roche@oracle.com>,
	Joao Martins <joao.m.martins@oracle.com>
Subject: Re: [PULL 39/42] i386: Add support for SUCCOR feature
Date: Thu, 27 Jun 2024 16:00:42 +0200	[thread overview]
Message-ID: <0794eb13-63a6-4a6e-a0a8-5953c3c09f9f@redhat.com> (raw)
In-Reply-To: <c54d5f72-ecfd-46e0-baf9-324fdedd2ed3@intel.com>

On 6/13/24 11:50, Xiaoyao Li wrote:
> On 6/8/2024 4:34 PM, Paolo Bonzini wrote:
>> From: John Allen <john.allen@amd.com>
>>
>> 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.
>>
>> ----
>> v2:
>>    - Add "succor" feature word.
>>    - Add case to kvm_arch_get_supported_cpuid for the SUCCOR feature.
>>
>> Reported-by: William Roche <william.roche@oracle.com>
>> Reviewed-by: Joao Martins <joao.m.martins@oracle.com>
>> Signed-off-by: John Allen <john.allen@amd.com>
>> Message-ID: <20240603193622.47156-3-john.allen@amd.com>
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> 
> [snip]
> ...
> 
>> diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
>> index 55a9e8a70cf..56d8e2a89ec 100644
>> --- a/target/i386/kvm/kvm.c
>> +++ b/target/i386/kvm/kvm.c
>> @@ -532,6 +532,8 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, 
>> uint32_t function,
>>            */
>>           cpuid_1_edx = kvm_arch_get_supported_cpuid(s, 1, 0, R_EDX);
>>           ret |= cpuid_1_edx & CPUID_EXT2_AMD_ALIASES;
>> +    } else if (function == 0x80000007 && reg == R_EBX) {
>> +        ret |= CPUID_8000_0007_EBX_SUCCOR;
> 
> IMO, this is incorrect.
> 
> Why make it supported unconditionally? Shouldn't there be a KVM patch to 
> report it in KVM_GET_SUPPORTED_CPUID?

Yes, but since the bit doesn't need any hypervisor support it is common 
to also add it in QEMU.

> If make it supported unconditionally, all VMs boot with "-cpu host/max" 
> will see the CPUID bits, even if it is Intel VMs.

It should be harmless, but you're right, it's not tidy and we don't know 
for sure that it doesn't trigger weird paths in guest OSes.  I've send a 
series to fix this.

Paolo



  parent reply	other threads:[~2024-06-27 14:01 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-08  8:33 [PULL 00/42] i386, scsi. hostmem fixes for 2024-06-08 Paolo Bonzini
2024-06-08  8:33 ` [PULL 01/42] target/i386: fix pushed value of EFLAGS.RF Paolo Bonzini
2024-06-08  8:33 ` [PULL 02/42] target/i386: fix implementation of ICEBP Paolo Bonzini
2024-06-08  8:33 ` [PULL 03/42] target/i386: cleanup HLT helpers Paolo Bonzini
2024-06-08  8:33 ` [PULL 04/42] target/i386: cleanup PAUSE helpers Paolo Bonzini
2024-06-08  8:33 ` [PULL 05/42] target/i386: implement DR7.GD Paolo Bonzini
2024-06-08  8:33 ` [PULL 06/42] target/i386: disable/enable breakpoints on vmentry/vmexit Paolo Bonzini
2024-06-08  8:33 ` [PULL 07/42] target/i386: fix INHIBIT_IRQ/TF/RF handling for VMRUN Paolo Bonzini
2024-06-08  8:33 ` [PULL 08/42] target/i386: fix INHIBIT_IRQ/TF/RF handling for PAUSE Paolo Bonzini
2024-06-08  8:33 ` [PULL 09/42] target/i386: fix TF/RF handling for HLT Paolo Bonzini
2024-06-08  8:33 ` [PULL 10/42] target/i386: document incorrect semantics of watchpoint following MOV/POP SS Paolo Bonzini
2024-06-08  8:33 ` [PULL 11/42] target/i386: document use of DISAS_NORETURN Paolo Bonzini
2024-06-08  8:33 ` [PULL 12/42] target/i386: use local X86DecodedOp in gen_POP() Paolo Bonzini
2024-06-08  8:33 ` [PULL 13/42] target/i386: use gen_writeback() within gen_POP() Paolo Bonzini
2024-07-10  9:42   ` Clément Chigot
2024-07-10 10:43     ` Paolo Bonzini
2024-07-10 12:53       ` Clément Chigot
2024-06-08  8:33 ` [PULL 14/42] target/i386: fix SP when taking a memory fault during POP Paolo Bonzini
2024-06-08  8:33 ` [PULL 15/42] target/i386: fix size of EBP writeback in gen_enter() Paolo Bonzini
2024-06-08  8:33 ` [PULL 16/42] machine: default -M mem-merge to off is QEMU_MADV_MERGEABLE is not available Paolo Bonzini
2024-06-08  8:33 ` [PULL 17/42] meson: Don't even detect posix_madvise() on Darwin Paolo Bonzini
2024-06-08  8:33 ` [PULL 18/42] osdep: Make qemu_madvise() to set errno in all cases Paolo Bonzini
2024-06-08  8:33 ` [PULL 19/42] osdep: Make qemu_madvise() return ENOSYS on unsupported OSes Paolo Bonzini
2024-06-08  8:33 ` [PULL 20/42] backends/hostmem: Report error when memory size is unaligned Paolo Bonzini
2024-06-08  8:33 ` [PULL 21/42] machine, hostmem: improve error messages for unsupported features Paolo Bonzini
2024-06-08  8:33 ` [PULL 22/42] hostmem: simplify the code for merge and dump properties Paolo Bonzini
2024-06-08  8:33 ` [PULL 23/42] scsi-disk: Don't silently truncate serial number Paolo Bonzini
2024-06-08  8:33 ` [PULL 24/42] stubs/meson: Fix qemuutil build when --disable-system Paolo Bonzini
2024-06-08  8:33 ` [PULL 25/42] i386/hvf: Adds support for INVTSC cpuid bit Paolo Bonzini
2024-06-08  8:33 ` [PULL 26/42] i386/hvf: Fixes some compilation warnings Paolo Bonzini
2024-06-08  8:34 ` [PULL 27/42] hvf: Consistent types for vCPU handles Paolo Bonzini
2024-06-08  8:34 ` [PULL 28/42] i386/hvf: Fixes dirty memory tracking by page granularity RX->RWX change Paolo Bonzini
2024-06-08  8:34 ` [PULL 29/42] i386/hvf: In kick_vcpu use hv_vcpu_interrupt to force exit Paolo Bonzini
2024-06-08  8:34 ` [PULL 30/42] i386/hvf: Updates API usage to use modern vCPU run function Paolo Bonzini
2024-06-08  8:34 ` [PULL 31/42] hvf: Makes assert_hvf_ok report failed expression Paolo Bonzini
2024-06-08  8:34 ` [PULL 32/42] target/i386: add support for FRED in CPUID enumeration Paolo Bonzini
2024-06-08  8:34 ` [PULL 33/42] target/i386: mark CR4.FRED not reserved Paolo Bonzini
2024-06-08  8:34 ` [PULL 34/42] vmxcap: add support for VMX FRED controls Paolo Bonzini
2024-06-08  8:34 ` [PULL 35/42] target/i386: enumerate VMX nested-exception support Paolo Bonzini
2024-06-08  8:34 ` [PULL 36/42] target/i386: Add get/set/migrate support for FRED MSRs Paolo Bonzini
2024-06-08  8:34 ` [PULL 37/42] docs: i386: pc: Avoid mentioning limit of maximum vCPUs Paolo Bonzini
2024-06-08  8:34 ` [PULL 38/42] i386: Fix MCE support for AMD hosts Paolo Bonzini
2024-06-08  8:34 ` [PULL 39/42] i386: Add support for SUCCOR feature Paolo Bonzini
2024-06-13  9:50   ` Xiaoyao Li
2024-06-24 16:29     ` John Allen
2024-06-27 14:00     ` Paolo Bonzini [this message]
2024-06-08  8:34 ` [PULL 40/42] i386: Add support for overflow recovery Paolo Bonzini
2024-06-08  8:34 ` [PULL 41/42] Revert "python: use vendored tomli" Paolo Bonzini
2024-06-08  8:34 ` [PULL 42/42] python: mkvenv: remove ensure command Paolo Bonzini
2024-06-08 20:19 ` [PULL 00/42] i386, scsi. hostmem fixes for 2024-06-08 Richard Henderson

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=0794eb13-63a6-4a6e-a0a8-5953c3c09f9f@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=joao.m.martins@oracle.com \
    --cc=john.allen@amd.com \
    --cc=qemu-devel@nongnu.org \
    --cc=william.roche@oracle.com \
    --cc=xiaoyao.li@intel.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).