From patchwork Fri Mar 20 03:36:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bamvor Jian Zhang X-Patchwork-Id: 452474 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D3DB814016B for ; Fri, 20 Mar 2015 14:40:34 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=sourceware.org header.i=@sourceware.org header.b=kgHGqb3C; dkim-adsp=none (unprotected policy); dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=uYxHPxwBp7ROgh4v j4QBlvrHYH0vRTStvXheMRoK0ouaKoWPw6j7Qw6fiR+XOfQy33/DprkVuFxl/eGQ 9WG2SkDxUEZOSCz0pLYocUUqQ6/dkkSh+5br7hZ/4McdFXzZwPoqWMAc7GZdbSi0 dtDQKDANQ/zUjgV1G3QpUQmrbJc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; s=default; bh=qecXh5H26D1CvfJgcGs5Ae H75P8=; b=kgHGqb3CID2RF3Rx+68t+xBXZHLSWpXevFy5cqpyA/EBtkBU/i0KyP ol7w2s9Jur8RRXH/637ZO7LwZuKrcLAaQakpxOMqm7WjnU9OjgKZjcJhpIEum7ni 9thbX41AEBx+SaLofgr4WW6K4t76cU4612f+J6iTG6oQz+vpq/gWU= Received: (qmail 28420 invoked by alias); 20 Mar 2015 03:40:29 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 28398 invoked by uid 89); 20 Mar 2015 03:40:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL, BAYES_00, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: szxga02-in.huawei.com Message-ID: <550B95D4.6020405@huawei.com> Date: Fri, 20 Mar 2015 11:36:52 +0800 From: Bamvor Jian Zhang User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: Chris Metcalf CC: "Pinski, Andrew" , "libc-alpha@sourceware.org" , "apinski@cavium.com" , "yangyingliang@huawei.com" , "bintian.wang@huawei.com" , "dingtianhong@huawei.com" , Subject: Re: [RFC PATCH 2/3] ARM64: ILP32: use __fsword_t in generic/bits/statfs.h References: <1426674611-26427-1-git-send-email-bamvor.zhangjian@huawei.com> <1426674611-26427-3-git-send-email-bamvor.zhangjian@huawei.com>, <550AFBE6.1000402@ezchip.com> <405BEB99-764E-474B-A3E0-7225FDE6596C@caviumnetworks.com> <550B007A.9090407@ezchip.com> In-Reply-To: <550B007A.9090407@ezchip.com> X-CFilter-Loop: Reflected On 2015/3/20 0:59, Chris Metcalf wrote: > On 03/19/2015 12:49 PM, Pinski, Andrew wrote: >>> On Mar 19, 2015, at 9:40 AM, Chris Metcalf wrote: >>> > >>>> >>On 03/18/2015 06:30 AM, Zhang Jian(Bamvor) wrote: >>>> >>From: Yang Yingliang >>>> >> >>>> >>Use __fsword_t to make size of struct statfs equal in userspace and kernel. >>>> >> >>>> >>Signed-off-by: Yang Yingliang >>>> >>--- >>>> >> sysdeps/unix/sysv/linux/generic/bits/statfs.h | 24 ++++++++++++------------ >>>> >> 1 file changed, 12 insertions(+), 12 deletions(-) >>> > >>> >I don't object to this patch as a cleanup (to match the types used in the base Linux statfs.h), but can you tell me why this makes a difference to you? On what asm-generic platform does __SWORD_TYPE != __fsword_t ? My earlier analysis a few minutes ago suggested that was true only for alpha and x32, neither of which use the linux/generic code in glibc. >> Aarch64:ILP32 will use linux/generic and will have SWORD_TYPE != __fsword_t just like x32. Basically this patch set goes on top of my already submitted patch set. > > OK, thanks. But presumably this won't work right, because if you don't > set __USE_FILE_OFFSET64, and __WORDSIZE == 32, you'll end up injecting > padding fields that don't belong, via the __field64 macro? In current patch from Andrew, ilp32 share the same type with lp64 for off_t, ino_t, blkcnt_t. And it share the same "#elif" with "__WORDSIZE == 64": > This is basically the issue I just raised in the parallel thread with HJ. It seems that aarch64:ilp32 is different from x32 at this point. In that thread H.J. Lu said that "Since x32 uses a combination of x86-64 and ia32 syscall interfaces, x32 can't use linux/generic.". Whereas aarch64:ilp32 include "unix/sysv/linux/generic" in its Imples. regards bamvor --- a/sysdeps/unix/sysv/linux/generic/bits/stat.h +++ b/sysdeps/unix/sysv/linux/generic/bits/stat.h @@ -42,7 +42,10 @@ #if defined __USE_FILE_OFFSET64 # define __field64(type, type64, name) type64 name -#elif __WORDSIZE == 64 +#elif __WORDSIZE == 64 \ + || (defined(__OFF_T_MATCHES_OFF64_T) \ + && defined(__INO_T_MATCHES_INO64_T) \ + && defined (__BLKCNT_T_TYPE_MATCHES_BLKCNT64_T_TYPE)) # define __field64(type, type64, name) type name #elif __BYTE_ORDER == __LITTLE_ENDIAN # define __field64(type, type64, name) \