Re: [kvm-unit-tests PATCH] x86: debug: use a constraint that doesn't allow a memory operand

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

 



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@xxxxxxxxxx>
> ---
>  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





[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux