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 04/26/2011 10:45 AM, Jan Kiszka wrote:
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.


Tricky stuff.

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

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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