qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Rob Herring" <rob.herring@linaro.org>,
	"Peter Crosthwaite" <peter.crosthwaite@xilinx.com>,
	patches@linaro.org, "Michael Matz" <matz@suse.de>,
	"Alexander Graf" <agraf@suse.de>,
	"Claudio Fontana" <claudio.fontana@linaro.org>,
	"Dirk Mueller" <dmueller@suse.de>,
	"Will Newton" <will.newton@linaro.org>,
	"Laurent Desnogues" <laurent.desnogues@gmail.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	kvmarm@lists.cs.columbia.edu,
	"Christoffer Dall" <christoffer.dall@linaro.org>,
	"Richard Henderson" <rth@twiddle.net>
Subject: [Qemu-devel] [PATCH v3 06/31] target-arm: Implement AArch64 TLB invalidate ops
Date: Sat, 15 Feb 2014 16:06:59 +0000	[thread overview]
Message-ID: <1392480444-25565-7-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1392480444-25565-1-git-send-email-peter.maydell@linaro.org>

Implement the AArch64 TLB invalidate operations. This is
the full set of TLBI ops defined for a CPU which doesn't
implement EL2 or EL3.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target-arm/helper.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)

diff --git a/target-arm/helper.c b/target-arm/helper.c
index e1f1c4d..8184c38 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -1525,6 +1525,30 @@ static CPAccessResult aa64_cacheop_access(CPUARMState *env,
     return CP_ACCESS_OK;
 }
 
+static void tlbi_aa64_va_write(CPUARMState *env, const ARMCPRegInfo *ri,
+                               uint64_t value)
+{
+    /* Invalidate by VA (AArch64 version) */
+    uint64_t pageaddr = value << 12;
+    tlb_flush_page(env, pageaddr);
+}
+
+static void tlbi_aa64_vaa_write(CPUARMState *env, const ARMCPRegInfo *ri,
+                                uint64_t value)
+{
+    /* Invalidate by VA, all ASIDs (AArch64 version) */
+    uint64_t pageaddr = value << 12;
+    tlb_flush_page(env, pageaddr);
+}
+
+static void tlbi_aa64_asid_write(CPUARMState *env, const ARMCPRegInfo *ri,
+                                 uint64_t value)
+{
+    /* Invalidate by ASID (AArch64 version) */
+    int asid = extract64(value, 48, 16);
+    tlb_flush(env, asid == 0);
+}
+
 static const ARMCPRegInfo v8_cp_reginfo[] = {
     /* Minimal set of EL0-visible registers. This will need to be expanded
      * significantly for system emulation of AArch64 CPUs.
@@ -1583,6 +1607,55 @@ static const ARMCPRegInfo v8_cp_reginfo[] = {
     { .name = "DC_CISW", .state = ARM_CP_STATE_AA64,
       .opc0 = 1, .opc1 = 0, .crn = 7, .crm = 14, .opc2 = 2,
       .access = PL1_W, .type = ARM_CP_NOP },
+    /* TLBI operations */
+    { .name = "TLBI_VMALLE1IS", .state = ARM_CP_STATE_AA64,
+      .opc0 = 1, .opc2 = 0, .crn = 8, .crm = 3, .opc2 = 0,
+      .access = PL1_W, .type = ARM_CP_NO_MIGRATE,
+      .writefn = tlbiall_write },
+    { .name = "TLBI_VAE1IS", .state = ARM_CP_STATE_AA64,
+      .opc0 = 1, .opc2 = 0, .crn = 8, .crm = 3, .opc2 = 1,
+      .access = PL1_W, .type = ARM_CP_NO_MIGRATE,
+      .writefn = tlbi_aa64_va_write },
+    { .name = "TLBI_ASIDE1IS", .state = ARM_CP_STATE_AA64,
+      .opc0 = 1, .opc2 = 0, .crn = 8, .crm = 3, .opc2 = 2,
+      .access = PL1_W, .type = ARM_CP_NO_MIGRATE,
+      .writefn = tlbi_aa64_asid_write },
+    { .name = "TLBI_VAAE1IS", .state = ARM_CP_STATE_AA64,
+      .opc0 = 1, .opc2 = 0, .crn = 8, .crm = 3, .opc2 = 3,
+      .access = PL1_W, .type = ARM_CP_NO_MIGRATE,
+      .writefn = tlbi_aa64_vaa_write },
+    { .name = "TLBI_VALE1IS", .state = ARM_CP_STATE_AA64,
+      .opc0 = 1, .opc2 = 0, .crn = 8, .crm = 3, .opc2 = 5,
+      .access = PL1_W, .type = ARM_CP_NO_MIGRATE,
+      .writefn = tlbi_aa64_va_write },
+    { .name = "TLBI_VAALE1IS", .state = ARM_CP_STATE_AA64,
+      .opc0 = 1, .opc2 = 0, .crn = 8, .crm = 3, .opc2 = 7,
+      .access = PL1_W, .type = ARM_CP_NO_MIGRATE,
+      .writefn = tlbi_aa64_vaa_write },
+    { .name = "TLBI_VMALLE1", .state = ARM_CP_STATE_AA64,
+      .opc0 = 1, .opc2 = 0, .crn = 8, .crm = 7, .opc2 = 0,
+      .access = PL1_W, .type = ARM_CP_NO_MIGRATE,
+      .writefn = tlbiall_write },
+    { .name = "TLBI_VAE1", .state = ARM_CP_STATE_AA64,
+      .opc0 = 1, .opc2 = 0, .crn = 8, .crm = 7, .opc2 = 1,
+      .access = PL1_W, .type = ARM_CP_NO_MIGRATE,
+      .writefn = tlbi_aa64_va_write },
+    { .name = "TLBI_ASIDE1", .state = ARM_CP_STATE_AA64,
+      .opc0 = 1, .opc2 = 0, .crn = 8, .crm = 7, .opc2 = 2,
+      .access = PL1_W, .type = ARM_CP_NO_MIGRATE,
+      .writefn = tlbi_aa64_asid_write },
+    { .name = "TLBI_VAAE1", .state = ARM_CP_STATE_AA64,
+      .opc0 = 1, .opc2 = 0, .crn = 8, .crm = 7, .opc2 = 3,
+      .access = PL1_W, .type = ARM_CP_NO_MIGRATE,
+      .writefn = tlbi_aa64_vaa_write },
+    { .name = "TLBI_VALE1", .state = ARM_CP_STATE_AA64,
+      .opc0 = 1, .opc2 = 0, .crn = 8, .crm = 7, .opc2 = 5,
+      .access = PL1_W, .type = ARM_CP_NO_MIGRATE,
+      .writefn = tlbi_aa64_va_write },
+    { .name = "TLBI_VAALE1", .state = ARM_CP_STATE_AA64,
+      .opc0 = 1, .opc2 = 0, .crn = 8, .crm = 7, .opc2 = 7,
+      .access = PL1_W, .type = ARM_CP_NO_MIGRATE,
+      .writefn = tlbi_aa64_vaa_write },
     REGINFO_SENTINEL
 };
 
