From patchwork Tue Aug 1 18:55:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Borislav Petkov X-Patchwork-Id: 9875245 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 78A1E60390 for ; Tue, 1 Aug 2017 18:56:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C53E1FF40 for ; Tue, 1 Aug 2017 18:56:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6089128739; Tue, 1 Aug 2017 18:56:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD14522B27 for ; Tue, 1 Aug 2017 18:56:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752016AbdHAS4m (ORCPT ); Tue, 1 Aug 2017 14:56:42 -0400 Received: from mail.skyhub.de ([5.9.137.197]:37102 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751936AbdHAS4l (ORCPT ); Tue, 1 Aug 2017 14:56:41 -0400 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de Received: from mail.skyhub.de ([127.0.0.1]) by localhost (blast.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id R9N_unLeQAQd; Tue, 1 Aug 2017 20:56:40 +0200 (CEST) Received: from nazgul.tnic (89-25-53-1.ip.btc-net.bg [89.25.53.1]) (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 992E41EC014F; Tue, 1 Aug 2017 20:56:39 +0200 (CEST) Date: Tue, 1 Aug 2017 20:55:52 +0200 From: Borislav Petkov To: Radim =?utf-8?B?S3LEjW3DocWZ?= Cc: Janakarajan Natarajan , Paolo Bonzini , x86-ml , lkml , kvm-ML , =?utf-8?B?SsO2cmcgUsO2ZGVs?= Subject: [PATCH] x86/cpufeature, kvm/svm: Shorten virtualized VMSAVE/VMLOAD flag Message-ID: <20170801185552.GA3743@nazgul.tnic> References: <20170801155618.GA2870@nazgul.tnic> <20170801174110.GA1437@flask> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170801174110.GA1437@flask> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, Aug 01, 2017 at 07:41:11PM +0200, Radim Krčmář wrote: > I think Janakarajan trimmed the output just to kvm. I'll start bitching > about that. Thanks! > (PPR for family 17h has it called "v_vmsave_vmload".) Grr, right, it says "V_VMSAVE_VMLOAD:" but then it says "virtualized VMLOAD and VMSAVE..." If people would only make up their mind about the order... But I *think* the name of the CPUID bit is relevant. Anyway, here's a v2: --- From: Borislav Petkov Date: Tue, 1 Aug 2017 17:32:47 +0200 Subject: [PATCH] x86/cpufeature, kvm/svm: Shorten virtualized VMSAVE/VMLOAD flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "virtual_vmload_vmsave" is what is going to land in /proc/cpuinfo now for a single feature bit which is clearly too long. So call it like it is called in the processor manual. "v_vmsave_vmload" is a bit shorter, after all. We could go more aggressively here but having it the same as in the processor manual is advantageous. Signed-off-by: Borislav Petkov Cc: Janakarajan Natarajan Cc: Paolo Bonzini Cc: Radim Krčmář --- arch/x86/include/asm/cpufeatures.h | 2 +- arch/x86/kvm/svm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h index ca3c48c0872f..5a28e8e55e36 100644 --- a/arch/x86/include/asm/cpufeatures.h +++ b/arch/x86/include/asm/cpufeatures.h @@ -286,7 +286,7 @@ #define X86_FEATURE_PAUSEFILTER (15*32+10) /* filtered pause intercept */ #define X86_FEATURE_PFTHRESHOLD (15*32+12) /* pause filter threshold */ #define X86_FEATURE_AVIC (15*32+13) /* Virtual Interrupt Controller */ -#define X86_FEATURE_VIRTUAL_VMLOAD_VMSAVE (15*32+15) /* Virtual VMLOAD VMSAVE */ +#define X86_FEATURE_V_VMSAVE_VMLOAD (15*32+15) /* Virtual VMSAVE VMLOAD */ /* Intel-defined CPU features, CPUID level 0x00000007:0 (ecx), word 16 */ #define X86_FEATURE_AVX512VBMI (16*32+ 1) /* AVX512 Vector Bit Manipulation instructions*/ diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 4d8141e533c3..f4965cc7ba1e 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -1100,7 +1100,7 @@ static __init int svm_hardware_setup(void) if (vls) { if (!npt_enabled || - !boot_cpu_has(X86_FEATURE_VIRTUAL_VMLOAD_VMSAVE) || + !boot_cpu_has(X86_FEATURE_V_VMSAVE_VMLOAD) || !IS_ENABLED(CONFIG_X86_64)) { vls = false; } else {