WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-3.0-testing] [HVM][AMD] Support HVM SMP guests on A

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.0-testing] [HVM][AMD] Support HVM SMP guests on AMD Pacifica hardware (svm platform).
From: Xen patchbot-3.0-testing <patchbot-3.0-testing@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 03 Jun 2006 00:01:23 +0000
Delivery-date: Fri, 02 Jun 2006 17:03:12 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID e38c8c6429eadb7cac129c949e6203d1008cc470
# Parent  d316d7faf64e7240c748acb598eb0cf83d86c536
[HVM][AMD] Support HVM SMP guests on AMD Pacifica hardware (svm platform).
Signed-off-by: K. Y. Srinivasan <ksrinivasan@xxxxxxxxxx>
xen-unstable changeset:   10180:e0ec3587a2f03d14e55862311f0a0be9f833d6c0
xen-unstable date:        Tue May 30 12:32:07 2006 +0100
---
 xen/arch/x86/hvm/svm/svm.c |   54 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 54 insertions(+)

diff -r d316d7faf64e -r e38c8c6429ea xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c        Wed May 31 07:32:55 2006 +0100
+++ b/xen/arch/x86/hvm/svm/svm.c        Wed May 31 07:33:28 2006 +0100
@@ -74,6 +74,9 @@ void svm_dump_regs(const char *from, str
 void svm_dump_regs(const char *from, struct cpu_user_regs *regs);
 
 static void svm_relinquish_guest_resources(struct domain *d);
+static int svm_do_vmmcall_reset_to_realmode(struct vcpu *v,
+        struct cpu_user_regs *regs);
+
 
 
 extern void set_hsa_to_guest( struct arch_svm_struct *arch_svm );
@@ -438,6 +441,42 @@ unsigned long svm_get_ctrl_reg(struct vc
     return 0;                   /* dummy */
 }
 
+
+/* SVM-specific intitialization code for VCPU application processors */
+void svm_init_ap_context(struct vcpu_guest_context *ctxt, 
+        int vcpuid, int trampoline_vector)
+{
+    int i;
+    struct vcpu *v, *bsp = current;
+    struct domain *d = bsp->domain;
+    cpu_user_regs_t *regs;;
+
+  
+    if ((v = d->vcpu[vcpuid]) == NULL)
+    {
+        printk("vcpuid %d is invalid!  good-bye.\n", vcpuid);
+        domain_crash_synchronous();
+    }
+    regs = &v->arch.guest_context.user_regs;
+
+    memset(ctxt, 0, sizeof(*ctxt));
+    for (i = 0; i < 256; ++i)
+    {
+        ctxt->trap_ctxt[i].vector = i;
+        ctxt->trap_ctxt[i].cs = FLAT_KERNEL_CS;
+    }
+
+
+    /*
+     * We execute the trampoline code in real mode. The trampoline vector
+     * passed to us is page alligned and is the physicall frame number for
+     * the code. We will execute this code in real mode. 
+     */
+    ctxt->user_regs.eip = 0x0;
+    ctxt->user_regs.cs = (trampoline_vector << 8); 
+    ctxt->flags = VGCF_HVM_GUEST;
+}
+
 int start_svm(void)
 {
     u32 eax, ecx, edx;
@@ -484,6 +523,7 @@ int start_svm(void)
     hvm_funcs.paging_enabled = svm_paging_enabled;
     hvm_funcs.instruction_length = svm_instruction_length;
     hvm_funcs.get_guest_ctrl_reg = svm_get_ctrl_reg;
+    hvm_funcs.init_ap_context = svm_init_ap_context;
 
     hvm_enabled = 1;    
 
@@ -660,6 +700,20 @@ static void arch_svm_do_launch(struct vc
     if (svm_dbg_on)
         svm_dump_host_regs(__func__);
 #endif
+    if (v->vcpu_id != 0) 
+    {
+       u16     cs_sel = regs->cs;
+       /*
+        * This is the launch of an AP; set state so that we begin executing
+        * the trampoline code in real-mode.
+        */
+       svm_do_vmmcall_reset_to_realmode(v, regs);      
+       /* Adjust the state to execute the trampoline code.*/
+       v->arch.hvm_svm.vmcb->rip = 0;
+       v->arch.hvm_svm.vmcb->cs.sel= cs_sel;
+       v->arch.hvm_svm.vmcb->cs.base = (cs_sel << 4);
+    }
+       
     reset_stack_and_jump(svm_asm_do_launch);
 }
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.0-testing] [HVM][AMD] Support HVM SMP guests on AMD Pacifica hardware (svm platform)., Xen patchbot-3 . 0-testing <=