Skip to content

Commit a373930

Browse files
author
Marc Zyngier
committed
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>
1 parent 17d7b15 commit a373930

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

arch/arm64/kvm/hyp/nvhe/mem_protect.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include <nvhe/mem_protect.h>
2020
#include <nvhe/mm.h>
2121

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)
2323

2424
struct host_mmu host_mmu;
2525

@@ -324,6 +324,8 @@ int __pkvm_prot_finalize(void)
324324
params->vttbr = kvm_get_vttbr(mmu);
325325
params->vtcr = mmu->vtcr;
326326
params->hcr_el2 |= HCR_VM;
327+
if (cpus_have_final_cap(ARM64_HAS_STAGE2_FWB))
328+
params->hcr_el2 |= HCR_FWB;
327329

328330
/*
329331
* The CMO below not only cleans the updated params to the

0 commit comments

Comments
 (0)