* [kvm-unit-tests PATCH] x86: debug: use a constraint that doesn't allow a memory operand
@ 2019-09-09 21:00 Bill Wendling
2019-09-10 16:46 ` Jim Mattson
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Bill Wendling @ 2019-09-09 21:00 UTC (permalink / raw)
To: kvm
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 &&
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [kvm-unit-tests PATCH] x86: debug: use a constraint that doesn't allow a memory operand
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
2019-09-25 13:49 ` Paolo Bonzini
2 siblings, 0 replies; 5+ messages in thread
From: Jim Mattson @ 2019-09-10 16:46 UTC (permalink / raw)
To: Bill Wendling; +Cc: kvm list
On Mon, Sep 9, 2019 at 2:00 PM Bill Wendling <morbo@google.com> 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>
Reviewed-by: Jim Mattson <jmattson@google.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [kvm-unit-tests PATCH] x86: debug: use a constraint that doesn't allow a memory operand
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-25 13:49 ` Paolo Bonzini
2 siblings, 1 reply; 5+ messages in thread
From: Sean Christopherson @ 2019-09-11 19:01 UTC (permalink / raw)
To: Bill Wendling; +Cc: kvm
On Mon, Sep 09, 2019 at 02:00:35PM -0700, 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>
> ---
Reviewed-by: Sean Christopherson <sean.j.christopherson@intel.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [kvm-unit-tests PATCH] x86: debug: use a constraint that doesn't allow a memory operand
[not found] ` <CAGG=3QUkr-i0vw8nxkEJJawasu7GY2de3ATRhWoxOkFg1MSZsQ@mail.gmail.com>
@ 2019-09-24 19:35 ` Bill Wendling
0 siblings, 0 replies; 5+ messages in thread
From: Bill Wendling @ 2019-09-24 19:35 UTC (permalink / raw)
To: Sean Christopherson, Paolo Bonzini, Radim Krčmář; +Cc: kvm list
Plain text now. Sorry for spam.
On Tue, Sep 24, 2019 at 12:33 PM Bill Wendling <morbo@google.com> wrote:
>
> + Paolo Bonzini, Radim Krčmář
>
> On Wed, Sep 11, 2019 at 12:01 PM Sean Christopherson <sean.j.christopherson@intel.com> wrote:
>>
>> On Mon, Sep 09, 2019 at 02:00:35PM -0700, 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>
>> > ---
>>
>> Reviewed-by: Sean Christopherson <sean.j.christopherson@intel.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [kvm-unit-tests PATCH] x86: debug: use a constraint that doesn't allow a memory operand
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
@ 2019-09-25 13:49 ` Paolo Bonzini
2 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2019-09-25 13:49 UTC (permalink / raw)
To: Bill Wendling, kvm
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-09-25 13:49 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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.