Re: [RFC PATCH 2/3] x86/cpufeatures: Combine word 11 and 12 into new scattered features word 11

2019-06-14 Thread Fenghua Yu
On Fri, Jun 14, 2019 at 05:02:19PM +0200, Borislav Petkov wrote: > On Fri, Jun 14, 2019 at 07:25:51AM -0700, Fenghua Yu wrote: > > But without this small patch, CPUID_7_EDX is 17 instead of > > NCAPINTS(19)-1=18 in patch 0002. Of course CPUID_7_EDX is 18 correctly > > evetually after applying

Re: [RFC PATCH 2/3] x86/cpufeatures: Combine word 11 and 12 into new scattered features word 11

2019-06-14 Thread Sean Christopherson
On Fri, Jun 14, 2019 at 06:10:12PM +0200, Borislav Petkov wrote: > On Fri, Jun 14, 2019 at 08:24:58AM -0700, Sean Christopherson wrote: > > On Fri, Jun 14, 2019 at 04:57:34PM +0200, Borislav Petkov wrote: > > > On Fri, Jun 14, 2019 at 07:39:12AM -0700, Sean Christopherson wrote: > > > > KVM can't

Re: [RFC PATCH 2/3] x86/cpufeatures: Combine word 11 and 12 into new scattered features word 11

2019-06-14 Thread Borislav Petkov
On Fri, Jun 14, 2019 at 08:24:58AM -0700, Sean Christopherson wrote: > On Fri, Jun 14, 2019 at 04:57:34PM +0200, Borislav Petkov wrote: > > On Fri, Jun 14, 2019 at 07:39:12AM -0700, Sean Christopherson wrote: > > > KVM can't handle Linux-defined leafs without extra tricks > > > > and that's what

Re: [RFC PATCH 2/3] x86/cpufeatures: Combine word 11 and 12 into new scattered features word 11

2019-06-14 Thread Sean Christopherson
On Fri, Jun 14, 2019 at 04:57:34PM +0200, Borislav Petkov wrote: > On Fri, Jun 14, 2019 at 07:39:12AM -0700, Sean Christopherson wrote: > > KVM can't handle Linux-defined leafs without extra tricks > > and that's what I'm proposing - an extra trick. It's not a trick, it's bug suppression. Try

Re: [RFC PATCH 2/3] x86/cpufeatures: Combine word 11 and 12 into new scattered features word 11

2019-06-14 Thread Borislav Petkov
On Fri, Jun 14, 2019 at 07:25:51AM -0700, Fenghua Yu wrote: > But without this small patch, CPUID_7_EDX is 17 instead of > NCAPINTS(19)-1=18 in patch 0002. Of course CPUID_7_EDX is 18 correctly > evetually after applying patch 0003 which add the word 12 back. Ok, then I guess the easiest should

Re: [RFC PATCH 2/3] x86/cpufeatures: Combine word 11 and 12 into new scattered features word 11

2019-06-14 Thread Borislav Petkov
On Fri, Jun 14, 2019 at 07:39:12AM -0700, Sean Christopherson wrote: > KVM can't handle Linux-defined leafs without extra tricks and that's what I'm proposing - an extra trick. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.

Re: [RFC PATCH 2/3] x86/cpufeatures: Combine word 11 and 12 into new scattered features word 11

2019-06-14 Thread Sean Christopherson
On Fri, Jun 14, 2019 at 04:21:39PM +0200, Borislav Petkov wrote: > On Fri, Jun 14, 2019 at 07:14:24AM -0700, Sean Christopherson wrote: > > This is wrong. KVM isn't complaining about shuffling the order of feature > > words, it's complaining that code is trying to do a reverse CPUID lookup > > to

Re: [RFC PATCH 2/3] x86/cpufeatures: Combine word 11 and 12 into new scattered features word 11

2019-06-14 Thread Fenghua Yu
On Fri, Jun 14, 2019 at 04:26:11PM +0200, Borislav Petkov wrote: > On Fri, Jun 14, 2019 at 07:15:20AM -0700, Fenghua Yu wrote: > > Adding this small patch into patch 0002 will solve the build errors without > > changing the build checks. > > There's no need for that if you remove the BUILD_BUG_ON

Re: [RFC PATCH 2/3] x86/cpufeatures: Combine word 11 and 12 into new scattered features word 11

2019-06-14 Thread Borislav Petkov
On Fri, Jun 14, 2019 at 07:15:20AM -0700, Fenghua Yu wrote: > Adding this small patch into patch 0002 will solve the build errors without > changing the build checks. There's no need for that if you remove the BUILD_BUG_ON checks first. -- Regards/Gruss, Boris. Good mailing practices for

Re: [RFC PATCH 2/3] x86/cpufeatures: Combine word 11 and 12 into new scattered features word 11

