From patchwork Wed Sep 4 08:24:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 13790079 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 1B915CA0ED3 for ; Wed, 4 Sep 2024 08:36:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ScPUtGBbO3J7WDK/3NOnQNeYMls1jTHOXVVyHyM0fi8=; b=ygkts0Qsx0T9TGNZCJ2Eyhqb5K r4pBrsO5p/jux1dp1hvwq2kHTRJmvhJvwlLBIpYNu+nZz2jdQ9msFZhQDDiXCsmIl+W1i7wNDbVW0 54M0iqYuRzz/B6n+3ueF6O2GOywkQzI8uuT6YC/M2CxWpNm/mO/CdArBUDp36yPMAkIY8AjaO4IBw fPaSxjTkmn+LpiJXjMLkFAXI2h9mhwcVwgkArDZTNig8BP7n7nW2Rnx1627iuZMEzYO6RPVsYVan2 ub98WT5mNtoiEfysYY69Gma6mGZgV5e0MSdfGuT1Zfxc+n59UmmZ/tezp/6+jXyykrAswCgBeSZVl FdMblhSQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sllVO-00000003RgV-2oiA; Wed, 04 Sep 2024 08:36:46 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sllJh-00000003OIl-39YK for linux-arm-kernel@lists.infradead.org; Wed, 04 Sep 2024 08:24:44 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 6D85E5C57A8; Wed, 4 Sep 2024 08:24:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90313C4AF0C; Wed, 4 Sep 2024 08:24:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725438280; bh=xIxn7pFaazMnNLaow2U2RFpl78qYQZADsRhk/aFuMDA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lK8Pv7uVaM8ay9ZRDgWSyp/oCUG9wsKhrj29HfzCgqFOc53VoOqiSC5bN3al2MWYo DB4ljJGq70CvJR2+NuvmR9npIOHuen01PxZoL+e/NnGw/aiBse9PFjjv7SO3ibaKUg XErXRAz0nGfW1Fc2IsXd2X0QFgT1sEwxdphtH2u+cPicKtJzHGWotgE2ZfbK51Viv7 SpxZCJ37q2O5pBG8JLmpcaHPnURqglF+o8BnG+7tcLP3DnhAbhjMkdQMan8DTqk2Tr xH9ZoNQLCI5IkAH2gxK+fYTckbHv++jlu6THNuh82k8wq4zIGmGq9DdeUKDy+AVUdu r1ANSNNMST3Jg== Received: from sofa.misterjones.org ([185.219.108.64] helo=valley-girl.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1sllJe-009VF3-LD; Wed, 04 Sep 2024 09:24:38 +0100 From: Marc Zyngier To: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org Cc: James Morse , Suzuki K Poulose , Oliver Upton , Zenghui Yu Subject: [PATCH 2/3] KVM: arm64: Simplify visibility handling of AArch32 SPSR_* Date: Wed, 4 Sep 2024 09:24:18 +0100 Message-Id: <20240904082419.1982402-3-maz@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240904082419.1982402-1-maz@kernel.org> References: <20240904082419.1982402-1-maz@kernel.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, james.morse@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, yuzenghui@huawei.com 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-20240904_012441_941527_FC197DC6 X-CRM114-Status: GOOD ( 12.03 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Since SPSR_* are not associated with any register in the sysreg array, nor do they have .get_user()/.set_user() helpers, they are invisible to userspace with that encoding. Therefore hidden_user_visibility() serves no purpose here, and can be safely removed. Signed-off-by: Marc Zyngier --- arch/arm64/kvm/sys_regs.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c index 5328fac8d547..2586ad29eaa0 100644 --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ -2795,14 +2795,10 @@ static const struct sys_reg_desc sys_reg_descs[] = { { SYS_DESC(SYS_SP_EL1), access_sp_el1}, /* AArch32 SPSR_* are RES0 if trapped from a NV guest */ - { SYS_DESC(SYS_SPSR_irq), .access = trap_raz_wi, - .visibility = hidden_user_visibility }, - { SYS_DESC(SYS_SPSR_abt), .access = trap_raz_wi, - .visibility = hidden_user_visibility }, - { SYS_DESC(SYS_SPSR_und), .access = trap_raz_wi, - .visibility = hidden_user_visibility }, - { SYS_DESC(SYS_SPSR_fiq), .access = trap_raz_wi, - .visibility = hidden_user_visibility }, + { SYS_DESC(SYS_SPSR_irq), .access = trap_raz_wi }, + { SYS_DESC(SYS_SPSR_abt), .access = trap_raz_wi }, + { SYS_DESC(SYS_SPSR_und), .access = trap_raz_wi }, + { SYS_DESC(SYS_SPSR_fiq), .access = trap_raz_wi }, { SYS_DESC(SYS_IFSR32_EL2), undef_access, reset_unknown, IFSR32_EL2 }, EL2_REG(AFSR0_EL2, access_rw, reset_val, 0),