From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH 1/1 v2] KVM: MMU: Optimize guest page table walk Date: Tue, 26 Apr 2011 09:45:39 +0200 Message-ID: <4DB67823.4010304@web.de> References: <20110422003222.9d08aee3.takuya.yoshikawa@gmail.com> <20110422003444.5b3a876a.takuya.yoshikawa@gmail.com> <4DB52B1B.5080407@web.de> <4DB6775F.9050207@redhat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig04FCE2230DA68490037E4E28" Cc: Takuya Yoshikawa , mtosatti@redhat.com, kvm@vger.kernel.org, yoshikawa.takuya@oss.ntt.co.jp, xiaoguangrong@cn.fujitsu.com, Joerg.Roedel@amd.com To: Avi Kivity Return-path: Received: from fmmailgate03.web.de ([217.72.192.234]:40128 "EHLO fmmailgate03.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755598Ab1DZHqm (ORCPT ); Tue, 26 Apr 2011 03:46:42 -0400 In-Reply-To: <4DB6775F.9050207@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig04FCE2230DA68490037E4E28 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2011-04-26 09:42, Avi Kivity wrote: > On 04/25/2011 11:04 AM, Jan Kiszka wrote: >> > + >> > + ptep_user =3D (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. >> >=20 > I actually considered this, and saw: >=20 > #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 >=20 > #define get_user(x, ptr) \ > ({ \ > int __ret_gu; \ > unsigned long __val_gu; \ > __chk_user_ptr(ptr); \ > might_fault(); \ > switch (sizeof(*(ptr))) { \ >=20 > ... >=20 > case 8: \ > __get_user_8(__ret_gu, __val_gu, ptr); \ > break; \ >=20 > ... >=20 > } \ > (x) =3D (__typeof__(*(ptr)))__val_gu; \ > __ret_gu; \ > }) >=20 > so it should work. How does it fail? On x86-32, the above macro resolves to __get_user_X, an undefined symbol.= >=20 >> Avi, what's your 32-bit buildbot doing? :) >=20 > I regularly autotest on x86_64, not on i386, sorry. Good that it's included in my kvm-kmod buildbot. Jan --------------enig04FCE2230DA68490037E4E28 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iEYEARECAAYFAk22eCMACgkQitSsb3rl5xS1cgCfRciicKgDzBvEWlZqTQjeiOHr P0wAn3UA9GQxqEnVbiCob1ywZdZxEfhR =6Vmd -----END PGP SIGNATURE----- --------------enig04FCE2230DA68490037E4E28--