2019-06-14 Thread Fenghua Yu
On Fri, Jun 14, 2019 at 07:14:24AM -0700, Sean Christopherson wrote: > On Fri, Jun 14, 2019 at 03:41:23PM +0200, Borislav Petkov wrote: > > + Radim and Paolo. See upthread for context. > > > > On Fri, Jun 14, 2019 at 06:17:02AM -0700, Fenghua Yu wrote: > > > > Alternatively - and what I think is

Re: [RFC PATCH 2/3] x86/cpufeatures: Combine word 11 and 12 into new scattered features word 11

2019-06-14 Thread Borislav Petkov
On Fri, Jun 14, 2019 at 07:14:24AM -0700, Sean Christopherson wrote: > This is wrong. KVM isn't complaining about shuffling the order of feature > words, it's complaining that code is trying to do a reverse CPUID lookup > to a feature that isn't in the reverse_cpuid table. Filtering out >

Re: [RFC PATCH 2/3] x86/cpufeatures: Combine word 11 and 12 into new scattered features word 11

2019-06-14 Thread Sean Christopherson
On Fri, Jun 14, 2019 at 03:41:23PM +0200, Borislav Petkov wrote: > + Radim and Paolo. See upthread for context. > > On Fri, Jun 14, 2019 at 06:17:02AM -0700, Fenghua Yu wrote: > > > Alternatively - and what I think is the better solution - would be to > > > remove those BUILD_BUG_ONs in

Re: [RFC PATCH 2/3] x86/cpufeatures: Combine word 11 and 12 into new scattered features word 11

2019-06-14 Thread Borislav Petkov
On Fri, Jun 14, 2019 at 06:51:05AM -0700, Fenghua Yu wrote: > CPUID_7_1_EAX is defined in patch 0003. Should I combine patch 0002 and 0003 > into one patch? That was just an example diff. Generally, patches should do one logical thing. In this case, I'd suggest you make the kvm change the first

Re: [RFC PATCH 2/3] x86/cpufeatures: Combine word 11 and 12 into new scattered features word 11

2019-06-14 Thread Fenghua Yu
On Fri, Jun 14, 2019 at 03:41:23PM +0200, Borislav Petkov wrote: > + Radim and Paolo. See upthread for context. > > On Fri, Jun 14, 2019 at 06:17:02AM -0700, Fenghua Yu wrote: > > > Alternatively - and what I think is the better solution - would be to > > > remove those BUILD_BUG_ONs in

Re: [RFC PATCH 2/3] x86/cpufeatures: Combine word 11 and 12 into new scattered features word 11

2019-06-14 Thread Borislav Petkov
+ Radim and Paolo. See upthread for context. On Fri, Jun 14, 2019 at 06:17:02AM -0700, Fenghua Yu wrote: > > Alternatively - and what I think is the better solution - would be to > > remove those BUILD_BUG_ONs in x86_feature_cpuid and filter out the > > Linux-defined leafs dynamically. This way

Re: [RFC PATCH 2/3] x86/cpufeatures: Combine word 11 and 12 into new scattered features word 11

2019-06-14 Thread Fenghua Yu
On Fri, Jun 14, 2019 at 02:27:50PM +0200, Borislav Petkov wrote: > On Fri, Jun 14, 2019 at 01:44:10PM +0200, Borislav Petkov wrote: > > On Thu, Jun 13, 2019 at 01:51:03PM -0700, Fenghua Yu wrote: > > > It's a waste for the four X86_FEATURE_CQM_* features to occupy two > > > pure feature bits

Re: [RFC PATCH 2/3] x86/cpufeatures: Combine word 11 and 12 into new scattered features word 11

2019-06-14 Thread Borislav Petkov
On Fri, Jun 14, 2019 at 01:44:10PM +0200, Borislav Petkov wrote: > On Thu, Jun 13, 2019 at 01:51:03PM -0700, Fenghua Yu wrote: > > It's a waste for the four X86_FEATURE_CQM_* features to occupy two > > pure feature bits words. To better utilize feature words, re-define > > word 11 to host

Re: [RFC PATCH 2/3] x86/cpufeatures: Combine word 11 and 12 into new scattered features word 11

2019-06-14 Thread Borislav Petkov
On Thu, Jun 13, 2019 at 01:51:03PM -0700, Fenghua Yu wrote: > It's a waste for the four X86_FEATURE_CQM_* features to occupy two > pure feature bits words. To better utilize feature words, re-define > word 11 to host scattered features and move the four X86_FEATURE_CQM_* > features into word 11.

[RFC PATCH 2/3] x86/cpufeatures: Combine word 11 and 12 into new scattered features word 11

2019-06-13 Thread Fenghua Yu
It's a waste for the four X86_FEATURE_CQM_* features to occupy two pure feature bits words. To better utilize feature words, re-define word 11 to host scattered features and move the four X86_FEATURE_CQM_* features into word 11. More scattered features can be added in word 11 in the future. KVM