From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753531AbcKGQuO (ORCPT ); Mon, 7 Nov 2016 11:50:14 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:52494 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752147AbcKGQuN (ORCPT ); Mon, 7 Nov 2016 11:50:13 -0500 Date: Mon, 7 Nov 2016 17:47:21 +0100 (CET) From: Thomas Gleixner To: Borislav Petkov cc: He Chen , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, Paolo Bonzini , =?ISO-8859-2?Q?Radim_Kr=E8m=E1=F8?= , Ingo Molnar , "H . Peter Anvin" , Luwei Kang , Piotr Luc Subject: Re: [PATCH v3] x86/cpuid: expose AVX512_4VNNIW and AVX512_4FMAPS features to kvm guest In-Reply-To: <20161107090504.f5didblo3p7xz5wg@pd.tnic> Message-ID: References: <1478243239-15586-1-git-send-email-he.chen@linux.intel.com> <20161104105235.qbqvmsv4ikajvjtu@pd.tnic> <20161107021007.GA28372@he> <20161107090504.f5didblo3p7xz5wg@pd.tnic> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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