diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2011-08-27 09:43:54 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2011-08-27 10:06:11 -0400 |
commit | 7b1bb388bc879ffcc6c69b567816d5c354afe42b (patch) | |
tree | 5a217fdfb0b5e5a327bdcd624506337c1ae1fe32 /include/xen/interface | |
parent | 7d754596756240fa918b94cd0c3011c77a638987 (diff) | |
parent | 02f8c6aee8df3cdc935e9bdd4f2d020306035dbe (diff) |
Merge 'Linux v3.0' into Litmus
Some notes:
* Litmus^RT scheduling class is the topmost scheduling class
(above stop_sched_class).
* scheduler_ipi() function (e.g., in smp_reschedule_interrupt())
may increase IPI latencies.
* Added path into schedule() to quickly re-evaluate scheduling
decision without becoming preemptive again. This used to be
a standard path before the removal of BKL.
Conflicts:
Makefile
arch/arm/kernel/calls.S
arch/arm/kernel/smp.c
arch/x86/include/asm/unistd_32.h
arch/x86/kernel/smp.c
arch/x86/kernel/syscall_table_32.S
include/linux/hrtimer.h
kernel/printk.c
kernel/sched.c
kernel/sched_fair.c
Diffstat (limited to 'include/xen/interface')
-rw-r--r-- | include/xen/interface/elfnote.h | 2 | ||||
-rw-r--r-- | include/xen/interface/features.h | 3 | ||||
-rw-r--r-- | include/xen/interface/io/blkif.h | 50 | ||||
-rw-r--r-- | include/xen/interface/io/netif.h | 80 | ||||
-rw-r--r-- | include/xen/interface/io/pciif.h | 112 | ||||
-rw-r--r-- | include/xen/interface/io/ring.h | 11 | ||||
-rw-r--r-- | include/xen/interface/io/xenbus.h | 8 | ||||
-rw-r--r-- | include/xen/interface/memory.h | 42 | ||||
-rw-r--r-- | include/xen/interface/physdev.h | 77 | ||||
-rw-r--r-- | include/xen/interface/sched.h | 34 | ||||
-rw-r--r-- | include/xen/interface/xen.h | 26 |
11 files changed, 396 insertions, 49 deletions
diff --git a/include/xen/interface/elfnote.h b/include/xen/interface/elfnote.h index 7a8262c375cc..0360b15f4883 100644 --- a/include/xen/interface/elfnote.h +++ b/include/xen/interface/elfnote.h | |||
@@ -51,7 +51,7 @@ | |||
51 | 51 | ||
52 | /* | 52 | /* |
53 | * The offset of the ELF paddr field from the acutal required | 53 | * The offset of the ELF paddr field from the acutal required |
54 | * psuedo-physical address (numeric). | 54 | * pseudo-physical address (numeric). |
55 | * | 55 | * |
56 | * This is used to maintain backwards compatibility with older kernels | 56 | * This is used to maintain backwards compatibility with older kernels |
57 | * which wrote __PAGE_OFFSET into that field. This field defaults to 0 | 57 | * which wrote __PAGE_OFFSET into that field. This field defaults to 0 |
diff --git a/include/xen/interface/features.h b/include/xen/interface/features.h index 70d2563ab166..b6ca39a069d8 100644 --- a/include/xen/interface/features.h +++ b/include/xen/interface/features.h | |||
@@ -47,6 +47,9 @@ | |||
47 | /* x86: pvclock algorithm is safe to use on HVM */ | 47 | /* x86: pvclock algorithm is safe to use on HVM */ |
48 | #define XENFEAT_hvm_safe_pvclock 9 | 48 | #define XENFEAT_hvm_safe_pvclock 9 |
49 | 49 | ||
50 | /* x86: pirq can be used by HVM guests */ | ||
51 | #define XENFEAT_hvm_pirqs 10 | ||
52 | |||
50 | #define XENFEAT_NR_SUBMAPS 1 | 53 | #define XENFEAT_NR_SUBMAPS 1 |
51 | 54 | ||
52 | #endif /* __XEN_PUBLIC_FEATURES_H__ */ | 55 | #endif /* __XEN_PUBLIC_FEATURES_H__ */ |
diff --git a/include/xen/interface/io/blkif.h b/include/xen/interface/io/blkif.h index c2d1fa4dc1ee..3d5d6db864fe 100644 --- a/include/xen/interface/io/blkif.h +++ b/include/xen/interface/io/blkif.h | |||
@@ -45,17 +45,26 @@ typedef uint64_t blkif_sector_t; | |||
45 | #define BLKIF_OP_WRITE_BARRIER 2 | 45 | #define BLKIF_OP_WRITE_BARRIER 2 |
46 | 46 | ||
47 | /* | 47 | /* |
48 | * Recognised if "feature-flush-cache" is present in backend xenbus | ||
49 | * info. A flush will ask the underlying storage hardware to flush its | ||
50 | * non-volatile caches as appropriate. The "feature-flush-cache" node | ||
51 | * contains a boolean indicating whether flush requests are likely to | ||
52 | * succeed or fail. Either way, a flush request may fail at any time | ||
53 | * with BLKIF_RSP_EOPNOTSUPP if it is unsupported by the underlying | ||
54 | * block-device hardware. The boolean simply indicates whether or not it | ||
55 | * is worthwhile for the frontend to attempt flushes. If a backend does | ||
56 | * not recognise BLKIF_OP_WRITE_FLUSH_CACHE, it should *not* create the | ||
57 | * "feature-flush-cache" node! | ||
58 | */ | ||
59 | #define BLKIF_OP_FLUSH_DISKCACHE 3 | ||
60 | /* | ||
48 | * Maximum scatter/gather segments per request. | 61 | * Maximum scatter/gather segments per request. |
49 | * This is carefully chosen so that sizeof(struct blkif_ring) <= PAGE_SIZE. | 62 | * This is carefully chosen so that sizeof(struct blkif_ring) <= PAGE_SIZE. |
50 | * NB. This could be 12 if the ring indexes weren't stored in the same page. | 63 | * NB. This could be 12 if the ring indexes weren't stored in the same page. |
51 | */ | 64 | */ |
52 | #define BLKIF_MAX_SEGMENTS_PER_REQUEST 11 | 65 | #define BLKIF_MAX_SEGMENTS_PER_REQUEST 11 |
53 | 66 | ||
54 | struct blkif_request { | 67 | struct blkif_request_rw { |
55 | uint8_t operation; /* BLKIF_OP_??? */ | ||
56 | uint8_t nr_segments; /* number of segments */ | ||
57 | blkif_vdev_t handle; /* only for read/write requests */ | ||
58 | uint64_t id; /* private guest value, echoed in resp */ | ||
59 | blkif_sector_t sector_number;/* start sector idx on disk (r/w only) */ | 68 | blkif_sector_t sector_number;/* start sector idx on disk (r/w only) */ |
60 | struct blkif_request_segment { | 69 | struct blkif_request_segment { |
61 | grant_ref_t gref; /* reference to I/O buffer frame */ | 70 | grant_ref_t gref; /* reference to I/O buffer frame */ |
@@ -65,6 +74,16 @@ struct blkif_request { | |||
65 | } seg[BLKIF_MAX_SEGMENTS_PER_REQUEST]; | 74 | } seg[BLKIF_MAX_SEGMENTS_PER_REQUEST]; |
66 | }; | 75 | }; |
67 | 76 | ||
77 | struct blkif_request { | ||
78 | uint8_t operation; /* BLKIF_OP_??? */ | ||
79 | uint8_t nr_segments; /* number of segments */ | ||
80 | blkif_vdev_t handle; /* only for read/write requests */ | ||
81 | uint64_t id; /* private guest value, echoed in resp */ | ||
82 | union { | ||
83 | struct blkif_request_rw rw; | ||
84 | } u; | ||
85 | }; | ||
86 | |||
68 | struct blkif_response { | 87 | struct blkif_response { |
69 | uint64_t id; /* copied from request */ | 88 | uint64_t id; /* copied from request */ |
70 | uint8_t operation; /* copied from request */ | 89 | uint8_t operation; /* copied from request */ |
@@ -91,4 +110,25 @@ DEFINE_RING_TYPES(blkif, struct blkif_request, struct blkif_response); | |||
91 | #define VDISK_REMOVABLE 0x2 | 110 | #define VDISK_REMOVABLE 0x2 |
92 | #define VDISK_READONLY 0x4 | 111 | #define VDISK_READONLY 0x4 |
93 | 112 | ||
113 | /* Xen-defined major numbers for virtual disks, they look strangely | ||
114 | * familiar */ | ||
115 | #define XEN_IDE0_MAJOR 3 | ||
116 | #define XEN_IDE1_MAJOR 22 | ||
117 | #define XEN_SCSI_DISK0_MAJOR 8 | ||
118 | #define XEN_SCSI_DISK1_MAJOR 65 | ||
119 | #define XEN_SCSI_DISK2_MAJOR 66 | ||
120 | #define XEN_SCSI_DISK3_MAJOR 67 | ||
121 | #define XEN_SCSI_DISK4_MAJOR 68 | ||
122 | #define XEN_SCSI_DISK5_MAJOR 69 | ||
123 | #define XEN_SCSI_DISK6_MAJOR 70 | ||
124 | #define XEN_SCSI_DISK7_MAJOR 71 | ||
125 | #define XEN_SCSI_DISK8_MAJOR 128 | ||
126 | #define XEN_SCSI_DISK9_MAJOR 129 | ||
127 | #define XEN_SCSI_DISK10_MAJOR 130 | ||
128 | #define XEN_SCSI_DISK11_MAJOR 131 | ||
129 | #define XEN_SCSI_DISK12_MAJOR 132 | ||
130 | #define XEN_SCSI_DISK13_MAJOR 133 | ||
131 | #define XEN_SCSI_DISK14_MAJOR 134 | ||
132 | #define XEN_SCSI_DISK15_MAJOR 135 | ||
133 | |||
94 | #endif /* __XEN_PUBLIC_IO_BLKIF_H__ */ | 134 | #endif /* __XEN_PUBLIC_IO_BLKIF_H__ */ |
diff --git a/include/xen/interface/io/netif.h b/include/xen/interface/io/netif.h index 518481c95f18..cb94668f6e9f 100644 --- a/include/xen/interface/io/netif.h +++ b/include/xen/interface/io/netif.h | |||
@@ -22,50 +22,50 @@ | |||
22 | 22 | ||
23 | /* | 23 | /* |
24 | * This is the 'wire' format for packets: | 24 | * This is the 'wire' format for packets: |
25 | * Request 1: netif_tx_request -- NETTXF_* (any flags) | 25 | * Request 1: xen_netif_tx_request -- XEN_NETTXF_* (any flags) |
26 | * [Request 2: netif_tx_extra] (only if request 1 has NETTXF_extra_info) | 26 | * [Request 2: xen_netif_extra_info] (only if request 1 has XEN_NETTXF_extra_info) |
27 | * [Request 3: netif_tx_extra] (only if request 2 has XEN_NETIF_EXTRA_MORE) | 27 | * [Request 3: xen_netif_extra_info] (only if request 2 has XEN_NETIF_EXTRA_MORE) |
28 | * Request 4: netif_tx_request -- NETTXF_more_data | 28 | * Request 4: xen_netif_tx_request -- XEN_NETTXF_more_data |
29 | * Request 5: netif_tx_request -- NETTXF_more_data | 29 | * Request 5: xen_netif_tx_request -- XEN_NETTXF_more_data |
30 | * ... | 30 | * ... |
31 | * Request N: netif_tx_request -- 0 | 31 | * Request N: xen_netif_tx_request -- 0 |
32 | */ | 32 | */ |
33 | 33 | ||
34 | /* Protocol checksum field is blank in the packet (hardware offload)? */ | 34 | /* Protocol checksum field is blank in the packet (hardware offload)? */ |
35 | #define _NETTXF_csum_blank (0) | 35 | #define _XEN_NETTXF_csum_blank (0) |
36 | #define NETTXF_csum_blank (1U<<_NETTXF_csum_blank) | 36 | #define XEN_NETTXF_csum_blank (1U<<_XEN_NETTXF_csum_blank) |
37 | 37 | ||
38 | /* Packet data has been validated against protocol checksum. */ | 38 | /* Packet data has been validated against protocol checksum. */ |
39 | #define _NETTXF_data_validated (1) | 39 | #define _XEN_NETTXF_data_validated (1) |
40 | #define NETTXF_data_validated (1U<<_NETTXF_data_validated) | 40 | #define XEN_NETTXF_data_validated (1U<<_XEN_NETTXF_data_validated) |
41 | 41 | ||
42 | /* Packet continues in the next request descriptor. */ | 42 | /* Packet continues in the next request descriptor. */ |
43 | #define _NETTXF_more_data (2) | 43 | #define _XEN_NETTXF_more_data (2) |
44 | #define NETTXF_more_data (1U<<_NETTXF_more_data) | 44 | #define XEN_NETTXF_more_data (1U<<_XEN_NETTXF_more_data) |
45 | 45 | ||
46 | /* Packet to be followed by extra descriptor(s). */ | 46 | /* Packet to be followed by extra descriptor(s). */ |
47 | #define _NETTXF_extra_info (3) | 47 | #define _XEN_NETTXF_extra_info (3) |
48 | #define NETTXF_extra_info (1U<<_NETTXF_extra_info) | 48 | #define XEN_NETTXF_extra_info (1U<<_XEN_NETTXF_extra_info) |
49 | 49 | ||
50 | struct xen_netif_tx_request { | 50 | struct xen_netif_tx_request { |
51 | grant_ref_t gref; /* Reference to buffer page */ | 51 | grant_ref_t gref; /* Reference to buffer page */ |
52 | uint16_t offset; /* Offset within buffer page */ | 52 | uint16_t offset; /* Offset within buffer page */ |
53 | uint16_t flags; /* NETTXF_* */ | 53 | uint16_t flags; /* XEN_NETTXF_* */ |
54 | uint16_t id; /* Echoed in response message. */ | 54 | uint16_t id; /* Echoed in response message. */ |
55 | uint16_t size; /* Packet size in bytes. */ | 55 | uint16_t size; /* Packet size in bytes. */ |
56 | }; | 56 | }; |
57 | 57 | ||
58 | /* Types of netif_extra_info descriptors. */ | 58 | /* Types of xen_netif_extra_info descriptors. */ |
59 | #define XEN_NETIF_EXTRA_TYPE_NONE (0) /* Never used - invalid */ | 59 | #define XEN_NETIF_EXTRA_TYPE_NONE (0) /* Never used - invalid */ |
60 | #define XEN_NETIF_EXTRA_TYPE_GSO (1) /* u.gso */ | 60 | #define XEN_NETIF_EXTRA_TYPE_GSO (1) /* u.gso */ |
61 | #define XEN_NETIF_EXTRA_TYPE_MAX (2) | 61 | #define XEN_NETIF_EXTRA_TYPE_MAX (2) |
62 | 62 | ||
63 | /* netif_extra_info flags. */ | 63 | /* xen_netif_extra_info flags. */ |
64 | #define _XEN_NETIF_EXTRA_FLAG_MORE (0) | 64 | #define _XEN_NETIF_EXTRA_FLAG_MORE (0) |
65 | #define XEN_NETIF_EXTRA_FLAG_MORE (1U<<_XEN_NETIF_EXTRA_FLAG_MORE) | 65 | #define XEN_NETIF_EXTRA_FLAG_MORE (1U<<_XEN_NETIF_EXTRA_FLAG_MORE) |
66 | 66 | ||
67 | /* GSO types - only TCPv4 currently supported. */ | 67 | /* GSO types - only TCPv4 currently supported. */ |
68 | #define XEN_NETIF_GSO_TYPE_TCPV4 (1) | 68 | #define XEN_NETIF_GSO_TYPE_TCPV4 (1) |
69 | 69 | ||
70 | /* | 70 | /* |
71 | * This structure needs to fit within both netif_tx_request and | 71 | * This structure needs to fit within both netif_tx_request and |
@@ -107,7 +107,7 @@ struct xen_netif_extra_info { | |||
107 | 107 | ||
108 | struct xen_netif_tx_response { | 108 | struct xen_netif_tx_response { |
109 | uint16_t id; | 109 | uint16_t id; |
110 | int16_t status; /* NETIF_RSP_* */ | 110 | int16_t status; /* XEN_NETIF_RSP_* */ |
111 | }; | 111 | }; |
112 | 112 | ||
113 | struct xen_netif_rx_request { | 113 | struct xen_netif_rx_request { |
@@ -116,25 +116,29 @@ struct xen_netif_rx_request { | |||
116 | }; | 116 | }; |
117 | 117 | ||
118 | /* Packet data has been validated against protocol checksum. */ | 118 | /* Packet data has been validated against protocol checksum. */ |
119 | #define _NETRXF_data_validated (0) | 119 | #define _XEN_NETRXF_data_validated (0) |
120 | #define NETRXF_data_validated (1U<<_NETRXF_data_validated) | 120 | #define XEN_NETRXF_data_validated (1U<<_XEN_NETRXF_data_validated) |
121 | 121 | ||
122 | /* Protocol checksum field is blank in the packet (hardware offload)? */ | 122 | /* Protocol checksum field is blank in the packet (hardware offload)? */ |
123 | #define _NETRXF_csum_blank (1) | 123 | #define _XEN_NETRXF_csum_blank (1) |
124 | #define NETRXF_csum_blank (1U<<_NETRXF_csum_blank) | 124 | #define XEN_NETRXF_csum_blank (1U<<_XEN_NETRXF_csum_blank) |
125 | 125 | ||
126 | /* Packet continues in the next request descriptor. */ | 126 | /* Packet continues in the next request descriptor. */ |
127 | #define _NETRXF_more_data (2) | 127 | #define _XEN_NETRXF_more_data (2) |
128 | #define NETRXF_more_data (1U<<_NETRXF_more_data) | 128 | #define XEN_NETRXF_more_data (1U<<_XEN_NETRXF_more_data) |
129 | 129 | ||
130 | /* Packet to be followed by extra descriptor(s). */ | 130 | /* Packet to be followed by extra descriptor(s). */ |
131 | #define _NETRXF_extra_info (3) | 131 | #define _XEN_NETRXF_extra_info (3) |
132 | #define NETRXF_extra_info (1U<<_NETRXF_extra_info) | 132 | #define XEN_NETRXF_extra_info (1U<<_XEN_NETRXF_extra_info) |
133 | |||
134 | /* GSO Prefix descriptor. */ | ||
135 | #define _XEN_NETRXF_gso_prefix (4) | ||
136 | #define XEN_NETRXF_gso_prefix (1U<<_XEN_NETRXF_gso_prefix) | ||
133 | 137 | ||
134 | struct xen_netif_rx_response { | 138 | struct xen_netif_rx_response { |
135 | uint16_t id; | 139 | uint16_t id; |
136 | uint16_t offset; /* Offset in page of start of received packet */ | 140 | uint16_t offset; /* Offset in page of start of received packet */ |
137 | uint16_t flags; /* NETRXF_* */ | 141 | uint16_t flags; /* XEN_NETRXF_* */ |
138 | int16_t status; /* -ve: BLKIF_RSP_* ; +ve: Rx'ed pkt size. */ | 142 | int16_t status; /* -ve: BLKIF_RSP_* ; +ve: Rx'ed pkt size. */ |
139 | }; | 143 | }; |
140 | 144 | ||
@@ -149,10 +153,10 @@ DEFINE_RING_TYPES(xen_netif_rx, | |||
149 | struct xen_netif_rx_request, | 153 | struct xen_netif_rx_request, |
150 | struct xen_netif_rx_response); | 154 | struct xen_netif_rx_response); |
151 | 155 | ||
152 | #define NETIF_RSP_DROPPED -2 | 156 | #define XEN_NETIF_RSP_DROPPED -2 |
153 | #define NETIF_RSP_ERROR -1 | 157 | #define XEN_NETIF_RSP_ERROR -1 |
154 | #define NETIF_RSP_OKAY 0 | 158 | #define XEN_NETIF_RSP_OKAY 0 |
155 | /* No response: used for auxiliary requests (e.g., netif_tx_extra). */ | 159 | /* No response: used for auxiliary requests (e.g., xen_netif_extra_info). */ |
156 | #define NETIF_RSP_NULL 1 | 160 | #define XEN_NETIF_RSP_NULL 1 |
157 | 161 | ||
158 | #endif | 162 | #endif |
diff --git a/include/xen/interface/io/pciif.h b/include/xen/interface/io/pciif.h new file mode 100644 index 000000000000..d9922ae36eb5 --- /dev/null +++ b/include/xen/interface/io/pciif.h | |||
@@ -0,0 +1,112 @@ | |||
1 | /* | ||
2 | * PCI Backend/Frontend Common Data Structures & Macros | ||
3 | * | ||
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
5 | * of this software and associated documentation files (the "Software"), to | ||
6 | * deal in the Software without restriction, including without limitation the | ||
7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | ||
8 | * sell copies of the Software, and to permit persons to whom the Software is | ||
9 | * furnished to do so, subject to the following conditions: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice shall be included in | ||
12 | * all copies or substantial portions of the Software. | ||
13 | * | ||
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
20 | * DEALINGS IN THE SOFTWARE. | ||
21 | * | ||
22 | * Author: Ryan Wilson <hap9@epoch.ncsc.mil> | ||
23 | */ | ||
24 | #ifndef __XEN_PCI_COMMON_H__ | ||
25 | #define __XEN_PCI_COMMON_H__ | ||
26 | |||
27 | /* Be sure to bump this number if you change this file */ | ||
28 | #define XEN_PCI_MAGIC "7" | ||
29 | |||
30 | /* xen_pci_sharedinfo flags */ | ||
31 | #define _XEN_PCIF_active (0) | ||
32 | #define XEN_PCIF_active (1<<_XEN_PCIF_active) | ||
33 | #define _XEN_PCIB_AERHANDLER (1) | ||
34 | #define XEN_PCIB_AERHANDLER (1<<_XEN_PCIB_AERHANDLER) | ||
35 | #define _XEN_PCIB_active (2) | ||
36 | #define XEN_PCIB_active (1<<_XEN_PCIB_active) | ||
37 | |||
38 | /* xen_pci_op commands */ | ||
39 | #define XEN_PCI_OP_conf_read (0) | ||
40 | #define XEN_PCI_OP_conf_write (1) | ||
41 | #define XEN_PCI_OP_enable_msi (2) | ||
42 | #define XEN_PCI_OP_disable_msi (3) | ||
43 | #define XEN_PCI_OP_enable_msix (4) | ||
44 | #define XEN_PCI_OP_disable_msix (5) | ||
45 | #define XEN_PCI_OP_aer_detected (6) | ||
46 | #define XEN_PCI_OP_aer_resume (7) | ||
47 | #define XEN_PCI_OP_aer_mmio (8) | ||
48 | #define XEN_PCI_OP_aer_slotreset (9) | ||
49 | |||
50 | /* xen_pci_op error numbers */ | ||
51 | #define XEN_PCI_ERR_success (0) | ||
52 | #define XEN_PCI_ERR_dev_not_found (-1) | ||
53 | #define XEN_PCI_ERR_invalid_offset (-2) | ||
54 | #define XEN_PCI_ERR_access_denied (-3) | ||
55 | #define XEN_PCI_ERR_not_implemented (-4) | ||
56 | /* XEN_PCI_ERR_op_failed - backend failed to complete the operation */ | ||
57 | #define XEN_PCI_ERR_op_failed (-5) | ||
58 | |||
59 | /* | ||
60 | * it should be PAGE_SIZE-sizeof(struct xen_pci_op))/sizeof(struct msix_entry)) | ||
61 | * Should not exceed 128 | ||
62 | */ | ||
63 | #define SH_INFO_MAX_VEC 128 | ||
64 | |||
65 | struct xen_msix_entry { | ||
66 | uint16_t vector; | ||
67 | uint16_t entry; | ||
68 | }; | ||
69 | struct xen_pci_op { | ||
70 | /* IN: what action to perform: XEN_PCI_OP_* */ | ||
71 | uint32_t cmd; | ||
72 | |||
73 | /* OUT: will contain an error number (if any) from errno.h */ | ||
74 | int32_t err; | ||
75 | |||
76 | /* IN: which device to touch */ | ||
77 | uint32_t domain; /* PCI Domain/Segment */ | ||
78 | uint32_t bus; | ||
79 | uint32_t devfn; | ||
80 | |||
81 | /* IN: which configuration registers to touch */ | ||
82 | int32_t offset; | ||
83 | int32_t size; | ||
84 | |||
85 | /* IN/OUT: Contains the result after a READ or the value to WRITE */ | ||
86 | uint32_t value; | ||
87 | /* IN: Contains extra infor for this operation */ | ||
88 | uint32_t info; | ||
89 | /*IN: param for msi-x */ | ||
90 | struct xen_msix_entry msix_entries[SH_INFO_MAX_VEC]; | ||
91 | }; | ||
92 | |||
93 | /*used for pcie aer handling*/ | ||
94 | struct xen_pcie_aer_op { | ||
95 | /* IN: what action to perform: XEN_PCI_OP_* */ | ||
96 | uint32_t cmd; | ||
97 | /*IN/OUT: return aer_op result or carry error_detected state as input*/ | ||
98 | int32_t err; | ||
99 | |||
100 | /* IN: which device to touch */ | ||
101 | uint32_t domain; /* PCI Domain/Segment*/ | ||
102 | uint32_t bus; | ||
103 | uint32_t devfn; | ||
104 | }; | ||
105 | struct xen_pci_sharedinfo { | ||
106 | /* flags - XEN_PCIF_* */ | ||
107 | uint32_t flags; | ||
108 | struct xen_pci_op op; | ||
109 | struct xen_pcie_aer_op aer_op; | ||
110 | }; | ||
111 | |||
112 | #endif /* __XEN_PCI_COMMON_H__ */ | ||
diff --git a/include/xen/interface/io/ring.h b/include/xen/interface/io/ring.h index e8cbf431c8cc..75271b9a8f61 100644 --- a/include/xen/interface/io/ring.h +++ b/include/xen/interface/io/ring.h | |||
@@ -24,8 +24,15 @@ typedef unsigned int RING_IDX; | |||
24 | * A ring contains as many entries as will fit, rounded down to the nearest | 24 | * A ring contains as many entries as will fit, rounded down to the nearest |
25 | * power of two (so we can mask with (size-1) to loop around). | 25 | * power of two (so we can mask with (size-1) to loop around). |
26 | */ | 26 | */ |
27 | #define __RING_SIZE(_s, _sz) \ | 27 | #define __CONST_RING_SIZE(_s, _sz) \ |
28 | (__RD32(((_sz) - (long)&(_s)->ring + (long)(_s)) / sizeof((_s)->ring[0]))) | 28 | (__RD32(((_sz) - offsetof(struct _s##_sring, ring)) / \ |
29 | sizeof(((struct _s##_sring *)0)->ring[0]))) | ||
30 | |||
31 | /* | ||
32 | * The same for passing in an actual pointer instead of a name tag. | ||
33 | */ | ||
34 | #define __RING_SIZE(_s, _sz) \ | ||
35 | (__RD32(((_sz) - (long)&(_s)->ring + (long)(_s)) / sizeof((_s)->ring[0]))) | ||
29 | 36 | ||
30 | /* | 37 | /* |
31 | * Macros to make the correct C datatypes for a new kind of ring. | 38 | * Macros to make the correct C datatypes for a new kind of ring. |
diff --git a/include/xen/interface/io/xenbus.h b/include/xen/interface/io/xenbus.h index 46508c7fa399..9fda532973a5 100644 --- a/include/xen/interface/io/xenbus.h +++ b/include/xen/interface/io/xenbus.h | |||
@@ -27,8 +27,14 @@ enum xenbus_state | |||
27 | XenbusStateClosing = 5, /* The device is being closed | 27 | XenbusStateClosing = 5, /* The device is being closed |
28 | due to an error or an unplug | 28 | due to an error or an unplug |
29 | event. */ | 29 | event. */ |
30 | XenbusStateClosed = 6 | 30 | XenbusStateClosed = 6, |
31 | 31 | ||
32 | /* | ||
33 | * Reconfiguring: The device is being reconfigured. | ||
34 | */ | ||
35 | XenbusStateReconfiguring = 7, | ||
36 | |||
37 | XenbusStateReconfigured = 8 | ||
32 | }; | 38 | }; |
33 | 39 | ||
34 | #endif /* _XEN_PUBLIC_IO_XENBUS_H */ | 40 | #endif /* _XEN_PUBLIC_IO_XENBUS_H */ |
diff --git a/include/xen/interface/memory.h b/include/xen/interface/memory.h index d3938d3e71f8..eac3ce153719 100644 --- a/include/xen/interface/memory.h +++ b/include/xen/interface/memory.h | |||
@@ -141,6 +141,19 @@ struct xen_machphys_mfn_list { | |||
141 | DEFINE_GUEST_HANDLE_STRUCT(xen_machphys_mfn_list); | 141 | DEFINE_GUEST_HANDLE_STRUCT(xen_machphys_mfn_list); |
142 | 142 | ||
143 | /* | 143 | /* |
144 | * Returns the location in virtual address space of the machine_to_phys | ||
145 | * mapping table. Architectures which do not have a m2p table, or which do not | ||
146 | * map it by default into guest address space, do not implement this command. | ||
147 | * arg == addr of xen_machphys_mapping_t. | ||
148 | */ | ||
149 | #define XENMEM_machphys_mapping 12 | ||
150 | struct xen_machphys_mapping { | ||
151 | unsigned long v_start, v_end; /* Start and end virtual addresses. */ | ||
152 | unsigned long max_mfn; /* Maximum MFN that can be looked up. */ | ||
153 | }; | ||
154 | DEFINE_GUEST_HANDLE_STRUCT(xen_machphys_mapping_t); | ||
155 | |||
156 | /* | ||
144 | * Sets the GPFN at which a particular page appears in the specified guest's | 157 | * Sets the GPFN at which a particular page appears in the specified guest's |
145 | * pseudophysical address space. | 158 | * pseudophysical address space. |
146 | * arg == addr of xen_add_to_physmap_t. | 159 | * arg == addr of xen_add_to_physmap_t. |
@@ -186,6 +199,35 @@ struct xen_translate_gpfn_list { | |||
186 | }; | 199 | }; |
187 | DEFINE_GUEST_HANDLE_STRUCT(xen_translate_gpfn_list); | 200 | DEFINE_GUEST_HANDLE_STRUCT(xen_translate_gpfn_list); |
188 | 201 | ||
202 | /* | ||
203 | * Returns the pseudo-physical memory map as it was when the domain | ||
204 | * was started (specified by XENMEM_set_memory_map). | ||
205 | * arg == addr of struct xen_memory_map. | ||
206 | */ | ||
207 | #define XENMEM_memory_map 9 | ||
208 | struct xen_memory_map { | ||
209 | /* | ||
210 | * On call the number of entries which can be stored in buffer. On | ||
211 | * return the number of entries which have been stored in | ||
212 | * buffer. | ||
213 | */ | ||
214 | unsigned int nr_entries; | ||
215 | |||
216 | /* | ||
217 | * Entries in the buffer are in the same format as returned by the | ||
218 | * BIOS INT 0x15 EAX=0xE820 call. | ||
219 | */ | ||
220 | GUEST_HANDLE(void) buffer; | ||
221 | }; | ||
222 | DEFINE_GUEST_HANDLE_STRUCT(xen_memory_map); | ||
223 | |||
224 | /* | ||
225 | * Returns the real physical memory map. Passes the same structure as | ||
226 | * XENMEM_memory_map. | ||
227 | * arg == addr of struct xen_memory_map. | ||
228 | */ | ||
229 | #define XENMEM_machine_memory_map 10 | ||
230 | |||
189 | 231 | ||
190 | /* | 232 | /* |
191 | * Prevent the balloon driver from changing the memory reservation | 233 | * Prevent the balloon driver from changing the memory reservation |
diff --git a/include/xen/interface/physdev.h b/include/xen/interface/physdev.h index cd6939147cb6..534cac89a77d 100644 --- a/include/xen/interface/physdev.h +++ b/include/xen/interface/physdev.h | |||
@@ -106,6 +106,57 @@ struct physdev_irq { | |||
106 | uint32_t vector; | 106 | uint32_t vector; |
107 | }; | 107 | }; |
108 | 108 | ||
109 | #define MAP_PIRQ_TYPE_MSI 0x0 | ||
110 | #define MAP_PIRQ_TYPE_GSI 0x1 | ||
111 | #define MAP_PIRQ_TYPE_UNKNOWN 0x2 | ||
112 | |||
113 | #define PHYSDEVOP_map_pirq 13 | ||
114 | struct physdev_map_pirq { | ||
115 | domid_t domid; | ||
116 | /* IN */ | ||
117 | int type; | ||
118 | /* IN */ | ||
119 | int index; | ||
120 | /* IN or OUT */ | ||
121 | int pirq; | ||
122 | /* IN */ | ||
123 | int bus; | ||
124 | /* IN */ | ||
125 | int devfn; | ||
126 | /* IN */ | ||
127 | int entry_nr; | ||
128 | /* IN */ | ||
129 | uint64_t table_base; | ||
130 | }; | ||
131 | |||
132 | #define PHYSDEVOP_unmap_pirq 14 | ||
133 | struct physdev_unmap_pirq { | ||
134 | domid_t domid; | ||
135 | /* IN */ | ||
136 | int pirq; | ||
137 | }; | ||
138 | |||
139 | #define PHYSDEVOP_manage_pci_add 15 | ||
140 | #define PHYSDEVOP_manage_pci_remove 16 | ||
141 | struct physdev_manage_pci { | ||
142 | /* IN */ | ||
143 | uint8_t bus; | ||
144 | uint8_t devfn; | ||
145 | }; | ||
146 | |||
147 | #define PHYSDEVOP_manage_pci_add_ext 20 | ||
148 | struct physdev_manage_pci_ext { | ||
149 | /* IN */ | ||
150 | uint8_t bus; | ||
151 | uint8_t devfn; | ||
152 | unsigned is_extfn; | ||
153 | unsigned is_virtfn; | ||
154 | struct { | ||
155 | uint8_t bus; | ||
156 | uint8_t devfn; | ||
157 | } physfn; | ||
158 | }; | ||
159 | |||
109 | /* | 160 | /* |
110 | * Argument to physdev_op_compat() hypercall. Superceded by new physdev_op() | 161 | * Argument to physdev_op_compat() hypercall. Superceded by new physdev_op() |
111 | * hypercall since 0x00030202. | 162 | * hypercall since 0x00030202. |
@@ -121,6 +172,32 @@ struct physdev_op { | |||
121 | } u; | 172 | } u; |
122 | }; | 173 | }; |
123 | 174 | ||
175 | #define PHYSDEVOP_setup_gsi 21 | ||
176 | struct physdev_setup_gsi { | ||
177 | int gsi; | ||
178 | /* IN */ | ||
179 | uint8_t triggering; | ||
180 | /* IN */ | ||
181 | uint8_t polarity; | ||
182 | /* IN */ | ||
183 | }; | ||
184 | |||
185 | #define PHYSDEVOP_get_nr_pirqs 22 | ||
186 | struct physdev_nr_pirqs { | ||
187 | /* OUT */ | ||
188 | uint32_t nr_pirqs; | ||
189 | }; | ||
190 | |||
191 | /* type is MAP_PIRQ_TYPE_GSI or MAP_PIRQ_TYPE_MSI | ||
192 | * the hypercall returns a free pirq */ | ||
193 | #define PHYSDEVOP_get_free_pirq 23 | ||
194 | struct physdev_get_free_pirq { | ||
195 | /* IN */ | ||
196 | int type; | ||
197 | /* OUT */ | ||
198 | uint32_t pirq; | ||
199 | }; | ||
200 | |||
124 | /* | 201 | /* |
125 | * Notify that some PIRQ-bound event channels have been unmasked. | 202 | * Notify that some PIRQ-bound event channels have been unmasked. |
126 | * ** This command is obsolete since interface version 0x00030202 and is ** | 203 | * ** This command is obsolete since interface version 0x00030202 and is ** |
diff --git a/include/xen/interface/sched.h b/include/xen/interface/sched.h index 5fec575a800a..dd55dac340de 100644 --- a/include/xen/interface/sched.h +++ b/include/xen/interface/sched.h | |||
@@ -65,6 +65,39 @@ struct sched_poll { | |||
65 | DEFINE_GUEST_HANDLE_STRUCT(sched_poll); | 65 | DEFINE_GUEST_HANDLE_STRUCT(sched_poll); |
66 | 66 | ||
67 | /* | 67 | /* |
68 | * Declare a shutdown for another domain. The main use of this function is | ||
69 | * in interpreting shutdown requests and reasons for fully-virtualized | ||
70 | * domains. A para-virtualized domain may use SCHEDOP_shutdown directly. | ||
71 | * @arg == pointer to sched_remote_shutdown structure. | ||
72 | */ | ||
73 | #define SCHEDOP_remote_shutdown 4 | ||
74 | struct sched_remote_shutdown { | ||
75 | domid_t domain_id; /* Remote domain ID */ | ||
76 | unsigned int reason; /* SHUTDOWN_xxx reason */ | ||
77 | }; | ||
78 | |||
79 | /* | ||
80 | * Latch a shutdown code, so that when the domain later shuts down it | ||
81 | * reports this code to the control tools. | ||
82 | * @arg == as for SCHEDOP_shutdown. | ||
83 | */ | ||
84 | #define SCHEDOP_shutdown_code 5 | ||
85 | |||
86 | /* | ||
87 | * Setup, poke and destroy a domain watchdog timer. | ||
88 | * @arg == pointer to sched_watchdog structure. | ||
89 | * With id == 0, setup a domain watchdog timer to cause domain shutdown | ||
90 | * after timeout, returns watchdog id. | ||
91 | * With id != 0 and timeout == 0, destroy domain watchdog timer. | ||
92 | * With id != 0 and timeout != 0, poke watchdog timer and set new timeout. | ||
93 | */ | ||
94 | #define SCHEDOP_watchdog 6 | ||
95 | struct sched_watchdog { | ||
96 | uint32_t id; /* watchdog ID */ | ||
97 | uint32_t timeout; /* timeout */ | ||
98 | }; | ||
99 | |||
100 | /* | ||
68 | * Reason codes for SCHEDOP_shutdown. These may be interpreted by control | 101 | * Reason codes for SCHEDOP_shutdown. These may be interpreted by control |
69 | * software to determine the appropriate action. For the most part, Xen does | 102 | * software to determine the appropriate action. For the most part, Xen does |
70 | * not care about the shutdown code. | 103 | * not care about the shutdown code. |
@@ -73,5 +106,6 @@ DEFINE_GUEST_HANDLE_STRUCT(sched_poll); | |||
73 | #define SHUTDOWN_reboot 1 /* Clean up, kill, and then restart. */ | 106 | #define SHUTDOWN_reboot 1 /* Clean up, kill, and then restart. */ |
74 | #define SHUTDOWN_suspend 2 /* Clean up, save suspend info, kill. */ | 107 | #define SHUTDOWN_suspend 2 /* Clean up, save suspend info, kill. */ |
75 | #define SHUTDOWN_crash 3 /* Tell controller we've crashed. */ | 108 | #define SHUTDOWN_crash 3 /* Tell controller we've crashed. */ |
109 | #define SHUTDOWN_watchdog 4 /* Restart because watchdog time expired. */ | ||
76 | 110 | ||
77 | #endif /* __XEN_PUBLIC_SCHED_H__ */ | 111 | #endif /* __XEN_PUBLIC_SCHED_H__ */ |
diff --git a/include/xen/interface/xen.h b/include/xen/interface/xen.h index 2befa3e2f1bc..70213b4515eb 100644 --- a/include/xen/interface/xen.h +++ b/include/xen/interface/xen.h | |||
@@ -30,7 +30,7 @@ | |||
30 | #define __HYPERVISOR_stack_switch 3 | 30 | #define __HYPERVISOR_stack_switch 3 |
31 | #define __HYPERVISOR_set_callbacks 4 | 31 | #define __HYPERVISOR_set_callbacks 4 |
32 | #define __HYPERVISOR_fpu_taskswitch 5 | 32 | #define __HYPERVISOR_fpu_taskswitch 5 |
33 | #define __HYPERVISOR_sched_op 6 | 33 | #define __HYPERVISOR_sched_op_compat 6 |
34 | #define __HYPERVISOR_dom0_op 7 | 34 | #define __HYPERVISOR_dom0_op 7 |
35 | #define __HYPERVISOR_set_debugreg 8 | 35 | #define __HYPERVISOR_set_debugreg 8 |
36 | #define __HYPERVISOR_get_debugreg 9 | 36 | #define __HYPERVISOR_get_debugreg 9 |
@@ -52,12 +52,13 @@ | |||
52 | #define __HYPERVISOR_mmuext_op 26 | 52 | #define __HYPERVISOR_mmuext_op 26 |
53 | #define __HYPERVISOR_acm_op 27 | 53 | #define __HYPERVISOR_acm_op 27 |
54 | #define __HYPERVISOR_nmi_op 28 | 54 | #define __HYPERVISOR_nmi_op 28 |
55 | #define __HYPERVISOR_sched_op_new 29 | 55 | #define __HYPERVISOR_sched_op 29 |
56 | #define __HYPERVISOR_callback_op 30 | 56 | #define __HYPERVISOR_callback_op 30 |
57 | #define __HYPERVISOR_xenoprof_op 31 | 57 | #define __HYPERVISOR_xenoprof_op 31 |
58 | #define __HYPERVISOR_event_channel_op 32 | 58 | #define __HYPERVISOR_event_channel_op 32 |
59 | #define __HYPERVISOR_physdev_op 33 | 59 | #define __HYPERVISOR_physdev_op 33 |
60 | #define __HYPERVISOR_hvm_op 34 | 60 | #define __HYPERVISOR_hvm_op 34 |
61 | #define __HYPERVISOR_tmem_op 38 | ||
61 | 62 | ||
62 | /* Architecture-specific hypercall definitions. */ | 63 | /* Architecture-specific hypercall definitions. */ |
63 | #define __HYPERVISOR_arch_0 48 | 64 | #define __HYPERVISOR_arch_0 48 |
@@ -461,6 +462,27 @@ typedef uint8_t xen_domain_handle_t[16]; | |||
461 | #define __mk_unsigned_long(x) x ## UL | 462 | #define __mk_unsigned_long(x) x ## UL |
462 | #define mk_unsigned_long(x) __mk_unsigned_long(x) | 463 | #define mk_unsigned_long(x) __mk_unsigned_long(x) |
463 | 464 | ||
465 | #define TMEM_SPEC_VERSION 1 | ||
466 | |||
467 | struct tmem_op { | ||
468 | uint32_t cmd; | ||
469 | int32_t pool_id; | ||
470 | union { | ||
471 | struct { /* for cmd == TMEM_NEW_POOL */ | ||
472 | uint64_t uuid[2]; | ||
473 | uint32_t flags; | ||
474 | } new; | ||
475 | struct { | ||
476 | uint64_t oid[3]; | ||
477 | uint32_t index; | ||
478 | uint32_t tmem_offset; | ||
479 | uint32_t pfn_offset; | ||
480 | uint32_t len; | ||
481 | GUEST_HANDLE(void) gmfn; /* guest machine page frame */ | ||
482 | } gen; | ||
483 | } u; | ||
484 | }; | ||
485 | |||
464 | #else /* __ASSEMBLY__ */ | 486 | #else /* __ASSEMBLY__ */ |
465 | 487 | ||
466 | /* In assembly code we cannot use C numeric constant suffixes. */ | 488 | /* In assembly code we cannot use C numeric constant suffixes. */ |