All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for 4.9 and older] x86: don't enable XPTI on idle domain
@ 2018-05-30  8:55 Jan Beulich
  2018-05-30 10:04 ` Andrew Cooper
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Beulich @ 2018-05-30  8:55 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper

While the involved code (in pv_domain_initialise()) sits behind an
!is_idle_domain() check already, we need to add one here.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
The further backport to 4.8 and older is going to look quite a bit
different; a one-liner looks to suffice there.

--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -714,20 +714,15 @@ int arch_domain_create(struct domain *d,
         if ( (rc = hvm_domain_initialise(d)) != 0 )
             goto fail;
     }
-    else
+    else if ( !is_idle_domain(d) )
     {
         static const struct arch_csw pv_csw = {
             .from = paravirt_ctxt_switch_from,
             .to   = paravirt_ctxt_switch_to,
             .tail = continue_nonidle_domain,
         };
-        static const struct arch_csw idle_csw = {
-            .from = paravirt_ctxt_switch_from,
-            .to   = paravirt_ctxt_switch_to,
-            .tail = continue_idle_domain,
-        };
 
-        d->arch.ctxt_switch = is_idle_domain(d) ? &idle_csw : &pv_csw;
+        d->arch.ctxt_switch = &pv_csw;
 
         /* 64-bit PV guest by default. */
         d->arch.is_32bit_pv = d->arch.has_32bit_shinfo = 0;
@@ -758,6 +753,16 @@ int arch_domain_create(struct domain *d,
                 break;
             }
     }
+    else
+    {
+        static const struct arch_csw idle_csw = {
+            .from = paravirt_ctxt_switch_from,
+            .to   = paravirt_ctxt_switch_to,
+            .tail = continue_idle_domain,
+        };
+
+        d->arch.ctxt_switch = &idle_csw;
+    }
 
     /* initialize default tsc behavior in case tools don't */
     tsc_set_info(d, TSC_MODE_DEFAULT, 0UL, 0, 0);





_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [PATCH for 4.9 and older] x86: don't enable XPTI on idle domain
  2018-05-30  8:55 [PATCH for 4.9 and older] x86: don't enable XPTI on idle domain Jan Beulich
@ 2018-05-30 10:04 ` Andrew Cooper
  2018-05-30 10:48   ` Jan Beulich
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Cooper @ 2018-05-30 10:04 UTC (permalink / raw)
  To: Jan Beulich, xen-devel

On 30/05/18 09:55, Jan Beulich wrote:
> While the involved code (in pv_domain_initialise()) sits behind an
> !is_idle_domain() check already, we need to add one here.

I'm afraid that I struggled to understand what you meant here.  AFACIT,
you mean that the backport over the introduction of
pv_domain_initialise() neglected to account for the fact that the idle
domain also wanders this path in 4.9 and earlier?

>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Either way, Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [PATCH for 4.9 and older] x86: don't enable XPTI on idle domain
  2018-05-30 10:04 ` Andrew Cooper
@ 2018-05-30 10:48   ` Jan Beulich
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Beulich @ 2018-05-30 10:48 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: xen-devel

>>> On 30.05.18 at 12:04, <andrew.cooper3@citrix.com> wrote:
> On 30/05/18 09:55, Jan Beulich wrote:
>> While the involved code (in pv_domain_initialise()) sits behind an
>> !is_idle_domain() check already, we need to add one here.
> 
> I'm afraid that I struggled to understand what you meant here.  AFACIT,
> you mean that the backport over the introduction of
> pv_domain_initialise() neglected to account for the fact that the idle
> domain also wanders this path in 4.9 and earlier?

Oh, I see I've omitted "in 4.10" ahead of the comma.

>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> Either way, Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

Thanks, Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

end of thread, other threads:[~2018-05-30 10:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-30  8:55 [PATCH for 4.9 and older] x86: don't enable XPTI on idle domain Jan Beulich
2018-05-30 10:04 ` Andrew Cooper
2018-05-30 10:48   ` Jan Beulich

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.