From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 995191D1F70 for ; Mon, 7 Oct 2024 11:05:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728299135; cv=none; b=UPhQbRhGT1f/0/BPDOaz79whmDpwk6ZQENjHzqS0cCRzP4/voPFQyodoR8J4VtHyS0DeFjxBuI664Pwiw8vgfC6MPswDMW19HshHsU0ty5EOVVkKOM4HgIJgJA7lGAHkwvFoH8qOacyTGxBzOcXH0aiImoPeDfpHJLR6rNCtIzA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728299135; c=relaxed/simple; bh=yANMR7+WV8NdFI+yP2ge+3PXooOxWpw4U8uuo/Xj2H4=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=mZciMFVD2GXt+O6TdIAZGBe4e+vmE1ifPSeBgfYH/WvuiHHf/bODtYS4jQnfUtfTbw1UnQOxze4xZmOm3WsNsesRV8luK2f7R9McSuHxLgnkn2UTEEZvTHth2c6OMTTg08IHeclTftCj0nosH0hwXigHPiRdKAMOkH1mBK8W9Yg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=d1GUX+yc; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="d1GUX+yc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7327AC4CED3; Mon, 7 Oct 2024 11:05:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1728299135; bh=yANMR7+WV8NdFI+yP2ge+3PXooOxWpw4U8uuo/Xj2H4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=d1GUX+yckCbMtT2b41QjtFKdYmktFaYHHofUNb+Kxedx0fZozXNLBdmWYObSA27y7 QJqBn3tORBMmmtqxLfJ5wOGaI+t8JE2JqRHY4GJadtQpSNYiijFu+MRJLAIch+cwSz 8YH+O/l9s0qyDgEm+UGUjDUpVvmC8eWzJO2giptWeZHi/9/i8i51kxGK59EbPA37Vu Haq7+XFAWfaIuwP4pAXiiBaE8C4G/6jiHztz3aqlzPhgpqq0kyx6wiHkHjW5OdRiWB 2KHlkLrKKEURtqNm6CxV1iBOVwyy8OU28ai2gCcaNcjRuLt7gVBWZTSa7ZxG51C7U/ LMKspzLAuUZOQ== 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 1sxlYS-000ysR-Ei; Mon, 07 Oct 2024 12:05:33 +0100 Date: Mon, 07 Oct 2024 12:05:31 +0100 Message-ID: <86zfng5g1w.wl-maz@kernel.org> From: Marc Zyngier To: Joey Gouly Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, anshuman.khandual@arm.com, james.morse@arm.com, Oliver Upton , Suzuki K Poulose , Zenghui Yu , Jing Zhang , Shameerali Kolothum Thodi , Catalin Marinas , Will Deacon Subject: Re: [PATCH v4 4/7] KVM: arm64: Fix missing traps of guest accesses to the MPAM registers In-Reply-To: <20241004110714.2051604-5-joey.gouly@arm.com> References: <20241004110714.2051604-1-joey.gouly@arm.com> <20241004110714.2051604-5-joey.gouly@arm.com> 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/29.4 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: joey.gouly@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, anshuman.khandual@arm.com, james.morse@arm.com, oliver.upton@linux.dev, suzuki.poulose@arm.com, yuzenghui@huawei.com, jingzhangos@google.com, shameerali.kolothum.thodi@huawei.com, catalin.marinas@arm.com, will@kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Fri, 04 Oct 2024 12:07:11 +0100, Joey Gouly wrote: > > diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c > index dad88e31f953..8b1a6cedc49e 100644 > --- a/arch/arm64/kvm/sys_regs.c > +++ b/arch/arm64/kvm/sys_regs.c > @@ -544,6 +544,14 @@ static bool trap_oslar_el1(struct kvm_vcpu *vcpu, > return true; > } > > +static bool trap_mpam(struct kvm_vcpu *vcpu, struct sys_reg_params *p, > + const struct sys_reg_desc *r) > +{ > + kvm_inject_undefined(vcpu); > + > + return false; > +} > + I have recently been hunting down re-implementations of undef_access() (see commit cd08d3216fc4), and this another case of such duplication. Can we stick to this one, given that we have no plan to expose MPAM to guests in the foreseeable future? > static bool trap_oslsr_el1(struct kvm_vcpu *vcpu, > struct sys_reg_params *p, > const struct sys_reg_desc *r) > @@ -2517,8 +2525,11 @@ static const struct sys_reg_desc sys_reg_descs[] = { > { SYS_DESC(SYS_LOREA_EL1), trap_loregion }, > { SYS_DESC(SYS_LORN_EL1), trap_loregion }, > { SYS_DESC(SYS_LORC_EL1), trap_loregion }, > + { SYS_DESC(SYS_MPAMIDR_EL1), trap_mpam }, > { SYS_DESC(SYS_LORID_EL1), trap_loregion }, > > + { SYS_DESC(SYS_MPAM1_EL1), trap_mpam }, > + { SYS_DESC(SYS_MPAM0_EL1), trap_mpam }, > { SYS_DESC(SYS_VBAR_EL1), access_rw, reset_val, VBAR_EL1, 0 }, > { SYS_DESC(SYS_DISR_EL1), NULL, reset_val, DISR_EL1, 0 }, > Thanks, M. -- Without deviation from the norm, progress is not possible.