Skip to content

Commit d44679f

Browse files
willdeaconctmarinas
authored andcommitted
drivers/virt: pkvm: Don't fail ioremap() call if MMIO_GUARD fails
Calling the MMIO_GUARD hypercall from guests which have not been enrolled (e.g. because they are running without pvmfw) results in -EINVAL being returned. In this case, MMIO_GUARD is not active and so we can simply proceed with the normal ioremap() routine. Don't fail ioremap() if MMIO_GUARD fails; instead WARN_ON_ONCE() to highlight that the pvm environment is slightly wonky. Fixes: 0f12694 ("drivers/virt: pkvm: Intercept ioremap using pKVM MMIO_GUARD hypercall") Signed-off-by: Will Deacon <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 8d09e2d commit d44679f

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

drivers/virt/coco/pkvm-guest/arm-pkvm-guest.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,8 @@ static int mmio_guard_ioremap_hook(phys_addr_t phys, size_t size,
8787

8888
while (phys < end) {
8989
const int func_id = ARM_SMCCC_VENDOR_HYP_KVM_MMIO_GUARD_FUNC_ID;
90-
int err;
91-
92-
err = arm_smccc_do_one_page(func_id, phys);
93-
if (err)
94-
return err;
9590

91+
WARN_ON_ONCE(arm_smccc_do_one_page(func_id, phys));
9692
phys += PAGE_SIZE;
9793
}
9894

0 commit comments

Comments
 (0)