aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Smetanin <asmetanin@virtuozzo.com>2015-10-16 03:07:50 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2015-11-04 10:24:33 -0500
commitc75efa974e013640496620f26f0b532cb5cb17f9 (patch)
treecb6da1f0d6077ccce8948231f780c6354cc29a64
parentf40606b147dd5b4678cedc877a71deb520ca507e (diff)
drivers/hv: share Hyper-V SynIC constants with userspace
Moved Hyper-V synic contants from guest Hyper-V drivers private header into x86 arch uapi Hyper-V header. Added Hyper-V synic msr's flags into x86 arch uapi Hyper-V header. Signed-off-by: Andrey Smetanin <asmetanin@virtuozzo.com> Reviewed-by: Roman Kagan <rkagan@virtuozzo.com> Signed-off-by: Denis V. Lunev <den@openvz.org> CC: Vitaly Kuznetsov <vkuznets@redhat.com> CC: "K. Y. Srinivasan" <kys@microsoft.com> CC: Gleb Natapov <gleb@kernel.org> CC: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--arch/x86/include/uapi/asm/hyperv.h12
-rw-r--r--drivers/hv/hyperv_vmbus.h5
-rw-r--r--include/linux/hyperv.h1
3 files changed, 13 insertions, 5 deletions
diff --git a/arch/x86/include/uapi/asm/hyperv.h b/arch/x86/include/uapi/asm/hyperv.h
index 2677a0aac2cc..040d4083c24f 100644
--- a/arch/x86/include/uapi/asm/hyperv.h
+++ b/arch/x86/include/uapi/asm/hyperv.h
@@ -257,4 +257,16 @@ typedef struct _HV_REFERENCE_TSC_PAGE {
257 __s64 tsc_offset; 257 __s64 tsc_offset;
258} HV_REFERENCE_TSC_PAGE, *PHV_REFERENCE_TSC_PAGE; 258} HV_REFERENCE_TSC_PAGE, *PHV_REFERENCE_TSC_PAGE;
259 259
260/* Define the number of synthetic interrupt sources. */
261#define HV_SYNIC_SINT_COUNT (16)
262/* Define the expected SynIC version. */
263#define HV_SYNIC_VERSION_1 (0x1)
264
265#define HV_SYNIC_CONTROL_ENABLE (1ULL << 0)
266#define HV_SYNIC_SIMP_ENABLE (1ULL << 0)
267#define HV_SYNIC_SIEFP_ENABLE (1ULL << 0)
268#define HV_SYNIC_SINT_MASKED (1ULL << 16)
269#define HV_SYNIC_SINT_AUTO_EOI (1ULL << 17)
270#define HV_SYNIC_SINT_VECTOR_MASK (0xFF)
271
260#endif 272#endif
diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h
index 3d70e36c918e..3782636562a1 100644
--- a/drivers/hv/hyperv_vmbus.h
+++ b/drivers/hv/hyperv_vmbus.h
@@ -63,9 +63,6 @@ enum hv_cpuid_function {
63/* Define version of the synthetic interrupt controller. */ 63/* Define version of the synthetic interrupt controller. */
64#define HV_SYNIC_VERSION (1) 64#define HV_SYNIC_VERSION (1)
65 65
66/* Define the expected SynIC version. */
67#define HV_SYNIC_VERSION_1 (0x1)
68
69/* Define synthetic interrupt controller message constants. */ 66/* Define synthetic interrupt controller message constants. */
70#define HV_MESSAGE_SIZE (256) 67#define HV_MESSAGE_SIZE (256)
71#define HV_MESSAGE_PAYLOAD_BYTE_COUNT (240) 68#define HV_MESSAGE_PAYLOAD_BYTE_COUNT (240)
@@ -105,8 +102,6 @@ enum hv_message_type {
105 HVMSG_X64_LEGACY_FP_ERROR = 0x80010005 102 HVMSG_X64_LEGACY_FP_ERROR = 0x80010005
106}; 103};
107 104
108/* Define the number of synthetic interrupt sources. */
109#define HV_SYNIC_SINT_COUNT (16)
110#define HV_SYNIC_STIMER_COUNT (4) 105#define HV_SYNIC_STIMER_COUNT (4)
111 106
112/* Define invalid partition identifier. */ 107/* Define invalid partition identifier. */
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index 54733d5b503e..8fdc17b84739 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -26,6 +26,7 @@
26#define _HYPERV_H 26#define _HYPERV_H
27 27
28#include <uapi/linux/hyperv.h> 28#include <uapi/linux/hyperv.h>
29#include <uapi/asm/hyperv.h>
29 30
30#include <linux/types.h> 31#include <linux/types.h>
31#include <linux/scatterlist.h> 32#include <linux/scatterlist.h>