From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965510AbdLRRSM (ORCPT ); Mon, 18 Dec 2017 12:18:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38338 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759910AbdLRRSE (ORCPT ); Mon, 18 Dec 2017 12:18:04 -0500 From: Vitaly Kuznetsov To: kvm@vger.kernel.org Cc: x86@kernel.org, Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , "Michael Kelley (EOSG)" , Mohammed Gamal , Cathy Avery , Bandan Das , Roman Kagan , linux-kernel@vger.kernel.org, devel@linuxdriverproject.org 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 Message-Id: <20171218171742.5765-4-vkuznets@redhat.com> In-Reply-To: <20171218171742.5765-1-vkuznets@redhat.com> References: <20171218171742.5765-1-vkuznets@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 18 Dec 2017 17:18:04 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ladi Prosek 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 Signed-off-by: Vitaly Kuznetsov --- 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