All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Gleb Natapov <gleb@redhat.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH] kvm-unit-test: fix cpuid test
Date: Mon, 04 Nov 2013 15:06:47 +0100	[thread overview]
Message-ID: <5277A9F7.3060700@redhat.com> (raw)
In-Reply-To: <20131104140430.GF7513@redhat.com>

Il 04/11/2013 15:04, Gleb Natapov ha scritto:
> If cpuid is called with function value greater than max supported one
> max supported value is used instead and index parameter is honored. That
> is why we need to initialize index to same value in the test to get
> same result from both cpuid invocations.
> 
> diff --git a/x86/realmode.c b/x86/realmode.c
> index c57e033..0e1cd37 100644
> --- a/x86/realmode.c
> +++ b/x86/realmode.c
> @@ -1375,6 +1375,7 @@ static void test_cpuid(void)
>      unsigned eax, ebx, ecx, edx;
>  
>      inregs.eax = eax = function;
> +    inregs.ecx = ecx = 0;
>      asm("cpuid" : "+a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx));
>      exec_in_big_real_mode(&insn_cpuid);
>      report("cpuid", R_AX|R_BX|R_CX|R_DX,
> --
> 			Gleb.
> 

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

      reply	other threads:[~2013-11-04 14:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-04 14:04 [PATCH] kvm-unit-test: fix cpuid test Gleb Natapov
2013-11-04 14:06 ` Paolo Bonzini [this message]

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=5277A9F7.3060700@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=gleb@redhat.com \
    --cc=kvm@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.