qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH uq/master V2] kvm: Add CPUID support for VIA CPU


From: Jan Kiszka
Subject: Re: [Qemu-devel] [PATCH uq/master V2] kvm: Add CPUID support for VIA CPU
Date: Sat, 28 May 2011 12:28:02 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

On 2011-05-10 10:02, BrillyWu wrote:
> From: BrillyWu <address@hidden>
> 
> When KVM is running on VIA CPU with host cpu's model, the
> feautures of VIA CPU will be passed into kvm guest by calling
> the CPUID instruction for Centaur.
> 
> Signed-off-by: BrillyWu<address@hidden>
> Signed-off-by: KaryJin<address@hidden>
> ---
>  target-i386/cpu.h   |    3 +++
>  target-i386/cpuid.c |   46 +++++++++++++++++++++++++++++++++++++++++++++-
>  target-i386/kvm.c   |   15 +++++++++++++++
>  3 files changed, 63 insertions(+), 1 deletion(-)
> 
> --- a/target-i386/cpu.h       2011-05-09 09:55:48.624885001 +0800
> +++ b/target-i386/cpu.h       2011-05-09 09:48:53.704885019 +0800
> @@ -721,6 +721,9 @@ typedef struct CPUX86State {
>      uint32_t cpuid_ext3_features;
>      uint32_t cpuid_apic_id;
>      int cpuid_vendor_override;
> +    /* Store the results of Centaur's CPUID instructions */
> +    uint32_t cpuid_xlevel2;
> +    uint32_t cpuid_ext4_features;
> 
>      /* MTRRs */
>      uint64_t mtrr_fixed[11];
> --- a/target-i386/cpuid.c     2011-05-09 09:31:11.754884991 +0800
> +++ b/target-i386/cpuid.c     2011-05-09 10:18:46.204885008 +0800
> @@ -230,6 +230,9 @@ typedef struct x86_def_t {
>      char model_id[48];
>      int vendor_override;
>      uint32_t flags;
> +    /* Store the results of Centaur's CPUID instructions */
> +    uint32_t ext4_features;
> +    uint32_t xlevel2;
>  } x86_def_t;
> 
>  #define I486_FEATURES (CPUID_FP87 | CPUID_VME | CPUID_PSE)
> @@ -522,6 +525,18 @@ static int cpu_x86_fill_host(x86_def_t *
>      cpu_x86_fill_model_id(x86_cpu_def->model_id);
>      x86_cpu_def->vendor_override = 0;
> 
> +    /* Call Centaur's CPUID instruction. */
> +    if (x86_cpu_def->vendor1 == CPUID_VENDOR_VIA_1 &&
> +    x86_cpu_def->vendor2 == CPUID_VENDOR_VIA_2 &&
> +    x86_cpu_def->vendor3 == CPUID_VENDOR_VIA_3) {

CPUID_VENDOR_VIA_* definitions in target-i386/cpu.h are missing so that
this patch breaks current uq/master build. Please fix.

Thanks,
Jan


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]