From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86066C47404 for ; Mon, 7 Oct 2019 19:56:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 653B22084D for ; Mon, 7 Oct 2019 19:56:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728330AbfJGT4k (ORCPT ); Mon, 7 Oct 2019 15:56:40 -0400 Received: from mga04.intel.com ([192.55.52.120]:27834 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728212AbfJGT4k (ORCPT ); Mon, 7 Oct 2019 15:56:40 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Oct 2019 12:56:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,269,1566889200"; d="scan'208";a="223020250" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.41]) by fmsmga002.fm.intel.com with ESMTP; 07 Oct 2019 12:56:38 -0700 Date: Mon, 7 Oct 2019 12:56:38 -0700 From: Sean Christopherson To: Paolo Bonzini Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, Peter Zijlstra , Arnaldo Carvalho de Melo , Radim =?utf-8?B?S3LEjW3DocWZ?= , Tony Luck , Tony W Wang-oc , "H. Peter Anvin" , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-edac@vger.kernel.org, Borislav Petkov , Jarkko Sakkinen Subject: Re: [PATCH 11/16] x86/cpu: Print VMX features as separate line item in /proc/cpuinfo Message-ID: <20191007195638.GG18016@linux.intel.com> References: <20191004215615.5479-1-sean.j.christopherson@intel.com> <20191004215615.5479-12-sean.j.christopherson@intel.com> <55f45459-47bf-df37-a12b-17c4c5c6c19a@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55f45459-47bf-df37-a12b-17c4c5c6c19a@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-edac-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-edac@vger.kernel.org On Mon, Oct 07, 2019 at 07:12:37PM +0200, Paolo Bonzini wrote: > On 04/10/19 23:56, Sean Christopherson wrote: > > diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c > > index cb2e49810d68..4eec8889b0ff 100644 > > --- a/arch/x86/kernel/cpu/proc.c > > +++ b/arch/x86/kernel/cpu/proc.c > > @@ -7,6 +7,10 @@ > > > > #include "cpu.h" > > > > +#ifdef CONFIG_X86_VMX_FEATURE_NAMES > > +extern const char * const x86_vmx_flags[NVMXINTS*32]; > > +#endif > > + > > /* > > * Get CPU information for use by the procfs. > > */ > > @@ -102,6 +106,17 @@ static int show_cpuinfo(struct seq_file *m, void *v) > > if (cpu_has(c, i) && x86_cap_flags[i] != NULL) > > seq_printf(m, " %s", x86_cap_flags[i]); > > I'm afraid this is going to break some scripts in the wild. I would > simply remove the seq_puts below. Can you elaborate? I'm having trouble connecting the dots... > Paolo > > > +#ifdef CONFIG_X86_VMX_FEATURE_NAMES > > + if (cpu_has(c, X86_FEATURE_VMX) && c->vmx_capability[0]) { > > + seq_puts(m, "\nvmx flags\t:"); > > + for (i = 0; i < 32*NVMXINTS; i++) { > > + if (test_bit(i, (unsigned long *)c->vmx_capability) && > > + x86_vmx_flags[i] != NULL) > > + seq_printf(m, " %s", x86_vmx_flags[i]); > > + } > > + } > > +#endif > > + > > seq_puts(m, "\nbugs\t\t:"); > > for (i = 0; i < 32*NBUGINTS; i++) { > > unsigned int bug_bit = 32*NCAPINTS + i;