Re: [PATCH v2 1/8] x86/feature: Detect the x86 IBRS feature to control Speculation

2018-01-18 Thread Andy Lutomirski
On Fri, Jan 5, 2018 at 6:12 PM, Tim Chen wrote: > cpuid ax=0x7, return rdx bit 26 to indicate presence of this feature > IA32_SPEC_CTRL (0x48) > IA32_SPEC_CTRL, bit0 – Indirect Branch Restricted Speculation (IBRS) > > If IBRS is set, near returns and near indirect

Re: [PATCH v2 1/8] x86/feature: Detect the x86 IBRS feature to control Speculation

2018-01-18 Thread Andy Lutomirski
On Fri, Jan 5, 2018 at 6:12 PM, Tim Chen wrote: > cpuid ax=0x7, return rdx bit 26 to indicate presence of this feature > IA32_SPEC_CTRL (0x48) > IA32_SPEC_CTRL, bit0 – Indirect Branch Restricted Speculation (IBRS) > > If IBRS is set, near returns and near indirect jumps/calls will not allow >

Re: [PATCH v2 1/8] x86/feature: Detect the x86 IBRS feature to control Speculation

2018-01-09 Thread Tim Chen
On 01/09/2018 09:58 AM, Paolo Bonzini wrote: > On 09/01/2018 18:53, Tim Chen wrote: >> On 01/09/2018 02:39 AM, Paolo Bonzini wrote: >> >>> + >>> +#define MSR_IA32_SPEC_CTRL 0x0048 >>> +#define SPEC_CTRL_FEATURE_DISABLE_IBRS (0 << 0) >>> +#define SPEC_CTRL_FEATURE_ENABLE_IBRS

Re: [PATCH v2 1/8] x86/feature: Detect the x86 IBRS feature to control Speculation

2018-01-09 Thread Tim Chen
On 01/09/2018 09:58 AM, Paolo Bonzini wrote: > On 09/01/2018 18:53, Tim Chen wrote: >> On 01/09/2018 02:39 AM, Paolo Bonzini wrote: >> >>> + >>> +#define MSR_IA32_SPEC_CTRL 0x0048 >>> +#define SPEC_CTRL_FEATURE_DISABLE_IBRS (0 << 0) >>> +#define SPEC_CTRL_FEATURE_ENABLE_IBRS

Re: [PATCH v2 1/8] x86/feature: Detect the x86 IBRS feature to control Speculation

2018-01-09 Thread Borislav Petkov
On Tue, Jan 09, 2018 at 10:13:23AM -0800, Dave Hansen wrote: > FWIW, I like the idea of including "SPEC_CTRL_" because it matches the > constant to the MSR name. But I don't care that much. Sure - just the "FEATURE_" part of the string is redundant. -- Regards/Gruss, Boris. Good mailing

Re: [PATCH v2 1/8] x86/feature: Detect the x86 IBRS feature to control Speculation

2018-01-09 Thread Borislav Petkov
On Tue, Jan 09, 2018 at 10:13:23AM -0800, Dave Hansen wrote: > FWIW, I like the idea of including "SPEC_CTRL_" because it matches the > constant to the MSR name. But I don't care that much. Sure - just the "FEATURE_" part of the string is redundant. -- Regards/Gruss, Boris. Good mailing

Re: [PATCH v2 1/8] x86/feature: Detect the x86 IBRS feature to control Speculation

2018-01-09 Thread Dave Hansen
On 01/06/2018 04:56 AM, Borislav Petkov wrote: >> +#define MSR_IA32_SPEC_CTRL 0x0048 >> +#define SPEC_CTRL_FEATURE_DISABLE_IBRS (0 << 0) >> +#define SPEC_CTRL_FEATURE_ENABLE_IBRS (1 << 0) > s/_FEATURE// > > SPEC_CTRL_{ENABLE,DISABLE}_IBRS is good enough. FWIW, I like the

Re: [PATCH v2 1/8] x86/feature: Detect the x86 IBRS feature to control Speculation

2018-01-09 Thread Dave Hansen
On 01/06/2018 04:56 AM, Borislav Petkov wrote: >> +#define MSR_IA32_SPEC_CTRL 0x0048 >> +#define SPEC_CTRL_FEATURE_DISABLE_IBRS (0 << 0) >> +#define SPEC_CTRL_FEATURE_ENABLE_IBRS (1 << 0) > s/_FEATURE// > > SPEC_CTRL_{ENABLE,DISABLE}_IBRS is good enough. FWIW, I like the

Re: [PATCH v2 1/8] x86/feature: Detect the x86 IBRS feature to control Speculation

2018-01-09 Thread Paolo Bonzini
On 09/01/2018 18:53, Tim Chen wrote: > On 01/09/2018 02:39 AM, Paolo Bonzini wrote: > >> + >> +#define MSR_IA32_SPEC_CTRL 0x0048 >> +#define SPEC_CTRL_FEATURE_DISABLE_IBRS (0 << 0) >> +#define SPEC_CTRL_FEATURE_ENABLE_IBRS (1 << 0) > > > Boris requested that the name for

Re: [PATCH v2 1/8] x86/feature: Detect the x86 IBRS feature to control Speculation

2018-01-09 Thread Paolo Bonzini
On 09/01/2018 18:53, Tim Chen wrote: > On 01/09/2018 02:39 AM, Paolo Bonzini wrote: > >> + >> +#define MSR_IA32_SPEC_CTRL 0x0048 >> +#define SPEC_CTRL_FEATURE_DISABLE_IBRS (0 << 0) >> +#define SPEC_CTRL_FEATURE_ENABLE_IBRS (1 << 0) > > > Boris requested that the name for

Re: [PATCH v2 1/8] x86/feature: Detect the x86 IBRS feature to control Speculation

2018-01-09 Thread Tim Chen
On 01/09/2018 02:39 AM, Paolo Bonzini wrote: > + > +#define MSR_IA32_SPEC_CTRL 0x0048 > +#define SPEC_CTRL_FEATURE_DISABLE_IBRS (0 << 0) > +#define SPEC_CTRL_FEATURE_ENABLE_IBRS(1 << 0) Boris requested that the name for ENABLE/DISABLE to be shortened to

Re: [PATCH v2 1/8] x86/feature: Detect the x86 IBRS feature to control Speculation

2018-01-09 Thread Tim Chen
On 01/09/2018 02:39 AM, Paolo Bonzini wrote: > + > +#define MSR_IA32_SPEC_CTRL 0x0048 > +#define SPEC_CTRL_FEATURE_DISABLE_IBRS (0 << 0) > +#define SPEC_CTRL_FEATURE_ENABLE_IBRS(1 << 0) Boris requested that the name for ENABLE/DISABLE to be shortened to

Re: [PATCH v2 1/8] x86/feature: Detect the x86 IBRS feature to control Speculation

2018-01-09 Thread Paolo Bonzini
On 06/01/2018 03:12, Tim Chen wrote: > diff --git a/arch/x86/include/asm/msr-index.h > b/arch/x86/include/asm/msr-index.h > index 34c4922..f881add 100644 > --- a/arch/x86/include/asm/msr-index.h > +++ b/arch/x86/include/asm/msr-index.h > @@ -42,6 +42,10 @@ > #define MSR_PPIN_CTL

Re: [PATCH v2 1/8] x86/feature: Detect the x86 IBRS feature to control Speculation

2018-01-09 Thread Paolo Bonzini
On 06/01/2018 03:12, Tim Chen wrote: > diff --git a/arch/x86/include/asm/msr-index.h > b/arch/x86/include/asm/msr-index.h > index 34c4922..f881add 100644 > --- a/arch/x86/include/asm/msr-index.h > +++ b/arch/x86/include/asm/msr-index.h > @@ -42,6 +42,10 @@ > #define MSR_PPIN_CTL

