Received: from list by lists.gnu.org with archive (Exim 4.71) id 1adNui-0006fG-8b for mharc-grub-devel@gnu.org; Tue, 08 Mar 2016 15:07:28 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adNud-0006Wn-1r for grub-devel@gnu.org; Tue, 08 Mar 2016 15:07:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1adNuY-0005LO-2e for grub-devel@gnu.org; Tue, 08 Mar 2016 15:07:22 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:28395) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adNuX-0005L1-JW for grub-devel@gnu.org; Tue, 08 Mar 2016 15:07:17 -0500 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u28K7A14022986 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 8 Mar 2016 20:07:11 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u28K7Ab8028523 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 8 Mar 2016 20:07:10 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u28K78Pc012703; Tue, 8 Mar 2016 20:07:09 GMT Received: from olila.local.net-space.pl (/10.175.206.73) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 08 Mar 2016 12:07:07 -0800 Date: Tue, 8 Mar 2016 21:07:03 +0100 From: Daniel Kiper To: "Vladimir 'phcoder' Serbinenko" Subject: Re: multiboot2 structs and packed attribute Message-ID: <20160308200703.GG3500@olila.local.net-space.pl> References: <20160307133452.GC3500@olila.local.net-space.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0021.oracle.com [141.146.126.233] Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by userp1040.oracle.com id u28K7A14022986 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 Cc: arvidjaar@gmail.com, grub-devel@gnu.org X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2016 20:07:27 -0000 On Mon, Mar 07, 2016 at 08:42:38PM +0000, Vladimir 'phcoder' Serbinenko w= rote: > Le lun. 7 mars 2016 14:35, Daniel Kiper a =E9= crit : > > > Hi, > > > > Does anybody know why only multiboot2 multiboot_mmap_entry struct > > has packed attribute? Is it by design or by mistake? I think that > > we should use packed attribute for every multiboot2 protocol related > > struct. If not then we should probably remove this attribute from > > multiboot_mmap_entry struct too. What do you think about that? > > > We put packed only when it changes relative offsets of members or size = of > the structure. Is it the case for structures you have in mind? I do not have anything specific. However, it looks like stray stuff. Hmmm... I took a look at multiboot_mmap_entry once again and it seems that this struct really does not need packed attribute. All members are in right order and even compiler should not add padding. Am I right? Anyway, maybe we should add somewhere in the header comment saying that all/most of multiboot2 structures are build in a way that fulfill alignme= nt requirements out of the box and compiler does not need to do any rearrang= ements. However, we should warn that new extensions should be added carefully and some structs may require GRUB_PACKED attribute in the future to properly represent added interface. Or we can add GRUB_PACKED to every struct. However, this seems redundant = here. There is no chance that somebody will rearrange, especially blindly, exis= ting structs. Daniel