]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drivers/virt: pkvm: Don't fail ioremap() call if MMIO_GUARD fails
authorWill Deacon <will@kernel.org>
Mon, 2 Dec 2024 14:57:29 +0000 (14:57 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 19:03:17 +0000 (20:03 +0100)
commit2459a0b149673702dbbd24b03c690b644f99de46
treef5982fe1a648f74cf48fc9784de7e04409cce17c
parent7cddf3b4a0529025c770e6917c6100cb38503dd2
drivers/virt: pkvm: Don't fail ioremap() call if MMIO_GUARD fails

[ Upstream commit d44679fb954ffea961036ed1aeb7d65035f78489 ]

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: 0f1269495800 ("drivers/virt: pkvm: Intercept ioremap using pKVM MMIO_GUARD hypercall")
Signed-off-by: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20241202145731.6422-2-will@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/virt/coco/pkvm-guest/arm-pkvm-guest.c