From: Cornelia Huck <cohuck@redhat.com>
To: Marc Zyngier <maz@kernel.org>, Joey Gouly <joey.gouly@arm.com>
Cc: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
kvm@vger.kernel.org, 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>
Subject: Re: [PATCH v2 4/5] KVM: arm64: Expose FEAT_RASv1p1 in a canonical manner
Date: Tue, 12 Aug 2025 11:12:31 +0200 [thread overview]
Message-ID: <878qjogayo.fsf@redhat.com> (raw)
In-Reply-To: <874iugtfib.wl-maz@kernel.org>
On Sat, Aug 09 2025, Marc Zyngier <maz@kernel.org> wrote:
> On Thu, 07 Aug 2025 13:55:31 +0100,
> Joey Gouly <joey.gouly@arm.com> wrote:
>>
>> On Wed, Aug 06, 2025 at 05:56:14PM +0100, Marc Zyngier wrote:
>> > If we have RASv1p1 on the host, advertise it to the guest in the
>> > "canonical way", by setting ID_AA64PFR0_EL1 to V1P1, rather than
>> > the convoluted RAS+RAS_frac method.
>> >
>> > Note that this also advertises FEAT_DoubleFault, which doesn't
>> > affect the guest at all, as only EL3 is concerned by this.
>> >
>> > Signed-off-by: Marc Zyngier <maz@kernel.org>
>> > ---
>> > arch/arm64/kvm/sys_regs.c | 12 ++++++++++++
>> > 1 file changed, 12 insertions(+)
>> >
>> > diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c
>> > index 1b4114790024e..66e5a733e9628 100644
>> > --- a/arch/arm64/kvm/sys_regs.c
>> > +++ b/arch/arm64/kvm/sys_regs.c
>> > @@ -1800,6 +1800,18 @@ static u64 sanitise_id_aa64pfr0_el1(const struct kvm_vcpu *vcpu, u64 val)
>> > if (!vcpu_has_sve(vcpu))
>> > val &= ~ID_AA64PFR0_EL1_SVE_MASK;
>> >
>> > + /*
>> > + * Describe RASv1p1 in a canonical way -- ID_AA64PFR1_EL1.RAS_frac
>> > + * is cleared separately. Note that by advertising RASv1p1 here, we
>>
>> Where is it cleared? __kvm_read_sanitised_id_reg() is where I would have
>> expected to see it:
>>
>> case SYS_ID_AA64PFR1_EL1:
>
> [...]
>
> Ah crap, it is the nested code that we get rid of it, nowhere else.
> Which means that non-nested VMs have already observed RAS_frac. What a
> mess. Then RAS_frac must be exposed as writable.
>
> The question is whether we want to allow migration between one flavour
> of RASv1p1 and the other.
I guess that boils down to which kind of observable changes we want to
allow: bit-for-bit register contents, or only features? If only feature
stability is needed, then a cross-flavour migration would be fine; OTOH,
we do not know how a guest deduces feature availability, and it might
check for one flavour, but not the other (which is mostly a problem if
it re-checks during the lifetime.)
Only looking at strictly matching register contents would probably be
easier to implement for the VMM (well, it looks easier for QEMU :)
next prev parent reply other threads:[~2025-08-12 9:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-06 16:56 [PATCH v2 0/5] KVM: arm64: FEAT_RASv1p1 support and RAS selection Marc Zyngier
2025-08-06 16:56 ` [PATCH v2 1/5] arm64: Add capability denoting FEAT_RASv1p1 Marc Zyngier
2025-08-06 16:56 ` [PATCH v2 2/5] KVM: arm64: Handle RASv1p1 registers Marc Zyngier
2025-08-07 11:12 ` Joey Gouly
2025-08-06 16:56 ` [PATCH v2 3/5] KVM: arm64: Ignore HCR_EL2.FIEN set by L1 guest's EL2 Marc Zyngier
2025-08-06 16:56 ` [PATCH v2 4/5] KVM: arm64: Expose FEAT_RASv1p1 in a canonical manner Marc Zyngier
2025-08-07 12:55 ` Joey Gouly
2025-08-08 22:48 ` Oliver Upton
2025-08-09 20:21 ` Marc Zyngier
2025-08-12 20:30 ` Oliver Upton
2025-08-09 20:19 ` Marc Zyngier
2025-08-12 9:12 ` Cornelia Huck [this message]
2025-08-06 16:56 ` [PATCH v2 5/5] KVM: arm64: Make ID_AA64PFR0_EL1.RAS writable Marc Zyngier
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=878qjogayo.fsf@redhat.com \
--to=cohuck@redhat.com \
--cc=catalin.marinas@arm.com \
--cc=joey.gouly@arm.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=maz@kernel.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 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.