linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Ben Horgan <ben.horgan@arm.com>
Cc: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	kvm@vger.kernel.org, Joey Gouly <joey.gouly@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Oliver Upton <oliver.upton@linux.dev>,
	Zenghui Yu <yuzenghui@huawei.com>, Will Deacon <will@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Cornelia Huck <cohuck@redhat.com>
Subject: Re: [PATCH v3 2/6] KVM: arm64: Handle RASv1p1 registers
Date: Thu, 21 Aug 2025 14:37:45 +0100	[thread overview]
Message-ID: <87ect4kd7a.wl-maz@kernel.org> (raw)
In-Reply-To: <95819606-ef3b-46e1-8201-1abf0219659f@arm.com>

On Thu, 21 Aug 2025 14:13:52 +0100,
Ben Horgan <ben.horgan@arm.com> wrote:
> 
> > diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c
> > index 82ffb3b3b3cf7..feb1a7a708e25 100644
> > --- a/arch/arm64/kvm/sys_regs.c
> > +++ b/arch/arm64/kvm/sys_regs.c
> > @@ -2697,6 +2697,18 @@ static bool access_ras(struct kvm_vcpu *vcpu,
> >   	struct kvm *kvm = vcpu->kvm;
> >     	switch(reg_to_encoding(r)) {
> > +	case SYS_ERXPFGCDN_EL1:
> > +	case SYS_ERXPFGCTL_EL1:
> > +	case SYS_ERXPFGF_EL1:
> > +	case SYS_ERXMISC2_EL1:
> > +	case SYS_ERXMISC3_EL1:
> > +		if (!(kvm_has_feat(kvm, ID_AA64PFR0_EL1, RAS, V1P1) ||
> > +		      (kvm_has_feat_enum(kvm, ID_AA64PFR0_EL1, RAS, IMP) &&
> > +		       kvm_has_feat(kvm, ID_AA64PFR1_EL1, RAS_frac, RASv1p1)))) {
> > +			kvm_inject_undefined(vcpu);
> > +			return false;
> > +		}
> > +		break;
> >   	default:
> >   		if (!kvm_has_feat(kvm, ID_AA64PFR0_EL1, RAS, IMP)) {
> >   			kvm_inject_undefined(vcpu);
> The default condition needs updating for the case when
> ID_AA64PFR0_EL1.RAS = b10 otherwise access to the non-v1 specific RAS
> registers will result in an UNDEF being injected.

I don't think so. The RAS field is described as such:

	UnsignedEnum    31:28   RAS
	        0b0000  NI
        	0b0001  IMP
	        0b0010  V1P1
	        0b0011  V2
	EndEnum

Since this is an unsigned enum, this checks for a value < IMP. Only
RAS not being implemented is this condition satisfied, and an UNDEF
injected.

Or am I missing something obvious here (I wouldn't be surprised...)?

	M.

-- 
Jazz isn't dead. It just smells funny.


  reply	other threads:[~2025-08-21 19:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-17 20:21 [PATCH v3 0/6] KVM: arm64: FEAT_RASv1p1 support and RAS selection Marc Zyngier
2025-08-17 20:21 ` [PATCH v3 1/6] arm64: Add capability denoting FEAT_RASv1p1 Marc Zyngier
2025-08-18 12:32   ` Cornelia Huck
2025-08-17 20:21 ` [PATCH v3 2/6] KVM: arm64: Handle RASv1p1 registers Marc Zyngier
2025-08-18 12:34   ` Cornelia Huck
2025-08-21 13:13   ` Ben Horgan
2025-08-21 13:37     ` Marc Zyngier [this message]
2025-08-21 13:44       ` Ben Horgan
2025-08-17 20:21 ` [PATCH v3 3/6] KVM: arm64: Ignore HCR_EL2.FIEN set by L1 guest's EL2 Marc Zyngier
2025-08-19 10:24   ` Joey Gouly
2025-08-17 20:21 ` [PATCH v3 4/6] KVM: arm64: Make ID_AA64PFR0_EL1.RAS writable Marc Zyngier
2025-08-18 12:37   ` Cornelia Huck
2025-08-17 20:21 ` [PATCH v3 5/6] KVM: arm64: Make ID_AA64PFR1_EL1.RAS_frac writable Marc Zyngier
2025-08-18 12:43   ` Cornelia Huck
2025-08-17 20:21 ` [PATCH v3 6/6] KVM: arm64: Get rid of ARM64_FEATURE_MASK() Marc Zyngier
2025-08-21 11:29   ` Ben Horgan
2025-08-21 13:43     ` Marc Zyngier
2025-08-22  0:01 ` [PATCH v3 0/6] KVM: arm64: FEAT_RASv1p1 support and RAS selection 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=87ect4kd7a.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=ben.horgan@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=cohuck@redhat.com \
    --cc=joey.gouly@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=oliver.upton@linux.dev \
    --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 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).