Merge tag 'powerpc-5.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
[linux-2.6-microblaze.git] / include / linux / hyperv.h
index 692c89c..40df310 100644 (file)
@@ -117,7 +117,7 @@ struct hv_ring_buffer {
         * Ring data starts here + RingDataStartOffset
         * !!! DO NOT place any fields below this !!!
         */
-       u8 buffer[0];
+       u8 buffer[];
 } __packed;
 
 struct hv_ring_buffer_info {
@@ -313,7 +313,7 @@ struct vmadd_remove_transfer_page_set {
 struct gpa_range {
        u32 byte_count;
        u32 byte_offset;
-       u64 pfn_array[0];
+       u64 pfn_array[];
 };
 
 /*
@@ -425,7 +425,7 @@ enum vmbus_channel_message_type {
        CHANNELMSG_19                           = 19,
        CHANNELMSG_20                           = 20,
        CHANNELMSG_TL_CONNECT_REQUEST           = 21,
-       CHANNELMSG_22                           = 22,
+       CHANNELMSG_MODIFYCHANNEL                = 22,
        CHANNELMSG_TL_CONNECT_RESULT            = 23,
        CHANNELMSG_COUNT
 };
@@ -563,7 +563,7 @@ struct vmbus_channel_gpadl_header {
        u32 gpadl;
        u16 range_buflen;
        u16 rangecount;
-       struct gpa_range range[0];
+       struct gpa_range range[];
 } __packed;
 
 /* This is the followup packet that contains more PFNs. */
@@ -571,7 +571,7 @@ struct vmbus_channel_gpadl_body {
        struct vmbus_channel_message_header header;
        u32 msgnumber;
        u32 gpadl;
-       u64 pfn[0];
+       u64 pfn[];
 } __packed;
 
 struct vmbus_channel_gpadl_created {
@@ -620,6 +620,13 @@ struct vmbus_channel_tl_connect_request {
        guid_t host_service_id;
 } __packed;
 
+/* Modify Channel parameters, cf. vmbus_send_modifychannel() */
+struct vmbus_channel_modifychannel {
+       struct vmbus_channel_message_header header;
+       u32 child_relid;
+       u32 target_vp;
+} __packed;
+
 struct vmbus_channel_version_response {
        struct vmbus_channel_message_header header;
        u8 version_supported;
@@ -672,7 +679,7 @@ struct vmbus_channel_msginfo {
         * The channel message that goes out on the "wire".
         * It will contain at minimum the VMBUS_CHANNEL_MESSAGE_HEADER header
         */
-       unsigned char msg[0];
+       unsigned char msg[];
 };
 
 struct vmbus_close_msg {
@@ -689,11 +696,6 @@ union hv_connection_id {
        } u;
 };
 
-enum hv_numa_policy {
-       HV_BALANCED = 0,
-       HV_LOCALIZED,
-};
-
 enum vmbus_device_type {
        HV_IDE = 0,
        HV_SCSI,
@@ -771,6 +773,15 @@ struct vmbus_channel {
        void (*onchannel_callback)(void *context);
        void *channel_callback_context;
 
+       void (*change_target_cpu_callback)(struct vmbus_channel *channel,
+                       u32 old, u32 new);
+
+       /*
+        * Synchronize channel scheduling and channel removal; see the inline
+        * comments in vmbus_chan_sched() and vmbus_reset_channel_cb().
+        */
+       spinlock_t sched_lock;
+
        /*
         * A channel can be marked for one of three modes of reading:
         *   BATCHED - callback called from taslket and should read
@@ -802,10 +813,6 @@ struct vmbus_channel {
        u32 target_vp;
        /* The corresponding CPUID in the guest */
        u32 target_cpu;
-       /*
-        * State to manage the CPU affiliation of channels.
-        */
-       struct cpumask alloced_cpus_in_node;
        int numa_node;
        /*
         * Support for sub-channels. For high performance devices,
@@ -854,11 +861,6 @@ struct vmbus_channel {
         * Support per-channel state for use by vmbus drivers.
         */
        void *per_channel_state;
-       /*
-        * To support per-cpu lookup mapping of relid to channel,
-        * link up channels based on their CPU affinity.
-        */
-       struct list_head percpu_list;
 
        /*
         * Defer freeing channel until after all cpu's have
@@ -897,19 +899,14 @@ struct vmbus_channel {
         */
        bool low_latency;
 
+       bool probe_done;
+
        /*
-        * NUMA distribution policy:
-        * We support two policies:
-        * 1) Balanced: Here all performance critical channels are
-        *    distributed evenly amongst all the NUMA nodes.
-        *    This policy will be the default policy.
-        * 2) Localized: All channels of a given instance of a
-        *    performance critical service will be assigned CPUs
-        *    within a selected NUMA node.
+        * Cache the device ID here for easy access; this is useful, in
+        * particular, in situations where the channel's device_obj has
+        * not been allocated/initialized yet.
         */
-       enum hv_numa_policy affinity_policy;
-
-       bool probe_done;
+       u16 device_id;
 
        /*
         * We must offload the handling of the primary/sub channels
@@ -964,12 +961,6 @@ static inline bool is_sub_channel(const struct vmbus_channel *c)
        return c->offermsg.offer.sub_channel_index != 0;
 }
 
-static inline void set_channel_affinity_state(struct vmbus_channel *c,
-                                             enum hv_numa_policy policy)
-{
-       c->affinity_policy = policy;
-}
-
 static inline void set_channel_read_mode(struct vmbus_channel *c,
                                        enum hv_callback_mode mode)
 {
@@ -1017,7 +1008,7 @@ static inline void clear_low_latency_mode(struct vmbus_channel *c)
        c->low_latency = false;
 }
 
-void vmbus_onmessage(void *context);
+void vmbus_onmessage(struct vmbus_channel_message_header *hdr);
 
 int vmbus_request_offers(void);
 
@@ -1531,6 +1522,7 @@ extern __u32 vmbus_proto_version;
 
 int vmbus_send_tl_connect_request(const guid_t *shv_guest_servie_id,
                                  const guid_t *shv_host_servie_id);
+int vmbus_send_modifychannel(u32 child_relid, u32 target_vp);
 void vmbus_set_event(struct vmbus_channel *channel);
 
 /* Get the start of the ring buffer. */