qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Avi Kivity <avi@redhat.com>,
	Anthony Liguori <aliguori@us.ibm.com>,
	Glauber Costa <glommer@redhat.com>,
	kvm@vger.kernel.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/6] kvm: add kvmclock to its second bit
Date: Sun, 17 Apr 2011 13:02:17 +0200	[thread overview]
Message-ID: <4DAAC8B9.7020708@web.de> (raw)
In-Reply-To: <8f53372986d7726c02fe0147e45be504a5208edc.1302991808.git.mtosatti@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2257 bytes --]

On 2011-04-17 00:10, Marcelo Tosatti wrote:
> From: Glauber Costa <glommer@redhat.com>
> 
> 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 <glommer@redhat.com>
> Signed-off-by: Avi Kivity <avi@redhat.com>
> ---
>  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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]

  reply	other threads:[~2011-04-17 11:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-16 22:10 [Qemu-devel] [PATCH 0/6] [PULL] qemu-kvm.git uq/master queue Marcelo Tosatti
2011-04-16 22:10 ` [Qemu-devel] [PATCH 1/6] kvm: use kernel-provided para_features instead of statically coming up with new capabilities Marcelo Tosatti
2011-04-16 22:10 ` [Qemu-devel] [PATCH 2/6] kvm: add kvmclock to its second bit Marcelo Tosatti
2011-04-17 11:02   ` Jan Kiszka [this message]
2011-04-19 11:06     ` [Qemu-devel] [PATCH v2 2a/6] x86: Allow multiple cpu feature matches of lookup_feature Jan Kiszka
2011-04-27 18:38       ` Glauber Costa
2011-04-19 11:06     ` [Qemu-devel] [PATCH v2 2b/6] kvm: add kvmclock to its second bit Jan Kiszka
2011-04-16 22:10 ` [Qemu-devel] [PATCH 3/6] kvm: create kvmclock when one of the flags are present Marcelo Tosatti
2011-04-16 22:10 ` [Qemu-devel] [PATCH 4/6] Break up user and system cpu_interrupt implementations Marcelo Tosatti
2011-04-16 22:10 ` [Qemu-devel] [PATCH 5/6] Redirect cpu_interrupt to callback handler Marcelo Tosatti
2011-04-16 22:10 ` [Qemu-devel] [PATCH 6/6] kvm: Install specialized interrupt handler Marcelo Tosatti
2011-04-16 23:57 ` [Qemu-devel] [PATCH 0/6] [PULL] qemu-kvm.git uq/master queue Anthony Liguori

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=4DAAC8B9.7020708@web.de \
    --to=jan.kiszka@web.de \
    --cc=aliguori@us.ibm.com \
    --cc=avi@redhat.com \
    --cc=glommer@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).