RE: [PATCH v2] x86/cpu: Use SERIALIZE in sync_core() when available

2020-08-05 Thread Luck, Tony
> I meant asm as in a .S file. But the code we have is fine for this purpose, > at least for now. There seem to be some drivers that call sync_core: drivers/misc/sgi-gru/grufault.c:sync_core(); drivers/misc/sgi-gru/grufault.c:sync_core();/* make sure

Re: [PATCH v2] x86/cpu: Use SERIALIZE in sync_core() when available

2020-08-05 Thread Andy Lutomirski
> On Aug 5, 2020, at 12:11 PM, Ricardo Neri > wrote: > > On Wed, Aug 05, 2020 at 11:28:31AM -0700, Andy Lutomirski wrote: >>> On Wed, Aug 5, 2020 at 10:07 AM Ricardo Neri >>> wrote: >>> >>> On Wed, Aug 05, 2020 at 07:08:08AM +0200, Borislav Petkov wrote: On Tue, Aug 04, 2020 at

Re: [PATCH v2] x86/cpu: Use SERIALIZE in sync_core() when available

2020-08-05 Thread Ricardo Neri
On Wed, Aug 05, 2020 at 06:48:40AM +0200, Borislav Petkov wrote: > On Tue, Aug 04, 2020 at 07:10:59PM -0700, Ricardo Neri wrote: > > The SERIALIZE instruction gives software a way to force the processor to > > complete all modifications to flags, registers and memory from previous > > instructions

Re: [PATCH v2] x86/cpu: Use SERIALIZE in sync_core() when available

2020-08-05 Thread Ricardo Neri
On Wed, Aug 05, 2020 at 07:08:08AM +0200, Borislav Petkov wrote: > On Tue, Aug 04, 2020 at 09:58:25PM -0700, h...@zytor.com wrote: > > Because why use an alternative to jump over one instruction? > > > > I personally would prefer to have the IRET put out of line > > Can't yet - SERIALIZE CPUs are

Re: [PATCH v2] x86/cpu: Use SERIALIZE in sync_core() when available

2020-08-05 Thread Ricardo Neri
On Wed, Aug 05, 2020 at 11:28:31AM -0700, Andy Lutomirski wrote: > On Wed, Aug 5, 2020 at 10:07 AM Ricardo Neri > wrote: > > > > On Wed, Aug 05, 2020 at 07:08:08AM +0200, Borislav Petkov wrote: > > > On Tue, Aug 04, 2020 at 09:58:25PM -0700, h...@zytor.com wrote: > > > > Because why use an

Re: [PATCH v2] x86/cpu: Use SERIALIZE in sync_core() when available

2020-08-05 Thread Andy Lutomirski
On Wed, Aug 5, 2020 at 10:07 AM Ricardo Neri wrote: > > On Wed, Aug 05, 2020 at 07:08:08AM +0200, Borislav Petkov wrote: > > On Tue, Aug 04, 2020 at 09:58:25PM -0700, h...@zytor.com wrote: > > > Because why use an alternative to jump over one instruction? > > > > > > I personally would prefer to

Re: [PATCH v2] x86/cpu: Use SERIALIZE in sync_core() when available

2020-08-04 Thread hpa
On August 4, 2020 10:08:08 PM PDT, Borislav Petkov wrote: >On Tue, Aug 04, 2020 at 09:58:25PM -0700, h...@zytor.com wrote: >> Because why use an alternative to jump over one instruction? >> >> I personally would prefer to have the IRET put out of line > >Can't yet - SERIALIZE CPUs are a minority

Re: [PATCH v2] x86/cpu: Use SERIALIZE in sync_core() when available

2020-08-04 Thread Borislav Petkov
On Tue, Aug 04, 2020 at 09:58:25PM -0700, h...@zytor.com wrote: > Because why use an alternative to jump over one instruction? > > I personally would prefer to have the IRET put out of line Can't yet - SERIALIZE CPUs are a minority at the moment. > and have the call/jmp replaced by SERIALIZE

Re: [PATCH v2] x86/cpu: Use SERIALIZE in sync_core() when available

2020-08-04 Thread hpa
On August 4, 2020 9:48:40 PM PDT, Borislav Petkov wrote: >On Tue, Aug 04, 2020 at 07:10:59PM -0700, Ricardo Neri wrote: >> The SERIALIZE instruction gives software a way to force the processor >to >> complete all modifications to flags, registers and memory from >previous >> instructions and

Re: [PATCH v2] x86/cpu: Use SERIALIZE in sync_core() when available

2020-08-04 Thread Borislav Petkov
On Tue, Aug 04, 2020 at 07:10:59PM -0700, Ricardo Neri wrote: > The SERIALIZE instruction gives software a way to force the processor to > complete all modifications to flags, registers and memory from previous > instructions and drain all buffered writes to memory before the next > instruction is

[PATCH v2] x86/cpu: Use SERIALIZE in sync_core() when available

2020-08-04 Thread Ricardo Neri
The SERIALIZE instruction gives software a way to force the processor to complete all modifications to flags, registers and memory from previous instructions and drain all buffered writes to memory before the next instruction is fetched and executed. Thus, it serves the purpose of sync_core(). Use