Received: from list by lists.gnu.org with archive (Exim 4.71) id 1cBetK-0000Ys-Em for mharc-grub-devel@gnu.org; Tue, 29 Nov 2016 04:39:58 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBetH-0000Xo-K8 for grub-devel@gnu.org; Tue, 29 Nov 2016 04:39:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cBetE-00005K-5g for grub-devel@gnu.org; Tue, 29 Nov 2016 04:39:55 -0500 Received: from st13p35im-asmtp003.me.com ([17.164.199.66]:50801) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cBetD-0008WN-Tt for grub-devel@gnu.org; Tue, 29 Nov 2016 04:39:52 -0500 Received: from process-dkim-sign-daemon.st13p35im-asmtp003.me.com by st13p35im-asmtp003.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OHE00O00DHQVA00@st13p35im-asmtp003.me.com> for grub-devel@gnu.org; Tue, 29 Nov 2016 09:39:50 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=4d515a; t=1480412390; bh=32EqIbwPZ6koEibPd5/gFSfmY3kFZVzHPtVnBEWLi8w=; h=Content-type:MIME-version:Subject:From:Date:Message-id:To; b=ZiqTACzxT3XGHI2BSfKC5Bgfj/PG/XwAVt7H9Tw5/OIr5zLmaZ6nwXrsw0Eg/DEWC ogowrYtgLWViGJqeyRuG7rpXfgf8a9YvPGDm9W/SGeLvyG2OmimN9eqgth+wblETG2 ceZW3dZGFvcXAbJsm9S8hL0NNAGorrVttBp58GXxm2Re87jrKbq+b07OLwyKW7gXs+ oJ3+zC1jl1UQ1Nib5Og9zF/QDpkhdTabEL5L4uxiYoxylz3igFCHdvOi8H7MOwiFmz OHcXWOQBJWI5RTkdiK+ZONcgUCvYW0qTs8OqGnnriKm8VEhlHO6qCX6AaiEGA4aiFY XpShwQCVUZ8rg== Received: from 41-11-196-88.dyn.estpak.ee (41-11-196-88.dyn.estpak.ee [88.196.11.41]) by st13p35im-asmtp003.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OHE00CRXDI4LP40@st13p35im-asmtp003.me.com>; Tue, 29 Nov 2016 09:39:49 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-11-29_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1034 suspectscore=3 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1611290166 Content-type: text/plain; charset=utf-8 MIME-version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Subject: Re: [MULTIBOOT2 DOC PATCH v2 05/11] multiboot2: Add description of support for EFI boot services From: Toomas Soome In-reply-to: <20161129090806.GC1485@router-fw-old.local.net-space.pl> Date: Tue, 29 Nov 2016 11:39:39 +0200 Cc: Andrei Borzenkov , jgross@suse.com, eric.snowberg@oracle.com, andrew.cooper3@citrix.com, daniel.kiper@oracle.com, seth.goldberg@oracle.com, =?utf-8?Q?Vladimir_=27=CF=86-coder/phcoder=27_Serbinenko?= , xen-devel@lists.xenproject.org Content-transfer-encoding: quoted-printable Message-id: <5952D76F-D708-4BFE-B8FF-41696C0815DF@me.com> References: <1480020010-18421-1-git-send-email-daniel.kiper@oracle.com> <1480020010-18421-6-git-send-email-daniel.kiper@oracle.com> <20161129090806.GC1485@router-fw-old.local.net-space.pl> To: The development of GNU GRUB X-Mailer: Apple Mail (2.3251) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 17.164.199.66 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: Tue, 29 Nov 2016 09:39:57 -0000 > On 29. nov 2016, at 11:08, Daniel Kiper wrote: >=20 > On Mon, Nov 28, 2016 at 08:53:51PM +0300, Andrei Borzenkov wrote: >> 24.11.2016 23:40, Daniel Kiper ?????: >>> Signed-off-by: Daniel Kiper >>> --- >>> v2 - suggestions/fixes: >>> - clarify physical address meaning for EFI amd64 >>> mode with boot services enabled >>> (suggested by Andrew Cooper). >>> --- >>> doc/multiboot.texi | 115 = +++++++++++++++++++++++++++++++++++++++++++++++++++- >>> doc/multiboot2.h | 2 + >>> 2 files changed, 115 insertions(+), 2 deletions(-) >>>=20 >>> diff --git a/doc/multiboot.texi b/doc/multiboot.texi >>> index f0f167e..cc1edab 100644 >>> --- a/doc/multiboot.texi >>> +++ b/doc/multiboot.texi >>> @@ -534,6 +534,66 @@ The physical address to which the boot loader = should jump in order to >>> start running the operating system. >>> @end table >>>=20 >>> +@subsection EFI i386 entry address tag of Multiboot2 header >>> + >>> +@example >>> +@group >>> + +-------------------+ >>> +u16 | type =3D 8 | >>> +u16 | flags | >>> +u32 | size | >>> +u_virt | entry_addr | >>> + +-------------------+ >>> +@end group >>> +@end example >>> + >>> +All of the address fields in this tag are physical addresses. >>=20 >> Should not entry_addr be u_phys then? Otherwise what is exact = difference >=20 > Please look at my earlier email to Toomas. >=20 >> between u_phys and u_virt? Also for type =3D=3D 3? >=20 > Short excerpt from multiboot.texi: >=20 > @item u_phys > The type of unsigned data of the same size as target architecture > physical address size. >=20 > @item u_virt > The type of unsigned data of the same size as target architecture > virtual address size. >=20 > Anyway, I agree that entry_addr type should be changed here. Just to give an example about the scale of the mess here=E2=80=A6 We boot BIOS system and get 32bit addresses as grub is running in 32bit = protected mode. We boot UEFI32, and get 32bit addresses. We boot UEFI64, and get 64bit addresses. Now, what is =E2=80=9Ctarget architecture physical/virtual address = size=E2=80=9D in case we start 64bit kernel from UEFI32? (or from BIOS = for that matter). Also in fact, the grub2 itself is *not* using this = =E2=80=9Ctarget architecture address size=E2=80=9D, but is explicitly = using multiboot_uint32_t - which from practical point of view seems to = work out just fine, but does not match at all with documentation. So, suppose I need to review and verify the implementation=E2=80=A6 ;) just my 2cents, toomas >=20 >>> +The meaning of each is as follows: >>> + >>> +@table @code >>> + >>> +@item entry_addr >>> +The physical address to which the boot loader should jump in order = to >>> +start running EFI i386 compatible operating system code. >>> +@end table >>> + >>> +This tag is taken into account only on EFI i386 platforms >>> +when Multiboot2 image header contains EFI boot services tag. >>> +Then entry point specified in ELF header and the entry address >>> +tag of Multiboot2 header are ignored. >>> + >>> +@subsection EFI amd64 entry address tag of Multiboot2 header >>> + >>> +@example >>> +@group >>> + +-------------------+ >>> +u16 | type =3D 9 | >>> +u16 | flags | >>> +u32 | size | >>> +u_virt | entry_addr | >>> + +-------------------+ >>> +@end group >>> +@end example >>> + >>> +All of the address fields in this tag are physical addresses = (paging >>> +mode is enabled and any memory space defined by the UEFI memory map >>> +is identity mapped, hence, virtual address equals physical address; >>=20 >> Same here; it is confusing marking field as u_virt and describing it >> immediately as "physical address". >=20 > Ditto. >=20 >>> +Unified Extensible Firmware Interface Specification, Version 2.6, >>> +section 2.3.4, x64 Platforms, boot services). The meaning of each >>> +is as follows: >>> + >>> +@table @code >>> + >>> +@item entry_addr >>> +The physical address to which the boot loader should jump in order = to >>> +start running EFI amd64 compatible operating system code. >>> +@end table >>> + >>> +This tag is taken into account only on EFI amd64 platforms >>> +when Multiboot2 image header contains EFI boot services tag. >>> +Then entry point specified in ELF header and the entry address >>> +tag of Multiboot2 header are ignored. >>> + >>=20 >> Why do we have two different tags for what is effectively the same >=20 > Because x86 32-bit and 64-bit are similar but different things. So, we > should have both. >=20 >> purpose? Is it possible for the same image to have both of them? Just >> for my understanding. >=20 > Yes, it is possible, however, I have not seen any real life usage yet. >=20 > Daniel >=20 > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel