Received: from list by lists.gnu.org with archive (Exim 4.71) id 1eAbQW-0003gG-7d for mharc-grub-devel@gnu.org; Fri, 03 Nov 2017 08:50:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50242) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eAbQT-0003g6-LF for grub-devel@gnu.org; Fri, 03 Nov 2017 08:50:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eAbQO-0003Fx-7n for grub-devel@gnu.org; Fri, 03 Nov 2017 08:50:21 -0400 Received: from mx2.suse.de ([195.135.220.15]:35265) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eAbQN-0003F7-Vt for grub-devel@gnu.org; Fri, 03 Nov 2017 08:50:16 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 114EEAAC1; Fri, 3 Nov 2017 12:50:14 +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 , xen-devel , Daniel Kiper 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: <7d4ea582-e936-35bf-fadb-58e11b1315ee@suse.com> Date: Fri, 3 Nov 2017 13:50:11 +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: en-US 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: Fri, 03 Nov 2017 12:50:22 -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. Why? This would depend on the semantics tied to the flag. It could just mean "don't assume availability of legacy stuff" (e.g. BIOS calls). Linux would have a problem with the ACPI approach as it would try BIOS calls way before it is initializing its ACPI handling. So in Linux I'd need another way to tell I'm running in PVH mode, e.g. a "no legacy" bit in the Xen HVM cpuid leaf. Juergen