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=-6.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=no 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 DD658C4727D for ; Wed, 23 Sep 2020 16:51:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A465B20936 for ; Wed, 23 Sep 2020 16:51:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726824AbgIWQvI (ORCPT ); Wed, 23 Sep 2020 12:51:08 -0400 Received: from mga06.intel.com ([134.134.136.31]:17994 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726381AbgIWQut (ORCPT ); Wed, 23 Sep 2020 12:50:49 -0400 IronPort-SDR: cAtwwTepbPSHsdCY3SV8hJC373gLA2yReXYPI+xqCpnpGcO9+uHRR4ZS1b+TE2C3ReA/zlQ3WQ 9s8Dr6WylfiA== X-IronPort-AV: E=McAfee;i="6000,8403,9753"; a="222529024" X-IronPort-AV: E=Sophos;i="5.77,293,1596524400"; d="scan'208";a="222529024" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2020 09:50:48 -0700 IronPort-SDR: S2ARUoPugkAvYLcEzjtZ6EXsuKeT46j6cDERXO6JItuC4CUm78wsMf1d3MVyMcMv+q/piNmTau pZYZ/TkcOVmg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,293,1596524400"; d="scan'208";a="454985293" Received: from sjchrist-coffee.jf.intel.com ([10.54.74.160]) by orsmga004.jf.intel.com with ESMTP; 23 Sep 2020 09:50:48 -0700 From: Sean Christopherson To: Paolo Bonzini Cc: Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/4] KVM: VMX: Add helper+macros to do sec exec adjustment Date: Wed, 23 Sep 2020 09:50:44 -0700 Message-Id: <20200923165048.20486-1-sean.j.christopherson@intel.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a helper function and macro wrappers to consolidate code for adjusting secondary execution controls based on guest CPUID. The adjustments are effectively 10+ lines of copy+paste for each control, with slight tweaks to account for annoying differences, e.g. XSAVES has additional checks. Patches 1-3 are prep work to make INVPCID and RDTSCP align with the "standard" nomenclature so that they don't require special casing. Sean Christopherson (4): KVM: VMX: Rename vmx_*_supported() helpers to cpu_has_vmx_*() KVM: VMX: Unconditionally clear CPUID.INVPCID if !CPUID.PCID KVM: VMX: Rename RDTSCP secondary exec control name to insert "ENABLE" KVM: VMX: Add a helper and macros to reduce boilerplate for sec exec ctls arch/x86/include/asm/vmx.h | 2 +- arch/x86/kvm/vmx/capabilities.h | 10 +- arch/x86/kvm/vmx/nested.c | 4 +- arch/x86/kvm/vmx/vmx.c | 150 +++++++----------- .../selftests/kvm/include/x86_64/vmx.h | 2 +- 5 files changed, 64 insertions(+), 104 deletions(-) -- 2.28.0