From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751714AbcA0AEm (ORCPT ); Tue, 26 Jan 2016 19:04:42 -0500 Received: from mx2.suse.de ([195.135.220.15]:60708 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751162AbcA0AEj (ORCPT ); Tue, 26 Jan 2016 19:04:39 -0500 Date: Wed, 27 Jan 2016 01:04:35 +0100 From: "Luis R. Rodriguez" To: Boris Ostrovsky Cc: Andrew Cooper , Roger Pau =?iso-8859-1?Q?Monn=E9?= , Juergen Gross , Jeremy Fitzhardinge , Rusty Russell , "linux-kernel@vger.kernel.org" , Andy Lutomirski , David Vrabel , "H. Peter Anvin" , xen-devel@lists.xenproject.org, Borislav Petkov , X86 ML Subject: Re: [Xen-devel] [PATCH v1 04/12] xen/hvmlite: Bootstrap HVMlite guest Message-ID: <20160127000435.GK20964@wotan.suse.de> References: <1453498558-6028-1-git-send-email-boris.ostrovsky@oracle.com> <1453498558-6028-5-git-send-email-boris.ostrovsky@oracle.com> <20160122233218.GA20964@wotan.suse.de> <56A2C99A.2050701@citrix.com> <56A39300.8050802@citrix.com> <20160125221920.GG20964@wotan.suse.de> <56A6A7C6.8060906@oracle.com> <20160126203023.GI20964@wotan.suse.de> <56A7EA6A.2030502@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56A7EA6A.2030502@oracle.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 26, 2016 at 04:51:38PM -0500, Boris Ostrovsky wrote: > On 01/26/2016 03:30 PM, Luis R. Rodriguez wrote: > hvmlite_start() is a 32-bit entry point [...] > > >4) hardware_subarch, hardware_subarch_data and future prospects > > > >Your patch relies on a *new* Linux entry point. Sure, we had one > >for EFI, and sure there is another for Xen PV, but since you're just > >rebranding PVH to HVMlite and given historic issues with any new > >Linux entry points I'd like for us to take a breather and evaluate > >the extent our lofty unification goals, and how the x86 boot protocol > >could help with this already. > > I am not sure I see how you can avoid having new entry point. For > example, all HVMlite guests start in 32-bit mode. Who will switch to > long mode? x86 i386 entry points need to have code to do all that stuff, this can happen for instance when you boot x86_64 from a 32-bit boot loader, and I think other things as well are possible that trigger this as well. > >why not just use a union and differentiate on PV subtype ? If you want to avoid > >a lot of PV calls for HVMlite it seems you could just take advantage of > >subarch Xen type, and differentiate on the subarch_data within Xen code > >to make that code just PV sepecific. > > > >I only see gains by using the Xen subarch, so would like to know why PC is > >being pushed. > > It's not that subarch 0 is being pushed here. It's that I don't see > how it can be useful for this particular guest type. Maybe as we add > new features (or discover something that we've missed up till now) > we can switch to using it. If you think we should delay initializing > boot_params until then --- I will disagree: boot_params are used > before we look at subarch and I don't believe it makes sense to pick > and choose what to initialize before and what can wait. subarch is part of boot_params, so not sure what I mean by an issue in timing here. The question is if its set and then how early can you possibly read the subarch from the boot_params. > (And I am not sure it can be useful on PV neither, Well.. > at least the way it is used now. that is the issue.. If we get access to boot_params on early boot then we can simply share the x86_64 entry point between PVH, PV, and native x86_64 with what I'm proposing and some minor extensions. > You will not reach the point in the (32-bit) code > where it is tested. You will die way earlier (I think on > startup_32()'s fourth instruction).) Its a bit different requirement for the subarch for PV/PVH and for HVMlite. Given what you have explained things are bit clearer now and I see the issue. You go: hvmlite_start_xen() --> HVM stub startup_64() | (startup_32() Note at the end of startup_32() though we have a neat asm set of entries that depend on the subarch type. Perhaps we should have a PV type early on startup_32() ? And/or I wonder if we can work off of the EFI boot loader code. Half baked thoughts for now, sorry have to go. Luis