linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Borislav Petkov <bp@alien8.de>
Cc: "He Chen" <he.chen@linux.intel.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	x86@kernel.org, "Paolo Bonzini" <pbonzini@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	"Ingo Molnar" <mingo@redhat.com>,
	"H . Peter Anvin" <hpa@zytor.com>,
	"Luwei Kang" <luwei.kang@intel.com>,
	"Piotr Luc" <Piotr.Luc@intel.com>
Subject: Re: [PATCH v3] x86/cpuid: expose AVX512_4VNNIW and AVX512_4FMAPS features to kvm guest
Date: Mon, 7 Nov 2016 17:47:21 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.20.1611071738480.3709@nanos> (raw)
In-Reply-To: <20161107090504.f5didblo3p7xz5wg@pd.tnic>

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

  reply	other threads:[~2016-11-07 16:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-04  7:07 [PATCH v3] x86/cpuid: expose AVX512_4VNNIW and AVX512_4FMAPS features to kvm guest He Chen
2016-11-04 10:52 ` Borislav Petkov
2016-11-04 14:53   ` Paolo Bonzini
2016-11-04 15:06     ` Borislav Petkov
2016-11-04 15:13       ` Paolo Bonzini
2016-11-04 15:57         ` Borislav Petkov
2016-11-04 15:58           ` Paolo Bonzini
2016-11-07 16:52         ` Thomas Gleixner
2016-11-07  2:10   ` He Chen
2016-11-07  9:05     ` Borislav Petkov
2016-11-07 16:47       ` Thomas Gleixner [this message]
2016-11-07 17:07         ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.20.1611071738480.3709@nanos \
    --to=tglx@linutronix.de \
    --cc=Piotr.Luc@intel.com \
    --cc=bp@alien8.de \
    --cc=he.chen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luwei.kang@intel.com \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).