From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F1D8C433E7 for ; Mon, 12 Oct 2020 13:57:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 437AC2076E for ; Mon, 12 Oct 2020 13:57:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390573AbgJLN5Q (ORCPT ); Mon, 12 Oct 2020 09:57:16 -0400 Received: from foss.arm.com ([217.140.110.172]:48228 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389400AbgJLN5P (ORCPT ); Mon, 12 Oct 2020 09:57:15 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C5E7F31B; Mon, 12 Oct 2020 06:57:14 -0700 (PDT) Received: from arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E50A13F66B; Mon, 12 Oct 2020 06:57:12 -0700 (PDT) Date: Mon, 12 Oct 2020 14:57:09 +0100 From: Dave Martin To: Peter Collingbourne Cc: Linux ARM , Parisc List , Catalin Marinas , Kevin Brodsky , Oleg Nesterov , "James E.J. Bottomley" , Kostya Serebryany , "Eric W. Biederman" , Andrey Konovalov , David Spickett , Vincenzo Frascino , Will Deacon , Evgenii Stepanov , Richard Henderson Subject: Re: [PATCH v10 6/7] signal: define the field siginfo.si_xflags Message-ID: <20201012135701.GF32292@arm.com> References: <8a12152d54ea782f47bc55d791b064abe478473e.1598072840.git.pcc@google.com> <20200908151337.GW6642@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org On Fri, Oct 09, 2020 at 11:19:55AM -0700, Peter Collingbourne wrote: > On Wed, Oct 7, 2020 at 7:11 PM Peter Collingbourne wrote: > > > > On Tue, Sep 8, 2020 at 8:13 AM Dave Martin wrote: > > > > > > On Fri, Aug 21, 2020 at 10:10:16PM -0700, Peter Collingbourne wrote: [...] > > > > diff --git a/include/linux/compat.h b/include/linux/compat.h > > > > index d38c4d7e83bd..55d4228dfd88 100644 > > > > --- a/include/linux/compat.h > > > > +++ b/include/linux/compat.h > > > > @@ -231,7 +231,9 @@ typedef struct compat_siginfo { > > > > char _dummy_pkey[__COMPAT_ADDR_BND_PKEY_PAD]; > > > > u32 _pkey; > > > > } _addr_pkey; > > > > + compat_uptr_t _pad[6]; > > > > }; > > > > + compat_uptr_t _xflags; > > > > > > Should we have the same type here for native and compat? > > > > > > I don't have a very strong opinion on this, but currently native on > > > 64-bit arches will have 32 extra bits in _xflags that can never be used > > > (or have to be defined differently for compat). > > > > Good point. I will make this a u64 (although I think 32 bits will > > probably be more than enough, the distance between si_xflags and > > si_addr_ignored_bits will be 8 bytes on 64-bit architectures due to > > alignment so we may as well make all of the bits available). > > It turns out that we can't actually make this a u64 because on 32-bit > platforms this increases the alignment of the union to 8, which breaks > layout for the other fields in the union. In v12 I will make this a > u32 so that we don't end up with unusable bits. u32 seems fine to me. If we need more bits later, we can always use one of the 32 xflags bits to indicate that the new field(s) exist. Cheers ---Dave From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0EA1C433DF for ; Mon, 12 Oct 2020 13:58:34 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 51228206FB for ; Mon, 12 Oct 2020 13:58:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="JmgAOVpJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 51228206FB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=BTJggOkqP8rpLiEMAOj9IlVBIedlM4oLF15AVuvI9Ao=; b=JmgAOVpJgMj3tAj2l59c1tpEw sl3J+SuDrD7vfkDeO/6vr19nhB5Rn9NKnzQ/NZMPdvialS4YfzK1Nov+LuLm8Jx0cjjQ/83zZmjjy hvhuSKvCBYMSB4gpgYYrBxCvlUlCCS06h7uDgiAwxOLlE1Vy0lfQBLCq2JmWo8Xz5AZL+pXICERD9 4dARrZOQGAqgwcDUXhA9tHasQYame/o62+Lbt3dNBvBaoxa3X9ER3OD8mr68MdQSuCgmgRvyUz5Fr hGokP6iLZVqDcNXB+QAb18ri/o8lnBKwtS0zXL9AVTehWqB7zXl/xWIpy0DfIklFkeKEe/0YQEJE5 Zxt1/hw6Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kRyKF-0005EI-8B; Mon, 12 Oct 2020 13:57:19 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kRyKB-0005DM-Hf for linux-arm-kernel@lists.infradead.org; Mon, 12 Oct 2020 13:57:16 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C5E7F31B; Mon, 12 Oct 2020 06:57:14 -0700 (PDT) Received: from arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E50A13F66B; Mon, 12 Oct 2020 06:57:12 -0700 (PDT) Date: Mon, 12 Oct 2020 14:57:09 +0100 From: Dave Martin To: Peter Collingbourne Subject: Re: [PATCH v10 6/7] signal: define the field siginfo.si_xflags Message-ID: <20201012135701.GF32292@arm.com> References: <8a12152d54ea782f47bc55d791b064abe478473e.1598072840.git.pcc@google.com> <20200908151337.GW6642@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201012_095716_041839_5EA9E9C7 X-CRM114-Status: GOOD ( 22.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Parisc List , Catalin Marinas , Kevin Brodsky , Oleg Nesterov , Evgenii Stepanov , "James E.J. Bottomley" , Kostya Serebryany , "Eric W. Biederman" , Andrey Konovalov , David Spickett , Vincenzo Frascino , Will Deacon , Linux ARM , Richard Henderson Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Oct 09, 2020 at 11:19:55AM -0700, Peter Collingbourne wrote: > On Wed, Oct 7, 2020 at 7:11 PM Peter Collingbourne wrote: > > > > On Tue, Sep 8, 2020 at 8:13 AM Dave Martin wrote: > > > > > > On Fri, Aug 21, 2020 at 10:10:16PM -0700, Peter Collingbourne wrote: [...] > > > > diff --git a/include/linux/compat.h b/include/linux/compat.h > > > > index d38c4d7e83bd..55d4228dfd88 100644 > > > > --- a/include/linux/compat.h > > > > +++ b/include/linux/compat.h > > > > @@ -231,7 +231,9 @@ typedef struct compat_siginfo { > > > > char _dummy_pkey[__COMPAT_ADDR_BND_PKEY_PAD]; > > > > u32 _pkey; > > > > } _addr_pkey; > > > > + compat_uptr_t _pad[6]; > > > > }; > > > > + compat_uptr_t _xflags; > > > > > > Should we have the same type here for native and compat? > > > > > > I don't have a very strong opinion on this, but currently native on > > > 64-bit arches will have 32 extra bits in _xflags that can never be used > > > (or have to be defined differently for compat). > > > > Good point. I will make this a u64 (although I think 32 bits will > > probably be more than enough, the distance between si_xflags and > > si_addr_ignored_bits will be 8 bytes on 64-bit architectures due to > > alignment so we may as well make all of the bits available). > > It turns out that we can't actually make this a u64 because on 32-bit > platforms this increases the alignment of the union to 8, which breaks > layout for the other fields in the union. In v12 I will make this a > u32 so that we don't end up with unusable bits. u32 seems fine to me. If we need more bits later, we can always use one of the 32 xflags bits to indicate that the new field(s) exist. Cheers ---Dave _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel