lkml.org 
[lkml]   [2016]   [Nov]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3] x86/cpuid: expose AVX512_4VNNIW and AVX512_4FMAPS features to kvm guest
On Mon, 7 Nov 2016, Borislav Petkov wrote:

> On Mon, Nov 07, 2016 at 10:10:07AM +0800, He Chen wrote:
> > It should be, but I found it conflcts with `struct cpuid_regs` in
> > `arch/x86/kernel/cpuid.c` since it got exported.
>
> So make the cpuid.c-one static.

That does not work.

processor.h

enum cpuid_regs {
....
};

cpuid.c

struct cpuid_regs {
....
};

How do you make that struct definition static? And even if that'd work, how
would that help to avoid the name clash in cpuid.c?

Not at all.

Both the enum and the struct should be in processor.h obviously with
different names so we won't trip over this once more. And the obvious
naming is:

struct cpuid_regs {
u32 eax, ebx, ecx, edx;
};

enum cpuid_regs_idx {
CPUID_EAX,
CPUID_EBX,
CPUID_ECX,
CPUID_EDX,
};

as CR_E*X is just not intuitive at all.

Thanks,

tglx

\
 
 \ /
  Last update: 2016-11-07 17:51    [W:0.070 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site