-- 
1.8.5

  parent reply	other threads:[~2014-02-15 16:07 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-15 16:06 [Qemu-devel] [PATCH v3 00/31] A64 system emulation prequisites Peter Maydell
2014-02-15 16:06 ` [Qemu-devel] [PATCH v3 01/31] target-arm: Fix raw read and write functions on AArch64 registers Peter Maydell
2014-02-26  0:17   ` Peter Crosthwaite
2014-02-15 16:06 ` [Qemu-devel] [PATCH v3 02/31] target-arm: A64: Make cache ID registers visible to AArch64 Peter Maydell
2014-02-15 16:06 ` [Qemu-devel] [PATCH v3 03/31] target-arm: Implement AArch64 CurrentEL sysreg Peter Maydell
2014-02-15 16:06 ` [Qemu-devel] [PATCH v3 04/31] target-arm: Implement AArch64 MIDR_EL1 Peter Maydell
2014-02-15 16:06 ` [Qemu-devel] [PATCH v3 05/31] target-arm: Implement AArch64 cache invalidate/clean ops Peter Maydell
2014-02-15 16:06 ` Peter Maydell [this message]
2014-02-15 16:07 ` [Qemu-devel] [PATCH v3 07/31] target-arm: Implement AArch64 dummy MDSCR_EL1 Peter Maydell
2014-02-15 16:07 ` [Qemu-devel] [PATCH v3 08/31] target-arm: Implement AArch64 memory attribute registers Peter Maydell
2014-02-15 16:07 ` [Qemu-devel] [PATCH v3 09/31] target-arm: Implement AArch64 SCTLR_EL1 Peter Maydell
2014-02-15 16:07 ` [Qemu-devel] [PATCH v3 10/31] target-arm: Implement AArch64 TCR_EL1 Peter Maydell
2014-02-15 16:07 ` [Qemu-devel] [PATCH v3 11/31] target-arm: Implement AArch64 VBAR_EL1 Peter Maydell
2014-02-15 16:07 ` [Qemu-devel] [PATCH v3 12/31] target-arm: Implement AArch64 TTBR* Peter Maydell
2014-02-26  6:33   ` Hu Tao
2014-02-26  9:50     ` Peter Maydell
2014-02-15 16:07 ` [Qemu-devel] [PATCH v3 13/31] target-arm: Implement AArch64 MPIDR Peter Maydell
2014-02-15 16:07 ` [Qemu-devel] [PATCH v3 14/31] target-arm: Implement AArch64 generic timers Peter Maydell
2014-02-15 16:07 ` [Qemu-devel] [PATCH v3 15/31] target-arm: Implement AArch64 ID and feature registers Peter Maydell
2014-02-15 16:07 ` [Qemu-devel] [PATCH v3 16/31] target-arm: Implement AArch64 dummy breakpoint and watchpoint registers Peter Maydell
2014-02-15 16:07 ` [Qemu-devel] [PATCH v3 17/31] target-arm: Implement AArch64 OSLAR_EL1 sysreg as WI Peter Maydell
2014-02-15 16:07 ` [Qemu-devel] [PATCH v3 18/31] target-arm: Get MMU index information correct for A64 code Peter Maydell
2014-02-25 23:27   ` Peter Crosthwaite
2014-02-15 16:07 ` [Qemu-devel] [PATCH v3 19/31] target-arm: A64: Implement WFI Peter Maydell
2014-02-25 23:20   ` Peter Crosthwaite
2014-02-15 16:07 ` [Qemu-devel] [PATCH v3 20/31] target-arm: Store AIF bits in env->pstate for AArch32 Peter Maydell
2014-02-25 23:25   ` Peter Crosthwaite
2014-02-15 16:07 ` [Qemu-devel] [PATCH v3 21/31] target-arm: Implement AArch64 DAIF system register Peter Maydell
2014-02-17  0:17   ` Peter Crosthwaite
2014-02-17  8:51     ` Peter Maydell
2014-02-28 13:48     ` Peter Maydell
2014-02-28 23:32       ` Peter Crosthwaite
2014-02-15 16:07 ` [Qemu-devel] [PATCH v3 22/31] target-arm: A64: Implement MSR (immediate) instructions Peter Maydell
2014-02-25  8:32   ` Peter Crosthwaite
2014-02-15 16:07 ` [Qemu-devel] [PATCH v3 23/31] target-arm: Implement AArch64 view of CPACR Peter Maydell
2014-02-25  8:34   ` Peter Crosthwaite
2014-02-15 16:07 ` [Qemu-devel] [PATCH v3 24/31] target-arm: Add utility function for checking AA32/64 state of an EL Peter Maydell
2014-02-25  8:36   ` Peter Crosthwaite
2014-02-15 16:07 ` [Qemu-devel] [PATCH v3 25/31] target-arm: Define exception record for AArch64 exceptions Peter Maydell
2014-02-15 16:07 ` [Qemu-devel] [PATCH v3 26/31] target-arm: Provide correct syndrome information for cpreg access traps Peter Maydell
2014-02-15 16:07 ` [Qemu-devel] [PATCH v3 27/31] target-arm: Add support for generating exceptions with syndrome information Peter Maydell
2014-02-15 16:07 ` [Qemu-devel] [PATCH v3 28/31] target-arm: A64: Correctly fault FP/Neon if CPACR.FPEN set Peter Maydell
2014-02-15 16:07 ` [Qemu-devel] [PATCH v3 29/31] target-arm: A64: Add assertion that FP access was checked Peter Maydell
2014-02-15 16:07 ` [Qemu-devel] [PATCH v3 30/31] target-arm: Fix VFP enables for AArch32 EL0 under AArch64 EL1 Peter Maydell
2014-02-15 16:07 ` [Qemu-devel] [PATCH v3 31/31] target-arm: Add v8 mmu translation support Peter Maydell
2014-02-26  2:49   ` Hu Tao
2014-02-26  3:32     ` Hu Tao
2014-02-26 10:31       ` Peter Maydell
2014-02-26 19:47         ` Rob Herring
2014-03-01 19:58           ` Peter Maydell
2014-02-25 20:16 ` [Qemu-devel] [PATCH v3 00/31] A64 system emulation prequisites Peter Maydell

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=1392480444-25565-7-git-send-email-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=agraf@suse.de \
    --cc=alex.bennee@linaro.org \
    --cc=christoffer.dall@linaro.org \
    --cc=claudio.fontana@linaro.org \
    --cc=dmueller@suse.de \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=laurent.desnogues@gmail.com \
    --cc=matz@suse.de \
    --cc=patches@linaro.org \
    --cc=peter.crosthwaite@xilinx.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rob.herring@linaro.org \
    --cc=rth@twiddle.net \
    --cc=will.newton@linaro.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).