public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: kvm@vger.kernel.org
Cc: "Stephen Hemminger" <sthemmin@microsoft.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	"Haiyang Zhang" <haiyangz@microsoft.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org,
	"Michael Kelley (EOSG)" <Michael.H.Kelley@microsoft.com>,
	"Bandan Das" <bsd@redhat.com>,
	"Roman Kagan" <rkagan@virtuozzo.com>,
	devel@linuxdriverproject.org,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Mohammed Gamal" <mmorsy@redhat.com>
Subject: [PATCH RFC 3/7] KVM: nVMX: add I/O exit ECX, ESI, EDI, EIP vmcs12 fields
Date: Mon, 18 Dec 2017 18:17:38 +0100	[thread overview]
Message-ID: <20171218171742.5765-4-vkuznets@redhat.com> (raw)
In-Reply-To: <20171218171742.5765-1-vkuznets@redhat.com>

From: Ladi Prosek <lprosek@redhat.com>

These non-synthetic VMCS fields were not supported by KVM thus far. The
layout is according to Hyper-V TLFS 5.0b, the physical encoding according
to the Intel SDM.

Signed-off-by: Ladi Prosek <lprosek@redhat.com>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
 arch/x86/include/asm/vmx.h | 4 ++++
 arch/x86/kvm/vmx.c         | 9 ++++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/vmx.h b/arch/x86/include/asm/vmx.h
index 8b6780751132..92a10aa839e6 100644
--- a/arch/x86/include/asm/vmx.h
+++ b/arch/x86/include/asm/vmx.h
@@ -298,6 +298,10 @@ enum vmcs_field {
 	CR3_TARGET_VALUE2               = 0x0000600c,
 	CR3_TARGET_VALUE3               = 0x0000600e,
 	EXIT_QUALIFICATION              = 0x00006400,
+	EXIT_IO_INSTR_ECX               = 0x00006402,
+	EXIT_IO_INSTR_ESI               = 0x00006404,
+	EXIT_IO_INSTR_EDI               = 0x00006406,
+	EXIT_IO_INSTR_EIP               = 0x00006408,
 	GUEST_LINEAR_ADDRESS            = 0x0000640a,
 	GUEST_CR0                       = 0x00006800,
 	GUEST_CR3                       = 0x00006802,
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index cd5f29a57880..f3215b6a0531 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -391,7 +391,10 @@ struct __packed vmcs12 {
 			u32 vmx_instruction_info;
 
 			natural_width exit_qualification;
-			natural_width padding64_3[4];
+			natural_width exit_io_instr_ecx;
+			natural_width exit_io_instr_esi;
+			natural_width exit_io_instr_edi;
+			natural_width exit_io_instr_eip;
 
 			natural_width guest_linear_address;
 			natural_width guest_rsp;
@@ -913,6 +916,10 @@ static const unsigned short vmcs_field_to_offset_table[] = {
 	FIELD(CR3_TARGET_VALUE2, cr3_target_value2),
 	FIELD(CR3_TARGET_VALUE3, cr3_target_value3),
 	FIELD(EXIT_QUALIFICATION, exit_qualification),
+	FIELD(EXIT_IO_INSTR_ECX, exit_io_instr_ecx),
+	FIELD(EXIT_IO_INSTR_ESI, exit_io_instr_esi),
+	FIELD(EXIT_IO_INSTR_EDI, exit_io_instr_edi),
+	FIELD(EXIT_IO_INSTR_EIP, exit_io_instr_eip),
 	FIELD(GUEST_LINEAR_ADDRESS, guest_linear_address),
 	FIELD(GUEST_CR0, guest_cr0),
 	FIELD(GUEST_CR3, guest_cr3),
-- 
2.14.3

  parent reply	other threads:[~2017-12-18 17:17 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-18 17:17 [PATCH RFC 0/7] KVM: nVMX: enlightened VMCS initial implementation Vitaly Kuznetsov
2017-12-18 17:17 ` [PATCH RFC 1/7] KVM: x86: rename HV_X64_MSR_APIC_ASSIST_PAGE to HV_X64_MSR_VP_ASSIST_PAGE Vitaly Kuznetsov
2017-12-18 17:17 ` [PATCH RFC 2/7] KVM: nVMX: modify vmcs12 fields to match Hyper-V enlightened VMCS Vitaly Kuznetsov
2017-12-18 20:23   ` Jim Mattson
2017-12-18 21:28     ` Jim Mattson
2017-12-19 12:25       ` Vitaly Kuznetsov
2017-12-19 12:37         ` Paolo Bonzini
2017-12-19 17:40           ` Jim Mattson
2017-12-19 21:19             ` Paolo Bonzini
2017-12-21 13:02           ` Vitaly Kuznetsov
2017-12-19 17:44         ` Jim Mattson
2017-12-18 17:17 ` Vitaly Kuznetsov [this message]
2017-12-18 17:17 ` [PATCH RFC 4/7] KVM: hyperv: define VP assist page structure and add helpers Vitaly Kuznetsov
2017-12-18 17:17 ` [PATCH RFC 5/7] KVM: nVMX: add KVM_CAP_HYPERV_ENLIGHTENED_VMCS capability Vitaly Kuznetsov
2017-12-18 17:17 ` [PATCH RFC 6/7] KVM: nVMX: add enlightened VMCS state Vitaly Kuznetsov
2017-12-18 17:17 ` [PATCH RFC 7/7] KVM: nVMX: implement enlightened VMPTRLD Vitaly Kuznetsov
2017-12-19 12:41 ` [PATCH RFC 0/7] KVM: nVMX: enlightened VMCS initial implementation Paolo Bonzini
2017-12-19 13:21   ` Vitaly Kuznetsov
2017-12-21 12:50     ` Vitaly Kuznetsov
2017-12-21 14:32       ` Paolo Bonzini
2017-12-21 15:08         ` Vitaly Kuznetsov

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=20171218171742.5765-4-vkuznets@redhat.com \
    --to=vkuznets@redhat.com \
    --cc=Michael.H.Kelley@microsoft.com \
    --cc=bsd@redhat.com \
    --cc=devel@linuxdriverproject.org \
    --cc=haiyangz@microsoft.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmorsy@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=rkagan@virtuozzo.com \
    --cc=rkrcmar@redhat.com \
    --cc=sthemmin@microsoft.com \
    --cc=x86@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