lkml.org 
[lkml]   [2021]   [Dec]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 5/6] KVM: arm64: pkvm: Stub io map functions
On Wed, Dec 08, 2021 at 03:22:58PM +0000, Quentin Perret wrote:
> 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>
> ---
> arch/arm64/kvm/mmu.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c
> index 326cdfec74a1..605c104eb030 100644
> --- a/arch/arm64/kvm/mmu.c
> +++ b/arch/arm64/kvm/mmu.c
> @@ -407,6 +407,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;

Looks like the vGIC is the only caller, so no need to worry about anybody
relying on *kaddr being zeroed on failure.

Acked-by: Will Deacon <will@kernel.org>

Will

\
 
 \ /
  Last update: 2021-12-08 18:50    [W:0.071 / U:1.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site