mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
FROMLIST: 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 <qperret@google.com> Link: https://lore.kernel.org/r/20211208152300.2478542-6-qperret@google.com Bug: 209580772 Change-Id: I371533976ce9ffdbf6b0eff986680d34d3153b86
This commit is contained in:
@@ -525,6 +525,9 @@ int create_hyp_io_mappings(phys_addr_t phys_addr, size_t size,
|
||||
unsigned long addr;
|
||||
int ret;
|
||||
|
||||
if (is_protected_kvm_enabled())
|
||||
return -EPERM;
|
||||
|
||||
*kaddr = ioremap(phys_addr, size);
|
||||
if (!*kaddr)
|
||||
return -ENOMEM;
|
||||
@@ -768,6 +771,9 @@ int kvm_phys_addr_ioremap(struct kvm *kvm, phys_addr_t guest_ipa,
|
||||
KVM_PGTABLE_PROT_R |
|
||||
(writable ? KVM_PGTABLE_PROT_W : 0);
|
||||
|
||||
if (is_protected_kvm_enabled())
|
||||
return -EPERM;
|
||||
|
||||
size += offset_in_page(guest_ipa);
|
||||
guest_ipa &= PAGE_MASK;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user