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

[Xen-changelog] [IA64] Add sal emulation to VTI domain



# HG changeset patch
# User awilliam@xxxxxxxxxxx
# Node ID a9d58ef8e4e7ee24fcb2e0c9527390bab14c647c
# Parent  380f87e8003fc9ce6235c7fcd9972ecb749f0a86
[IA64] Add sal emulation to VTI domain

Signed-off-by Anthony.xu <anthony.xu@xxxxxxxxx>
---
 xen/arch/ia64/vmx/pal_emul.c    |   20 +++++++-
 xen/arch/ia64/vmx/vmx_process.c |   92 +++-------------------------------------
 xen/include/asm-ia64/vmx_pal.h  |    1 
 3 files changed, 28 insertions(+), 85 deletions(-)

diff -r 380f87e8003f -r a9d58ef8e4e7 xen/arch/ia64/vmx/pal_emul.c
--- a/xen/arch/ia64/vmx/pal_emul.c      Wed May 31 11:27:59 2006 -0600
+++ b/xen/arch/ia64/vmx/pal_emul.c      Wed May 31 11:28:03 2006 -0600
@@ -21,6 +21,7 @@
 #include <asm/vmx_vcpu.h>
 #include <asm/pal.h>
 #include <asm/sal.h>
+#include <asm/dom_fw.h>
 #include <asm/tlb.h>
 #include <asm/vmx_mm_def.h>
 
@@ -42,7 +43,14 @@ set_pal_result (VCPU *vcpu,struct ia64_p
        vcpu_set_gr(vcpu,11, result.v2,0);
 }
 
