From: Oliver Upton <oupton@kernel.org>
To: Wei-Lin Chang <weilin.chang@arm.com>
Cc: Mark Brown <broonie@kernel.org>,
kvmarm@lists.linux.dev, Marc Zyngier <maz@kernel.org>,
Joey Gouly <joey.gouly@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Zenghui Yu <yuzenghui@huawei.com>,
Steffen Eiden <seiden@linux.ibm.com>,
Fuad Tabba <fuad.tabba@linux.dev>,
Aishwarya.TCV@arm.com
Subject: Re: [PATCH v3 4/5] KVM: arm64: Convert TCR_EL2 to config-driven sanitisation
Date: Fri, 6 Nov 2026 09:45:12 -0800 [thread overview]
Message-ID: <au4SKGsAAdsPm9SD@kernel.org> (raw)
In-Reply-To: <3pof5ftjdhngkbwn3ixnlynryabl67gfhwrfr54xnizo3iytwi@cicn7hku5i74>
Hi,
On Fri, Nov 06, 2026 at 05:30:57PM +0000, Wei-Lin Chang wrote:
> On Fri, Nov 06, 2026 at 11:34:47AM +0000, Mark Brown wrote:
> > On Thu, Oct 29, 2026 at 03:37:31PM -0700, Oliver Upton wrote:
> > > From: Wei-Lin Chang <weilin.chang@arm.com>
> > >
> > > Feature dependencies of the fields in TCR_EL2 are extracted from
> > > Registers.json of the BSD licenced AARCHMRS
> > > (AARCHMRS_OPENSOURCE_A_profile_FAT-2026-06).
> > >
> > > Places where we slightly deviate from the above:
> > >
> > > - Stick to the ARM ARM M.c requirement for TCR_EL2.TCMA*, which only
> > > depends on FEAT_MTE2. This avoids updating ID_AA64PFR2_EL1 with new
> > > VMTE* definitions that we don't know the meaning of, as they aren't
> > > present in the ARM ARM yet.
> > >
> > > - Ignore TCR_EL2.DS's requirement of needing the effective value of
> > > TCR2_EL2.D128 be 0. This requires runtime detection of TCR2_EL2.D128
> > > and we don't have D128 support yet.
> > >
> > > - TCR_EL2.AS is dependent on FEAT_ASID16, this information is missing
> > > from the json.
> >
> > I'm seeing a regression in -next for the pre_fault_memory_test selftest
> > when run on qemu with EL2 and NV enabled which bisects to this commit in
> > -next:
Thanks for reporting this Mark. Next time can you also include the QEMU
command line that reproduces the issue?
> > # selftests: kvm: pre_fault_memory_test
> > <47>[ 1358.708301] systemd-journald[75]: Sent WATCHDOG=1 notification.
> > # Random seed: 0xe322a57
> > # Testing guest mode: PA-bits:52, VA-bits:48, 4K pages
> > # Testing memory backing src type: anonymous
> > #
> > # ==== Test Assertion Failure ====
> > # pre_fault_memory_test.c:260: false
> > # pid=1888 tid=1888 errno=2 - No such file or directory
> > # sh: 1: addr2line: not found
> > # Unknown ucall 0x0.
> > not ok 48 selftests: kvm: pre_fault_memory_test # exit=254
> >
> > The NV pre fault test appears to run fine in the same run, and the test
> > passes when run on the same qemu version in vanilla VHE mode.
> >
> > Full log:
> >
> > https://lava.sirena.org.uk/scheduler/job/196379#L2476
> >
>
> The selftests are running vCPUs in vEL2 with 52-bit page tables it seems
> like. NV doesn't support 52-bit and this commit enforces that by forcing
> vCPU TCR_EL2.DS (hardware TCR_EL1.DS) to 0, so bad things happen.
>
> aarch64_get_supported_page_sizes() asks KVM for the preferred target,
> which does not include KVM_ARM_VCPU_HAS_EL2. Without
> KVM_ARM_VCPU_HAS_EL2, 52bit ipa is permitted if the host supports it.
>
> Then with 52-bit PA deemed supported, the selftest builds page tables
> with the 52-bit format for that case.
>
> Then when creating the actual vCPU to run, kvm_get_default_vcpu_target()
> includes KVM_ARM_VCPU_HAS_EL2.
>
> One potential solution is make vm_supports_el2() return false when
> vm->pa_bits > 48.
Bit of a hack but gets the job done, do you have time to send a patch?
I'm sure we'll get around to doing LPA2 long before anything useful
actually shows up anyway.
Thanks,
Oliver
next prev parent reply other threads:[~2026-11-06 17:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 22:37 [PATCH v3 0/5] KVM: arm64: TCR_EL2 fixes, FEAT_LPA2=NI for NV Oliver Upton
2026-10-29 22:37 ` [PATCH v3 1/5] KVM: arm64: nv: Don't advertise FEAT_LPA2 for guest stage-1 Oliver Upton
2026-10-29 22:37 ` [PATCH v3 2/5] arm64: sysreg: Add TCR_EL2 to sysreg infrastructure Oliver Upton
2026-10-29 22:37 ` [PATCH v3 3/5] KVM: arm64: Reset TCR_EL2 according to guest's E2H mode Oliver Upton
2026-10-29 22:37 ` [PATCH v3 4/5] KVM: arm64: Convert TCR_EL2 to config-driven sanitisation Oliver Upton
2026-10-30 1:26 ` Wei-Lin Chang
2026-11-06 11:34 ` Mark Brown
2026-11-06 17:30 ` Wei-Lin Chang
2026-11-06 17:45 ` Oliver Upton [this message]
2026-11-06 18:18 ` Mark Brown
2026-11-06 18:24 ` Wei-Lin Chang
2026-10-29 22:37 ` [PATCH v3 5/5] KVM: arm64: nv: Correctly compute the effective TCR_EL1 for nVHE TCR_EL2 Oliver Upton
2026-10-30 1:13 ` Wei-Lin Chang
2026-10-30 11:03 ` [PATCH v3 0/5] KVM: arm64: TCR_EL2 fixes, FEAT_LPA2=NI for NV Fuad Tabba
2026-11-03 13:05 ` 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=au4SKGsAAdsPm9SD@kernel.org \
--to=oupton@kernel.org \
--cc=Aishwarya.TCV@arm.com \
--cc=broonie@kernel.org \
--cc=fuad.tabba@linux.dev \
--cc=joey.gouly@arm.com \
--cc=kvmarm@lists.linux.dev \
--cc=maz@kernel.org \
--cc=seiden@linux.ibm.com \
--cc=suzuki.poulose@arm.com \
--cc=weilin.chang@arm.com \
--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.