Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

KVM: arm64: Switch pKVM host S2 over to KVM_PGTABLE_S2_AS_S1

Since we have the basics to use the S1 memory attributes as the
final ones with FWB, flip the host over to that when FWB is present.

Reviewed-by: Joey Gouly <joey.gouly@arm.com>
Tested-by: Fuad Tabba <tabba@google.com>
Reviewed-by: Fuad Tabba <tabba@google.com>
Link: https://patch.msgid.link/20260123191637.715429-4-maz@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>

+3 -1
+3 -1
arch/arm64/kvm/hyp/nvhe/mem_protect.c
··· 19 19 #include <nvhe/mem_protect.h> 20 20 #include <nvhe/mm.h> 21 21 22 - #define KVM_HOST_S2_FLAGS (KVM_PGTABLE_S2_NOFWB | KVM_PGTABLE_S2_IDMAP) 22 + #define KVM_HOST_S2_FLAGS (KVM_PGTABLE_S2_AS_S1 | KVM_PGTABLE_S2_IDMAP) 23 23 24 24 struct host_mmu host_mmu; 25 25 ··· 324 324 params->vttbr = kvm_get_vttbr(mmu); 325 325 params->vtcr = mmu->vtcr; 326 326 params->hcr_el2 |= HCR_VM; 327 + if (cpus_have_final_cap(ARM64_HAS_STAGE2_FWB)) 328 + params->hcr_el2 |= HCR_FWB; 327 329 328 330 /* 329 331 * The CMO below not only cleans the updated params to the