All of lore.kernel.org
 help / color / mirror / Atom feed
* HVM smp guest save/restore support
@ 2007-01-23 15:34 Zhai, Edwin
  2007-01-23 15:49 ` Keir Fraser
  0 siblings, 1 reply; 6+ messages in thread
From: Zhai, Edwin @ 2007-01-23 15:34 UTC (permalink / raw)
  To: Keir; +Cc: Tim, xen-devel

Keir,

smp save/restore has been reverted in the changeset 13499:
*****************************************
--- a/xen/common/domain.c       Fri Jan 19 11:58:52 2007 +0000
+++ b/xen/common/domain.c       Fri Jan 19 12:03:51 2007 +0000
@@ -506,14 +506,6 @@ int set_info_guest(struct domain *d,
     if ( rc == 0 )
         rc = arch_set_info_guest(v, c);

-    /*XXX: hvm smp guest restore support */
-    if ( rc == 0 &&
-            v->vcpu_id != 0 &&
-            is_hvm_vcpu(v) &&
-            test_and_clear_bit(_VCPUF_down, &v->vcpu_flags) ) {
-        vcpu_wake(v);
-    }
-
     domain_unpause(d);

     xfree(c.nat);
******************************************

this code wake up all the aps like hvm_bringup_ap, since no IPI for ap when 
restore.
if it's slightly ugly, how about add a similar hypercall like xc_domain_resume?

thanks,


-- 
best rgds,
edwin

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: HVM smp guest save/restore support
  2007-01-23 15:34 HVM smp guest save/restore support Zhai, Edwin
@ 2007-01-23 15:49 ` Keir Fraser
  2007-01-24 13:30   ` Zhai, Edwin
  0 siblings, 1 reply; 6+ messages in thread
From: Keir Fraser @ 2007-01-23 15:49 UTC (permalink / raw)
  To: Zhai, Edwin; +Cc: Tim, xen-devel

On 23/1/07 15:34, "Zhai, Edwin" <edwin.zhai@intel.com> wrote:

> this code wake up all the aps like hvm_bringup_ap, since no IPI for ap when
> restore.
> if it's slightly ugly, how about add a similar hypercall like
> xc_domain_resume?

All hvm vcpu context restore should be done via the new hvm domctl, and the
wakeup of APs can be implemented there (rather than in common/ directory).

 -- Keir

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: HVM smp guest save/restore support
  2007-01-23 15:49 ` Keir Fraser
@ 2007-01-24 13:30   ` Zhai, Edwin
  2007-01-24 18:32     ` Keir Fraser
  0 siblings, 1 reply; 6+ messages in thread
From: Zhai, Edwin @ 2007-01-24 13:30 UTC (permalink / raw)
  To: Keir Fraser; +Cc: Tim, xen-devel, Zhai, Edwin

