From: Jim Mattson <jmattson@google.com>
To: kvm@vger.kernel.org
Cc: Jim Mattson <jmattson@google.com>
Subject: [PATCH 1/3] kvm: vmx: Introduce VMCS12_MAX_FIELD_INDEX
Date: Thu, 21 Dec 2017 12:46:21 -0800 [thread overview]
Message-ID: <20171221204623.164581-2-jmattson@google.com> (raw)
In-Reply-To: <20171221204623.164581-1-jmattson@google.com>
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 <jmattson@google.com>
---
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;
}
/*
--
2.15.1.620.gb9897f4670-goog
next prev parent reply other threads:[~2017-12-21 20:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-21 20:46 [PATCH 0/3] Reduce the size of the vmcs_field_to_offset_table Jim Mattson
2017-12-21 20:46 ` Jim Mattson [this message]
2017-12-22 20:11 ` [PATCH v2 1/3] kvm: vmx: Introduce VMCS12_MAX_FIELD_INDEX Jim Mattson
2018-01-18 16:46 ` David Hildenbrand
2017-12-21 20:46 ` [PATCH 2/3] kvm: vmx: Change vmcs_field_type to vmcs_field_width Jim Mattson
2017-12-22 20:12 ` [PATCH v2 " Jim Mattson
2017-12-21 20:46 ` [PATCH 3/3] kvm: vmx: Reduce size of vmcs_field_to_offset_table Jim Mattson
2017-12-22 16:26 ` Paolo Bonzini
2017-12-22 18:28 ` Jim Mattson
2017-12-22 20:13 ` [PATCH v2 " Jim Mattson
2017-12-22 20:09 ` [PATCH v2 0/3] Reduce the size of the vmcs_field_to_offset_table Jim Mattson
2018-01-01 22:55 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171221204623.164581-2-jmattson@google.com \
--to=jmattson@google.com \
--cc=kvm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).