lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190614122749.GE2586@zn.tnic>
Date:   Fri, 14 Jun 2019 14:27:50 +0200
From:   Borislav Petkov <bp@...en8.de>
To:     Fenghua Yu <fenghua.yu@...el.com>
Cc:     Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, H Peter Anvin <hpa@...or.com>,
        Christopherson Sean J <sean.j.christopherson@...el.com>,
        Ravi V Shankar <ravi.v.shankar@...el.com>,
        linux-kernel <linux-kernel@...r.kernel.org>, x86 <x86@...nel.org>
Subject: Re: [RFC PATCH 2/3] x86/cpufeatures: Combine word 11 and 12 into new
 scattered features word 11

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 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 doesn't support resctrl now. So it's safe to move the
> > X86_FEATURE_CQM_* features to scattered features word 11 for KVM.
> > 
> > Signed-off-by: Fenghua Yu <fenghua.yu@...el.com>
> 
> ...
> 
> > diff --git a/arch/x86/kvm/cpuid.h b/arch/x86/kvm/cpuid.h
> > index 9a327d5b6d1f..d78a61408243 100644
> > --- a/arch/x86/kvm/cpuid.h
> > +++ b/arch/x86/kvm/cpuid.h
> > @@ -47,8 +47,6 @@ static const struct cpuid_reg reverse_cpuid[] = {
> >  	[CPUID_8000_0001_ECX] = {0x80000001, 0, CPUID_ECX},
> >  	[CPUID_7_0_EBX]       = {         7, 0, CPUID_EBX},
> >  	[CPUID_D_1_EAX]       = {       0xd, 1, CPUID_EAX},
> > -	[CPUID_F_0_EDX]       = {       0xf, 0, CPUID_EDX},
> > -	[CPUID_F_1_EDX]       = {       0xf, 1, CPUID_EDX},
> 
> I think you're going to have to change those to:
> 
>         [CPUID_LNX_4]         = {         0, 0, 0},
>         [CPUID_7_1_EAX]       = {         7, 1, CPUID_EAX },
> 
> instead of removing them because kvm is basically hardcoding the feature
> words and then bitches when array elements in the middle get removed:

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 the array won't have holes in
it.

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