Received: from list by lists.gnu.org with archive (Exim 4.71) id 1eAcu1-0007MD-JM for mharc-grub-devel@gnu.org; Fri, 03 Nov 2017 10:24:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48287) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eActz-0007Kf-I4 for grub-devel@gnu.org; Fri, 03 Nov 2017 10:24:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eActt-0003W2-OJ for grub-devel@gnu.org; Fri, 03 Nov 2017 10:24:55 -0400 Received: from mx2.suse.de ([195.135.220.15]:47347) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eActt-0003VI-E6 for grub-devel@gnu.org; Fri, 03 Nov 2017 10:24:49 -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 07859AD09; Fri, 3 Nov 2017 14:24:46 +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> <7d4ea582-e936-35bf-fadb-58e11b1315ee@suse.com> <20171103140722.lrlokgese4mttojs@dhcp-3-128.uk.xensource.com> From: Juergen Gross Message-ID: Date: Fri, 3 Nov 2017 15:24:45 +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: <20171103140722.lrlokgese4mttojs@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: Fri, 03 Nov 2017 14:24:56 -0000 On 03/11/17 15:07, Roger Pau Monn=C3=A9 wrote: > On Fri, Nov 03, 2017 at 01:50:11PM +0100, Juergen Gross wrote: >> 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 = load >>>>>>> the kernel using the PVH entry point or the native entry point. W= ould >>>>>>> it be possible to boot a Linux kernel up to the point where cpuid= can >>>>>>> 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 kern= el. >>>>> >>>>> 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 u= sed >>>>> 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 gue= st. >>>> 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). >>> >>> 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. >>> >>> 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 jus= t >> 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. >=20 > If you are booted from the PVH entry point, there's no BIOS or UEFI > (ie: no firmware), if you are booted from the BIOS entry point there's > a BIOS and the same applies to UEFI. How does Linux differentiate > whether it's booted from BIOS or UEFI? They use different entries. Juergen