arm: traps: use only least 32 bits of fid in PSCI handler
authorVolodymyr Babchuk <volodymyr_babchuk@epam.com>
Tue, 10 Oct 2017 15:52:41 +0000 (18:52 +0300)
committerStefano Stabellini <sstabellini@kernel.org>
Wed, 11 Oct 2017 19:39:36 +0000 (12:39 -0700)
According to SMCCC (ARM DEN 0028B, page 12), function id is
stored in least 32 bits of r0/x0 register:

    The least significant 32-bits are used, and the most significant
    32-bits are zero.

Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Acked-by: Julien Grall <julien.grall@arm.com>
xen/arch/arm/traps.c

index 701fdc841d152816799a0b2f3c838eeefcebff2a..0cff83e431fd42d9d6bf45261f7a9191c6444271 100644 (file)
@@ -1463,14 +1463,14 @@ static void do_debug_trap(struct cpu_user_regs *regs, unsigned int code)
 #endif
 
 /* helper function for checking arm mode 32/64 bit */
-static inline int psci_mode_check(struct domain *d, register_t fid)
+static inline int psci_mode_check(struct domain *d, uint32_t fid)
 {
         return !( is_64bit_domain(d)^( (fid & PSCI_0_2_64BIT) >> 30 ) );
 }
 
 static void do_trap_psci(struct cpu_user_regs *regs)
 {
-    register_t fid = PSCI_ARG(regs,0);
+    uint32_t fid = PSCI_ARG32(regs,0);
 
     /* preloading in case psci_mode_check fails */
     PSCI_RESULT_REG(regs) = PSCI_INVALID_PARAMETERS;