Re: [PATCH 1/1 v2] KVM: MMU: Optimize guest page table walk

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

 



On 2011-04-26 09:42, Avi Kivity wrote:
> On 04/25/2011 11:04 AM, Jan Kiszka wrote:
>> >  +
>> >  +        ptep_user = (pt_element_t __user *)((void *)host_addr +
>> offset);
>> >  +        if (get_user(pte, ptep_user)) {
>>                      ^^^^^^^^^^^^
>> This doesn't work for x86-32: pte is 64 bit, but get_user is only
>> defined up to 32 bit on that platform.
>>
> 
> I actually considered this, and saw:
> 
> #ifdef CONFIG_X86_32
> #define __get_user_8(__ret_gu, __val_gu, ptr)                \
>         __get_user_x(X, __ret_gu, __val_gu, ptr)
> #else
> #define __get_user_8(__ret_gu, __val_gu, ptr)                \
>         __get_user_x(8, __ret_gu, __val_gu, ptr)
> #endif
> 
> #define get_user(x, ptr)                        \
> ({                                    \
>     int __ret_gu;                            \
>     unsigned long __val_gu;                        \
>     __chk_user_ptr(ptr);                        \
>     might_fault();                            \
>     switch (sizeof(*(ptr))) {                    \
> 
> ...
> 
>     case 8:                                \
>         __get_user_8(__ret_gu, __val_gu, ptr);            \
>         break;                            \
> 
> ...
> 
>     }                                \
>     (x) = (__typeof__(*(ptr)))__val_gu;                \
>     __ret_gu;                            \
> })
> 
> so it should work.  How does it fail?

On x86-32, the above macro resolves to __get_user_X, an undefined symbol.

> 
>> Avi, what's your 32-bit buildbot doing? :)
> 
> I regularly autotest on x86_64, not on i386, sorry.

Good that it's included in my kvm-kmod buildbot.

Jan

Attachment: signature.asc
Description: OpenPGP digital signature


[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