From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x32d.google.com (mail-ot1-x32d.google.com [IPv6:2607:f8b0:4864:20::32d]) by sourceware.org (Postfix) with ESMTPS id EEC5C385841A for ; Tue, 30 Aug 2022 17:04:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EEC5C385841A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ot1-x32d.google.com with SMTP id 6-20020a9d0106000000b0063963134d04so8507781otu.3 for ; Tue, 30 Aug 2022 10:04:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc; bh=8m69TNCgun9s//LGmSPn80zlHUTOulb+rk5Rr3nOBI0=; b=gBMA1twggDj1akBv2JDR8h0YxvNYEf6r1rUEBIgRwBVMoxCNz9ulkZbrN/PBCmv0u7 fPV/kcNy6fdWOK7108pAtKzK4Ak4uUlRZExC7NU0t8WbBeiZWWMx6OHpIvUabp86wtni dMy81MG7r9G0mh+lRc7yDD4vofiqKyve9a0B2c3lv5N8PKRyFfKtwmCxQbU5xQAsQ0S2 joekqI1HRnilgOngPomuJFMfKkexvS3sZmNIwrG11I8L6hl6hOLJL7eBGQ8Q8vi6Q7km Qr8KNuAdU1EZhd782akeeIrGdEGm+RTT9JS0coU1uZfYWjZEQ2BRvHNdCFfp5Hxokogj 7IQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=8m69TNCgun9s//LGmSPn80zlHUTOulb+rk5Rr3nOBI0=; b=PROjfaEI8IFZLK14Sgt74wZMm6ioq2ROhIJUNzGCZ0L5dFUZI1jAZkfjOcBQlmavob Z7r+QKU9wo4fYr4lgjuigmkIieCx1qfQSRmZbYed6NC3JittOD8FbwSmB+oq9GjeVbta L0NEnhTVRnZRw1sE6TDs1+NGQNlcOj6DAKqCQtoDFcOQxU0yGrrIlYDnkvc+wLrxLlFa GqEpf2SAcyyHjoHMRilNpbW/kkHV47kRUbiedP2pf5IvZmXWOgKS7BrPtBJyXTdGBUPq 4FDzy6obvQ6qRuKSOOWmvFs3iA85eYPtLgej8Lbens3Ey1TZKfYzEiAL/gl4ATz3FrSZ qyIg== X-Gm-Message-State: ACgBeo2A4qhs5LSajwCblNV5y38CF41Qi6oGuvbVggwth+azHjzxZhBl cXzmyMcMPLy1Qd33SROQ9le86J+Gdz9g9A== X-Google-Smtp-Source: AA6agR7K07urWWLC5GRTwMIAI3dgSqCAgQyB7vb0R41ajik2QpyavumMn26u0/fsQ0k6W0PUErZ/fw== X-Received: by 2002:a9d:2c06:0:b0:637:150f:6109 with SMTP id f6-20020a9d2c06000000b00637150f6109mr8735756otb.203.1661879048863; Tue, 30 Aug 2022 10:04:08 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c0:745e:449b:a205:b33e:4a53? ([2804:1b3:a7c0:745e:449b:a205:b33e:4a53]) by smtp.gmail.com with ESMTPSA id e20-20020a056830201400b006394756c04fsm7523513otp.0.2022.08.30.10.04.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 30 Aug 2022 10:04:08 -0700 (PDT) Message-ID: <7e7f223b-0fc6-6e47-e64a-057ee6e02334@linaro.org> Date: Tue, 30 Aug 2022 14:04:06 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH] m68: Enforce 4-byte alignment on internal locks (BZ #29537) Content-Language: en-US To: Richard Henderson , libc-alpha@sourceware.org, glaubitz@physik.fu-berlin.de References: <20220830133504.2669323-1-adhemerval.zanella@linaro.org> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 30/08/22 13:32, Richard Henderson wrote: > On 8/30/22 06:35, Adhemerval Zanella via Libc-alpha wrote: >> The HPPA also requires a 16-byte alignment for locks, although it is >> just a historical artifact to keep compatibility with old >> implementation. >> --- >>   sysdeps/nptl/libc-lockP.h | 2 +- >>   1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/sysdeps/nptl/libc-lockP.h b/sysdeps/nptl/libc-lockP.h >> index d3a6837fd2..9efe962588 100644 >> --- a/sysdeps/nptl/libc-lockP.h >> +++ b/sysdeps/nptl/libc-lockP.h >> @@ -34,7 +34,7 @@ >>   #include >>     /* Mutex type.  */ >> -typedef int __libc_lock_t; >> +typedef int __libc_lock_t __LOCK_ALIGNMENT; > > As Carlos explained, hppa doesn't require 16-byte alignment for kernel-assisted CAS. > > I was on my way towards testing > > -/* Mutex type.  */ > > -typedef int __libc_lock_t; > > +/* Mutex type. > > +   It is a requirement of the futex interface that the data be > > +   naturally aligned.  This is almost always already the case > > +   for 'int', but some older ABIs, e.g. m68k, do not. > > +   The pthread types will have been aligned by __LOCK_ALIGNMENT.  */ > > +typedef int __libc_lock_t __attribute__((aligned(4))); > > > > > r~ I don't have a strong preference, using __LOCK_ALIGNMENT at least is a no-op for other architectures (although it most likely won't change anything assuming int has 4-bytes alignment as usual).