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 03/31] target-arm: Implement AArch64 CurrentEL sysreg
Date: Sat, 15 Feb 2014 16:06:56 +0000	[thread overview]
Message-ID: <1392480444-25565-4-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1392480444-25565-1-git-send-email-peter.maydell@linaro.org>

Implement the CurrentEL sysreg.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
---
 target-arm/cpu.h           | 3 ++-
 target-arm/helper.c        | 3 +++
 target-arm/translate-a64.c | 7 +++++++
 3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/target-arm/cpu.h b/target-arm/cpu.h
index 8c4ed0f..632b4d1 100644
--- a/target-arm/cpu.h
+++ b/target-arm/cpu.h
@@ -731,7 +731,8 @@ static inline uint64_t cpreg_to_kvm_id(uint32_t cpregid)
 #define ARM_CP_NOP (ARM_CP_SPECIAL | (1 << 8))
 #define ARM_CP_WFI (ARM_CP_SPECIAL | (2 << 8))
 #define ARM_CP_NZCV (ARM_CP_SPECIAL | (3 << 8))
-#define ARM_LAST_SPECIAL ARM_CP_NZCV
+#define ARM_CP_CURRENTEL (ARM_CP_SPECIAL | (4 << 8))
+#define ARM_LAST_SPECIAL ARM_CP_CURRENTEL
 /* Used only as a terminator for ARMCPRegInfo lists */
 #define ARM_CP_SENTINEL 0xffff
 /* Mask of only the flag bits in a type field */
diff --git a/target-arm/helper.c b/target-arm/helper.c
index 2d573d9..73dcaf6 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -1533,6 +1533,9 @@ static const ARMCPRegInfo v8_cp_reginfo[] = {
       .opc0 = 3, .opc1 = 3, .opc2 = 7, .crn = 0, .crm = 0,
       .access = PL0_R, .type = ARM_CP_CONST,
       .resetvalue = 0x10 },
+    { .name = "CURRENTEL", .state = ARM_CP_STATE_AA64,
+      .opc0 = 3, .opc1 = 0, .opc2 = 2, .crn = 4, .crm = 2,
+      .access = PL1_R, .type = ARM_CP_CURRENTEL },
     REGINFO_SENTINEL
 };
 
diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c
index 3de9cad..7c55a90 100644
--- a/target-arm/translate-a64.c
+++ b/target-arm/translate-a64.c
@@ -1216,6 +1216,13 @@ static void handle_sys(DisasContext *s, uint32_t insn, bool isread,
             gen_set_nzcv(tcg_rt);
         }
         return;
+    case ARM_CP_CURRENTEL:
+        /* Reads as current EL value from pstate, which is
+         * guaranteed to be constant by the tb flags.
+         */
+        tcg_rt = cpu_reg(s, rt);
+        tcg_gen_movi_i64(tcg_rt, s->current_pl << 2);
+        return;
     default:
         break;
     }
-- 
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 ` Peter Maydell [this message]
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 ` [Qemu-devel] [PATCH v3 06/31] target-arm: Implement AArch64 TLB invalidate ops Peter Maydell
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-4-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).