Re: [PATCH 1/2] xen/*/nospec: Provide common versions of evaluate_nospec/block_speculation

2024-03-05 Thread Oleksii
On Tue, 2024-03-05 at 16:43 +0100, Jan Beulich wrote: > On 05.03.2024 16:15, Oleksii wrote: > > I agree that upon examining the current state of the code around > > these > > functions, it appears safe to provide stubs. However, the reason my > > patch was rejected is that it may not be entirely

Re: [PATCH 1/2] xen/*/nospec: Provide common versions of evaluate_nospec/block_speculation

2024-03-05 Thread Andrew Cooper
On 05/03/2024 3:43 pm, Jan Beulich wrote: > On 05.03.2024 16:15, Oleksii wrote: >> I agree that upon examining the current state of the code around these >> functions, it appears safe to provide stubs. However, the reason my >> patch was rejected is that it may not be entirely safe, as Julien >>

Re: [PATCH 1/2] xen/*/nospec: Provide common versions of evaluate_nospec/block_speculation

2024-03-05 Thread Jan Beulich
On 05.03.2024 16:15, Oleksii wrote: > I agree that upon examining the current state of the code around these > functions, it appears safe to provide stubs. However, the reason my > patch was rejected is that it may not be entirely safe, as Julien > pointed out that even with Arm, some functions

Re: [PATCH 1/2] xen/*/nospec: Provide common versions of evaluate_nospec/block_speculation

2024-03-05 Thread Oleksii
On Mon, 2024-03-04 at 17:50 +, Andrew Cooper wrote: > On 04/03/2024 5:40 pm, Julien Grall wrote: > > Hi Andrew, > > > > On 04/03/2024 17:07, Andrew Cooper wrote: > > > On 04/03/2024 4:55 pm, Jan Beulich wrote: > > > > On 04.03.2024 17:46, Julien Grall wrote: > > > > > On 04/03/2024 16:41, Jan

Re: [PATCH 1/2] xen/*/nospec: Provide common versions of evaluate_nospec/block_speculation

2024-03-04 Thread Jan Beulich
On 04.03.2024 17:10, Andrew Cooper wrote: > --- a/xen/include/xen/nospec.h > +++ b/xen/include/xen/nospec.h > @@ -9,6 +9,29 @@ > > #include > > +/* > + * Protect a conditional branch from bad speculation. Architectures *must* > + * provide arch_evaluate_nospec() for this to be effective. >

Re: [PATCH 1/2] xen/*/nospec: Provide common versions of evaluate_nospec/block_speculation

2024-03-04 Thread Jan Beulich
On 04.03.2024 17:10, Andrew Cooper wrote: > It is daft to require all architectures to provide empty implementations of > this functionality. > > Provide evaluate_nospec() and block_speculation() unconditionally in > xen/nospec.h with architectures able to opt in by providing suitable arch >

Re: [PATCH 1/2] xen/*/nospec: Provide common versions of evaluate_nospec/block_speculation

2024-03-04 Thread Jan Beulich
On 04.03.2024 18:40, Julien Grall wrote: > Hi Andrew, > > On 04/03/2024 17:07, Andrew Cooper wrote: >> On 04/03/2024 4:55 pm, Jan Beulich wrote: >>> On 04.03.2024 17:46, Julien Grall wrote: On 04/03/2024 16:41, Jan Beulich wrote: > On 04.03.2024 17:31, Julien Grall wrote: >> On

Re: [PATCH 1/2] xen/*/nospec: Provide common versions of evaluate_nospec/block_speculation

2024-03-04 Thread Andrew Cooper
On 04/03/2024 5:40 pm, Julien Grall wrote: > Hi Andrew, > > On 04/03/2024 17:07, Andrew Cooper wrote: >> On 04/03/2024 4:55 pm, Jan Beulich wrote: >>> On 04.03.2024 17:46, Julien Grall wrote: On 04/03/2024 16:41, Jan Beulich wrote: > On 04.03.2024 17:31, Julien Grall wrote: >> On

Re: [PATCH 1/2] xen/*/nospec: Provide common versions of evaluate_nospec/block_speculation

2024-03-04 Thread Julien Grall
Hi Andrew, On 04/03/2024 17:07, Andrew Cooper wrote: On 04/03/2024 4:55 pm, Jan Beulich wrote: On 04.03.2024 17:46, Julien Grall wrote: On 04/03/2024 16:41, Jan Beulich wrote: On 04.03.2024 17:31, Julien Grall wrote: On 04/03/2024 16:10, Andrew Cooper wrote: It is daft to require all

Re: [PATCH 1/2] xen/*/nospec: Provide common versions of evaluate_nospec/block_speculation

