From mboxrd@z Thu Jan 1 00:00:00 1970 From: Attilio Rao Subject: Re: Should we revert "mm: New XENMEM space, XENMAPSPACE_gmfn_range"? Date: Thu, 2 Aug 2012 13:57:25 +0100 Message-ID: <501A7935.9090603@citrix.com> References: <1321471508-31633-1-git-send-email-jean.guyader@eu.citrix.com> <1321471508-31633-2-git-send-email-jean.guyader@eu.citrix.com> <1321471508-31633-3-git-send-email-jean.guyader@eu.citrix.com> <1321471508-31633-4-git-send-email-jean.guyader@eu.citrix.com> <1321471508-31633-5-git-send-email-jean.guyader@eu.citrix.com> <501A631D02000078000921B8@nat28.tlf.novell.com> <501A4C29.5080006@citrix.com> <501A71030200007800092257@nat28.tlf.novell.com> <501A57E9.6070407@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <501A57E9.6070407@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 02/08/12 11:35, Attilio Rao wrote: > On 02/08/12 11:22, Jan Beulich wrote: > >>>>> On 02.08.12 at 11:45, Attilio Rao wrote: >>>>> >>>>> >>> On 02/08/12 10:23, Jan Beulich wrote: >>> >>> >>>>>>> On 01.08.12 at 19:55, Stefano Stabellini >>>>>>> >>>>>>> >>> wrote: >>> >>> >>>>>>> >>>>>>> >>>>> I was reading more about this commit because this patch breaks the ABI >>>>> on ARM, when I realized that on x86 there is no standard that specifies >>>>> the alignment of fields in a struct. >>>>> >>>>> >>>>> >>>> There is - the psABI supplements to the SVR4 ABI. >>>> >>>> >>>> >>>> >>> This is a completely different issue. >>> The problem here gcc/whatever compiler padding added to the struct in >>> order to have alignment of the members to the word boundry. The >>> difference is that this is not enforced in the ARM case (apparently, >>> from Stefano's report) while it happens in the x86 case. >>> >>> This is why it is a good rule to organize member of a struct from the >>> bigger to the smaller when compiling with gcc and this is not the case >>> of the struct in question. >>> >>> In the end it is a compiler decisional thing, not something decided by >>> the ABI. >>> >>> >> No, definitely not. Otherwise inter-operation between code >> compiled with different compilers would be impossible. To >> allow this is what the various ABI specifications exist for (and >> their absence had, e.g. on DOS, lead to a complete mess). >> >> >> > Look, I'm speaking about the problem Stefano is trying to crunch which > has nothing to do with your discussion on ABI. > > >> As to the ARM issue - mind pointing out where mis-aligned >> structure fields are specified as being the standard? >> >> >> > I think that alignment is important, infact I'm more surprised to the > ARM side than the x86. Of course, because this is a compiler-dependent > behaviour (the fact that not only gcc does that doesn't mean it is > "standardized", just like it is not standardized anywhere that stack on > x86 must be word aligned, even if it is so common that it is taken for > granted now). > > It seems that I was missing something -- the x86 psABI explicitly mention about the structures padding for the internal members of structures and unions (Chapter 3, Paragraph 3.1.2, subsection "Aggregates and Unions"), so this behaviour really cames from the SVR4, as Jan pointed out. Attilio