From owner-svn-src-head@freebsd.org Thu Jun 22 18:34:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B688ED92403; Thu, 22 Jun 2017 18:34:36 +0000 (UTC) (envelope-from tsoome@me.com) Received: from st13p35im-asmtp001.me.com (st13p35im-asmtp001.me.com [17.164.199.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8BA8ABF7; Thu, 22 Jun 2017 18:34:36 +0000 (UTC) (envelope-from tsoome@me.com) Received: from process-dkim-sign-daemon.st13p35im-asmtp001.me.com by st13p35im-asmtp001.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0ORY00800OGZA400@st13p35im-asmtp001.me.com>; Thu, 22 Jun 2017 18:34:30 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=04042017; t=1498156470; bh=VP1grAwiVdiYzuXN1JQw4zwXtiD2YUMdRHxR9/rC+og=; h=Content-type:MIME-version:Subject:From:Date:Message-id:To; b=r2LUcf975TDAmY4uShTs26R6ivZxsxIUqYmZHNv4wfsF7GHLkr+YZ9WzdSiSqw0HV 3z4QryLx2Ku5WIujWVuQVRcQN1tdnlbG/Ck1VQogc6SzFFujtrqhfUevGjPjh707G6 hEb55OQ/hWB1/dTrLQR/RV0yNZi5se3T2doTyMpMrpm4wXkZi0DMUmhTrTxb/pkUxw WDNK6YhCkzjhDPxxe9JRl7G01xynOb16t7APh0CCtgVzu7VPxSSqkYGqi8WmmAEocD 8+h21NJmNsnJKa4HjNWMwR0p+Tcxo0y5tXe5mZ+rhyBua2WEPP5sYtY93+nB32AAKZ mVcY7fJnhpe/Q== Received: from icloud.com ([127.0.0.1]) by st13p35im-asmtp001.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0ORY001Z6OXEUE00@st13p35im-asmtp001.me.com>; Thu, 22 Jun 2017 18:34:28 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-06-22_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1034 suspectscore=2 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1701120000 definitions=main-1706220317 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r320234 - head/sys/boot/efi/include From: Toomas Soome In-reply-to: <1F8C5886-71FC-486B-9793-E3554843CC65@FreeBSD.org> Date: Thu, 22 Jun 2017 21:34:25 +0300 Cc: Ed Maste , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-transfer-encoding: quoted-printable Message-id: <62AB7B61-DE8C-4CBA-94EA-899A7564E751@me.com> References: <201706221430.v5MEU9Zc063375@repo.freebsd.org> <1F8C5886-71FC-486B-9793-E3554843CC65@FreeBSD.org> To: Dimitry Andric X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jun 2017 18:34:36 -0000 > On 22. juuni 2017, at 21:23, Dimitry Andric wrote: >=20 > On 22 Jun 2017, at 16:30, Ed Maste wrote: >>=20 >> Author: emaste >> Date: Thu Jun 22 14:30:09 2017 >> New Revision: 320234 >> URL: https://svnweb.freebsd.org/changeset/base/320234 >>=20 >> Log: >> Make structure padding explicit in EFI_MEMORY_DESCRIPTOR >>=20 >> The EFI memory descriptor 64-bit aligns PhysicalStart on both 32- and >> 64-bit platforms. Make the padding explicit for i386 EFI. >>=20 >> Submitted by: Siva Mahadevan = >> MFC after: 3 weeks >> Sponsored by: The FreeBSD Foundation >> Differential Revision: https://reviews.freebsd.org/D11301 >>=20 >> Modified: >> head/sys/boot/efi/include/efidef.h >>=20 >> Modified: head/sys/boot/efi/include/efidef.h >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/boot/efi/include/efidef.h Thu Jun 22 13:31:44 2017 = (r320233) >> +++ head/sys/boot/efi/include/efidef.h Thu Jun 22 14:30:09 2017 = (r320234) >> @@ -178,6 +178,7 @@ typedef enum { >> #define EFI_MEMORY_DESCRIPTOR_VERSION 1 >> typedef struct { >> UINT32 Type; // Field size is = 32 bits followed by 32 bit pad >> + UINT32 Pad; >> EFI_PHYSICAL_ADDRESS PhysicalStart; // Field size is = 64 bits >> EFI_VIRTUAL_ADDRESS VirtualStart; // Field size is = 64 bits >> UINT64 NumberOfPages; // Field size is = 64 bits >=20 > If you explicitly insert padding, it is better to mark the struct as > __packed, I think. Or at least also specify the alignment explicitly. >=20 > -Dimitry >=20 There is also second one with the same issue: in sys/boot/efi/include/efiprot.h @@ -90,12 +90,14 @@ typedef struct { BOOLEAN LogicalPartition; BOOLEAN ReadOnly; BOOLEAN WriteCaching; + UINT8 pad1[3]; =20 UINT32 BlockSize; UINT32 IoAlign; + UINT8 pad2[4]; =20 EFI_LBA LastBlock; -} EFI_BLOCK_IO_MEDIA; +} __packed EFI_BLOCK_IO_MEDIA; Without this, the EFI32 will get disk sizes wrong. rgds, toomas