xen/arm64: Remove vreg_emulate_sysreg32
authorMichal Orzel <michal.orzel@arm.com>
Thu, 29 Jul 2021 10:42:58 +0000 (12:42 +0200)
committerJulien Grall <jgrall@amazon.com>
Mon, 6 Sep 2021 17:45:13 +0000 (17:45 +0000)
commit6c27a8da8d2024aa78a9ec67bcfb18c123e84a17
tree70e83ee51f5cb2c681539329d71a5dfaf445b666
parent2d4978ead4b98452bc45ebe47952e524b12e2b41
xen/arm64: Remove vreg_emulate_sysreg32

According to ARMv8A architecture, AArch64 registers are 64bit wide
even though in many cases the upper 32bit is reserved. Therefore there
is no need for function vreg_emulate_sysreg32 on arm64. This means
that we can have just one function vreg_emulate_sysreg using new
function pointer:

typedef bool (*vreg_reg_fn_t)(struct cpu_user_regs *regs,
                              register_t *r, bool read);

Modify vreg_emulate_cp32 to use the new function pointer as well.

This change allows to properly use 64bit registers in AArch64 state.
In case of AArch32 the documentation (D1.20.2, DDI 0487A.j) states
that "the upper 32 bits either become zero, or hold the value that
the same architectural register held before any AArch32 execution." As
the choice between them is IMPLEMENTATION DEFINED we cannot assume they
are zeroed. Xen should ensure that but currently it does not. This is
not a new bug and must be fixed as agreed during a discussion over this
patch.

Take the opportunity to switch CNTx_CTL_* to use UL to avoid any
surprise with the negation of any bits (as used in vtimer_cntp_ctl)

Signed-off-by: Michal Orzel <michal.orzel@arm.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
xen/arch/arm/arm64/vsysreg.c
xen/arch/arm/vcpreg.c
xen/arch/arm/vgic-v3.c
xen/arch/arm/vtimer.c
xen/include/asm-arm/processor.h
xen/include/asm-arm/vreg.h