-
+static void
+set_sal_result (VCPU *vcpu,struct sal_ret_values result) {
+
+       vcpu_set_gr(vcpu,8, result.r8,0);
+       vcpu_set_gr(vcpu,9, result.r9,0);
+       vcpu_set_gr(vcpu,10, result.r10,0);
+       vcpu_set_gr(vcpu,11, result.r11,0);
+}
 static struct ia64_pal_retval
 pal_cache_flush (VCPU *vcpu) {
        UINT64 gr28,gr29, gr30, gr31;
@@ -450,4 +458,12 @@ pal_emul( VCPU *vcpu) {
                set_pal_result (vcpu, result);
 }
 
-
+void
+sal_emul(VCPU *v) {
+       struct sal_ret_values result;
+       result = sal_emulator(vcpu_get_gr(v,32),vcpu_get_gr(v,33),
+                             vcpu_get_gr(v,34),vcpu_get_gr(v,35),
+                             vcpu_get_gr(v,36),vcpu_get_gr(v,37),
+                             vcpu_get_gr(v,38),vcpu_get_gr(v,39));
+       set_sal_result(v, result);      
+}
diff -r 380f87e8003f -r a9d58ef8e4e7 xen/arch/ia64/vmx/vmx_process.c
--- a/xen/arch/ia64/vmx/vmx_process.c   Wed May 31 11:27:59 2006 -0600
+++ b/xen/arch/ia64/vmx/vmx_process.c   Wed May 31 11:28:03 2006 -0600
@@ -64,6 +64,7 @@ extern void ivhpt_fault (VCPU *vcpu, u64
 extern void ivhpt_fault (VCPU *vcpu, u64 vadr);
 
 #define DOMN_PAL_REQUEST    0x110000
+#define DOMN_SAL_REQUEST    0x110001
 
 static UINT64 vec2off[68] = {0x0,0x400,0x800,0xc00,0x1000, 0x1400,0x1800,
     0x1c00,0x2000,0x2400,0x2800,0x2c00,0x3000,0x3400,0x3800,0x3c00,0x4000,
@@ -96,85 +97,6 @@ void vmx_reflect_interruption(UINT64 ifa
     inject_guest_interruption(vcpu, vector);
 }
 
-static void
-vmx_handle_hypercall (VCPU *v, REGS *regs)
-{
-    struct ia64_pal_retval y;
-    struct sal_ret_values x;
-    unsigned long i, sal_param[8];
-
-    switch (regs->r2) {
-        case FW_HYPERCALL_PAL_CALL:
-            //printf("*** PAL hypercall: index=%d\n",regs->r28);
-            //FIXME: This should call a C routine
-            y = pal_emulator_static(VCPU(v, vgr[12]));
-            regs->r8 = y.status; regs->r9 = y.v0;
-            regs->r10 = y.v1; regs->r11 = y.v2;
-#if 0
-            if (regs->r8)
-                printk("Failed vpal emulation, with index:0x%lx\n",
-                       VCPU(v, vgr[12]));
-#endif
-            break;
-        case FW_HYPERCALL_SAL_CALL:
-            for (i = 0; i < 8; i++)
-                vcpu_get_gr_nat(v, 32+i, &sal_param[i]);
-            x = sal_emulator(sal_param[0], sal_param[1],
-                             sal_param[2], sal_param[3],
-                             sal_param[4], sal_param[5],
-                             sal_param[6], sal_param[7]);
-            regs->r8 = x.r8; regs->r9 = x.r9;
-            regs->r10 = x.r10; regs->r11 = x.r11;
-#if 0
-            if (regs->r8)
-                printk("Failed vsal emulation, with index:0x%lx\n",
-                       sal_param[0]);
-#endif
-            break;
-        case FW_HYPERCALL_EFI_RESET_SYSTEM:
-            printf("efi.reset_system called ");
-            if (current->domain == dom0) {
-                printf("(by dom0)\n ");
-                (*efi.reset_system)(EFI_RESET_WARM,0,0,NULL);
-            }
-            printf("(not supported for non-0 domain)\n");
-            regs->r8 = EFI_UNSUPPORTED;
-            break;
-        case FW_HYPERCALL_EFI_GET_TIME:
-            {
-                unsigned long *tv, *tc;
-                vcpu_get_gr_nat(v, 32, (u64 *)&tv);
-                vcpu_get_gr_nat(v, 33, (u64 *)&tc);
-                printf("efi_get_time(%p,%p) called...",tv,tc);
-                tv = __va(translate_domain_mpaddr((unsigned long)tv));
-                if (tc) tc = __va(translate_domain_mpaddr((unsigned long)tc));
-                regs->r8 = (*efi.get_time)((efi_time_t *)tv,(efi_time_cap_t 
*)tc);
-                printf("and returns %lx\n",regs->r8);
-            }
-            break;
-        case FW_HYPERCALL_EFI_SET_TIME:
-        case FW_HYPERCALL_EFI_GET_WAKEUP_TIME:
-        case FW_HYPERCALL_EFI_SET_WAKEUP_TIME:
-            // FIXME: need fixes in efi.h from 2.6.9
-        case FW_HYPERCALL_EFI_SET_VIRTUAL_ADDRESS_MAP:
-            // FIXME: WARNING!! IF THIS EVER GETS IMPLEMENTED
-            // SOME OF THE OTHER EFI EMULATIONS WILL CHANGE AS
-            // POINTER ARGUMENTS WILL BE VIRTUAL!!
-        case FW_HYPERCALL_EFI_GET_VARIABLE:
-            // FIXME: need fixes in efi.h from 2.6.9
-        case FW_HYPERCALL_EFI_GET_NEXT_VARIABLE:
-        case FW_HYPERCALL_EFI_SET_VARIABLE:
-        case FW_HYPERCALL_EFI_GET_NEXT_HIGH_MONO_COUNT:
-            // FIXME: need fixes in efi.h from 2.6.9
-            regs->r8 = EFI_UNSUPPORTED;
-            break;
-    }
-#if 0
-    if (regs->r8)
-        printk("Failed vgfw emulation, with index:0x%lx\n",
-               regs->r2);
-#endif
-}
 
 IA64FAULT
 vmx_ia64_handle_break (unsigned long ifa, struct pt_regs *regs, unsigned long 
isr, unsigned long iim)
@@ -197,13 +119,17 @@ vmx_ia64_handle_break (unsigned long ifa
         if (!user_mode(regs)) {
             /* Allow hypercalls only when cpl = 0.  */
             if (iim == d->arch.breakimm) {
-                vmx_handle_hypercall (v ,regs);
-                vmx_vcpu_increment_iip(current);
+                ia64_hypercall(regs);
+                vmx_vcpu_increment_iip(v);
                 return IA64_NO_FAULT;
             }
             else if(iim == DOMN_PAL_REQUEST){
-                pal_emul(current);
-                vmx_vcpu_increment_iip(current);
+                pal_emul(v);
+                vmx_vcpu_increment_iip(v);
+                return IA64_NO_FAULT;
+            }else if(iim == DOMN_SAL_REQUEST){
+                sal_emul(v);
+                vmx_vcpu_increment_iip(v);
                 return IA64_NO_FAULT;
             }
         }
diff -r 380f87e8003f -r a9d58ef8e4e7 xen/include/asm-ia64/vmx_pal.h
--- a/xen/include/asm-ia64/vmx_pal.h    Wed May 31 11:27:59 2006 -0600
+++ b/xen/include/asm-ia64/vmx_pal.h    Wed May 31 11:28:03 2006 -0600
@@ -115,6 +115,7 @@ ia64_pal_vp_save (u64 *vpd, u64 pal_proc
        return iprv.status;
 }
 extern void pal_emul(struct vcpu *vcpu);
+extern void sal_emul(struct vcpu *vcpu);
 #define PAL_PROC_VM_BIT                (1UL << 40)
 #define PAL_PROC_VMSW_BIT      (1UL << 54)
 #endif /* _ASM_IA64_VT_PAL_H */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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