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=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 2938CC43603 for ; Thu, 12 Dec 2019 09:34:47 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 EB41121655 for ; Thu, 12 Dec 2019 09:34:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="R8tYE2Af" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EB41121655 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+infradead-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=bombadil.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=YaeTd3Z1RO+mFnYXm0aXCDLr6/ikMlZJttI/O3FyU5M=; b=R8tYE2AfYBxdAG +vsvGEu3bZ2X9/8ZnSKP733YwvpG/0MqxGcYSeIf5qOUY87jSIQ7Ani1/gQd7o44cSGrOMKpCMGsp Z0dIRX/WSkiCVpiz6cJlj0BJBUCC31Z5UOqMajlbjr0iCV+KE9NCZumdOj0aJieKqkRGn2THoiKE2 PLWXG3g3ReijxHhbelndV53/AK8Up8/bbXpcQdoF/3Os2gM7gdrnNJKxk20YXIzXRBPynsk7fZZg2 Ab+uxd1Y/V7igr8yNqxczqIjHEN4YWqq+Su1EDhcHRxDjeqL/n3Iv/YsMJe6VReAcIsEj2d1UR5hi wtIBMXLq7LxPQ9NUlcow==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifKrj-0005yA-Ub; Thu, 12 Dec 2019 09:34:35 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifKrg-0005xb-GO for linux-arm-kernel@lists.infradead.org; Thu, 12 Dec 2019 09:34:34 +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 AB8CA328; Thu, 12 Dec 2019 01:34:30 -0800 (PST) Received: from arrakis.emea.arm.com (arrakis.cambridge.arm.com [10.1.197.42]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 047A83F6CF; Thu, 12 Dec 2019 01:34:28 -0800 (PST) Date: Thu, 12 Dec 2019 09:34:26 +0000 From: Catalin Marinas To: Arnd Bergmann Subject: Re: [PATCH 12/22] arm64: mte: Add specific SIGSEGV codes Message-ID: <20191212093425.GA18258@arrakis.emea.arm.com> References: <20191211184027.20130-1-catalin.marinas@arm.com> <20191211184027.20130-13-catalin.marinas@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191212_013432_639228_F2500B5D X-CRM114-Status: GOOD ( 17.51 ) 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-arch , Richard Earnshaw , Szabolcs Nagy , Marc Zyngier , Kevin Brodsky , Linux-MM , "Eric W. Biederman" , Andrey Konovalov , Vincenzo Frascino , Will Deacon , Linux ARM , Al Viro Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Dec 11, 2019 at 08:31:28PM +0100, Arnd Bergmann wrote: > On Wed, Dec 11, 2019 at 7:40 PM Catalin Marinas wrote: > > > > From: Vincenzo Frascino > > > > Add MTE-specific SIGSEGV codes to siginfo.h. > > > > Note that the for MTE we are reusing the same SPARC ADI codes because > > the two functionalities are similar and they cannot coexist on the same > > system. > > > > Cc: Arnd Bergmann > > Signed-off-by: Vincenzo Frascino > > [catalin.marinas@arm.com: renamed precise/imprecise to sync/async] > > Signed-off-by: Catalin Marinas > > --- > > include/uapi/asm-generic/siginfo.h | 9 +++++++-- > > 1 file changed, 7 insertions(+), 2 deletions(-) > > > > diff --git a/include/uapi/asm-generic/siginfo.h b/include/uapi/asm-generic/siginfo.h > > index cb3d6c267181..a5184a5438c6 100644 > > --- a/include/uapi/asm-generic/siginfo.h > > +++ b/include/uapi/asm-generic/siginfo.h > > @@ -227,8 +227,13 @@ typedef struct siginfo { > > # define SEGV_PKUERR 4 /* failed protection key checks */ > > #endif > > #define SEGV_ACCADI 5 /* ADI not enabled for mapped object */ > > -#define SEGV_ADIDERR 6 /* Disrupting MCD error */ > > -#define SEGV_ADIPERR 7 /* Precise MCD exception */ > > +#ifdef __aarch64__ > > +# define SEGV_MTEAERR 6 /* Asynchronous MTE error */ > > +# define SEGV_MTESERR 7 /* Synchronous MTE exception */ > > +#else > > +# define SEGV_ADIDERR 6 /* Disrupting MCD error */ > > +# define SEGV_ADIPERR 7 /* Precise MCD exception */ > > +#endif > > SEGV_ADIPERR/SEGV_ADIDERR were added together with SEGV_ACCADI, > it seems a bit odd to make only two of them conditional but not the others. Ah, I missed this. I think we should drop the #ifdef entirely. There is no harm in having two different macros with the same value. > I think we are generally working towards having the same constants > across architectures even for features that only exist on one of them. I'd rather keep both the ARM and SPARC naming here as the behaviour may be subtly different between the two architectures. IIUC, the disrupting SPARC MCD error on means a memory corruption trap sent to the hypervisor. On ARM MTE, the asynchronous tag check fault is a pretty much benign setting of a status flag. The kernel, when detecting this flag, injects a SIGSEGV on the ret_to_user path. If there's no switch into the kernel, a user program cannot become aware of the asynchronous MTE tag check fault. We also don't have the equivalent of ACCADI. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel