linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Ruidong Tian <tianruidong@linux.alibaba.com>
Cc: kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, oliver.upton@linux.dev,
	james.morse@arm.com, suzuki.poulose@arm.com,
	yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org
Subject: Re: [PATCH] KVM: arm64: Add missing ERX*_EL1 registers
Date: Wed, 10 Jan 2024 12:20:30 +0000	[thread overview]
Message-ID: <867ckh9y7l.wl-maz@kernel.org> (raw)
In-Reply-To: <20240110075739.8291-1-tianruidong@linux.alibaba.com>

On Wed, 10 Jan 2024 07:57:39 +0000,
Ruidong Tian <tianruidong@linux.alibaba.com> wrote:
> 
> Commit 464f2164da7e ("arm64: Add missing ERX*_EL1 encodings") add some
> new RAS registers. Trap them to kvm.

Well, they *are* already trapped by virtue of HCR_EL2.FIEN being
0. They are lacking a trap handler though.

> 
> Signed-off-by: Ruidong Tian <tianruidong@linux.alibaba.com>
> ---
>  arch/arm64/kvm/sys_regs.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c
> index 30253bd19917..76a9ba155d58 100644
> --- a/arch/arm64/kvm/sys_regs.c
> +++ b/arch/arm64/kvm/sys_regs.c
> @@ -2389,8 +2389,13 @@ static const struct sys_reg_desc sys_reg_descs[] = {
>  	{ SYS_DESC(SYS_ERXCTLR_EL1), trap_raz_wi },
>  	{ SYS_DESC(SYS_ERXSTATUS_EL1), trap_raz_wi },
>  	{ SYS_DESC(SYS_ERXADDR_EL1), trap_raz_wi },
> +	{ SYS_DESC(SYS_ERXPFGF_EL1), trap_raz_wi },
> +	{ SYS_DESC(SYS_ERXPFGCTL_EL1), trap_raz_wi },
> +	{ SYS_DESC(SYS_ERXPFGCDN_EL1), trap_raz_wi },
>  	{ SYS_DESC(SYS_ERXMISC0_EL1), trap_raz_wi },
>  	{ SYS_DESC(SYS_ERXMISC1_EL1), trap_raz_wi },
> +	{ SYS_DESC(SYS_ERXMISC2_EL1), trap_raz_wi },
> +	{ SYS_DESC(SYS_ERXMISC3_EL1), trap_raz_wi },
>  
>  	MTE_REG(TFSR_EL1),
>  	MTE_REG(TFSRE0_EL1),

If my reading of the ARM ARM is correct, these registers only exist if
FEAT_RASv1p1 is implemented. Which means that we shouldn't handle
those as RAZ/WI unconditionally, but instead check for what we
advertise to the guest and handle it accordingly.

Thanks,

	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

  reply	other threads:[~2024-01-10 12:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-10  7:57 [PATCH] KVM: arm64: Add missing ERX*_EL1 registers Ruidong Tian
2024-01-10 12:20 ` Marc Zyngier [this message]
2024-01-15 14:47   ` Oliver Upton
2024-01-15 17:21     ` James Morse
2024-01-16 15:38       ` Oliver Upton

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=867ckh9y7l.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=james.morse@arm.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oliver.upton@linux.dev \
    --cc=suzuki.poulose@arm.com \
    --cc=tianruidong@linux.alibaba.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).