Received: from list by lists.gnu.org with archive (Exim 4.71) id 1eBfhj-0000jY-Oo for mharc-grub-devel@gnu.org; Mon, 06 Nov 2017 06:36:35 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eBfhh-0000jI-67 for grub-devel@gnu.org; Mon, 06 Nov 2017 06:36:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eBfhd-0000Y1-WB for grub-devel@gnu.org; Mon, 06 Nov 2017 06:36:33 -0500 Received: from mx2.suse.de ([195.135.220.15]:35776) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eBfhd-0000Xf-PE for grub-devel@gnu.org; Mon, 06 Nov 2017 06:36:29 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 5F89FABFA; Mon, 6 Nov 2017 11:36:28 +0000 (UTC) Subject: Re: [Xen-devel] Xen PVH support in grub2 To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Cc: The development of GNU GRUB , Daniel Kiper , xen-devel References: <11dda1ae-5b70-41fe-a592-39750a74e5d7@suse.com> <20170929152439.iibhzqtwfmqi4yx2@dhcp-3-128.uk.xensource.com> <230ef18e-6739-58c6-1f95-b04e7245beaf@suse.com> <20170929155104.45wv3c7civz6uif6@dhcp-3-128.uk.xensource.com> <20171103121750.jztbuimjjt34efk6@dhcp-3-128.uk.xensource.com> From: Juergen Gross Message-ID: Date: Mon, 6 Nov 2017 12:36:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171103121750.jztbuimjjt34efk6@dhcp-3-128.uk.xensource.com> Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 195.135.220.15 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 11:36:34 -0000 On 03/11/17 13:17, Roger Pau Monn=C3=A9 wrote: > On Fri, Nov 03, 2017 at 01:00:46PM +0100, Juergen Gross wrote: >> On 29/09/17 17:51, Roger Pau Monn=C3=A9 wrote: >>> On Fri, Sep 29, 2017 at 03:33:58PM +0000, Juergen Gross wrote: >>>> On 29/09/17 17:24, Roger Pau Monn=C3=A9 wrote: >>>>> On Fri, Sep 29, 2017 at 02:46:53PM +0000, Juergen Gross wrote: >>>>> Then, I also wonder whether it would make sense for this grub to lo= ad >>>>> the kernel using the PVH entry point or the native entry point. Wou= ld >>>>> it be possible to boot a Linux kernel up to the point where cpuid c= an >>>>> be used inside of a PVH container? >>>> >>>> I don't think today's Linux allows that. This has been discussed >>>> very thoroughly at the time Boris added PVH V2 support to the kernel= . >>> >>> OK, I'm not going to insist on that, but my plans for FreeBSD is to >>> make the native entry point capable of booting inside of a PVH >>> container up to the point where cpuid (or whatever method) can be use= d >>> to detect the environment. >> >> Looking more thoroughly into the Linux boot code I think this could >> work for Linux, too. But only if we can tell PVH from HVM in the guest= . >> How would you do that in FreeBSD? Via flags in the boot params? This >> would the have to be done in the boot loader (e.g. grub or OVMF). >=20 > My plan was not to differentiate between HVM and PVH, but rather to > make use of the ACPI information in order to decide which devices are > available and which are not inside of a PVH guest. >=20 > For example in the FADT "IA-PC Boot Architecture Flags" field for PVH > we already set "VGA Not Present" and "CMOS RTC Not Present". There > might be other flags/fields that must be set, but I would like to > avoid having a CPUID bit or similar saying "PVH", because then Xen > will be tied to always providing the same set of devices in PVH > containers. I looked through the xen_pvh_domain() use cases in the Linux kernel again. Maybe we can really manage to not need differentiating PVH from HVM until ACPI table scan. We'd need another hook for Xen, but this should be easy as KVM already has a hook where we'd need one. So this can be made more general and we are fine. I even think we can drop some of the PVH tests, as the PVH-specific handling (e.g. for grant table initialization) should work for HVM, too. Juergen