diff options
| author | Zenghui Yu (Huawei) <zenghui.yu@linux.dev> | 2026-02-26 01:35:13 +0800 |
|---|---|---|
| committer | Marc Zyngier <maz@kernel.org> | 2026-03-05 15:46:47 +0000 |
| commit | 4c2264ecdf39ddbdb62e37b156015aacf05d0dcb (patch) | |
| tree | cc70bee34f96a1f991e79d5921b17f200364d296 /include/uapi/linux/psample.h | |
| parent | 8531d5a83d8eb8affb5c0249b466c28d94192603 (diff) | |
KVM: arm64: nv: Check S2 limits based on implemented PA size
check_base_s2_limits() checks the validity of SL0 and inputsize against
ia_size (inputsize again!) but the pseudocode from DDI0487 G.a
AArch64.TranslationTableWalk() says that we should check against the
implemented PA size.
We would otherwise fail to walk S2 with a valid configuration. E.g.,
granule size = 4KB, inputsize = 40 bits, initial lookup level = 0 (no
concatenation) on a system with 48 bits PA range supported is allowed by
architecture.
Fix it by obtaining PA size by kvm_get_pa_bits(). Note that
kvm_get_pa_bits() returns the fixed limit now and should eventually reflect
the per VM PARange (one day!). Given that the configured PARange should not
be greater that kvm_ipa_limit, it at least fixes the problem described
above.
While at it, inject a level 0 translation fault to guest if
check_base_s2_limits() fails, as per the pseudocode.
Fixes: 61e30b9eef7f ("KVM: arm64: nv: Implement nested Stage-2 page table walk logic")
Signed-off-by: Zenghui Yu (Huawei) <zenghui.yu@linux.dev>
Link: https://patch.msgid.link/20260225173515.20490-2-zenghui.yu@linux.dev
Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'include/uapi/linux/psample.h')
0 files changed, 0 insertions, 0 deletions
