]> Pileus Git - ~andy/linux/blobdiff - drivers/hv/hyperv_vmbus.h
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[~andy/linux] / drivers / hv / hyperv_vmbus.h
index d8d1fadb398aa75e11375fffe8826dbd8781f1fa..12f2f9e989f73be86d6fbf7da7b928cab13aa0cf 100644 (file)
@@ -101,15 +101,6 @@ enum hv_message_type {
 /* Define invalid partition identifier. */
 #define HV_PARTITION_ID_INVALID                ((u64)0x0)
 
-/* Define connection identifier type. */
-union hv_connection_id {
-       u32 asu32;
-       struct {
-               u32 id:24;
-               u32 reserved:8;
-       } u;
-};
-
 /* Define port identifier type. */
 union hv_port_id {
        u32 asu32;
@@ -338,13 +329,6 @@ struct hv_input_post_message {
        u64 payload[HV_MESSAGE_PAYLOAD_QWORD_COUNT];
 };
 
-/* Definition of the hv_signal_event hypercall input structure. */
-struct hv_input_signal_event {
-       union hv_connection_id connectionid;
-       u16 flag_number;
-       u16 rsvdz;
-};
-
 /*
  * Versioning definitions used for guests reporting themselves to the
  * hypervisor, and visa versa.
@@ -498,11 +482,6 @@ static const uuid_le VMBUS_SERVICE_ID = {
 
 
 
-struct hv_input_signal_event_buffer {
-       u64 align8;
-       struct hv_input_signal_event event;
-};
-
 struct hv_context {
        /* We only support running on top of Hyper-V
        * So at this point this really can only contain the Hyper-V ID
@@ -513,16 +492,24 @@ struct hv_context {
 
        bool synic_initialized;
 
-       /*
-        * This is used as an input param to HvCallSignalEvent hypercall. The
-        * input param is immutable in our usage and must be dynamic mem (vs
-        * stack or global). */
-       struct hv_input_signal_event_buffer *signal_event_buffer;
-       /* 8-bytes aligned of the buffer above */
-       struct hv_input_signal_event *signal_event_param;
-
        void *synic_message_page[NR_CPUS];
        void *synic_event_page[NR_CPUS];
+       /*
+        * Hypervisor's notion of virtual processor ID is different from
+        * Linux' notion of CPU ID. This information can only be retrieved
+        * in the context of the calling CPU. Setup a map for easy access
+        * to this information:
+        *
+        * vp_index[a] is the Hyper-V's processor ID corresponding to
+        * Linux cpuid 'a'.
+        */
+       u32 vp_index[NR_CPUS];
+       /*
+        * Starting with win8, we can take channel interrupts on any CPU;
+        * we will manage the tasklet that handles events on a per CPU
+        * basis.
+        */
+       struct tasklet_struct *event_dpc[NR_CPUS];
 };
 
 extern struct hv_context hv_context;
@@ -538,12 +525,19 @@ extern int hv_post_message(union hv_connection_id connection_id,
                         enum hv_message_type message_type,
                         void *payload, size_t payload_size);
 
-extern u16 hv_signal_event(void);
+extern u16 hv_signal_event(void *con_id);
 
 extern void hv_synic_init(void *irqarg);
 
 extern void hv_synic_cleanup(void *arg);
 
+/*
+ * Host version information.
+ */
+extern unsigned int host_info_eax;
+extern unsigned int host_info_ebx;
+extern unsigned int host_info_ecx;
+extern unsigned int host_info_edx;
 
 /* Interface */
 
@@ -555,7 +549,7 @@ void hv_ringbuffer_cleanup(struct hv_ring_buffer_info *ring_info);
 
 int hv_ringbuffer_write(struct hv_ring_buffer_info *ring_info,
                    struct scatterlist *sglist,
-                   u32 sgcount);
+                   u32 sgcount, bool *signal);
 
 int hv_ringbuffer_peek(struct hv_ring_buffer_info *ring_info, void *buffer,
                   u32 buflen);
@@ -563,13 +557,16 @@ int hv_ringbuffer_peek(struct hv_ring_buffer_info *ring_info, void *buffer,
 int hv_ringbuffer_read(struct hv_ring_buffer_info *ring_info,
                   void *buffer,
                   u32 buflen,
-                  u32 offset);
+                  u32 offset, bool *signal);
 
-u32 hv_get_ringbuffer_interrupt_mask(struct hv_ring_buffer_info *ring_info);
 
 void hv_ringbuffer_get_debuginfo(struct hv_ring_buffer_info *ring_info,
                            struct hv_ring_buffer_debug_info *debug_info);
 
+void hv_begin_read(struct hv_ring_buffer_info *rbi);
+
+u32 hv_end_read(struct hv_ring_buffer_info *rbi);
+
 /*
  * Maximum channels is determined by the size of the interrupt page
  * which is PAGE_SIZE. 1/2 of PAGE_SIZE is for send endpoint interrupt
@@ -657,7 +654,7 @@ int vmbus_connect(void);
 
 int vmbus_post_msg(void *buffer, size_t buflen);
 
-int vmbus_set_event(u32 child_relid);
+int vmbus_set_event(struct vmbus_channel *channel);
 
 void vmbus_on_event(unsigned long data);