[fedora-virt] Re: rpms/qemu/F-11 qemu-fix-x86-feature-modifications-for-features-that-set.patch, NONE, 1.1 qemu-make-x86-cpuid-feature-names-available-in-file-scope.patch, NONE, 1.1 qemu-trim-cpu-features-not-supported-by-kvm.patch, NONE, 1.1 qemu.spec, 1.94, 1.95

Mark McLoughlin markmc at redhat.com
Tue May 19 06:37:10 UTC 2009


Hi Glauber,

I've pushed qemu-0.10.4-4.fc11 to stable, since it's had some good
testing:

  https://admin.fedoraproject.org/updates/F11/FEDORA-2009-5050

So, qemu-0.10.4-5.fc11 in testing just has the cpuid trimming backport
now:

  https://admin.fedoraproject.org/updates/qemu-0.10.4-5.fc11

Also, now that I look more closely, Jan's cpuinfo in bug #499596 does
actually contain nx. Maybe cpuid trimming won't help him after all?

On Tue, 2009-05-19 at 03:01 +0000, Glauber Costa wrote:

> Author: glommer
> 
> Update of /cvs/pkgs/rpms/qemu/F-11
> In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv8104
> 
> Modified Files:
>         qemu.spec 
> Added Files:
>         qemu-fix-x86-feature-modifications-for-features-that-set.patch 
>         qemu-make-x86-cpuid-feature-names-available-in-file-scope.patch 
>         qemu-trim-cpu-features-not-supported-by-kvm.patch 
> Log Message:
> - Backport cpuid trimming from upstream (#499596)
...
> qemu-trim-cpu-features-not-supported-by-kvm.patch:
> 
> --- NEW FILE qemu-trim-cpu-features-not-supported-by-kvm.patch ---
> >From 3b944bee95c6a5ee561acfc4c4d75d8cc971a567 Mon Sep 17 00:00:00 2001
> From: Avi Kivity <avi at redhat.com>
> Date: Sun, 3 May 2009 17:04:04 +0300
> Subject: [PATCH STABLE 3/3] kvm: Trim cpu features not supported by kvm
> 
> Remove cpu features that are not supported by kvm from the cpuid features
> reported to the guest.
> 
> Signed-off-by: Avi Kivity <avi at redhat.com>
> Signed-off-by: Anthony Liguori <aliguori at us.ibm.com>
> Signed-off-by: Glauber Costa <glommer at redhat.com>
> ---
>  target-i386/helper.c |   31 ++++++++++++++++++++++++++++++-
>  1 files changed, 30 insertions(+), 1 deletions(-)
> 
> diff --git a/target-i386/helper.c b/target-i386/helper.c
> index 1433857..6af5d23 100644
> --- a/target-i386/helper.c
> +++ b/target-i386/helper.c
> @@ -93,6 +93,21 @@ static void add_flagname_to_bitmaps(char *flagname, uint32_t *features,
>      }
>  }
>  
> +static void kvm_trim_features(uint32_t *features, uint32_t supported,
> +                              const char *names[])
> +{
> +    int i;
> +    uint32_t mask;
> +
> +    for (i = 0; i < 32; ++i) {
> +        mask = 1U << i;
> +        if ((*features & mask) && !(supported & mask)) {
> +            printf("Processor feature %s not supported by kvm\n", names[i]);

Anthony later killed off this message, it's too verbose.

> +            *features &= ~mask;
> +        }
> +    }
> +}
> +
>  typedef struct x86_def_t {
>      const char *name;
>      uint32_t level;
> @@ -1672,7 +1687,21 @@ CPUX86State *cpu_x86_init(const char *cpu_model)
>  #ifdef USE_KQEMU
>      kqemu_init(env);
>  #endif
> -    if (kvm_enabled())
> +    if (kvm_enabled()) {
>          kvm_init_vcpu(env);
> +        kvm_trim_features(&env->cpuid_features,
> +                          kvm_arch_get_supported_cpuid(env, 1, R_EDX),
> +                          feature_name);
> +        kvm_trim_features(&env->cpuid_ext_features,
> +                          kvm_arch_get_supported_cpuid(env, 1, R_ECX),
> +                          ext_feature_name);
> +        kvm_trim_features(&env->cpuid_ext2_features,
> +                          kvm_arch_get_supported_cpuid(env, 0x80000001, R_EDX),
> +                          ext2_feature_name);
> +        kvm_trim_features(&env->cpuid_ext3_features,
> +                          kvm_arch_get_supported_cpuid(env, 0x80000001, R_ECX),
> +                          ext3_feature_name);

This doesn't work on my machine without:

  http://patchwork.kernel.org/patch/23233/

> Index: qemu.spec
> ===================================================================
> RCS file: /cvs/pkgs/rpms/qemu/F-11/qemu.spec,v
> retrieving revision 1.94
> retrieving revision 1.95
> diff -u -p -r1.94 -r1.95
> --- qemu.spec   14 May 2009 11:00:13 -0000      1.94
> +++ qemu.spec   19 May 2009 03:00:56 -0000      1.95
> @@ -1,7 +1,7 @@
>  Summary: QEMU is a FAST! processor emulator
>  Name: qemu
>  Version: 0.10.4
> -Release: 4%{?dist}
> +Release: 5%{?dist}
>  # Epoch because we pushed a qemu-1.0 package
>  Epoch: 2
>  License: GPLv2+ and LGPLv2+ and BSD
> @@ -33,6 +33,10 @@ Patch17: qemu-dma-aio-cancellation1.patc
>  Patch18: qemu-dma-aio-cancellation2.patch
>  Patch19: qemu-dma-aio-cancellation3.patch
>  Patch20: qemu-dma-aio-cancellation4.patch
> +Patch21: qemu-make-x86-cpuid-feature-names-available-in-file-scope.patch
> +Patch22: qemu-fix-x86-feature-modifications-for-features-that-set.patch
> +Patch23: qemu-trim-cpu-features-not-supported-by-kvm.patch
> +
>  
>  BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
>  BuildRequires: SDL-devel zlib-devel which texi2html gnutls-devel cyrus-sasl-devel
> @@ -233,6 +237,9 @@ such as kvmtrace and kvm_stat.
>  %patch18 -p1
>  %patch19 -p1
>  %patch20 -p1
> +%patch21 -p1
> +#%patch22 -p1
> +#%patch23 -p1

Why aren't you applying the patches?

Cheers,
Mark.




More information about the Fedora-virt mailing list