kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Bill Wendling <morbo@google.com>, kvm@vger.kernel.org
Subject: Re: [kvm-unit-tests PATCH] x86: debug: use a constraint that doesn't allow a memory operand
Date: Wed, 25 Sep 2019 15:49:05 +0200	[thread overview]
Message-ID: <97179bda-2c90-7aba-e2f1-f65612125a23@redhat.com> (raw)
In-Reply-To: <CAGG=3QUHwHsVtrc3UYhhbkBX5WOp4Am=beFnn7yyxh6ykTe_Fw@mail.gmail.com>

On 09/09/19 23:00, Bill Wendling wrote:
> The "lea" instruction cannot load the effective address into a memory
> location. The "g" constraint allows a compiler to use a memory location.
> A compiler that uses a register destination does so only because one is
> available. Use a general register constraint to make sure it always uses
> a register.
> 
> Signed-off-by: Bill Wendling <morbo@google.com>
> ---
>  x86/debug.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/x86/debug.c b/x86/debug.c
> index f66d1d0..2327dac 100644
> --- a/x86/debug.c
> +++ b/x86/debug.c
> @@ -113,7 +113,7 @@ int main(int ac, char **av)
>   "and $~(1<<8),%%rax\n\t"
>   "push %%rax\n\t"
>   "popf\n\t"
> - : "=g" (start) : : "rax");
> + : "=r" (start) : : "rax");
>   report("single step",
>          n == 3 &&
>          db_addr[0] == start+1+6 && dr6[0] == 0xffff4ff0 &&
> 

There is another occurrence, also this has spaces and tabs messed up as
well.  Fixed up and queued.

Paolo


      parent reply	other threads:[~2019-09-25 13:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-09 21:00 [kvm-unit-tests PATCH] x86: debug: use a constraint that doesn't allow a memory operand Bill Wendling
2019-09-10 16:46 ` Jim Mattson
2019-09-11 19:01 ` Sean Christopherson
     [not found]   ` <CAGG=3QUkr-i0vw8nxkEJJawasu7GY2de3ATRhWoxOkFg1MSZsQ@mail.gmail.com>
2019-09-24 19:35     ` Bill Wendling
2019-09-25 13:49 ` 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=97179bda-2c90-7aba-e2f1-f65612125a23@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=morbo@google.com \
    /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).