From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Ostrovsky Subject: Re: [PATCH v2 1/4] x86/compat: Test whether guest has 32b shinfo instead of being a PV 32b domain Date: Thu, 09 Jul 2015 12:05:59 -0400 Message-ID: <559E9BE7.80903@oracle.com> References: <1435609282-1383-1-git-send-email-boris.ostrovsky@oracle.com> <1435609282-1383-2-git-send-email-boris.ostrovsky@oracle.com> <559BB3DF020000780008D3A6@mail.emea.novell.com> <559BF471.7080904@oracle.com> <559C173F020000780008DBAD@mail.emea.novell.com> <559C08AD.106@oracle.com> <559CE3DD020000780008DEAA@mail.emea.novell.com> <559D2CD8.7050807@oracle.com> <559D4AF2020000780008E463@mail.emea.novell.com> <559D3662.4070803@oracle.com> <559D54E2020000780008E4D7@mail.emea.novell.com> <559D8EB8.9040804@oracle.com> <559E3896020000780008E91E@mail.emea.novell.com> <559E80D9.7010300@oracle.com> <559E9EAA020000780008EE10@mail.emea.novell.com> <559E8592.5010005@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <559E8592.5010005@oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: elena.ufimtseva@oracle.com, tim@xen.org, wei.liu2@citrix.com, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org, roger.pau@citrix.com List-Id: xen-devel@lists.xenproject.org On 07/09/2015 10:30 AM, Boris Ostrovsky wrote: > On 07/09/2015 10:17 AM, Jan Beulich wrote: >>>>> On 09.07.15 at 16:10, wrote: >>> On 07/09/2015 03:02 AM, Jan Beulich wrote: >>>>>>> On 08.07.15 at 22:57, wrote: >>>>> As I started to update the patches I realized that in some cases >>>>> (especially in arch_do_domctl():XEN_DOMCTL_get_address_size) we don't >>>>> have VCPU (which is what hvm_guest_x86_mode() wants) but rather >>>>> only the >>>>> domain. d->vcpu[0] should work. Otherwise I'll either need a new >>>>> field >>>>> in struct domain or wrap has_32bit_shinfo into something >>>>> PVH-specific, >>>>> like is_32bit_pvh_vcpu(). >>>> Shouldn't XEN_DOMCTL_get_address_size be handled HVM-like >>>> for PVH, especially if you also intend the tools to use the 64-bit >>>> guest context variant even for 32-bit PVH? Once again - are you >>>> intending to prohibit 32-bit PVH switching to 64-bit mode (which >>>> would seem both wrong and possibly cumbersome to me)? >>> With current PVH implementation I don't think we can switch. We are >>> starting the guest in very much PV-like fashion. That's why we are >>> getting into switch_compat() --- via XEN_DOMCTL_set_address_size. >>> >>> For XEN_DOMCTL_get_address_size specifically we need to be able to >>> figure out the mode *before* the guest is running because we use it to >>> set cpuid bits in xc_cpuid_pv_policy(). So just that means we can't >>> change the mode. >> Okay - but is there code (being put) in place to refuse switch >> attempts? > > No, I should add code to deal with this. Forgot to include here --- so what is your preference wrt what I am asking in the first paragraph? d->vcpu[0], new field (or maybe a flag with bits per 32bit-pv and 32bit-pvh), or a PVH-wrapper for has_32bit_shinfo? -boris -boris