qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/6] kvm: add kvmclock to its second bit


From: Jan Kiszka
Subject: Re: [Qemu-devel] [PATCH 2/6] kvm: add kvmclock to its second bit
Date: Sun, 17 Apr 2011 13:02:17 +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-04-17 00:10, Marcelo Tosatti wrote:
> From: Glauber Costa <address@hidden>
> 
> We have two bits that can represent kvmclock in cpuid.
> They signal the guest which msr set to use. When we tweak flags
> involving this value - specially when we use "-", we have to act on both.
> 
> Besides adding it to the kvm features list, we also have to "break" the
> assumption represented by the break in lookup_feature.
> 
> Signed-off-by: Glauber Costa <address@hidden>
> Signed-off-by: Avi Kivity <address@hidden>
> ---
>  target-i386/cpuid.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c
> index 814d13e..5e48d35 100644
> --- a/target-i386/cpuid.c
> +++ b/target-i386/cpuid.c
> @@ -73,7 +73,7 @@ static const char *ext3_feature_name[] = {
>  };
>  
>  static const char *kvm_feature_name[] = {
> -    "kvmclock", "kvm_nopiodelay", "kvm_mmu", NULL, "kvm_asyncpf", NULL, 
> NULL, NULL,
> +    "kvmclock", "kvm_nopiodelay", "kvm_mmu", "kvmclock", "kvm_asyncpf", 
> NULL, NULL, NULL,
>      NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
>      NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
>      NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
> @@ -193,7 +193,6 @@ static int lookup_feature(uint32_t *pval, const char *s, 
> const char *e,
>      for (mask = 1, ppc = featureset; mask; mask <<= 1, ++ppc)
>          if (*ppc && !altcmp(s, e, *ppc)) {
>              *pval |= mask;
> -            break;
>          }
>      return (mask ? 1 : 0);
>  }

This is required on top to fix the issues Anthony was seeing:

diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c
index 5e48d35..b7e20e8 100644
--- a/target-i386/cpuid.c
+++ b/target-i386/cpuid.c
@@ -189,12 +189,14 @@ static int lookup_feature(uint32_t *pval, const char *s, 
const char *e,
 {
     uint32_t mask;
     const char **ppc;
+    int found = 0;
 
     for (mask = 1, ppc = featureset; mask; mask <<= 1, ++ppc)
         if (*ppc && !altcmp(s, e, *ppc)) {
             *pval |= mask;
+            found = 1;
         }
-    return (mask ? 1 : 0);
+    return found;
 }
 
 static void add_flagname_to_bitmaps(const char *flagname, uint32_t *features,

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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