[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [RFC 09/10] xen/arm: Remove the C version of do_trap_hypercall



This has been fully implemented in assembly so it's not necessary to
keep it anymore.

Signed-off-by: Julien Grall <julien.grall@xxxxxxxxxx>

---

    It's possible to factorize the code to handle HVC32/HVC64, but this will
    be done in the next patch.
---
 xen/arch/arm/traps.c | 74 ++++++----------------------------------------------
 1 file changed, 8 insertions(+), 66 deletions(-)

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index cc67d23..3cd8992 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -1335,70 +1335,6 @@ static void do_trap_psci(struct cpu_user_regs *regs)
     }
 }
 
-#ifdef CONFIG_ARM_64
-#define HYPERCALL_RESULT_REG(r) (r)->x0
-#define HYPERCALL_ARG1(r) (r)->x0
-#define HYPERCALL_ARG2(r) (r)->x1
-#define HYPERCALL_ARG3(r) (r)->x2
-#define HYPERCALL_ARG4(r) (r)->x3
-#define HYPERCALL_ARG5(r) (r)->x4
-#define HYPERCALL_ARGS(r) (r)->x0, (r)->x1, (r)->x2, (r)->x3, (r)->x4
-#else
-#define HYPERCALL_RESULT_REG(r) (r)->r0
-#define HYPERCALL_ARG1(r) (r)->r0
-#define HYPERCALL_ARG2(r) (r)->r1
-#define HYPERCALL_ARG3(r) (r)->r2
-#define HYPERCALL_ARG4(r) (r)->r3
-#define HYPERCALL_ARG5(r) (r)->r4
-#define HYPERCALL_ARGS(r) (r)->r0, (r)->r1, (r)->r2, (r)->r3, (r)->r4
-#endif
-
-static void do_trap_hypercall(struct cpu_user_regs *regs, register_t *nr,
-                              unsigned long iss)
-{
-#ifndef NDEBUG
-    register_t orig_pc = regs->pc;
-#endif
-
-    if ( iss != XEN_HYPERCALL_TAG )
-        domain_crash_synchronous();
-
-    if ( *nr >= NR_hypercalls )
-    {
-        perfc_incr(invalid_hypercalls);
-        HYPERCALL_RESULT_REG(regs) = -ENOSYS;
-        return;
-    }
-
-    perfc_incra(hypercalls, *nr);
-
-    HYPERCALL_RESULT_REG(regs) = do_dispatch_hypercall(HYPERCALL_ARGS(regs),
-                                                       *nr);
-
-#ifndef NDEBUG
-    /*
-     * Clobber argument registers only if pc is unchanged, otherwise
-     * this is a hypercall continuation.
-     */
-    if ( orig_pc == regs->pc )
-    {
-        switch ( hypercall_args_table[*nr] ) {
-        case 5: HYPERCALL_ARG5(regs) = 0xDEADBEEF;
-        case 4: HYPERCALL_ARG4(regs) = 0xDEADBEEF;
-        case 3: HYPERCALL_ARG3(regs) = 0xDEADBEEF;
-        case 2: HYPERCALL_ARG2(regs) = 0xDEADBEEF;
-        case 1: /* Don't clobber x0/r0 -- it's the return value */
-            break;
-        case 0:
-            ASSERT(hypercall_table[*nr] == do_ni_hypercall);
-            break;
-        default: BUG();
-        }
-        *nr = 0xDEADBEEF;
-    }
-#endif
-}
-
 static bool_t check_multicall_32bit_clean(struct multicall_entry *multi)
 {
     int i;
@@ -2476,7 +2412,10 @@ asmlinkage void do_trap_hypervisor(struct cpu_user_regs 
*regs)
 #endif
         if ( hsr.iss == 0 )
             return do_trap_psci(regs);
-        do_trap_hypercall(regs, (register_t *)&regs->r12, hsr.iss);
+
+        /* The ISS is not supported */
+        domain_crash_synchronous();
+
         break;
 #ifdef CONFIG_ARM_64
     case HSR_EC_HVC64:
@@ -2488,7 +2427,10 @@ asmlinkage void do_trap_hypervisor(struct cpu_user_regs 
*regs)
 #endif
         if ( hsr.iss == 0 )
             return do_trap_psci(regs);
-        do_trap_hypercall(regs, &regs->x16, hsr.iss);
+
+        /* The ISS is not supported */
+        domain_crash_synchronous();
+
         break;
     case HSR_EC_SMC64:
         /*
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.