diff options
author | Andrey Smetanin <asmetanin@virtuozzo.com> | 2015-11-30 11:22:15 -0500 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-12-16 12:49:40 -0500 |
commit | 5b423efe11e822e092e8c911a6bad17eadf718eb (patch) | |
tree | cb9e9d7595ad84958e0efd38036cfbd7cf656af4 /arch/x86/include | |
parent | 4f39bcfd1c132522380138a323f9af7902766301 (diff) |
drivers/hv: Move struct hv_message into UAPI Hyper-V x86 header
This struct is required for Hyper-V SynIC timers implementation inside KVM
and for upcoming Hyper-V VMBus support by userspace(QEMU). So place it into
Hyper-V UAPI header.
Signed-off-by: Andrey Smetanin <asmetanin@virtuozzo.com>
Acked-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Roman Kagan <rkagan@virtuozzo.com>
CC: Gleb Natapov <gleb@kernel.org>
CC: Paolo Bonzini <pbonzini@redhat.com>
CC: "K. Y. Srinivasan" <kys@microsoft.com>
CC: Haiyang Zhang <haiyangz@microsoft.com>
CC: Vitaly Kuznetsov <vkuznets@redhat.com>
CC: Roman Kagan <rkagan@virtuozzo.com>
CC: Denis V. Lunev <den@openvz.org>
CC: qemu-devel@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/include')
-rw-r--r-- | arch/x86/include/uapi/asm/hyperv.h | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/arch/x86/include/uapi/asm/hyperv.h b/arch/x86/include/uapi/asm/hyperv.h index 07981f085b92..a41cdee88adb 100644 --- a/arch/x86/include/uapi/asm/hyperv.h +++ b/arch/x86/include/uapi/asm/hyperv.h | |||
@@ -271,4 +271,80 @@ typedef struct _HV_REFERENCE_TSC_PAGE { | |||
271 | 271 | ||
272 | #define HV_SYNIC_STIMER_COUNT (4) | 272 | #define HV_SYNIC_STIMER_COUNT (4) |
273 | 273 | ||
274 | /* Define synthetic interrupt controller message constants. */ | ||
275 | #define HV_MESSAGE_SIZE (256) | ||
276 | #define HV_MESSAGE_PAYLOAD_BYTE_COUNT (240) | ||
277 | #define HV_MESSAGE_PAYLOAD_QWORD_COUNT (30) | ||
278 | |||
279 | /* Define hypervisor message types. */ | ||
280 | enum hv_message_type { | ||
281 | HVMSG_NONE = 0x00000000, | ||
282 | |||
283 | /* Memory access messages. */ | ||
284 | HVMSG_UNMAPPED_GPA = 0x80000000, | ||
285 | HVMSG_GPA_INTERCEPT = 0x80000001, | ||
286 | |||
287 | /* Timer notification messages. */ | ||
288 | HVMSG_TIMER_EXPIRED = 0x80000010, | ||
289 | |||
290 | /* Error messages. */ | ||
291 | HVMSG_INVALID_VP_REGISTER_VALUE = 0x80000020, | ||
292 | HVMSG_UNRECOVERABLE_EXCEPTION = 0x80000021, | ||
293 | HVMSG_UNSUPPORTED_FEATURE = 0x80000022, | ||
294 | |||
295 | /* Trace buffer complete messages. */ | ||
296 | HVMSG_EVENTLOG_BUFFERCOMPLETE = 0x80000040, | ||
297 | |||
298 | /* Platform-specific processor intercept messages. */ | ||
299 | HVMSG_X64_IOPORT_INTERCEPT = 0x80010000, | ||
300 | HVMSG_X64_MSR_INTERCEPT = 0x80010001, | ||
301 | HVMSG_X64_CPUID_INTERCEPT = 0x80010002, | ||
302 | HVMSG_X64_EXCEPTION_INTERCEPT = 0x80010003, | ||
303 | HVMSG_X64_APIC_EOI = 0x80010004, | ||
304 | HVMSG_X64_LEGACY_FP_ERROR = 0x80010005 | ||
305 | }; | ||
306 | |||
307 | /* Define synthetic interrupt controller message flags. */ | ||
308 | union hv_message_flags { | ||
309 | __u8 asu8; | ||
310 | struct { | ||
311 | __u8 msg_pending:1; | ||
312 | __u8 reserved:7; | ||
313 | }; | ||
314 | }; | ||
315 | |||
316 | /* Define port identifier type. */ | ||
317 | union hv_port_id { | ||
318 | __u32 asu32; | ||
319 | struct { | ||
320 | __u32 id:24; | ||
321 | __u32 reserved:8; | ||
322 | } u; | ||
323 | }; | ||
324 | |||
325 | /* Define synthetic interrupt controller message header. */ | ||
326 | struct hv_message_header { | ||
327 | __u32 message_type; | ||
328 | __u8 payload_size; | ||
329 | union hv_message_flags message_flags; | ||
330 | __u8 reserved[2]; | ||
331 | union { | ||
332 | __u64 sender; | ||
333 | union hv_port_id port; | ||
334 | }; | ||
335 | }; | ||
336 | |||
337 | /* Define synthetic interrupt controller message format. */ | ||
338 | struct hv_message { | ||
339 | struct hv_message_header header; | ||
340 | union { | ||
341 | __u64 payload[HV_MESSAGE_PAYLOAD_QWORD_COUNT]; | ||
342 | } u; | ||
343 | }; | ||
344 | |||
345 | /* Define the synthetic interrupt message page layout. */ | ||
346 | struct hv_message_page { | ||
347 | struct hv_message sint_message[HV_SYNIC_SINT_COUNT]; | ||
348 | }; | ||
349 | |||
274 | #endif | 350 | #endif |