2024-03-04 Thread Andrew Cooper
On 04/03/2024 4:55 pm, Jan Beulich wrote: > On 04.03.2024 17:46, Julien Grall wrote: >> On 04/03/2024 16:41, Jan Beulich wrote: >>> On 04.03.2024 17:31, Julien Grall wrote: On 04/03/2024 16:10, Andrew Cooper wrote: > It is daft to require all architectures to provide empty implementations

Re: [PATCH 1/2] xen/*/nospec: Provide common versions of evaluate_nospec/block_speculation

2024-03-04 Thread Jan Beulich
On 04.03.2024 17:46, Julien Grall wrote: > On 04/03/2024 16:41, Jan Beulich wrote: >> On 04.03.2024 17:31, Julien Grall wrote: >>> On 04/03/2024 16:10, Andrew Cooper wrote: It is daft to require all architectures to provide empty implementations of this functionality. >>> >>> Oleksii

Re: [PATCH 1/2] xen/*/nospec: Provide common versions of evaluate_nospec/block_speculation

2024-03-04 Thread Andrew Cooper
On 04/03/2024 4:41 pm, Jan Beulich wrote: > On 04.03.2024 17:31, Julien Grall wrote: >> On 04/03/2024 16:10, Andrew Cooper wrote: >>> It is daft to require all architectures to provide empty implementations of >>> this functionality. >> Oleksii recenlty sent a similar patch [1]. This was pushed

Re: [PATCH 1/2] xen/*/nospec: Provide common versions of evaluate_nospec/block_speculation

2024-03-04 Thread Julien Grall
Hi Jan, On 04/03/2024 16:41, Jan Beulich wrote: On 04.03.2024 17:31, Julien Grall wrote: On 04/03/2024 16:10, Andrew Cooper wrote: It is daft to require all architectures to provide empty implementations of this functionality. Oleksii recenlty sent a similar patch [1]. This was pushed back

Re: [PATCH 1/2] xen/*/nospec: Provide common versions of evaluate_nospec/block_speculation

2024-03-04 Thread Andrew Cooper
On 04/03/2024 4:45 pm, Jan Beulich wrote: > On 04.03.2024 17:10, Andrew Cooper wrote: >> --- a/xen/arch/x86/include/asm/nospec.h >> +++ b/xen/arch/x86/include/asm/nospec.h >> @@ -23,20 +23,20 @@ static always_inline bool barrier_nospec_false(void) >> return false; >> } >> >> -/* Allow to

Re: [PATCH 1/2] xen/*/nospec: Provide common versions of evaluate_nospec/block_speculation

2024-03-04 Thread Jan Beulich
On 04.03.2024 17:10, Andrew Cooper wrote: > --- a/xen/arch/x86/include/asm/nospec.h > +++ b/xen/arch/x86/include/asm/nospec.h > @@ -23,20 +23,20 @@ static always_inline bool barrier_nospec_false(void) > return false; > } > > -/* Allow to protect evaluation of conditionals with respect to

Re: [PATCH 1/2] xen/*/nospec: Provide common versions of evaluate_nospec/block_speculation

2024-03-04 Thread Jan Beulich
On 04.03.2024 17:31, Julien Grall wrote: > On 04/03/2024 16:10, Andrew Cooper wrote: >> It is daft to require all architectures to provide empty implementations of >> this functionality. > > Oleksii recenlty sent a similar patch [1]. This was pushed back because > from naming, it sounds like the

Re: [PATCH 1/2] xen/*/nospec: Provide common versions of evaluate_nospec/block_speculation

2024-03-04 Thread Julien Grall
Hi Andrew, On 04/03/2024 16:10, Andrew Cooper wrote: It is daft to require all architectures to provide empty implementations of this functionality. Oleksii recenlty sent a similar patch [1]. This was pushed back because from naming, it sounds like the helpers ought to be non-empty on every

[PATCH 1/2] xen/*/nospec: Provide common versions of evaluate_nospec/block_speculation

2024-03-04 Thread Andrew Cooper
It is daft to require all architectures to provide empty implementations of this functionality. Provide evaluate_nospec() and block_speculation() unconditionally in xen/nospec.h with architectures able to opt in by providing suitable arch variants. Rename x86's implementation to the arch_*()