From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Magenheimer Subject: RE: getting a 32-bit mfn from a 32-on-64 HVM guest Date: Sun, 20 Jun 2010 18:50:32 -0700 (PDT) Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser , "Xen-Devel (xen-devel@lists.xensource.com)" List-Id: xen-devel@lists.xenproject.org > From: Keir Fraser [mailto:keir.fraser@eu.citrix.com] > Sent: Sunday, June 20, 2010 11:56 AM > To: Dan Magenheimer; Xen-Devel (xen-devel@lists.xensource.com) > Subject: Re: [Xen-devel] getting a 32-bit mfn from a 32-on-64 HVM guest >=20 > On 20/06/2010 18:45, "Dan Magenheimer" > wrote: >=20 > > What is the "proper" way to ensure that the cmfn > > is properly truncated for a 32-bit HVM guest > > without truncating it for a 64-bit guest? I > > have used is_pv_32on64_vcpu()... is there an equivalent > > for HVM? Or do I need to do something entirely different? >=20 > See the x86_64 version of arch/x86/hvm/hvm.c:hvm_do_hypercall() which > uses > hvm_guest_x86_mode() to get the 'bitness' of the HVM-guest caller. You > should do the same, probably. Or even have a compat shim around your > hypercall same as others which have differences between 32- and 64-bit > struct layouts, and have the dispatch tables in hvm.c (HVM callers) and > entry.S (PV callers) dispatch to the correct entry point for the > bitness of > the caller. Thanks! The code was already in place for PV (see tmh_get_tmemop_from_client() in include/xen/tmem_xen.h), so I just had to add the case for HVM 32-on-64 and it works! A little more cleanup and I'll submit the patch. Dan