From patchwork Fri Dec 22 20:11:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Mattson X-Patchwork-Id: 10131035 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 752D16038F for ; Fri, 22 Dec 2017 20:11:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 66F3929CCE for ; Fri, 22 Dec 2017 20:11:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5AAE129E21; Fri, 22 Dec 2017 20:11:33 +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 037F929CCE for ; Fri, 22 Dec 2017 20:11:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756790AbdLVUL3 (ORCPT ); Fri, 22 Dec 2017 15:11:29 -0500 Received: from mail-it0-f67.google.com ([209.85.214.67]:46137 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756764AbdLVUL3 (ORCPT ); Fri, 22 Dec 2017 15:11:29 -0500 Received: by mail-it0-f67.google.com with SMTP id t1so15479201ite.5 for ; Fri, 22 Dec 2017 12:11:28 -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=SzvsLT8Fq3j2myq7Rt8wKw/Pn9xK6ahOofJnXR4y/QHWflhy61UZr8sSjRlpH0V9se LVSyOmaSViAkPmMzEXL5R0E0iPKzqEO3yvXGuBGWwKrte+2LrOe03PBOMasggue6s8LD B5ujemBJYIfGYOavo5yv60BSwgZrNw40YUT2J4hXTtKIxnQD5TY77TyfQ0U52XMNY2uH oYJUE7iKsmzN1sQ9sg18QEnPZ3/HreQ7RTWB6vJ3B0rw3fQdH4uxX7YN34irMZp6iIBv s6zrt8FapcSlbSvGz/uWtkT0ZIMzDzEhbcTjqI3WHVUG07TgRNabnd5FNBoASNI4Jjg5 +RJw== 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=jl/dTT7rkCP+L65PzDdCVJLRWRXBjlxRErr6mM9u7MyAAJH1la7xK+Hel69Rz23WxW WB71LmO28LYYPDgLlbGIrV0X3USY8cldnOVyi+7o2TNIOISpgQo4COyIfiwJvdOAemyA VHQFbAmxb5fZEl5r0xADy3FUMEwUoQIoTXJH7EiaPZyZ9peRQypXirLrCmFRiPdEYV5d PrP9swmRNA/b23f11MD+5EzRWyYudLhiRGbIEkdxS1l2VX94fQg1XHIzH9BxZ59AhJrx wl9jn10VV+QzaSVVF9yY4EF5PC4M6/tn2tw8mepAA/bOjzOlHllEF5Zk1dSTMHjVgEXC nSFw== X-Gm-Message-State: AKGB3mLXUV6MR3NR4YZlMzSRE1bhJYROWo23uXB2y7mCjZfqwOfh5Dnu kEqqNEYX4RF442z2z4vkizVzaMf57G8= X-Google-Smtp-Source: ACJfBosrxsryZVrsa/gLrVo7zXTpmtUZO5NTXqp9syGghfNEoqxkcgzrXlyR3AaRXqUJBJPgTBqwWA== X-Received: by 10.36.230.134 with SMTP id e128mr18760075ith.24.1513973488151; Fri, 22 Dec 2017 12:11:28 -0800 (PST) Received: from turtle.sea.corp.google.com ([100.100.207.61]) by smtp.gmail.com with ESMTPSA id q3sm2169862ioh.40.2017.12.22.12.11.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Dec 2017 12:11:27 -0800 (PST) From: Jim Mattson To: kvm@vger.kernel.org, Paolo Bonzini Cc: Jim Mattson Subject: [PATCH v2 1/3] kvm: vmx: Introduce VMCS12_MAX_FIELD_INDEX Date: Fri, 22 Dec 2017 12:11:12 -0800 Message-Id: <20171222201112.97818-1-jmattson@google.com> X-Mailer: git-send-email 2.15.1.620.gb9897f4670-goog In-Reply-To: <20171221204623.164581-2-jmattson@google.com> References: <20171221204623.164581-2-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 Reviewed-by: David Hildenbrand --- 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; } /*