Re: [PATCH] x86/cpuid: Stop masking the CPU vendor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Argh. Sorry. Sent with the wrong prefix.

On Thu, Mar 17, 2022 at 12:27 PM Oliver Upton <oupton@xxxxxxxxxx> wrote:
>
> commit bc0b99a ("kvm tools: Filter out CPU vendor string") replaced the
> processor's native vendor string with a synthetic one to hack around
> some interesting guest MSR accesses that were not handled in KVM. In
> particular, the MC4_CTL_MASK MSR was accessed for AMD VMs, which isn't
> supported by KVM. This MSR relates to masking MCEs originating from the
> northbridge on real hardware, but is of zero use in virtualization.
>
> Speaking more broadly, KVM does in fact do the right thing for such an
> MSR (#GP), and it is annoying but benign that KVM does a printk for the
> MSR. Masking the CPU vendor string is far from ideal, and gets in the
> way of testing vendor-specific CPU features. Stop the shenanigans and
> expose the vendor ID as returned by KVM_GET_SUPPORTED_CPUID.
>
> Signed-off-by: Oliver Upton <oupton@xxxxxxxxxx>
> ---
>  x86/cpuid.c | 8 --------
>  1 file changed, 8 deletions(-)
>
> diff --git a/x86/cpuid.c b/x86/cpuid.c
> index aa213d5..f4347a8 100644
> --- a/x86/cpuid.c
> +++ b/x86/cpuid.c
> @@ -10,7 +10,6 @@
>
>  static void filter_cpuid(struct kvm_cpuid2 *kvm_cpuid, int cpu_id)
>  {
> -       unsigned int signature[3];
>         unsigned int i;
>
>         /*
> @@ -20,13 +19,6 @@ static void filter_cpuid(struct kvm_cpuid2 *kvm_cpuid, int cpu_id)
>                 struct kvm_cpuid_entry2 *entry = &kvm_cpuid->entries[i];
>
>                 switch (entry->function) {
> -               case 0:
> -                       /* Vendor name */
> -                       memcpy(signature, "LKVMLKVMLKVM", 12);
> -                       entry->ebx = signature[0];
> -                       entry->ecx = signature[1];
> -                       entry->edx = signature[2];
> -                       break;
>                 case 1:
>                         entry->ebx &= ~(0xff << 24);
>                         entry->ebx |= cpu_id << 24;
> --
> 2.35.1.894.gb6a874cedc-goog
>



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux