public inbox for qemu-arm@nongnu.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] arm: demuxed ID registers (CCSIDR_EL1)
@ 2026-02-04 13:32 Cornelia Huck
  2026-02-04 13:32 ` [PATCH v2 1/3] arm: handle demuxed ID registers Cornelia Huck
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Cornelia Huck @ 2026-02-04 13:32 UTC (permalink / raw)
  To: qemu-arm, qemu-devel
  Cc: Peter Maydell, Eric Auger, Sebastian Ott, Jonathan Cameron,
	Alireza Sanaee, Cornelia Huck

[previously posted as RFC, but given that I got T-b and R-b, I promoted
it to full v2 :)]

Changes RFC->v2:
- use a proper #define so that it is clearer why we end up with that
  specific array size
- rebased on top of master
- collected T-bs and R-bs (thanks!)

Original cover letter follows. I'm not sure whether the questions contain
any actual blockers, or whether it is easier to just go ahead and deal
with it later.

--------8<---------8<--------

While trying to move to an autogenerated cpu-sysregs.h.inc (so that we
may keep a common view on registers), we should first address the ID
registers that are still kept outside of ARMISARegisters. Other than
DCZID_EL0 (addressed by the series this one goes on top of), that's
the CCSIDR_EL1 values kept in cpu->cssidr[] (indexed via CSSELR_EL1.)

My idea was to provide {GET,SET}_IDREG_DEMUX helper that work similar
to {GET,SET}_IDREG and operate on a two-dimensional array. As a side
effect, this also allows to get the values KVM provides for CCSIDR_EL1
(which are virtualized as well.)

RFC because there are still some open questions:
- The demux array cannot easily be autogenerated. We can get rid of the
  ccsidr[] array, but we now have an autogenerated entry in the non-demux
  array that does nothing. Both are not that nice.
- I'm not sure if we need any compat handling for KVM (on TCG, everything
  should stay the same.) In theory, the KVM interface allows setting
  values from userspace (I didn't try.)
- There's a slight disagreement between the current code (providing 16
  entries for CCSIDR_EL1) and the KVM code (providing (7 cache levels) *
  (data/unified, instruction) = 14 entries.) With FEAT_MTE2, we might be
  needing 7 more entries.

Feedback appreciated.

--------8<---------8<--------

Cornelia Huck (3):
  arm: handle demuxed ID registers
  arm: handle CCSIDR_EL1 as a demuxed register
  arm/kvm: get demuxed ID registers from kvm

 hw/intc/armv7m_nvic.c        |  2 +-
 target/arm/cpu-sysregs.h     | 14 +++++++++
 target/arm/cpu-sysregs.h.inc |  1 +
 target/arm/cpu.h             | 26 ++++++++++++----
 target/arm/cpu64.c           | 12 ++++----
 target/arm/helper.c          |  2 +-
 target/arm/kvm.c             | 33 ++++++++++++++++++++
 target/arm/tcg/cpu32.c       | 32 +++++++++----------
 target/arm/tcg/cpu64.c       | 60 ++++++++++++++++++------------------
 9 files changed, 122 insertions(+), 60 deletions(-)

-- 
2.52.0



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-04-02 15:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-04 13:32 [PATCH v2 0/3] arm: demuxed ID registers (CCSIDR_EL1) Cornelia Huck
2026-02-04 13:32 ` [PATCH v2 1/3] arm: handle demuxed ID registers Cornelia Huck
2026-02-04 13:32 ` [PATCH v2 2/3] arm: handle CCSIDR_EL1 as a demuxed register Cornelia Huck
2026-04-01 16:46   ` Eric Auger
2026-04-02 15:04     ` Cornelia Huck
2026-02-04 13:32 ` [PATCH v2 3/3] arm/kvm: get demuxed ID registers from kvm Cornelia Huck
2026-04-01 17:00   ` Eric Auger
2026-04-02 15:19     ` Cornelia Huck
2026-02-05 11:52 ` [PATCH v2 0/3] arm: demuxed ID registers (CCSIDR_EL1) Peter Maydell
2026-02-05 16:50   ` Cornelia Huck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox