Re: [PATCH v6 5/6] Optionally flush L1D on context switch

2020-05-14 Thread Singh, Balbir
On Wed, 2020-05-13 at 17:27 +0200, Thomas Gleixner wrote: > CAUTION: This email originated from outside of the organization. Do > not click links or open attachments unless you can confirm the sender > and know the content is safe. > > > > Balbir Singh writes: > > > Implement a mechanism to se

Re: [PATCH v6 5/6] Optionally flush L1D on context switch

2020-05-14 Thread Thomas Gleixner
Balbir, "Singh, Balbir" writes: > On Wed, 2020-05-13 at 18:16 +0200, Thomas Gleixner wrote: >> Balbir Singh writes: >> But looking at this deeper (yes I should have noticed earlier): >> >> Why do we need yet another PRCTL? >> >> We already have PR_SET_SPECULATION_CTRL/PR_GET_SPECULATION_CT

Re: [PATCH v6 5/6] Optionally flush L1D on context switch

2020-05-14 Thread Singh, Balbir
On Wed, 2020-05-13 at 17:04 +0200, Thomas Gleixner wrote: > > > Balbir Singh writes: > > > > + if (prev_mm & LAST_USER_MM_L1D_FLUSH) > > + arch_l1d_flush(0); /* Just flush, don't populate the > > TLB */ > > Bah. I fundamentally hate tail comments. They are just disturbing the >

Re: [PATCH v6 5/6] Optionally flush L1D on context switch

2020-05-14 Thread Singh, Balbir
On Wed, 2020-05-13 at 18:16 +0200, Thomas Gleixner wrote: > Balbir Singh writes: > > This part: > > > --- a/include/uapi/linux/prctl.h > > +++ b/include/uapi/linux/prctl.h > > @@ -238,4 +238,8 @@ struct prctl_mm_map { > > #define PR_SET_IO_FLUSHER57 > > #define PR_GET_IO_FLUSHER

Re: [PATCH v6 5/6] Optionally flush L1D on context switch

2020-05-13 Thread Thomas Gleixner
Balbir Singh writes: This part: > --- a/include/uapi/linux/prctl.h > +++ b/include/uapi/linux/prctl.h > @@ -238,4 +238,8 @@ struct prctl_mm_map { > #define PR_SET_IO_FLUSHER57 > #define PR_GET_IO_FLUSHER58 > > +/* Flush L1D on context switch (mm) */ > +#define PR_SET_

Re: [PATCH v6 5/6] Optionally flush L1D on context switch

2020-05-13 Thread Thomas Gleixner
Balbir Singh writes: > Implement a mechanism to selectively flush the L1D cache. The goal is to > allow tasks that are paranoid due to the recent snoop assisted data sampling > vulnerabilites, to flush their L1D on being switched out. This protects > their data from being snooped or leaked via s

Re: [PATCH v6 5/6] Optionally flush L1D on context switch

2020-05-13 Thread Thomas Gleixner
Balbir Singh writes: > > + if (prev_mm & LAST_USER_MM_L1D_FLUSH) > + arch_l1d_flush(0); /* Just flush, don't populate the TLB */ Bah. I fundamentally hate tail comments. They are just disturbing the reading flow. Aside of that, this states the WHAT but not the WHY. And if you ad

[PATCH v6 5/6] Optionally flush L1D on context switch

2020-05-09 Thread Balbir Singh
Implement a mechanism to selectively flush the L1D cache. The goal is to allow tasks that are paranoid due to the recent snoop assisted data sampling vulnerabilites, to flush their L1D on being switched out. This protects their data from being snooped or leaked via side channels after the task has