[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180926111139.GA12037@linux.intel.com>
Date: Wed, 26 Sep 2018 14:11:39 +0300
From: Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
To: Borislav Petkov <bp@...en8.de>
Cc: x86@...nel.org, platform-driver-x86@...r.kernel.org,
dave.hansen@...el.com, sean.j.christopherson@...el.com,
nhorman@...hat.com, npmccallum@...hat.com, serge.ayoun@...el.com,
shay.katz-zamir@...el.com, linux-sgx@...r.kernel.org,
andriy.shevchenko@...ux.intel.com,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>,
Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
David Woodhouse <dwmw@...zon.co.uk>,
David Wang <davidwang@...oxin.com>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
"Levin, Alexander (Sasha Levin)" <alexander.levin@...izon.com>,
Jia Zhang <qianyue.zj@...baba-inc.com>,
"open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)"
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v14 04/19] x86/cpufeatures: Add SGX feature bits
On Tue, Sep 25, 2018 at 06:48:54PM +0200, Borislav Petkov wrote:
> > + eax = cpuid_eax(SGX_CPUID);
> > +
> > + if (eax & _X86_FEATURE_SGX1)
> > + set_cpu_cap(c, X86_FEATURE_SGX1);
> > +
> > + if (eax & _X86_FEATURE_SGX2)
> > + set_cpu_cap(c, X86_FEATURE_SGX2);
> > +
> > + if (eax & _X86_FEATURE_SGX_ENCLV)
> > + set_cpu_cap(c, X86_FEATURE_SGX_ENCLV);
> > +
> > + if (eax & _X86_FEATURE_SGX_ENCLS_C)
> > + set_cpu_cap(c, X86_FEATURE_SGX_ENCLS_C);
>
>
> Look at arch/x86/kernel/cpu/scattered.c for how to do this properly.
Thank you. I guess I understand what you want me to do i.e.
+ { X86_FEATURE_SGX1, CPUID_EAX, 0, 0x00000012, 0 },
+ { X86_FEATURE_SGX2, CPUID_EAX, 1, 0x00000012, 0 },
+ { X86_FEATURE_ENCLV, CPUID_EAX, 5, 0x00000012, 0 },
+ { X86_FEATURE_ENCLS_C, CPUID_EAX, 6, 0x00000012, 0 },
What puzzles me is that I cannot find any call site for
get_scattered_cpuid_leaf():
$ git grep get_scattered
arch/x86/kernel/cpu/cpu.h:extern u32 get_scattered_cpuid_leaf(unsigned int level,
arch/x86/kernel/cpu/scattered.c:u32 get_scattered_cpuid_leaf(unsigned int level, unsigned int sub_leaf,
arch/x86/kernel/cpu/scattered.c:EXPORT_SYMBOL_GPL(get_scattered_cpuid_leaf);
/Jarkko
Powered by blists - more mailing lists