All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Jones <drjones@redhat.com>
To: kvm@vger.kernel.org
Cc: pbonzini@redhat.com, rkrcmar@redhat.com
Subject: [PATCH kvm-unit-tests 2/2] arm/arm64: mmu: add missing TLB flushes
Date: Tue, 21 Nov 2017 17:49:21 +0100	[thread overview]
Message-ID: <20171121164921.8396-3-drjones@redhat.com> (raw)
In-Reply-To: <20171121164921.8396-1-drjones@redhat.com>

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 <drjones@redhat.com>
---
 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

  parent reply	other threads:[~2017-11-21 16:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-21 16:49 [PATCH kvm-unit-tests 0/2] arm/arm64: some fixups Andrew Jones
2017-11-21 16:49 ` [PATCH kvm-unit-tests 1/2] Makefile: fix cscope target Andrew Jones
2017-11-21 16:49 ` Andrew Jones [this message]
2017-11-23 16:13   ` [PATCH kvm-unit-tests 2/2] arm/arm64: mmu: add missing TLB flushes Radim Krčmář
2017-11-23 16:23     ` Andrew Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171121164921.8396-3-drjones@redhat.com \
    --to=drjones@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.