]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
KVM: arm64: nv: Expose BTI and CSV_frac to a guest hypervisor
authorMarc Zyngier <maz@kernel.org>
Tue, 28 May 2024 10:06:32 +0000 (11:06 +0100)
committerMarc Zyngier <maz@kernel.org>
Thu, 30 May 2024 16:36:22 +0000 (17:36 +0100)
Now that we expose PAC to NV guests, we can also expose BTI (as
the two as joined at the hip, due to some of the PAC instructions
being landing pads).

While we're at it, also propagate CSV_frac, which requires no
particular emulation.

Fixes: f4f6a95bac49 ("KVM: arm64: nv: Advertise support for PAuth")
Reviewed-by: Oliver Upton <oliver.upton@linux.dev>
Link: https://lore.kernel.org/r/20240528100632.1831995-3-maz@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/nested.c

index 6813c7c7f00ab2eedf9d04a9a84bfb5f4858ca77..bae8536cbf003e9b949db4df115f0a7815e55554 100644 (file)
@@ -58,8 +58,10 @@ static u64 limit_nv_id_reg(u32 id, u64 val)
                break;
 
        case SYS_ID_AA64PFR1_EL1:
-               /* Only support SSBS */
-               val &= NV_FTR(PFR1, SSBS);
+               /* Only support BTI, SSBS, CSV2_frac */
+               val &= (NV_FTR(PFR1, BT)        |
+                       NV_FTR(PFR1, SSBS)      |
+                       NV_FTR(PFR1, CSV2_frac));
                break;
 
        case SYS_ID_AA64MMFR0_EL1: