qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: alex.bennee@linaro.org, pbonzini@redhat.com, philmd@linaro.org
Subject: [PATCH v3 10/15] target/arm: Add isar_feature_aa32_a32
Date: Fri, 11 Aug 2023 09:50:47 -0700	[thread overview]
Message-ID: <20230811165052.161080-11-richard.henderson@linaro.org> (raw)
In-Reply-To: <20230811165052.161080-1-richard.henderson@linaro.org>

Add a probe for whether A32 mode is supported.
Fill in the field for the pre-v5 cpus.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/cpu.h       | 5 +++++
 target/arm/tcg/cpu32.c | 7 +++++++
 2 files changed, 12 insertions(+)

diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index 88e5accda6..41d05839a2 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -3462,6 +3462,11 @@ static inline bool isar_feature_aa32_i8mm(const ARMISARegisters *id)
     return FIELD_EX32(id->id_isar6, ID_ISAR6, I8MM) != 0;
 }
 
+static inline bool isar_feature_aa32_a32(const ARMISARegisters *id)
+{
+    return FIELD_EX32(id->id_pfr0, ID_PFR0, STATE0) != 0;
+}
+
 static inline bool isar_feature_aa32_ras(const ARMISARegisters *id)
 {
     return FIELD_EX32(id->id_pfr0, ID_PFR0, RAS) != 0;
diff --git a/target/arm/tcg/cpu32.c b/target/arm/tcg/cpu32.c
index 47d2e8e781..ea8ccf59a9 100644
--- a/target/arm/tcg/cpu32.c
+++ b/target/arm/tcg/cpu32.c
@@ -145,6 +145,8 @@ static void arm926_initfn(Object *obj)
     cpu->isar.mvfr0 = FIELD_DP32(cpu->isar.mvfr0, MVFR0, FPSHVEC, 1);
     cpu->isar.mvfr0 = FIELD_DP32(cpu->isar.mvfr0, MVFR0, FPSP, 1);
     cpu->isar.mvfr0 = FIELD_DP32(cpu->isar.mvfr0, MVFR0, FPDP, 1);
+    /* Similarly, we need to set STATE0 for A32 support.  */
+    cpu->isar.id_pfr0 = FIELD_DP32(cpu->isar.id_pfr0, ID_PFR0, STATE0, 1);
 }
 
 static void arm946_initfn(Object *obj)
@@ -158,6 +160,9 @@ static void arm946_initfn(Object *obj)
     cpu->midr = 0x41059461;
     cpu->ctr = 0x0f004006;
     cpu->reset_sctlr = 0x00000078;
+
+    /* We need to set STATE0 for A32 support. */
+    cpu->isar.id_pfr0 = FIELD_DP32(cpu->isar.id_pfr0, ID_PFR0, STATE0, 1);
 }
 
 static void arm1026_initfn(Object *obj)
@@ -187,6 +192,8 @@ static void arm1026_initfn(Object *obj)
     cpu->isar.mvfr0 = FIELD_DP32(cpu->isar.mvfr0, MVFR0, FPSHVEC, 1);
     cpu->isar.mvfr0 = FIELD_DP32(cpu->isar.mvfr0, MVFR0, FPSP, 1);
     cpu->isar.mvfr0 = FIELD_DP32(cpu->isar.mvfr0, MVFR0, FPDP, 1);
+    /* Similarly, we need to set STATE0 for A32 support.  */
+    cpu->isar.id_pfr0 = FIELD_DP32(cpu->isar.id_pfr0, ID_PFR0, STATE0, 1);
 
     {
         /* The 1026 had an IFAR at c6,c0,0,1 rather than the ARMv6 c6,c0,0,2 */
-- 
2.34.1



  parent reply	other threads:[~2023-08-11 16:52 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-11 16:50 [PATCH v3 00/15] linux-user: Implement VDSOs Richard Henderson
2023-08-11 16:50 ` [PATCH v3 01/15] linux-user: Introduce imgsrc_read, imgsrc_read_alloc Richard Henderson
2023-08-11 16:50 ` [PATCH v3 02/15] linux-user: Tidy loader_exec Richard Henderson
2023-08-11 16:50 ` [PATCH v3 03/15] linux-user: Do not clobber bprm_buf swapping ehdr Richard Henderson
2023-08-11 16:50 ` [PATCH v3 04/15] linux-user: Use ImageSource in load_elf_image Richard Henderson
2023-08-11 16:50 ` [PATCH v3 05/15] linux-user: Use ImageSource in load_symbols Richard Henderson
2023-08-11 16:50 ` [PATCH v3 06/15] linux-user: Replace bprm->fd with bprm->src.fd Richard Henderson
2023-08-11 16:50 ` [PATCH v3 07/15] linux-user: Load vdso image if available Richard Henderson
2023-08-11 16:50 ` [PATCH v3 08/15] linux-user: Add gen-vdso tool Richard Henderson
2023-08-11 16:50 ` [PATCH v3 09/15] linux-user/aarch64: Add vdso and use it for rt_sigreturn Richard Henderson
2023-08-11 16:50 ` Richard Henderson [this message]
2023-08-11 16:50 ` [PATCH v3 11/15] linux-user/arm: " Richard Henderson
2023-08-11 16:50 ` [PATCH v3 12/15] linux-user/hppa: " Richard Henderson
2023-08-11 16:50 ` [PATCH v3 13/15] linux-user/i386: Add vdso and use it for sigreturn Richard Henderson
2023-08-11 16:50 ` [PATCH v3 14/15] linux-user/x86_64: Add vdso Richard Henderson
2023-08-11 16:50 ` [PATCH v3 15/15] linux-user/riscv: Add vdso and use it for sigreturn Richard Henderson
2023-08-14  9:52 ` [PATCH v3 00/15] linux-user: Implement VDSOs Alex Bennée
2023-08-16 18:06   ` Richard Henderson

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=20230811165052.161080-11-richard.henderson@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.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).