From patchwork Thu Dec 21 20:46:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Mattson X-Patchwork-Id: 10128381 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 B330D603B5 for ; Thu, 21 Dec 2017 20:47:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A72DD29E09 for ; Thu, 21 Dec 2017 20:47:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9C23E29E10; Thu, 21 Dec 2017 20:47:14 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham 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 4B30629E09 for ; Thu, 21 Dec 2017 20:47:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755468AbdLUUrM (ORCPT ); Thu, 21 Dec 2017 15:47:12 -0500 Received: from mail-io0-f196.google.com ([209.85.223.196]:35585 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753178AbdLUUrL (ORCPT ); Thu, 21 Dec 2017 15:47:11 -0500 Received: by mail-io0-f196.google.com with SMTP id 14so15900434iou.2 for ; Thu, 21 Dec 2017 12:47:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZTzsIG60Boqeg+REhAFxF3iAl91sNlVZ2HItDH+dPPs=; b=stQUn661P7WdiJOCtZMF+QJdrwDK+wwONbRxAb5ngE6mi/86MRN3x7aCvZmn1aDdTq htMqdRUrLWJez25a5GHrdqh3z89k11e36yFZmPEyzVy8scjvZ1/7gh+1r5nrlr5qb/dQ IkUq9vCR5Ih0au28XwDVQrlhKPPEyrVSl7Ll3MB8Ikx6PstnXZWzU1twpoLsxIf08OOh 9LlUBMFGebxj7MtBoYr3wOs9ISHfR14ALkXPXIGc9aJHjjteSM1pqAo8AX24G55t8Vm8 uMEV2jp3oau3I1vq9+7lVc6CHMXkY9N5EBWsW1dvTHVW2v3l2Zfdfn2dJK/oCAWxJfkE DZ8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZTzsIG60Boqeg+REhAFxF3iAl91sNlVZ2HItDH+dPPs=; b=s8vxlFkw5i+NH9LvLi9eeo/RfKaUIGlYmUXwr9HRpNbu2eaBA5poSQAELoXH3DZltH c3e43zKtugplV9FnPwd309w86jkk7NnVoLRac1Wnq/Na1wODat8HAfAtj/wFrx5SO1Ei CcqPzj6gPTf6DxIJfT9QxXHLqBYLIo/w7BMoX4OUnhAbYz6gF/YD7wRWfzKo3ay03ZAL WDVQrNnXJvANYMKMEyhgaU52Mjre44WQxW8xeUaQfFamEs+I4pXd3gXP3L0W/3hg91jo 515KDKv4/8YmnNU9/c86H06neSENaA/fl7Gl1/bNuxL+Xdect091p39rIyunNlUhxmdn ajvQ== X-Gm-Message-State: AKGB3mKNsEJL+FFRKHBYr1//fcP9ctEbWd1IPSEjoXucKcz54Vw2ixT5 VAD7yL6AaYFNn8Kun6Z2KNtdHu6jcXU= X-Google-Smtp-Source: ACJfBot7K1COm+NVbiha1KL71KYD4LvNRqaAP4aoEBFkDvI3de7D0/S7OFVgjakzIDrayV6XOVmyIA== X-Received: by 10.107.128.98 with SMTP id b95mr15804632iod.57.1513889230578; Thu, 21 Dec 2017 12:47:10 -0800 (PST) Received: from turtle.sea.corp.google.com ([100.100.207.61]) by smtp.gmail.com with ESMTPSA id s4sm4622920ita.12.2017.12.21.12.47.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Dec 2017 12:47:10 -0800 (PST) From: Jim Mattson To: kvm@vger.kernel.org Cc: Jim Mattson Subject: [PATCH 1/3] kvm: vmx: Introduce VMCS12_MAX_FIELD_INDEX Date: Thu, 21 Dec 2017 12:46:21 -0800 Message-Id: <20171221204623.164581-2-jmattson@google.com> X-Mailer: git-send-email 2.15.1.620.gb9897f4670-goog In-Reply-To: <20171221204623.164581-1-jmattson@google.com> References: <20171221204623.164581-1-jmattson@google.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This is the highest index value used in any supported VMCS12 field encoding. It is used to populate the IA32_VMX_VMCS_ENUM MSR. Signed-off-by: Jim Mattson --- arch/x86/kvm/vmx.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 669f5f74857d..dfce28498636 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -418,6 +418,12 @@ struct __packed vmcs12 { */ #define VMCS12_SIZE 0x1000 +/* + * VMCS12_MAX_FIELD_INDEX is the highest index value used in any + * supported VMCS12 field encoding. + */ +#define VMCS12_MAX_FIELD_INDEX 0x17 + /* * The nested_vmx structure is part of vcpu_vmx, and holds information we need * for correct emulation of VMX (i.e., nested VMX) on this vcpu. @@ -3005,7 +3011,7 @@ static void nested_vmx_setup_ctls_msrs(struct vcpu_vmx *vmx) rdmsrl(MSR_IA32_VMX_CR4_FIXED1, vmx->nested.nested_vmx_cr4_fixed1); /* highest index: VMX_PREEMPTION_TIMER_VALUE */ - vmx->nested.nested_vmx_vmcs_enum = 0x2e; + vmx->nested.nested_vmx_vmcs_enum = VMCS12_MAX_FIELD_INDEX << 1; } /*