arm64: Change type of hsr, cpsr, spsr_el1 to uint64_t
authorMichal Orzel <michal.orzel@arm.com>
Mon, 5 Jul 2021 06:39:52 +0000 (08:39 +0200)
committerJulien Grall <jgrall@amazon.com>
Tue, 6 Jul 2021 09:02:00 +0000 (10:02 +0100)
commit918b8842a852e0e7446286f546724b1c63c56c66
tree28981d78e2f82480d2dabfd07f628b4be971e08d
parent4473f3601098a2c3cf5ab89d5a29504772985e3a
arm64: Change type of hsr, cpsr, spsr_el1 to uint64_t

AArch64 registers are 64bit whereas AArch32 registers
are 32bit or 64bit. MSR/MRS are expecting 64bit values thus
we should get rid of helpers READ/WRITE_SYSREG32
in favour of using READ/WRITE_SYSREG.
We should also use register_t type when reading sysregs
which can correspond to uint64_t or uint32_t.
Even though many AArch64 registers have upper 32bit reserved
it does not mean that they can't be widen in the future.

Modify type of hsr, cpsr, spsr_el1 to uint64_t.
Previously we relied on the padding after spsr_el1.
As we removed the padding, modify the union to be 64bit so we don't corrupt spsr_fiq.
No need to modify the assembly code because the accesses were based on 64bit
registers as there was a 32bit padding after spsr_el1.

Remove 32bit padding in cpu_user_regs before spsr_fiq
as it is no longer needed due to upper union being 64bit now.
Add 64bit padding in cpu_user_regs before spsr_el1
because the kernel frame should be 16-byte aligned.

Change type of cpsr to uint64_t in the public outside interface
"public/arch-arm.h" to allow ABI compatibility between 32bit and 64bit.
Increment XEN_DOMCTL_INTERFACE_VERSION.

Change type of cpsr to uint64_t in the public outside interface
"public/vm_event.h" to allow ABI compatibility between 32bit and 64bit.

Signed-off-by: Michal Orzel <michal.orzel@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
xen/arch/arm/arm64/entry.S
xen/arch/arm/arm64/traps.c
xen/arch/arm/arm64/vsysreg.c
xen/arch/arm/domain.c
xen/arch/arm/traps.c
xen/arch/arm/vcpreg.c
xen/include/asm-arm/arm64/processor.h
xen/include/asm-arm/hsr.h
xen/include/public/arch-arm.h
xen/include/public/domctl.h
xen/include/public/vm_event.h