[PATCH v5 3/8] KVM: arm64: Simplify the sanitise_mte_tags() logic

Cornelia Huck cohuck at redhat.com
Mon Nov 7 09:10:39 PST 2022


On Thu, Nov 03 2022, Peter Collingbourne <pcc at google.com> wrote:

> From: Catalin Marinas <catalin.marinas at arm.com>
>
> Currently sanitise_mte_tags() checks if it's an online page before
> attempting to sanitise the tags. Such detection should be done in the
> caller via the VM_MTE_ALLOWED vma flag. Since kvm_set_spte_gfn() does
> not have the vma, leave the page unmapped if not already tagged. Tag
> initialisation will be done on a subsequent access fault in
> user_mem_abort().
>
> Signed-off-by: Catalin Marinas <catalin.marinas at arm.com>
> [pcc at google.com: fix the page initializer]
> Signed-off-by: Peter Collingbourne <pcc at google.com>
> Reviewed-by: Steven Price <steven.price at arm.com>
> Cc: Will Deacon <will at kernel.org>
> Cc: Marc Zyngier <maz at kernel.org>
> Cc: Peter Collingbourne <pcc at google.com>
> ---
>  arch/arm64/kvm/mmu.c | 40 +++++++++++++++-------------------------
>  1 file changed, 15 insertions(+), 25 deletions(-)

Reviewed-by: Cornelia Huck <cohuck at redhat.com>




More information about the linux-arm-kernel mailing list