lkml.org 
[lkml]   [2006]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [kvm-devel] [PATCH] KVM: Avoid using vmx instruction directly
Arnd Bergmann wrote:
> On Thursday 09 November 2006 12:08, Avi Kivity wrote:
>
>> Index: linux-2.6/drivers/kvm/kvm_main.c
>> ===================================================================
>> --- linux-2.6.orig/drivers/kvm/kvm_main.c
>> +++ linux-2.6/drivers/kvm/kvm_main.c
>> @@ -369,8 +369,8 @@ static void vmcs_clear(struct vmcs *vmcs
>> u64 phys_addr = __pa(vmcs);
>> u8 error;
>>
>> - asm volatile ("vmclear %1; setna %0"
>> - : "=m"(error) : "m"(phys_addr) : "cc", "memory" );
>> + asm volatile (ASM_VMX_VMCLEAR_RAX "; setna %0"
>> + : "=g"(error) : "a"(&phys_addr) : "cc", "memory" );
>> if (error)
>> printk(KERN_ERR "kvm: vmclear fail: %p/%llx\n",
>> vmcs, phys_addr);
>>
>
> I'm not an expert on inline assembly, but don't you need an extra
> '"m" (phys_addr)' to make sure that gcc actually puts the variable
> on the stack instead of passing a NULL pointer as '"a"(&phys_addr)'?
>
>

Taking a variable's address should force its contents into memory (like
calling an uninlined function with &var).


--
error compiling committee.c: too many arguments to function

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-11-09 14:39    [W:0.057 / U:0.964 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site