Skip to content

Commit bff01cb

Browse files
Quentin PerretMarc Zyngier
authored andcommitted
KVM: arm64: pkvm: Stub io map functions
Now that GICv2 is disabled in nVHE protected mode there should be no other reason for the host to use create_hyp_io_mappings() or kvm_phys_addr_ioremap(). Add sanity checks to make sure that assumption remains true looking forward. Signed-off-by: Quentin Perret <[email protected]> Acked-by: Will Deacon <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 473a3ef commit bff01cb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

arch/arm64/kvm/mmu.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,9 @@ int create_hyp_io_mappings(phys_addr_t phys_addr, size_t size,
407407
unsigned long addr;
408408
int ret;
409409

410+
if (is_protected_kvm_enabled())
411+
return -EPERM;
412+
410413
*kaddr = ioremap(phys_addr, size);
411414
if (!*kaddr)
412415
return -ENOMEM;
@@ -650,6 +653,9 @@ int kvm_phys_addr_ioremap(struct kvm *kvm, phys_addr_t guest_ipa,
650653
KVM_PGTABLE_PROT_R |
651654
(writable ? KVM_PGTABLE_PROT_W : 0);
652655

656+
if (is_protected_kvm_enabled())
657+
return -EPERM;
658+
653659
size += offset_in_page(guest_ipa);
654660
guest_ipa &= PAGE_MASK;
655661

0 commit comments

Comments
 (0)