arm: Modify type of actlr to register_t
authorMichal Orzel <michal.orzel@arm.com>
Wed, 5 May 2021 07:43:01 +0000 (09:43 +0200)
committerJulien Grall <jgrall@amazon.com>
Mon, 10 May 2021 17:16:34 +0000 (18:16 +0100)
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.

ACTLR_EL1 system register bits are implementation defined
which means it is possibly a latent bug on current HW as the CPU
implementer may already have decided to use the top 32bit.

Signed-off-by: Michal Orzel <michal.orzel@arm.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
xen/arch/arm/domain.c
xen/include/asm-arm/domain.h

index 621f518b834e991e6cd30c82f14a4248abcd826b..c021a03c619981011f8219330c8e4ebe26df6e5f 100644 (file)
@@ -330,7 +330,7 @@ static void schedule_tail(struct vcpu *prev)
 
 static void continue_new_vcpu(struct vcpu *prev)
 {
-    current->arch.actlr = READ_SYSREG32(ACTLR_EL1);
+    current->arch.actlr = READ_SYSREG(ACTLR_EL1);
     processor_vcpu_initialise(current);
 
     schedule_tail(prev);
index c6b59ee755c2679f7902363b8d14eee8206d6def..2d4f38c6697a0dedb1103d37411997fbf89217d7 100644 (file)
@@ -156,7 +156,7 @@ struct arch_vcpu
 
     /* Control Registers */
     register_t sctlr;
-    uint32_t actlr;
+    register_t actlr;
     uint32_t cpacr;
 
     uint32_t contextidr;