Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp754049ybl; Thu, 12 Dec 2019 04:27:59 -0800 (PST) X-Google-Smtp-Source: APXvYqxhojUVlGW2vsGWEVc9A2SbdXYibAdawI0jU2Z5x6gyylrABHCdwlp1NS6xuYBYaNczD2R9 X-Received: by 2002:aca:3846:: with SMTP id f67mr4637549oia.61.1576153679719; Thu, 12 Dec 2019 04:27:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576153679; cv=none; d=google.com; s=arc-20160816; b=nsg5PCbSjB4drPbAvtzn2835mKDfzXThBS7XvfI/vxReXFuPFrtM0HPmwJu0xHXM8p aAW3vxGO1ZCi4DALNkBsoxhDbXSuc9f65HgYmrWfeO+jHi83UurDH60OPH9KfeMyzj8u cp3PX2fhAXVjPE7q7mpfTx2WArgOrZRcBiwsn1uWqpKHmk7NRCo0DKhYgI5CqhgWCWIr SJ9PJjzFCz1vGjwVbd8sEbRsIdZW8H+qdjX4jUsOHO6fzMgpaEjuyEKkFk3vvHcq5d2+ sM1VUo6ICrtcnHPxaNsg/dZrGHiUrnew7GtARGoRaBnxl0Wmqsf3Mrwq0RvS6tgfqIAL HbFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=4nnUQORr01dv2OD8c5wfMXkKjRS70BcFeDE2vIOENyE=; b=X/ywSfuDWF6RKOEzDHFpLR39CJK7LowDvfY/UlJRScRThwV3tpPIQicmYM31sU6cL0 53ay6qRZg6z2nGBcp+6jZMCywwreJlLJVsP387jd83dYDQqQ1KccB6rgFsoTEzo56TYS bj5PCN0K1RKv1HoU6z4m6G92z4fzMilaLWg62CrsthiHvhQigVjG9POXWY6Oyoez518j +23GB0gjIIp5E85xQ0LEoNfNmYb99vLnOLfhKgA+ELUjeS+DeNiYD3rsWxo/seifWLSy DLCi1OLb72V6an6EbS/hajTNzM4F3b+jp5YN/f1HsfEUwIOoTdAemYLzc19ypgpXlqQx pCjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=GGQjyQxl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q9si2829739oif.92.2019.12.12.04.27.46; Thu, 12 Dec 2019 04:27:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=GGQjyQxl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729230AbfLLM0y (ORCPT + 99 others); Thu, 12 Dec 2019 07:26:54 -0500 Received: from mail.skyhub.de ([5.9.137.197]:47930 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729092AbfLLM0x (ORCPT ); Thu, 12 Dec 2019 07:26:53 -0500 Received: from zn.tnic (p200300EC2F0A5A00CC48E6B3BEAE7272.dip0.t-ipconnect.de [IPv6:2003:ec:2f0a:5a00:cc48:e6b3:beae:7272]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 7E6341EC0CF2; Thu, 12 Dec 2019 13:26:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1576153611; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=4nnUQORr01dv2OD8c5wfMXkKjRS70BcFeDE2vIOENyE=; b=GGQjyQxlr2BIjMsm/DkgrYML2PlbdeQ23AAj8AL8zZsLdEGFpqWklMdrOSA1p6kXHl+0TD 4PVP3GRB/BU+2Op9INl4DrlIzJ+CHVnIuFZKeWSOLRXXKPlcR5QLp51FWpJ2Z1kEbJ5f/a PRoHbEAVfhpA3Ic5/DUpTCVH6h3re90= Date: Thu, 12 Dec 2019 13:26:46 +0100 From: Borislav Petkov To: Sean Christopherson Cc: Thomas Gleixner , Ingo Molnar , x86@kernel.org, "H. Peter Anvin" , Peter Zijlstra , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Tony Luck , Tony W Wang-oc , Len Brown , Shuah Khan , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-edac@vger.kernel.org, linux-pm@vger.kernel.org, linux-kselftest@vger.kernel.org, Jarkko Sakkinen Subject: Re: [PATCH v4 11/19] x86/cpu: Print VMX flags in /proc/cpuinfo using VMX_FEATURES_* Message-ID: <20191212122646.GE4991@zn.tnic> References: <20191128014016.4389-1-sean.j.christopherson@intel.com> <20191128014016.4389-12-sean.j.christopherson@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20191128014016.4389-12-sean.j.christopherson@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 27, 2019 at 05:40:08PM -0800, Sean Christopherson wrote: > Add support for generating VMX feature names in capflags.c and use the > resulting x86_vmx_flags to print the VMX flags in /proc/cpuinfo. Don't > print VMX flags if no bits are set in word 0, which holds Pin Controls. > Pin Control's INTR and NMI exiting are fundamental pillars of VMX, if > they are not supported then the CPU is broken, it does not actually > support VMX, or the kernel wasn't built with support for the target CPU. > > Print the features in a dedicated "vmx flags" line to avoid polluting > the common "flags" and to avoid having to prefix all flags with "vmx_", > which results in horrendously long names. > > Keep synthetic VMX flags in cpufeatures to preserve /proc/cpuinfo's ABI > for those flags. This means that "flags" and "vmx flags" will have > duplicate entries for tpr_shadow (virtual_tpr), vnmi (virtual_nmis), > ept, flexpriority, vpid and ept_ad, but caps the pollution of "flags" at > those six VMX features. The vendor specific code that populates the > synthetic flags will be consolidated in a future patch to futher ^ further > +#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 Oh well, some could be shorter: vmx flags : virtual_nmis preemption_timer invvpid ept_x_only ept_ad ept_1gb flexpriority tsc_offsetting virtual_tpr mtf virt_apic_accesses ept vpid unrestricted_guest ple shadow_vmcs pml mode_based_ept_exec virtual_nmis -> vnmis preemption_timer -> preempt_tmr flexpriority -> flexprio tsc_offsetting -> tsc_ofs virtual_tpr -> vtpr virt_apic_accesses -> vapic unrestricted_guest -> unres_guest and so on. Those are just my examples - I betcha the SDM is more creative here with abbreviations. But you guys are going to grep for them. If it were me, I'd save on typing. :-) -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette