From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Jones Subject: [PATCH kvm-unit-tests 2/2] arm/arm64: mmu: add missing TLB flushes Date: Tue, 21 Nov 2017 17:49:21 +0100 Message-ID: <20171121164921.8396-3-drjones@redhat.com> References: <20171121164921.8396-1-drjones@redhat.com> Cc: pbonzini@redhat.com, rkrcmar@redhat.com To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:52266 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751191AbdKUQt0 (ORCPT ); Tue, 21 Nov 2017 11:49:26 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6F0BE6A7C9 for ; Tue, 21 Nov 2017 16:49:26 +0000 (UTC) In-Reply-To: <20171121164921.8396-1-drjones@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Since 031755db "arm: enable vmalloc" the virtual addresses returned from malloc and friends are no longer identical to the physical addresses they map to. On some hardware the change exposes missing TLB flushes. Let's get them added. Signed-off-by: Andrew Jones --- lib/arm/mmu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/arm/mmu.c b/lib/arm/mmu.c index 21bcf3a363af..2e5c993f1e7f 100644 --- a/lib/arm/mmu.c +++ b/lib/arm/mmu.c @@ -86,6 +86,7 @@ static pteval_t *install_pte(pgd_t *pgtable, uintptr_t vaddr, pteval_t pte) { pteval_t *p_pte = get_pte(pgtable, vaddr); *p_pte = pte; + flush_tlb_page(vaddr); return p_pte; } @@ -136,9 +137,9 @@ void mmu_set_range_sect(pgd_t *pgtable, uintptr_t virt_offset, pgd_val(*pgd) |= PMD_TYPE_SECT | PMD_SECT_AF | PMD_SECT_S; pgd_val(*pgd) |= pgprot_val(prot); } + flush_tlb_all(); } - void *setup_mmu(phys_addr_t phys_end) { uintptr_t code_end = (uintptr_t)&etext; -- 2.13.6