Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3120168ybt; Mon, 22 Jun 2020 15:45:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0Rk1zTiTnr9Gr3ctQesi6DYG03Yxb+eOVDNt3F3+cT79yxsldt1O11n58rBJZ6puUqbUw X-Received: by 2002:a17:906:689:: with SMTP id u9mr17231559ejb.13.1592865923487; Mon, 22 Jun 2020 15:45:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592865923; cv=none; d=google.com; s=arc-20160816; b=f0kk/G69OHfJASZ1H4xA4jJBznLvX2k1gz0/Nj4xUqOi4utO8kHCywZC9kxDLu/FVI KIZUCCoOYxgiPlJcHuYlxzFOh3+vtlh0Lw0YSrQvRo/FESEMOvE6y7AqtPfvTDjULppK aCA/VAnonrPckppCe2ZLkqeMZul27GmMmFsoH/h5hoZA5Cn2eSIs1qWn+xPHX5hGXHvl R+q4gg2WJTis7li56/XGBhCsq7tbiQp0ZM7Fdtu7W3hkc+1GT6uyVZ1n6cQ8V22zBddD hnbyMiEI887B1l0HbFm96uPgYvZYMlfSa/WLms6yJACWvA26L6bmWOwlKgqtfJS40pBJ tChA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=r+N8JPGjX5Qs1ZqIZscdHEqmtpmlnEyWxeYERw44+eQ=; b=ubkNfM3qCb/sS2v7dZHUpF2mEUQnOFhjrCnH3cdOMvoBjP6f8F3T/OYHba7muFxVrF jKhfN1BAQ2w80Ucv0MIRwsamDhiDYAj8tugNYn0pNCvSDyf0qj/rZvmR7PwkBdcZOT8M Kjai9UmSIg6TPHOg4bWGD3gquMaJevp2RGaTMKxqlEF5zp3Gs1RFfQAFdGgQSJMv/Gln AgICaEmnE12iBLLCbzpgCUKUBYlwEifKH/g3S6X+YN1ct+Z118lKN6eOOI8sAQETyNnZ aCaR84H9q78fRZEXWlVSB0WpyA22E2PbuEs4f+rTaakBF6WVB17m58MFLgpcJmj+dUcI AA3g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id op23si1686807ejb.694.2020.06.22.15.45.00; Mon, 22 Jun 2020 15:45:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731281AbgFVWnG (ORCPT + 99 others); Mon, 22 Jun 2020 18:43:06 -0400 Received: from mga18.intel.com ([134.134.136.126]:27426 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731253AbgFVWnD (ORCPT ); Mon, 22 Jun 2020 18:43:03 -0400 IronPort-SDR: Oa+ueFLW84wxFleKAjZD1s98UNCorBROw/tXAvsthQJoamNEhd8IDEzREIbp2oEMrjX+NkrzNm V1Y3L420CKNg== X-IronPort-AV: E=McAfee;i="6000,8403,9660"; a="131303579" X-IronPort-AV: E=Sophos;i="5.75,268,1589266800"; d="scan'208";a="131303579" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2020 15:42:56 -0700 IronPort-SDR: 8FKNo0ARdxWg/XLV+akSa+b+mTj3mHGCb4vr3xHaKPfR6kaZmfvZtnIyT2/4/XL23ou7NMG/Az tZ4G8WGCW/3w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,268,1589266800"; d="scan'208";a="264634945" Received: from sjchrist-coffee.jf.intel.com ([10.54.74.152]) by fmsmga008.fm.intel.com with ESMTP; 22 Jun 2020 15:42:55 -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 14/15] KVM: VMX: Rename "vmx_msr_index" to "vmx_uret_msrs_list" Date: Mon, 22 Jun 2020 15:42:48 -0700 Message-Id: <20200622224249.29562-15-sean.j.christopherson@intel.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200622224249.29562-1-sean.j.christopherson@intel.com> References: <20200622224249.29562-1-sean.j.christopherson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Rename "vmx_msr_index" to "vmx_uret_msrs_list" to associate it with the uret MSRs array, and to avoid conflating "MSR's ECX index" with "MSR's index into an array". Similarly, don't use "slot" in the name as that terminology is claimed by the common x86 "user_return_msrs" mechanism. No functional change intended. Signed-off-by: Sean Christopherson --- arch/x86/kvm/vmx/vmx.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index 178315b2758b..e958c911dcf8 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -449,9 +449,9 @@ static unsigned long host_idt_base; * will emulate SYSCALL in legacy mode if the vendor string in guest * CPUID.0:{EBX,ECX,EDX} is "AuthenticAMD" or "AMDisbetter!" To * support this emulation, IA32_STAR must always be included in - * vmx_msr_index[], even in i386 builds. + * vmx_uret_msrs_list[], even in i386 builds. */ -const u32 vmx_msr_index[] = { +const u32 vmx_uret_msrs_list[] = { #ifdef CONFIG_X86_64 MSR_SYSCALL_MASK, MSR_LSTAR, MSR_CSTAR, #endif @@ -630,7 +630,7 @@ static inline int __vmx_find_uret_msr(struct vcpu_vmx *vmx, u32 msr) int i; for (i = 0; i < vmx->nr_uret_msrs; ++i) - if (vmx_msr_index[vmx->guest_uret_msrs[i].index] == msr) + if (vmx_uret_msrs_list[vmx->guest_uret_msrs[i].index] == msr) return i; return -1; } @@ -6888,10 +6888,10 @@ static int vmx_create_vcpu(struct kvm_vcpu *vcpu) goto free_vpid; } - BUILD_BUG_ON(ARRAY_SIZE(vmx_msr_index) != MAX_NR_USER_RETURN_MSRS); + BUILD_BUG_ON(ARRAY_SIZE(vmx_uret_msrs_list) != MAX_NR_USER_RETURN_MSRS); - for (i = 0; i < ARRAY_SIZE(vmx_msr_index); ++i) { - u32 index = vmx_msr_index[i]; + for (i = 0; i < ARRAY_SIZE(vmx_uret_msrs_list); ++i) { + u32 index = vmx_uret_msrs_list[i]; u32 data_low, data_high; int j = vmx->nr_uret_msrs; @@ -7997,8 +7997,8 @@ static __init int hardware_setup(void) store_idt(&dt); host_idt_base = dt.address; - for (i = 0; i < ARRAY_SIZE(vmx_msr_index); ++i) - kvm_define_user_return_msr(i, vmx_msr_index[i]); + for (i = 0; i < ARRAY_SIZE(vmx_uret_msrs_list); ++i) + kvm_define_user_return_msr(i, vmx_uret_msrs_list[i]); if (setup_vmcs_config(&vmcs_config, &vmx_capability) < 0) return -EIO; -- 2.26.0