[-- Attachment #1: Type: text/plain, Size: 287 bytes --]

On Tue, Jan 23, 2007 at 03:49:04PM +0000, Keir Fraser wrote:
> All hvm vcpu context restore should be done via the new hvm domctl, and the
> wakeup of APs can be implemented there (rather than in common/ directory).

how about this patch?
thanks,

> 
>  -- Keir
> 

-- 
best rgds,
edwin

[-- Attachment #2: smp_fix_save_restore.patch --]
[-- Type: text/plain, Size: 538 bytes --]

diff -r bea505a69722 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Tue Jan 23 15:58:05 2007 +0000
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Wed Jan 24 17:37:51 2007 +0800
@@ -659,6 +659,12 @@ int vmx_load_vmcs_ctxt(hvm_domain_contex
         printk("vmx_vmcs restore failed!\n");
         domain_crash(v->domain);
         return -EINVAL;
+    }
+
+    /* wake up this vcpu for smp support */
+    if ( is_hvm_vcpu(v) &&
+            test_and_clear_bit(_VCPUF_down, &v->vcpu_flags) ) {
+        vcpu_wake(v);
     }
 
     return 0;

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Re: HVM smp guest save/restore support
  2007-01-24 13:30   ` Zhai, Edwin
@ 2007-01-24 18:32     ` Keir Fraser
  2007-01-25  3:30       ` Zhai, Edwin
  0 siblings, 1 reply; 6+ messages in thread
From: Keir Fraser @ 2007-01-24 18:32 UTC (permalink / raw)
  To: Zhai, Edwin; +Cc: xen-devel

On 24/1/07 13:30, "Zhai, Edwin" <edwin.zhai@intel.com> wrote:

>> All hvm vcpu context restore should be done via the new hvm domctl, and the
>> wakeup of APs can be implemented there (rather than in common/ directory).
> 
> how about this patch?
> thanks,

This new piece of code is not VMX specific. Define an hvm_load_cpu_ctxt()
function which executes that new piece of code after calling the VMX/SVM
specific hook function. Also you shouldn't need to check if the vcpu is HVM,
as otherwise you wouldn't be in this function!

 -- Keir

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Re: HVM smp guest save/restore support
  2007-01-24 18:32     ` Keir Fraser
@ 2007-01-25  3:30       ` Zhai, Edwin
  2007-01-25 12:29         ` Keir Fraser
  0 siblings, 1 reply; 6+ messages in thread
From: Zhai, Edwin @ 2007-01-25  3:30 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel, Zhai, Edwin

[-- Attachment #1: Type: text/plain, Size: 700 bytes --]

thanks for your comments,
update it.

thanks,

On Wed, Jan 24, 2007 at 06:32:36PM +0000, Keir Fraser wrote:
> On 24/1/07 13:30, "Zhai, Edwin" <edwin.zhai@intel.com> wrote:
> 
> >> All hvm vcpu context restore should be done via the new hvm domctl, and the
> >> wakeup of APs can be implemented there (rather than in common/ directory).
> > 
> > how about this patch?
> > thanks,
> 
> This new piece of code is not VMX specific. Define an hvm_load_cpu_ctxt()
> function which executes that new piece of code after calling the VMX/SVM
> specific hook function. Also you shouldn't need to check if the vcpu is HVM,
> as otherwise you wouldn't be in this function!
> 
>  -- Keir
> 

-- 
best rgds,
edwin

[-- Attachment #2: smp_fix2.patch --]
[-- Type: text/plain, Size: 1015 bytes --]

diff -r bea505a69722 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Tue Jan 23 15:58:05 2007 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Thu Jan 25 10:29:18 2007 +0800
@@ -170,12 +170,27 @@ void hvm_domain_destroy(struct domain *d
         unmap_domain_page_global((void *)d->arch.hvm_domain.buffered_io_va);
 }
 
+int hvm_load_cpu_ctxt(hvm_domain_context_t *h, void *opaque, int version)
+{
+    struct vcpu *v = opaque;
+
+    if ( hvm_funcs.load_cpu_ctxt(h, opaque, version) < 0 )
+        return -EINVAL;
+
+    /* wake up this vcpu for smp support */
+    if ( test_and_clear_bit(_VCPUF_down, &v->vcpu_flags) ) {
+        vcpu_wake(v);
+    }
+
+    return 0;
+}
+
 int hvm_vcpu_initialise(struct vcpu *v)
 {
     int rc;
 
     hvm_register_savevm(v->domain, "xen_hvm_cpu", v->vcpu_id, 1,
-                        hvm_funcs.save_cpu_ctxt, hvm_funcs.load_cpu_ctxt, 
+                        hvm_funcs.save_cpu_ctxt, hvm_load_cpu_ctxt, 
                         (void *)v);
 
     if ( (rc = vlapic_init(v)) != 0 )

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Re: HVM smp guest save/restore support
  2007-01-25  3:30       ` Zhai, Edwin
@ 2007-01-25 12:29         ` Keir Fraser
  0 siblings, 0 replies; 6+ messages in thread
From: Keir Fraser @ 2007-01-25 12:29 UTC (permalink / raw)
  To: Zhai, Edwin; +Cc: xen-devel

Applied, thanks.

On 25/1/07 03:30, "Zhai, Edwin" <edwin.zhai@intel.com> wrote:

> thanks for your comments,
> update it.
> 
> thanks,
> 
> On Wed, Jan 24, 2007 at 06:32:36PM +0000, Keir Fraser wrote:
>> On 24/1/07 13:30, "Zhai, Edwin" <edwin.zhai@intel.com> wrote:
>> 
>>>> All hvm vcpu context restore should be done via the new hvm domctl, and the
>>>> wakeup of APs can be implemented there (rather than in common/ directory).
>>> 
>>> how about this patch?
>>> thanks,
>> 
>> This new piece of code is not VMX specific. Define an hvm_load_cpu_ctxt()
>> function which executes that new piece of code after calling the VMX/SVM
>> specific hook function. Also you shouldn't need to check if the vcpu is HVM,
>> as otherwise you wouldn't be in this function!
>> 
>>  -- Keir
>> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-01-25 12:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-23 15:34 HVM smp guest save/restore support Zhai, Edwin
2007-01-23 15:49 ` Keir Fraser
2007-01-24 13:30   ` Zhai, Edwin
2007-01-24 18:32     ` Keir Fraser
2007-01-25  3:30       ` Zhai, Edwin
2007-01-25 12:29         ` Keir Fraser

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.