From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 09/27] target/arm: expose remaining CPUID registers as RAZ
Date: Thu, 14 Feb 2019 19:05:45 +0000 [thread overview]
Message-ID: <20190214190603.25030-10-peter.maydell@linaro.org> (raw)
In-Reply-To: <20190214190603.25030-1-peter.maydell@linaro.org>
From: Alex Bennée <alex.bennee@linaro.org>
There are a whole bunch more registers in the CPUID space which are
currently not used but are exposed as RAZ. To avoid too much
duplication we expand ARMCPRegUserSpaceInfo to understand glob
patterns so we only need one entry to tweak whole ranges of registers.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20190205190224.2198-5-alex.bennee@linaro.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
target/arm/cpu.h | 3 +++
target/arm/helper.c | 26 +++++++++++++++++++++++---
2 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index 7c31e5a2d10..f0334413ece 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -2474,6 +2474,9 @@ typedef struct ARMCPRegUserSpaceInfo {
/* Name of register */
const char *name;
+ /* Is the name actually a glob pattern */
+ bool is_glob;
+
/* Only some bits are exported to user space */
uint64_t exported_bits;
diff --git a/target/arm/helper.c b/target/arm/helper.c
index 77c73056948..5ac335f598c 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -6109,19 +6109,27 @@ void register_cp_regs_for_features(ARMCPU *cpu)
.fixed_bits = 0x0000000000000011 },
{ .name = "ID_AA64PFR1_EL1",
.exported_bits = 0x00000000000000f0 },
+ { .name = "ID_AA64PFR*_EL1_RESERVED",
+ .is_glob = true },
{ .name = "ID_AA64ZFR0_EL1" },
{ .name = "ID_AA64MMFR0_EL1",
.fixed_bits = 0x00000000ff000000 },
{ .name = "ID_AA64MMFR1_EL1" },
+ { .name = "ID_AA64MMFR*_EL1_RESERVED",
+ .is_glob = true },
{ .name = "ID_AA64DFR0_EL1",
.fixed_bits = 0x0000000000000006 },
{ .name = "ID_AA64DFR1_EL1" },
- { .name = "ID_AA64AFR0_EL1" },
- { .name = "ID_AA64AFR1_EL1" },
+ { .name = "ID_AA64DFR*_EL1_RESERVED",
+ .is_glob = true },
+ { .name = "ID_AA64AFR*",
+ .is_glob = true },
{ .name = "ID_AA64ISAR0_EL1",
.exported_bits = 0x00fffffff0fffff0 },
{ .name = "ID_AA64ISAR1_EL1",
.exported_bits = 0x000000f0ffffffff },
+ { .name = "ID_AA64ISAR*_EL1_RESERVED",
+ .is_glob = true },
REGUSERINFO_SENTINEL
};
modify_arm_cp_regs(v8_idregs, v8_user_idregs);
@@ -7020,8 +7028,17 @@ void modify_arm_cp_regs(ARMCPRegInfo *regs, const ARMCPRegUserSpaceInfo *mods)
ARMCPRegInfo *r;
for (m = mods; m->name; m++) {
+ GPatternSpec *pat = NULL;
+ if (m->is_glob) {
+ pat = g_pattern_spec_new(m->name);
+ }
for (r = regs; r->type != ARM_CP_SENTINEL; r++) {
- if (strcmp(r->name, m->name) == 0) {
+ if (pat && g_pattern_match_string(pat, r->name)) {
+ r->type = ARM_CP_CONST;
+ r->access = PL0U_R;
+ r->resetvalue = 0;
+ /* continue */
+ } else if (strcmp(r->name, m->name) == 0) {
r->type = ARM_CP_CONST;
r->access = PL0U_R;
r->resetvalue &= m->exported_bits;
@@ -7029,6 +7046,9 @@ void modify_arm_cp_regs(ARMCPRegInfo *regs, const ARMCPRegUserSpaceInfo *mods)
break;
}
}
+ if (pat) {
+ g_pattern_spec_free(pat);
+ }
}
}
--
2.20.1
next prev parent reply other threads:[~2019-02-14 19:06 UTC|newest]
Thread overview: 63+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-14 19:05 [Qemu-devel] [PULL 00/27] target-arm queue Peter Maydell
2019-02-14 19:05 ` [Qemu-devel] [PULL 01/27] target/arm: Fix CRn to be 14 for PMEVTYPER/PMEVCNTR Peter Maydell
2019-02-14 19:05 ` [Qemu-devel] [PULL 02/27] target/arm: Implement HACR_EL2 Peter Maydell
2019-02-14 19:05 ` [Qemu-devel] [PULL 03/27] target/arm: Fix int128_make128 lo, hi order in paired_cmpxchg64_be Peter Maydell
2019-02-14 19:05 ` [Qemu-devel] [PULL 04/27] target/arm: Force result size into dp after operation Peter Maydell
2019-02-14 19:05 ` [Qemu-devel] [PULL 05/27] target/arm: Restructure disas_fp_int_conv Peter Maydell
2019-02-14 19:05 ` [Qemu-devel] [PULL 06/27] target/arm: relax permission checks for HWCAP_CPUID registers Peter Maydell
2019-02-14 19:05 ` [Qemu-devel] [PULL 07/27] target/arm: expose CPUID registers to userspace Peter Maydell
2019-02-14 19:05 ` [Qemu-devel] [PULL 08/27] target/arm: expose MPIDR_EL1 " Peter Maydell
2019-02-14 19:05 ` Peter Maydell [this message]
2019-02-14 19:05 ` [Qemu-devel] [PULL 10/27] linux-user/elfload: enable HWCAP_CPUID for AArch64 Peter Maydell
2019-02-14 19:05 ` [Qemu-devel] [PULL 11/27] arm: Allow system registers for KVM guests to be changed by QEMU code Peter Maydell
2019-02-21 14:20 ` Auger Eric
2019-02-21 14:23 ` Peter Maydell
2019-02-21 14:26 ` Peter Maydell
2019-02-21 14:55 ` Auger Eric
2019-03-08 15:53 ` Peter Maydell
2019-03-08 16:54 ` Auger Eric
2019-02-21 14:42 ` Alex Bennée
2019-02-26 16:53 ` Peter Maydell
2019-03-11 13:26 ` Peter Maydell
2019-03-11 14:54 ` Auger Eric
2019-03-11 14:55 ` Peter Maydell
2019-03-11 15:09 ` Auger Eric
2019-03-11 16:07 ` Peter Maydell
2019-02-14 19:05 ` [Qemu-devel] [PULL 12/27] MAINTAINERS: Remove Peter Crosthwaite from various entries Peter Maydell
2019-02-14 19:05 ` [Qemu-devel] [PULL 13/27] hw/intc/armv7m_nvic: Allow byte accesses to SHPR1 Peter Maydell
2019-02-14 19:05 ` [Qemu-devel] [PULL 14/27] hw/arm/armsse: Fix miswiring of expansion IRQs Peter Maydell
2019-02-14 19:05 ` [Qemu-devel] [PULL 15/27] target/arm: Rely on optimization within tcg_gen_gvec_or Peter Maydell
2019-02-14 19:05 ` [Qemu-devel] [PULL 16/27] target/arm: Use vector minmax expanders for aarch64 Peter Maydell
2019-02-14 19:05 ` [Qemu-devel] [PULL 17/27] target/arm: Use vector minmax expanders for aarch32 Peter Maydell
2019-02-14 19:05 ` [Qemu-devel] [PULL 18/27] target/arm: Use tcg integer min/max primitives for neon Peter Maydell
2019-02-14 19:05 ` [Qemu-devel] [PULL 19/27] target/arm: Remove neon min/max helpers Peter Maydell
2019-02-14 19:05 ` [Qemu-devel] [PULL 20/27] target/arm: Fix vfp_gdb_get/set_reg vs FPSCR Peter Maydell
2019-02-14 19:05 ` [Qemu-devel] [PULL 21/27] target/arm: Fix arm_cpu_dump_state " Peter Maydell
2019-02-14 19:05 ` [Qemu-devel] [PULL 22/27] target/arm: Split out flags setting from vfp compares Peter Maydell
2019-02-14 19:05 ` [Qemu-devel] [PULL 23/27] target/arm: Fix set of bits kept in xregs[ARM_VFP_FPSCR] Peter Maydell
2019-02-14 19:06 ` [Qemu-devel] [PULL 24/27] target/arm: Split out FPSCR.QC to a vector field Peter Maydell
2019-02-14 19:06 ` [Qemu-devel] [PULL 25/27] target/arm: Use vector operations for saturation Peter Maydell
2019-02-14 19:06 ` [Qemu-devel] [PULL 26/27] target/arm: Add missing clear_tail calls Peter Maydell
2019-02-14 19:06 ` [Qemu-devel] [PULL 27/27] gdbstub: Send a reply to the vKill packet Peter Maydell
2019-02-14 19:56 ` [Qemu-devel] [PULL 00/27] target-arm queue no-reply
2019-02-14 20:30 ` no-reply
2019-02-14 20:57 ` no-reply
2019-02-14 21:24 ` no-reply
2019-02-14 21:51 ` no-reply
2019-02-14 22:18 ` no-reply
2019-02-14 23:39 ` no-reply
2019-02-15 0:07 ` no-reply
2019-02-15 0:11 ` no-reply
2019-02-15 0:34 ` no-reply
2019-02-15 0:38 ` no-reply
2019-02-15 1:01 ` no-reply
2019-02-15 1:20 ` no-reply
2019-02-15 1:24 ` no-reply
2019-02-15 1:28 ` no-reply
2019-02-15 1:32 ` no-reply
2019-02-15 1:48 ` no-reply
2019-02-15 1:56 ` no-reply
2019-02-15 2:15 ` no-reply
2019-02-15 2:19 ` no-reply
2019-02-15 2:24 ` no-reply
2019-02-15 2:43 ` no-reply
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=20190214190603.25030-10-peter.maydell@linaro.org \
--to=peter.maydell@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).