Re: [PATCH v2 1/8] x86/feature: Detect the x86 IBRS feature to control Speculation

2018-01-08 Thread Paolo Bonzini
On 06/01/2018 03:12, Tim Chen wrote: > cpuid ax=0x7, return rdx bit 26 to indicate presence of this feature > IA32_SPEC_CTRL (0x48) > IA32_SPEC_CTRL, bit0 – Indirect Branch Restricted Speculation (IBRS) > > If IBRS is set, near returns and near indirect jumps/calls will not allow > their

Re: [PATCH v2 1/8] x86/feature: Detect the x86 IBRS feature to control Speculation

2018-01-08 Thread Paolo Bonzini
On 06/01/2018 03:12, Tim Chen wrote: > cpuid ax=0x7, return rdx bit 26 to indicate presence of this feature > IA32_SPEC_CTRL (0x48) > IA32_SPEC_CTRL, bit0 – Indirect Branch Restricted Speculation (IBRS) > > If IBRS is set, near returns and near indirect jumps/calls will not allow > their

Re: [PATCH v2 1/8] x86/feature: Detect the x86 IBRS feature to control Speculation

2018-01-07 Thread Borislav Petkov
On Sun, Jan 07, 2018 at 09:14:57AM -0800, Tim Chen wrote: > RSB is return stack buffer, basically speculation addresses for return > statement. I had a very good idea what it was but maybe other readers might not. So please write out abbreviations on their first use. -- Regards/Gruss,

Re: [PATCH v2 1/8] x86/feature: Detect the x86 IBRS feature to control Speculation

2018-01-07 Thread Borislav Petkov
On Sun, Jan 07, 2018 at 09:14:57AM -0800, Tim Chen wrote: > RSB is return stack buffer, basically speculation addresses for return > statement. I had a very good idea what it was but maybe other readers might not. So please write out abbreviations on their first use. -- Regards/Gruss,

Re: [PATCH v2 1/8] x86/feature: Detect the x86 IBRS feature to control Speculation

2018-01-07 Thread Tim Chen
On 01/06/2018 04:56 AM, Borislav Petkov wrote: > On Fri, Jan 05, 2018 at 06:12:16PM -0800, Tim Chen wrote: > > <--- This needs an introductory sentence here. > >> cpuid ax=0x7, return rdx bit 26 to indicate presence of this feature > > You can write that as CPUID(7).RDX[26]. > >>

Re: [PATCH v2 1/8] x86/feature: Detect the x86 IBRS feature to control Speculation

2018-01-07 Thread Tim Chen
On 01/06/2018 04:56 AM, Borislav Petkov wrote: > On Fri, Jan 05, 2018 at 06:12:16PM -0800, Tim Chen wrote: > > <--- This needs an introductory sentence here. > >> cpuid ax=0x7, return rdx bit 26 to indicate presence of this feature > > You can write that as CPUID(7).RDX[26]. > >>

Re: [PATCH v2 1/8] x86/feature: Detect the x86 IBRS feature to control Speculation

2018-01-06 Thread Borislav Petkov
On Fri, Jan 05, 2018 at 06:12:16PM -0800, Tim Chen wrote: <--- This needs an introductory sentence here. > cpuid ax=0x7, return rdx bit 26 to indicate presence of this feature You can write that as CPUID(7).RDX[26]. > IA32_SPEC_CTRL (0x48) > IA32_SPEC_CTRL, bit0 – Indirect Branch Restricted

Re: [PATCH v2 1/8] x86/feature: Detect the x86 IBRS feature to control Speculation

2018-01-06 Thread Borislav Petkov
On Fri, Jan 05, 2018 at 06:12:16PM -0800, Tim Chen wrote: <--- This needs an introductory sentence here. > cpuid ax=0x7, return rdx bit 26 to indicate presence of this feature You can write that as CPUID(7).RDX[26]. > IA32_SPEC_CTRL (0x48) > IA32_SPEC_CTRL, bit0 – Indirect Branch Restricted