From: Marc Zyngier <maz@kernel.org>
To: Joey Gouly <joey.gouly@arm.com>
Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
anshuman.khandual@arm.com, james.morse@arm.com,
Oliver Upton <oliver.upton@linux.dev>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Zenghui Yu <yuzenghui@huawei.com>,
Jing Zhang <jingzhangos@google.com>,
Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>
Subject: Re: [PATCH v4 4/7] KVM: arm64: Fix missing traps of guest accesses to the MPAM registers
Date: Mon, 07 Oct 2024 12:05:31 +0100 [thread overview]
Message-ID: <86zfng5g1w.wl-maz@kernel.org> (raw)
In-Reply-To: <20241004110714.2051604-5-joey.gouly@arm.com>
On Fri, 04 Oct 2024 12:07:11 +0100,
Joey Gouly <joey.gouly@arm.com> 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.
next prev parent reply other threads:[~2024-10-07 11:05 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-04 11:07 [PATCH v4 0/7] KVM: arm64: Hide unsupported MPAM from the guest Joey Gouly
2024-10-04 11:07 ` [PATCH v4 1/7] arm64: head.S: Initialise MPAM EL2 registers and disable traps Joey Gouly
2024-10-09 3:59 ` Gavin Shan
2024-10-04 11:07 ` [PATCH v4 2/7] arm64/sysreg: Convert existing MPAM sysregs and add the remaining entries Joey Gouly
2024-10-09 4:12 ` Gavin Shan
2024-10-04 11:07 ` [PATCH v4 3/7] arm64: cpufeature: discover CPU support for MPAM Joey Gouly
2024-10-09 5:50 ` Gavin Shan
2024-10-04 11:07 ` [PATCH v4 4/7] KVM: arm64: Fix missing traps of guest accesses to the MPAM registers Joey Gouly
2024-10-07 11:05 ` Marc Zyngier [this message]
2024-10-09 5:53 ` Gavin Shan
2024-10-10 10:18 ` Joey Gouly
2024-10-04 11:07 ` [PATCH v4 5/7] KVM: arm64: Add a macro for creating filtered sys_reg_descs entries Joey Gouly
2024-10-09 6:12 ` Gavin Shan
2024-10-04 11:07 ` [PATCH v4 6/7] KVM: arm64: Disable MPAM visibility by default and ignore VMM writes Joey Gouly
2024-10-09 6:40 ` Gavin Shan
2024-10-04 11:07 ` [PATCH v4 7/7] KVM: arm64: selftests: Test ID_AA64PFR0.MPAM isn't completely ignored Joey Gouly
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86zfng5g1w.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=anshuman.khandual@arm.com \
--cc=catalin.marinas@arm.com \
--cc=james.morse@arm.com \
--cc=jingzhangos@google.com \
--cc=joey.gouly@arm.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=oliver.upton@linux.dev \
--cc=shameerali.kolothum.thodi@huawei.com \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.org \
--cc=yuzenghui@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.