Re: [PATCH v2 1/2] x86/uaccess: rework user access speculative harden guards

2025-01-14 Thread Nicola Vetrini
On 2025-01-10 09:56, Nicola Vetrini wrote: On 2025-01-10 09:29, Roger Pau Monné wrote: On Thu, Jan 09, 2025 at 03:57:24PM -0800, Stefano Stabellini wrote: On Thu, 9 Jan 2025, Nicola Vetrini wrote: > On 2025-01-04 01:20, Stefano Stabellini wrote: > > Hi Nicola, one question below > > I will u

Re: [PATCH v2 1/2] x86/uaccess: rework user access speculative harden guards

2025-01-10 Thread Nicola Vetrini
On 2025-01-10 09:29, Roger Pau Monné wrote: On Thu, Jan 09, 2025 at 03:57:24PM -0800, Stefano Stabellini wrote: On Thu, 9 Jan 2025, Nicola Vetrini wrote: > On 2025-01-04 01:20, Stefano Stabellini wrote: > > Hi Nicola, one question below > > > > On Wed, 27 Nov 2024, Nicola Vetrini wrote: > > > >

Re: [PATCH v2 1/2] x86/uaccess: rework user access speculative harden guards

2025-01-10 Thread Roger Pau Monné
On Thu, Jan 09, 2025 at 03:57:24PM -0800, Stefano Stabellini wrote: > On Thu, 9 Jan 2025, Nicola Vetrini wrote: > > On 2025-01-04 01:20, Stefano Stabellini wrote: > > > Hi Nicola, one question below > > > > > > On Wed, 27 Nov 2024, Nicola Vetrini wrote: > > > > > #define AMD_OSVW_ERRATUM(osvw_id,

Re: [PATCH v2 1/2] x86/uaccess: rework user access speculative harden guards

2025-01-09 Thread Stefano Stabellini
On Thu, 9 Jan 2025, Nicola Vetrini wrote: > On 2025-01-04 01:20, Stefano Stabellini wrote: > > Hi Nicola, one question below > > > > On Wed, 27 Nov 2024, Nicola Vetrini wrote: > > > > #define AMD_OSVW_ERRATUM(osvw_id, ...) osvw_id, __VA_ARGS__, 0 > > > > > > > > where we're using the C99 form rat

Re: [PATCH v2 1/2] x86/uaccess: rework user access speculative harden guards

2025-01-08 Thread Nicola Vetrini
On 2025-01-04 01:20, Stefano Stabellini wrote: Hi Nicola, one question below On Wed, 27 Nov 2024, Nicola Vetrini wrote: > #define AMD_OSVW_ERRATUM(osvw_id, ...) osvw_id, __VA_ARGS__, 0 > > where we're using the C99 form rather than the GNU extension, and where > hence __VA_ARGS__ would - by ex

Re: [PATCH v2 1/2] x86/uaccess: rework user access speculative harden guards

2025-01-03 Thread Stefano Stabellini
Hi Nicola, one question below On Wed, 27 Nov 2024, Nicola Vetrini wrote: > > #define AMD_OSVW_ERRATUM(osvw_id, ...) osvw_id, __VA_ARGS__, 0 > > > > where we're using the C99 form rather than the GNU extension, and where > > hence __VA_ARGS__ would - by extrapolation of the Misra rule - need > >

Re: [PATCH v2 1/2] x86/uaccess: rework user access speculative harden guards

2024-11-27 Thread Nicola Vetrini
On 2024-11-26 10:58, Jan Beulich wrote: On 26.11.2024 10:35, Roger Pau Monne wrote: The current guards to select whether user accesses should be speculative hardened violate Misra rule 20.7, as the UA_KEEP() macro doesn't (and can't) parenthesize the 'args' argument. For my own education: Th

Re: [PATCH v2 1/2] x86/uaccess: rework user access speculative harden guards

2024-11-26 Thread Jan Beulich
On 26.11.2024 10:35, Roger Pau Monne wrote: > The current guards to select whether user accesses should be speculative > hardened violate Misra rule 20.7, as the UA_KEEP() macro doesn't (and can't) > parenthesize the 'args' argument. For my own education: This definitely isn't the only place where

[PATCH v2 1/2] x86/uaccess: rework user access speculative harden guards

2024-11-26 Thread Roger Pau Monne
The current guards to select whether user accesses should be speculative hardened violate Misra rule 20.7, as the UA_KEEP() macro doesn't (and can't) parenthesize the 'args' argument. Change the logic so the guard is implemented inside the assembly block using the .if assembly directive. This res