]> xenbits.xensource.com Git - people/dwmw2/xen.git/commitdiff
xen/arm: vsmc: The function identifier is always 32-bit
authorJulien Grall <julien.grall@arm.com>
Thu, 16 May 2019 22:31:46 +0000 (23:31 +0100)
committerStefano Stabellini <sstabellini@kernel.org>
Tue, 29 Oct 2019 18:39:20 +0000 (11:39 -0700)
On Arm64, the SMCCC function identifier is always stored in the first 32-bit
of x0 register. The rest of the bits are not defined and should be
ignored.

This means the variable funcid should be an uint32_t rather than
register_t.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
(cherry picked from commit 7f4217cc60574866cb90d67d9750228c6b86c91e)

xen/arch/arm/vsmc.c

index 40a80d5760e84a71101fd5f0de31ce3081d0e0e3..2f1b608fbd343fdc244666d8391b4c3b7d2af65c 100644 (file)
@@ -181,7 +181,7 @@ static bool vsmccc_handle_call(struct cpu_user_regs *regs)
 {
     bool handled = false;
     const union hsr hsr = { .bits = regs->hsr };
-    register_t funcid = get_user_reg(regs, 0);
+    uint32_t funcid = get_user_reg(regs, 0);
 
     /*
      * Check immediate value for HVC32, HVC64 and SMC64.
@@ -240,7 +240,7 @@ static bool vsmccc_handle_call(struct cpu_user_regs *regs)
 
     if ( !handled )
     {
-        gprintk(XENLOG_INFO, "Unhandled SMC/HVC: %08"PRIregister"\n", funcid);
+        gprintk(XENLOG_INFO, "Unhandled SMC/HVC: %#x\n", funcid);
 
         /* Inform caller that function is not supported. */
         set_user_reg(regs, 0, ARM_SMCCC_ERR_UNKNOWN_FUNCTION);