Re: [PATCH] x86/Xen: make use of IBPB controlling VM assist

2023-03-20 Thread Juergen Gross
On 20.03.23 14:17, Jan Beulich wrote: On 20.03.2023 14:02, Juergen Gross wrote: On 20.03.23 11:19, Jan Beulich wrote: On 17.03.2023 14:56, Juergen Gross wrote: +void __init xen_pv_fix_mitigations(void) +{ + if (!xen_vm_assist_ibpb(true)) + setup_clear_cpu_cap(X86_FEATURE_EN

Re: [PATCH] x86/Xen: make use of IBPB controlling VM assist

2023-03-20 Thread Jan Beulich
On 20.03.2023 14:02, Juergen Gross wrote: > On 20.03.23 11:19, Jan Beulich wrote: >> On 17.03.2023 14:56, Juergen Gross wrote: >>> +void __init xen_pv_fix_mitigations(void) >>> +{ >>> + if (!xen_vm_assist_ibpb(true)) >>> + setup_clear_cpu_cap(X86_FEATURE_ENTRY_IBPB); >> >> ... u

Re: [PATCH] x86/Xen: make use of IBPB controlling VM assist

2023-03-20 Thread Juergen Gross
On 20.03.23 11:19, Jan Beulich wrote: On 17.03.2023 14:56, Juergen Gross wrote: On 15.02.23 09:31, Jan Beulich wrote: Eventually yes. But I would prefer to sort the above question first (which I'm sure would have been raised by them, in perhaps more harsh a way), hence the initially limited exp

Re: [PATCH] x86/Xen: make use of IBPB controlling VM assist

2023-03-20 Thread Jan Beulich
On 17.03.2023 15:21, Andrew Cooper wrote: > On 17/03/2023 1:56 pm, Juergen Gross wrote: >> --- a/arch/x86/xen/enlighten_pv.c >> +++ b/arch/x86/xen/enlighten_pv.c >> @@ -1476,6 +1476,23 @@ static uint32_t __init xen_platform_pv(void) >>     return 0; >>  } >> >> +int __init xen_vm_assist_ibpb(bo

Re: [PATCH] x86/Xen: make use of IBPB controlling VM assist

2023-03-20 Thread Jan Beulich
On 17.03.2023 14:56, Juergen Gross wrote: > On 15.02.23 09:31, Jan Beulich wrote: >> Eventually yes. But I would prefer to sort the above question first >> (which I'm sure would have been raised by them, in perhaps more >> harsh a way), hence the initially limited exposure. > > I'd rather add _one

Re: [PATCH] x86/Xen: make use of IBPB controlling VM assist

2023-03-17 Thread Juergen Gross
On 17.03.23 15:21, Andrew Cooper wrote: On 17/03/2023 1:56 pm, Juergen Gross wrote: On 15.02.23 09:31, Jan Beulich wrote: On 15.02.2023 01:07, Boris Ostrovsky wrote: On 2/14/23 6:53 PM, Boris Ostrovsky wrote: On 2/14/23 11:13 AM, Jan Beulich wrote: --- a/arch/x86/kernel/cpu/bugs.c +++ b/a

Re: [PATCH] x86/Xen: make use of IBPB controlling VM assist

2023-03-17 Thread Andrew Cooper
On 17/03/2023 1:56 pm, Juergen Gross wrote: > On 15.02.23 09:31, Jan Beulich wrote: >> On 15.02.2023 01:07, Boris Ostrovsky wrote: >>> >>> On 2/14/23 6:53 PM, Boris Ostrovsky wrote: On 2/14/23 11:13 AM, Jan Beulich wrote: > --- a/arch/x86/kernel/cpu/bugs.c > +++ b/arch/x86/ke

Re: [PATCH] x86/Xen: make use of IBPB controlling VM assist

2023-03-17 Thread Juergen Gross
On 15.02.23 09:31, Jan Beulich wrote: On 15.02.2023 01:07, Boris Ostrovsky wrote: On 2/14/23 6:53 PM, Boris Ostrovsky wrote: On 2/14/23 11:13 AM, Jan Beulich wrote: --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -18,6 +18,8 @@   #include   #include   +#include +

Re: [PATCH] x86/Xen: make use of IBPB controlling VM assist

2023-02-15 Thread Jan Beulich
On 16.02.2023 00:22, Boris Ostrovsky wrote: > > On 2/15/23 3:31 AM, Jan Beulich wrote: >> On 15.02.2023 01:07, Boris Ostrovsky wrote: >>> On 2/14/23 6:53 PM, Boris Ostrovsky wrote: On 2/14/23 11:13 AM, Jan Beulich wrote: > --- a/arch/x86/kernel/cpu/bugs.c > +++ b/arch/x86/kernel/

Re: [PATCH] x86/Xen: make use of IBPB controlling VM assist

2023-02-15 Thread Boris Ostrovsky
On 2/15/23 3:31 AM, Jan Beulich wrote: On 15.02.2023 01:07, Boris Ostrovsky wrote: On 2/14/23 6:53 PM, Boris Ostrovsky wrote: On 2/14/23 11:13 AM, Jan Beulich wrote: --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -18,6 +18,8 @@   #include   #include   +#include +

Re: [PATCH] x86/Xen: make use of IBPB controlling VM assist

2023-02-15 Thread Jan Beulich
On 15.02.2023 01:07, Boris Ostrovsky wrote: > > On 2/14/23 6:53 PM, Boris Ostrovsky wrote: >> >> On 2/14/23 11:13 AM, Jan Beulich wrote: >> >>> --- a/arch/x86/kernel/cpu/bugs.c >>> +++ b/arch/x86/kernel/cpu/bugs.c >>> @@ -18,6 +18,8 @@ >>>   #include >>>   #include >>>   +#include >>> + >>>   #

Re: [PATCH] x86/Xen: make use of IBPB controlling VM assist

2023-02-14 Thread Boris Ostrovsky
On 2/14/23 6:53 PM, Boris Ostrovsky wrote: On 2/14/23 11:13 AM, Jan Beulich wrote: --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -18,6 +18,8 @@   #include   #include   +#include +   #include   #include   #include @@ -32,6 +34,7 @@   #include   #include   #inclu

Re: [PATCH] x86/Xen: make use of IBPB controlling VM assist

2023-02-14 Thread Boris Ostrovsky
On 2/14/23 11:13 AM, Jan Beulich wrote: --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -18,6 +18,8 @@ #include #include +#include + #include #include #include @@ -32,6 +34,7 @@ #include #include #include +#include #include #include "c

[PATCH] x86/Xen: make use of IBPB controlling VM assist

2023-02-14 Thread Jan Beulich
If this VM assist is available (to PV guests only), use it to - avoid issuing an IBPB ourselves upon entry from user mode (which the hypervisor would then have to emulate, as the MSR write traps), - suppress the IBPB in the hypervisor if we don't mean to have one issued. As there's no good pla