From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roman Kagan Subject: [PATCH kvm-unit-tests 4/5] hyperv: add more hyperv definitions Date: Tue, 6 Jun 2017 22:19:58 +0300 Message-ID: <20170606191959.16987-5-rkagan@virtuozzo.com> References: <20170606191959.16987-1-rkagan@virtuozzo.com> Mime-Version: 1.0 Content-Type: text/plain Cc: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Evgeny Yakovlev , "Denis V . Lunev" To: kvm@vger.kernel.org Return-path: Received: from mail-eopbgr50104.outbound.protection.outlook.com ([40.107.5.104]:6899 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751606AbdFFTUm (ORCPT ); Tue, 6 Jun 2017 15:20:42 -0400 In-Reply-To: <20170606191959.16987-1-rkagan@virtuozzo.com> Sender: kvm-owner@vger.kernel.org List-ID: Add Hyper-V definitions necessary for message end event connection tests. Signed-off-by: Roman Kagan --- x86/hyperv.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/x86/hyperv.h b/x86/hyperv.h index 76a569a..e135221 100644 --- a/x86/hyperv.h +++ b/x86/hyperv.h @@ -10,6 +10,9 @@ #define HV_X64_MSR_SYNIC_AVAILABLE (1 << 2) #define HV_X64_MSR_SYNTIMER_AVAILABLE (1 << 3) +#define HV_X64_MSR_GUEST_OS_ID 0x40000000 +#define HV_X64_MSR_HYPERCALL 0x40000001 + #define HV_X64_MSR_TIME_REF_COUNT 0x40000020 #define HV_X64_MSR_REFERENCE_TSC 0x40000021 @@ -155,6 +158,31 @@ struct hv_message_page { struct hv_message sint_message[HV_SYNIC_SINT_COUNT]; }; +#define HV_EVENT_FLAGS_COUNT (256 * 8) + +struct hv_event_flags { + ulong flags[HV_EVENT_FLAGS_COUNT / (8 * sizeof(ulong))]; +}; + +struct hv_event_flags_page { + struct hv_event_flags slot[HV_SYNIC_SINT_COUNT]; +}; + +#define HV_X64_MSR_HYPERCALL_ENABLE 0x1 + +#define HV_HYPERCALL_FAST (1u << 16) + +#define HVCALL_POST_MESSAGE 0x5c +#define HVCALL_SIGNAL_EVENT 0x5d + +struct hv_input_post_message { + u32 connectionid; + u32 reserved; + u32 message_type; + u32 payload_size; + u64 payload[HV_MESSAGE_PAYLOAD_QWORD_COUNT]; +}; + static inline bool synic_supported(void) { return cpuid(HYPERV_CPUID_FEATURES).a & HV_X64_MSR_SYNIC_AVAILABLE; -- 2.9.4