From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754763AbbIJMGv (ORCPT ); Thu, 10 Sep 2015 08:06:51 -0400 Received: from smtp.citrix.com ([66.165.176.89]:17338 "EHLO SMTP.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754689AbbIJMGc (ORCPT ); Thu, 10 Sep 2015 08:06:32 -0400 X-IronPort-AV: E=Sophos;i="5.17,504,1437436800"; d="scan'208";a="299141539" Subject: Re: [PATCH] efi/libstub/fdt: Standardize the names of EFI stub parameters To: Julien Grall , Andrew Turner , Shannon Zhao References: <1441874516-11364-1-git-send-email-zhaoshenglong@huawei.com> <20150910123251.7e0810d1@bender.Home> <55F16DF5.1080705@citrix.com> CC: , , , , , , , , , , , , , , , From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= X-Enigmail-Draft-Status: N1110 Message-ID: <55F1721D.1010801@citrix.com> Date: Thu, 10 Sep 2015 14:05:49 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <55F16DF5.1080705@citrix.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-DLP: MIA2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org El 10/09/15 a les 13.48, Julien Grall ha escrit: > On 10/09/15 12:32, Andrew Turner wrote: >> On Thu, 10 Sep 2015 16:41:56 +0800 >> Shannon Zhao wrote: >> >>> From: Shannon Zhao >>> >>> These EFI stub parameters are used to internal communication between >>> EFI stub and Linux kernel and EFI stub creates these parameters. But >>> for Xen on ARM when booting with UEFI, Xen will create a minimal DT >>> providing these parameters for Dom0 and Dom0 is not only Linux >>> kernel, but also other OS (such as FreeBSD) which will be used in the >>> future. So here we plan to standardize the names by dropping the >>> prefix "linux," and make them common to other OS. Also this will not >>> break the compatibility since these parameters are used to internal >>> communication between EFI stub and kernel. >> >> It is unlikely FreeBSD will use this property when booting ad Xen dom0. >> The kernel expects to be passed a data structure to find boot this >> information. >> >> My preference would be to have the FreeBSD loader load the xen binary, >> the FreeBSD kernel, and set up these data structs before passing >> control to Xen, with the information it needs to boot the kernel. My >> understanding is this is how it is done on x86. > > Well, AFAICT, there is no FreeBSD specific code in Xen for x86. We are > faking a multiboot module which contains all the informations. > > I know that the bootloader is at least involved, I don't remember if > there is some code in FreeBSD to read this boot module. I've CCed Roger > to confirm. The metadata/modules needed by the FreeBSD Dom0 kernel is generated by the native FreeBSD bootloader (as would be done when booting bare metal). Then this blob is passed as a multiboot module in the same place that Linux puts it's initramfs. Xen simply copies this blob straight into guest memory and sets start_info.mod_start to point to the start memory address of this blob. I've done it this way because I don't see many other options. Xen is tailored for Linux and only allows passing one module to the Dom0 kernel (initramfs). For FreeBSD it would be good to be able to pass at least two modules to the Dom0 kernel, one containing the metadata, and the other one containing the modules themselves. The new PVH work (HVMlite or whatever) will hopefully allow passing more than one module to the Dom0 kernel, and should make the code in the FreeBSD loader simpler. Roger. From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Subject: Re: [PATCH] efi/libstub/fdt: Standardize the names of EFI stub parameters Date: Thu, 10 Sep 2015 14:05:49 +0200 Message-ID: <55F1721D.1010801@citrix.com> References: <1441874516-11364-1-git-send-email-zhaoshenglong@huawei.com> <20150910123251.7e0810d1@bender.Home> <55F16DF5.1080705@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <55F16DF5.1080705@citrix.com> Sender: linux-kernel-owner@vger.kernel.org To: Julien Grall , Andrew Turner , Shannon Zhao Cc: devicetree@vger.kernel.org, linux-efi@vger.kernel.org, ian.campbell@citrix.com, ard.biesheuvel@linaro.org, stefano.stabellini@eu.citrix.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, leif.lindholm@linaro.org, xen-devel@lists.xen.org, freebsd-arm@freebsd.org, matt.fleming@intel.com, christoffer.dall@linaro.org, jbeulich@suse.com, peter.huangpeng@huawei.com, linux-arm-kernel@lists.infradead.org, shannon.zhao@linaro.org List-Id: linux-efi@vger.kernel.org El 10/09/15 a les 13.48, Julien Grall ha escrit: > On 10/09/15 12:32, Andrew Turner wrote: >> On Thu, 10 Sep 2015 16:41:56 +0800 >> Shannon Zhao wrote: >> >>> From: Shannon Zhao >>> >>> These EFI stub parameters are used to internal communication between >>> EFI stub and Linux kernel and EFI stub creates these parameters. But >>> for Xen on ARM when booting with UEFI, Xen will create a minimal DT >>> providing these parameters for Dom0 and Dom0 is not only Linux >>> kernel, but also other OS (such as FreeBSD) which will be used in the >>> future. So here we plan to standardize the names by dropping the >>> prefix "linux," and make them common to other OS. Also this will not >>> break the compatibility since these parameters are used to internal >>> communication between EFI stub and kernel. >> >> It is unlikely FreeBSD will use this property when booting ad Xen dom0. >> The kernel expects to be passed a data structure to find boot this >> information. >> >> My preference would be to have the FreeBSD loader load the xen binary, >> the FreeBSD kernel, and set up these data structs before passing >> control to Xen, with the information it needs to boot the kernel. My >> understanding is this is how it is done on x86. > > Well, AFAICT, there is no FreeBSD specific code in Xen for x86. We are > faking a multiboot module which contains all the informations. > > I know that the bootloader is at least involved, I don't remember if > there is some code in FreeBSD to read this boot module. I've CCed Roger > to confirm. The metadata/modules needed by the FreeBSD Dom0 kernel is generated by the native FreeBSD bootloader (as would be done when booting bare metal). Then this blob is passed as a multiboot module in the same place that Linux puts it's initramfs. Xen simply copies this blob straight into guest memory and sets start_info.mod_start to point to the start memory address of this blob. I've done it this way because I don't see many other options. Xen is tailored for Linux and only allows passing one module to the Dom0 kernel (initramfs). For FreeBSD it would be good to be able to pass at least two modules to the Dom0 kernel, one containing the metadata, and the other one containing the modules themselves. The new PVH work (HVMlite or whatever) will hopefully allow passing more than one module to the Dom0 kernel, and should make the code in the FreeBSD loader simpler. Roger. From mboxrd@z Thu Jan 1 00:00:00 1970 From: roger.pau@citrix.com (=?UTF-8?Q?Roger_Pau_Monn=c3=a9?=) Date: Thu, 10 Sep 2015 14:05:49 +0200 Subject: [PATCH] efi/libstub/fdt: Standardize the names of EFI stub parameters In-Reply-To: <55F16DF5.1080705@citrix.com> References: <1441874516-11364-1-git-send-email-zhaoshenglong@huawei.com> <20150910123251.7e0810d1@bender.Home> <55F16DF5.1080705@citrix.com> Message-ID: <55F1721D.1010801@citrix.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org El 10/09/15 a les 13.48, Julien Grall ha escrit: > On 10/09/15 12:32, Andrew Turner wrote: >> On Thu, 10 Sep 2015 16:41:56 +0800 >> Shannon Zhao wrote: >> >>> From: Shannon Zhao >>> >>> These EFI stub parameters are used to internal communication between >>> EFI stub and Linux kernel and EFI stub creates these parameters. But >>> for Xen on ARM when booting with UEFI, Xen will create a minimal DT >>> providing these parameters for Dom0 and Dom0 is not only Linux >>> kernel, but also other OS (such as FreeBSD) which will be used in the >>> future. So here we plan to standardize the names by dropping the >>> prefix "linux," and make them common to other OS. Also this will not >>> break the compatibility since these parameters are used to internal >>> communication between EFI stub and kernel. >> >> It is unlikely FreeBSD will use this property when booting ad Xen dom0. >> The kernel expects to be passed a data structure to find boot this >> information. >> >> My preference would be to have the FreeBSD loader load the xen binary, >> the FreeBSD kernel, and set up these data structs before passing >> control to Xen, with the information it needs to boot the kernel. My >> understanding is this is how it is done on x86. > > Well, AFAICT, there is no FreeBSD specific code in Xen for x86. We are > faking a multiboot module which contains all the informations. > > I know that the bootloader is at least involved, I don't remember if > there is some code in FreeBSD to read this boot module. I've CCed Roger > to confirm. The metadata/modules needed by the FreeBSD Dom0 kernel is generated by the native FreeBSD bootloader (as would be done when booting bare metal). Then this blob is passed as a multiboot module in the same place that Linux puts it's initramfs. Xen simply copies this blob straight into guest memory and sets start_info.mod_start to point to the start memory address of this blob. I've done it this way because I don't see many other options. Xen is tailored for Linux and only allows passing one module to the Dom0 kernel (initramfs). For FreeBSD it would be good to be able to pass at least two modules to the Dom0 kernel, one containing the metadata, and the other one containing the modules themselves. The new PVH work (HVMlite or whatever) will hopefully allow passing more than one module to the Dom0 kernel, and should make the code in the FreeBSD loader simpler. Roger.