* [PATCH] x86: limit issuing of IBPB during context switch
@ 2022-07-25 12:09 Jan Beulich
2022-07-25 12:15 ` Andrew Cooper
0 siblings, 1 reply; 3+ messages in thread
From: Jan Beulich @ 2022-07-25 12:09 UTC (permalink / raw)
To: xen-devel; +Cc: Andrew Cooper, Wei Liu, Roger Pau Monné
When the outgoing vCPU had IBPB issued upon entering Xen there's no
need for a 2nd barrier during context switch.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -2098,7 +2098,8 @@ void context_switch(struct vcpu *prev, s
ctxt_switch_levelling(next);
- if ( opt_ibpb_ctxt_switch && !is_idle_domain(nextd) )
+ if ( opt_ibpb_ctxt_switch && !is_idle_domain(nextd) &&
+ !(prevd->arch.spec_ctrl_flags & SCF_entry_ibpb) )
{
static DEFINE_PER_CPU(unsigned int, last);
unsigned int *last_id = &this_cpu(last);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] x86: limit issuing of IBPB during context switch
2022-07-25 12:09 [PATCH] x86: limit issuing of IBPB during context switch Jan Beulich
@ 2022-07-25 12:15 ` Andrew Cooper
2022-07-25 12:27 ` Jan Beulich
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Cooper @ 2022-07-25 12:15 UTC (permalink / raw)
To: Jan Beulich, xen-devel; +Cc: Wei Liu, Roger Pau Monne
On 25/07/2022 13:09, Jan Beulich wrote:
> When the outgoing vCPU had IBPB issued upon entering Xen there's no
> need for a 2nd barrier during context switch.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
That's already accounted for by opt_ibpb_ctxt_switch conditionally being
not set.
~Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] x86: limit issuing of IBPB during context switch
2022-07-25 12:15 ` Andrew Cooper
@ 2022-07-25 12:27 ` Jan Beulich
0 siblings, 0 replies; 3+ messages in thread
From: Jan Beulich @ 2022-07-25 12:27 UTC (permalink / raw)
To: Andrew Cooper; +Cc: Wei Liu, Roger Pau Monne, xen-devel
On 25.07.2022 14:15, Andrew Cooper wrote:
> On 25/07/2022 13:09, Jan Beulich wrote:
>> When the outgoing vCPU had IBPB issued upon entering Xen there's no
>> need for a 2nd barrier during context switch.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> That's already accounted for by opt_ibpb_ctxt_switch conditionally being
> not set.
That option defaults to false only if both PV and HVM have the entry
barrier turned on. In fact, if it wasn't for Dom0 I was first thinking
the global could go away and only the per-domain setting could be
inspected here.
Jan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-07-25 12:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-25 12:09 [PATCH] x86: limit issuing of IBPB during context switch Jan Beulich
2022-07-25 12:15 ` Andrew Cooper
2022-07-25 12:27 ` 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.