target/arm: expose CPUID registers to userspace
commit6c5c0fec29bbfe36c64eca1edfd8455be46b77c6
authorAlex Bennée <alex.bennee@linaro.org>
Fri, 15 Feb 2019 09:56:38 +0000 (15 09:56 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 15 Feb 2019 09:56:38 +0000 (15 09:56 +0000)
treec4a444a50fe3ae3bd222b422c3bf9245ee07860d
parentb5bd7440422bb66deaceb812bb9287a6a3cdf10c
target/arm: expose CPUID registers to userspace

A number of CPUID registers are exposed to userspace by modern Linux
kernels thanks to the "ARM64 CPU Feature Registers" ABI. For QEMU's
user-mode emulation we don't need to emulate the kernels trap but just
return the value the trap would have done. To avoid too much #ifdef
hackery we process ARMCPRegInfo with a new helper (modify_arm_cp_regs)
before defining the registers. The modify routine is driven by a
simple data structure which describes which bits are exported and
which are fixed.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20190205190224.2198-3-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
target/arm/helper.c