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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C7427C4321E for ; Mon, 5 Dec 2022 16:40:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KS2gcw/EF3b7NWBlwG38imNcsVqxTsTyuH3o1WtXJzM=; b=Yfx2Cj9RHid2ch syoSTJ30FTjEZsMlR2ahv1QIt0HmY0e2I35hPy5/2E2otKMMSy8/Q4ySq1rKscmXnlGEXRdNEbuMY QchmfDkYj73yFYfRkokcZW9x1AikvJBQHFucoawQqfVVY/xO1GRE21HYUX18ZdluUN9oRSHlufcmh XeN/9OKAPVIN702kesTBLi7JYiiOqgniTiaGpn0EovVCBoEZdOWiYowRQyftUvd2plPNsfKkIC+Mt qenZudehaxUgOCV2Grv673Hch9Ptu/PfL4kNs5DWq2cKK1qNI4r9q6rYRWz4r/4vQ1bLsxifXvsfe ida5RtgLX/+fgvE+345w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p2EUg-006cLs-Sb; Mon, 05 Dec 2022 16:39:03 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p2EUd-006cK0-FM for linux-arm-kernel@lists.infradead.org; Mon, 05 Dec 2022 16:39:01 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id B5585CE0FEA; Mon, 5 Dec 2022 16:38:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F3824C433D6; Mon, 5 Dec 2022 16:38:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670258336; bh=Lq1rTjycwqQDl0USchgqfdUUYNYKVqa3EijEOwfwyXk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=BuU4480AlqsNBzIDtN7NBaZSLYtTAEakgxVzbxTeSXE1GUdjFU5Bw1Ut36of9rqck BJ6g5+Ssx1Aqxb3z0GUzOtcawo9N9YrXivqt+nR1hcgF9dtwl/VzXAfgC3LrlWs9n0 rP7mGr7egEYA/akn3qZj8RZZVogAN/MNyXnvyKelJXYXsLDlFAv81mQ5qnRuBLCrkW mPBysgyfxc8dsdviR/Y6pDZxisUIgKmrNh9DZD5f/4RGq5SN94sMKowVhovRNXfDWe +OFg3BMJZBwAkXf0jNSf8lgOdF9PJ1jCLDfi0zh/DtpF1/WI7Wkghl3jKls4hXwiHE CotLbLKtvFHjQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1p2EUX-00AcQ0-HD; Mon, 05 Dec 2022 16:38:53 +0000 Date: Mon, 05 Dec 2022 16:38:53 +0000 Message-ID: <86wn75ls9u.wl-maz@kernel.org> From: Marc Zyngier To: Mark Brown Cc: Catalin Marinas , Will Deacon , Lorenzo Pieralisi , Mark Rutland , Sami Mujawar , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev Subject: Re: [PATCH v2 04/14] arm64/sysreg: Add definitions for immediate versions of MSR ALLINT In-Reply-To: <20221112151708.175147-5-broonie@kernel.org> References: <20221112151708.175147-1-broonie@kernel.org> <20221112151708.175147-5-broonie@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: broonie@kernel.org, catalin.marinas@arm.com, will@kernel.org, lpieralisi@kernel.org, mark.rutland@arm.com, Sami.Mujawar@arm.com, tglx@linutronix.de, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221205_083859_912741_3682416B X-CRM114-Status: GOOD ( 27.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Sat, 12 Nov 2022 15:16:58 +0000, Mark Brown wrote: > > Encodings are provided for ALLINT which allow setting of ALLINT.ALLINT > using an immediate rather than requiring that a register be loaded with > the value to write. Since these don't currently fit within the scheme we > have for sysreg generation add manual encodings like we currently do for > other similar registers such as SVCR. > > Since it is required that these immediate versions be encoded with xzr > as the source register provide asm wrapper which ensure this is the > case. > > Signed-off-by: Mark Brown > --- > arch/arm64/include/asm/daifflags.h | 1 + > arch/arm64/include/asm/nmi.h | 18 ++++++++++++++++++ > arch/arm64/include/asm/sysreg.h | 2 ++ > 3 files changed, 21 insertions(+) > create mode 100644 arch/arm64/include/asm/nmi.h > > diff --git a/arch/arm64/include/asm/daifflags.h b/arch/arm64/include/asm/daifflags.h > index 55f57dfa8e2f..b3bed2004342 100644 > --- a/arch/arm64/include/asm/daifflags.h > +++ b/arch/arm64/include/asm/daifflags.h > @@ -141,4 +141,5 @@ static inline void local_daif_inherit(struct pt_regs *regs) > */ > write_sysreg(flags, daif); > } > + > #endif Spurious change? > diff --git a/arch/arm64/include/asm/nmi.h b/arch/arm64/include/asm/nmi.h > new file mode 100644 > index 000000000000..067e2554e144 > --- /dev/null > +++ b/arch/arm64/include/asm/nmi.h > @@ -0,0 +1,18 @@ > +/* SPDX-License-Identifier: GPL-2.0-only */ > +/* > + * Copyright (C) 2022 ARM Ltd. > + */ > +#ifndef __ASM_NMI_H > +#define __ASM_NMI_H > + > +static __always_inline void _allint_clear(void) > +{ > + asm volatile(__msr_s(SYS_ALLINT_CLR, "xzr")); > +} > + > +static __always_inline void _allint_set(void) > +{ > + asm volatile(__msr_s(SYS_ALLINT_SET, "xzr")); > +} > + > +#endif If this *really* must be a separate include file, it should at least directly include its dependencies. My gut feeling is that it would be better placed in daiflags.h. > diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h > index 7d301700d1a9..0c07b740c750 100644 > --- a/arch/arm64/include/asm/sysreg.h > +++ b/arch/arm64/include/asm/sysreg.h > @@ -126,6 +126,8 @@ > * System registers, organised loosely by encoding but grouped together > * where the architected name contains an index. e.g. ID_MMFR_EL1. > */ > +#define SYS_ALLINT_CLR sys_reg(0, 1, 4, 0, 0) > +#define SYS_ALLINT_SET sys_reg(0, 1, 4, 1, 0) This only covers the immediate versions of ALLINT, and misses the definition for the register version, aka sys_reg(3, 0, 4, 3, 0). M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel