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.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,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 2EE5DC2BBD0 for ; Tue, 8 Sep 2020 15:13:56 +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 8E96223C8E for ; Tue, 8 Sep 2020 15:13:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="LLefMR5W" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8E96223C8E Authentication-Results: mail.kernel.org; dmarc=none (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=4HbDALQXdjQMANpsh2sFZDkwywrCkGW5i6QDi9McYlY=; b=LLefMR5WEujJhvV/3nGDVTlqX 4IyaOyC3GYAPptNshaYInSZOhF2mpu84PFi6YLg7mDMVhVUHfQ84eZsaWYAxKtMG2kGiI0OlWP98l /PKuecyUMVqwb65Xdrm0DGux8xI899LpQoObX3IGGodOgzDHB7rqi8YQh5Bfc/C1iXCIcuDFqEMlf EVHLwXJgSWqzuO/nIti2th05/jwgskYL65t39qMDagIhBxnk09Qk5wOs+kEr3UKv5GxAZ65Ku+U7h AXS2ydVcA1cMtSSFiIgqjbJ/guNsffOTqK9bNxZwPFW+E+iHLzJWczMfKcug0Mnf+dqhkSKniSHk1 ARd4Ivfkg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFfIN-0007RL-AZ; Tue, 08 Sep 2020 15:12:31 +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 1kFfIK-0007QD-KL for linux-arm-kernel@lists.infradead.org; Tue, 08 Sep 2020 15:12:29 +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 A4D2E1692; Tue, 8 Sep 2020 08:12:27 -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 C50A03F73C; Tue, 8 Sep 2020 08:12:25 -0700 (PDT) Date: Tue, 8 Sep 2020 16:12:23 +0100 From: Dave Martin To: Peter Collingbourne Subject: Re: [PATCH v10 2/7] arch: move SA_* definitions to generic headers Message-ID: <20200908151223.GS6642@arm.com> References: 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-20200908_111228_738499_565F913D X-CRM114-Status: GOOD ( 15.26 ) 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: Linux ARM , linux-parisc@vger.kernel.org, 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 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, Aug 21, 2020 at 10:10:12PM -0700, Peter Collingbourne wrote: > Most architectures with the exception of alpha, mips, parisc and > sparc use the same values for these flags. Move their definitions into > asm-generic/signal-defs.h and allow the architectures with non-standard > values to override them. Also, document the non-standard flag values > in order to make it easier to add new generic flags in the future. > > Signed-off-by: Peter Collingbourne While this looks reasonable, I've just realised that you strip the "U" from some arches' definitions here. So, on powerpc and x86, this changes the type of flags other than SA_RESETHAND from unsigned int to int. While I can't see this breaking any sensible use of these flags, there's a chance that there is software relying on this distinction by accident. I wonder whether it's worth doing something like #ifdef ARCH_WANT_STRICTLY_UNSIGNED_SA_FLAGS #define __SA_FLAG_VAL(x) x ## U #else #define __SA_FLAG_VAL(x) x #endif #ifndef SA_NOCLDSTOP #define SA_NOCLDSTOP __SA_FLAG_VAL(0x00000001) #endif /* ... */ Mind you, the historical situation also has issues, e.g. because sa_flags in struct sigaction is an int, assigning struct sigaction sa; sa.sa_flags = SA_RESETHAND; implies an overflow and so isn't portably safe (at least in theory). I guess we are getting away with it today. Preserving the situation by keeping the "U"s where appropriate would at least avoid making the situation worse. [...] Cheers ---Dave _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel