summaryrefslogtreecommitdiffstats
path: root/sys/dev/hyperv/include
diff options
context:
space:
mode:
authorsephe <sephe@FreeBSD.org>2016-10-14 08:02:37 +0000
committersephe <sephe@FreeBSD.org>2016-10-14 08:02:37 +0000
commit5691021e808c20e7a770942b04bdb9e039d2f624 (patch)
tree8de1d9c8074cfd3e4e05d8575346267569092ac1 /sys/dev/hyperv/include
parent56da3ec17e37a6540c26f6be524c4c541e122690 (diff)
downloadFreeBSD-src-5691021e808c20e7a770942b04bdb9e039d2f624.zip
FreeBSD-src-5691021e808c20e7a770942b04bdb9e039d2f624.tar.gz
MFC 302617-302621,302623,302629-302631
302617 hyperv/vmbus: Flatten channel message response processing. Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6914 302618 hyperv/vmbus: Avoid tx_evtflags setting code duplication. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6915 302619 hyperv/vmbus: Busdma-fy Hypercall signal event input parameter. Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6916 302620 hyperv: Nuke unused stuffs Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6917 302621 hyperv/vmbus: Don't be oversmart in default cpu selection. Pin the channel to cpu0 by default. Drivers having special channel-cpu mapping requirement should call vmbus_channel_cpu_{set,rr}() themselves. Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6918 302623 hyperv/vmbus: Minor renaming Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6919 302629 hyperv/vmbus: Rework vmbus version accessing. Instead of global variable, vmbus version is accessed through a vmbus DEVMETHOD now. Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6953 302630 hyperv/vmbus: Move GPADL index into vmbus_softc Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6954 302631 hyperv/vmbus: Move channel list to vmbus_softc Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6956
Diffstat (limited to 'sys/dev/hyperv/include')
-rw-r--r--sys/dev/hyperv/include/hyperv.h40
-rw-r--r--sys/dev/hyperv/include/hyperv_busdma.h4
2 files changed, 16 insertions, 28 deletions
diff --git a/sys/dev/hyperv/include/hyperv.h b/sys/dev/hyperv/include/hyperv.h
index 5c09231..b661b35 100644
--- a/sys/dev/hyperv/include/hyperv.h
+++ b/sys/dev/hyperv/include/hyperv.h
@@ -55,6 +55,7 @@
#include <amd64/include/xen/synch_bitops.h>
#include <amd64/include/atomic.h>
+#include <dev/hyperv/include/hyperv_busdma.h>
typedef uint8_t hv_bool_uint8_t;
@@ -72,10 +73,13 @@ typedef uint8_t hv_bool_uint8_t;
* 2.4 -- Windows 8
* 3.0 -- Windows 8.1
*/
-#define HV_VMBUS_VERSION_WS2008 ((0 << 16) | (13))
-#define HV_VMBUS_VERSION_WIN7 ((1 << 16) | (1))
-#define HV_VMBUS_VERSION_WIN8 ((2 << 16) | (4))
-#define HV_VMBUS_VERSION_WIN8_1 ((3 << 16) | (0))
+#define VMBUS_VERSION_WS2008 ((0 << 16) | (13))
+#define VMBUS_VERSION_WIN7 ((1 << 16) | (1))
+#define VMBUS_VERSION_WIN8 ((2 << 16) | (4))
+#define VMBUS_VERSION_WIN8_1 ((3 << 16) | (0))
+
+#define VMBUS_VERSION_MAJOR(ver) (((uint32_t)(ver)) >> 16)
+#define VMBUS_VERSION_MINOR(ver) (((uint32_t)(ver)) & 0xffff)
/*
* Make maximum size of pipe payload of 16K
@@ -528,22 +532,7 @@ typedef union {
} __packed hv_vmbus_connection_id;
-/*
- * Definition of the hv_vmbus_signal_event hypercall input structure
- */
-typedef struct {
- hv_vmbus_connection_id connection_id;
- uint16_t flag_number;
- uint16_t rsvd_z;
-} __packed hv_vmbus_input_signal_event;
-
-typedef struct {
- uint64_t align8;
- hv_vmbus_input_signal_event event;
-} __packed hv_vmbus_input_signal_event_buffer;
-
typedef struct hv_vmbus_channel {
- TAILQ_ENTRY(hv_vmbus_channel) list_entry;
struct hv_device* device;
struct vmbus_softc *vmbus_sc;
hv_vmbus_channel_state state;
@@ -589,14 +578,8 @@ typedef struct hv_vmbus_channel {
boolean_t is_dedicated_interrupt;
- /*
- * Used as an input param for HV_CALL_SIGNAL_EVENT hypercall.
- */
- hv_vmbus_input_signal_event_buffer signal_event_buffer;
- /*
- * 8-bytes aligned of the buffer above
- */
- hv_vmbus_input_signal_event *signal_event_param;
+ struct hypercall_sigevt_in *ch_sigevt;
+ struct hyperv_dma ch_sigevt_dma;
/*
* From Win8, this field specifies the target virtual process
@@ -643,6 +626,7 @@ typedef struct hv_vmbus_channel {
void *hv_chan_priv3;
struct task ch_detach_task;
+ TAILQ_ENTRY(hv_vmbus_channel) ch_link;
} hv_vmbus_channel;
#define HV_VMBUS_CHAN_ISPRIMARY(chan) ((chan)->primary_channel == NULL)
@@ -726,6 +710,7 @@ int hv_vmbus_channel_teardown_gpdal(
struct hv_vmbus_channel* vmbus_select_outgoing_channel(struct hv_vmbus_channel *promary);
void vmbus_channel_cpu_set(struct hv_vmbus_channel *chan, int cpu);
+void vmbus_channel_cpu_rr(struct hv_vmbus_channel *chan);
struct hv_vmbus_channel **
vmbus_get_subchan(struct hv_vmbus_channel *pri_chan, int subchan_cnt);
void vmbus_rel_subchan(struct hv_vmbus_channel **subchan, int subchan_cnt);
@@ -741,5 +726,4 @@ hv_get_phys_addr(void *virt)
return (ret);
}
-extern uint32_t hv_vmbus_protocal_version;
#endif /* __HYPERV_H__ */
diff --git a/sys/dev/hyperv/include/hyperv_busdma.h b/sys/dev/hyperv/include/hyperv_busdma.h
index f4ea8cf..a27d2db 100644
--- a/sys/dev/hyperv/include/hyperv_busdma.h
+++ b/sys/dev/hyperv/include/hyperv_busdma.h
@@ -29,6 +29,10 @@
#ifndef _HYPERV_BUSDMA_H_
#define _HYPERV_BUSDMA_H_
+#include <sys/param.h>
+#include <sys/bus.h>
+#include <machine/bus.h>
+
struct hyperv_dma {
bus_addr_t hv_paddr;
bus_dma_tag_t hv_dtag;
OpenPOWER on IntegriCloud