[Xen-devel] [PATCH net-next 3/7] xen-netback: refactor guest rx
From: David Vrabel Refactor the to-guest (rx) path to: 1. Push responses for completed skbs earlier, reducing latency. 2. Reduce the per-queue memory overhead by greatly reducing the maximum number of grant copy ops in each hypercall (from 4352 to 64). Each struct xenvif_queue is now only 44 kB instead of 220 kB. 3. Make the code more maintainable. Signed-off-by: David Vrabel [re-based] Signed-off-by: Paul Durrant --- Cc: Wei Liu --- drivers/net/xen-netback/common.h | 23 +- drivers/net/xen-netback/rx.c | 654 +++ 2 files changed, 254 insertions(+), 423 deletions(-) diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h index e16004a..adef482 100644 --- a/drivers/net/xen-netback/common.h +++ b/drivers/net/xen-netback/common.h @@ -91,13 +91,6 @@ struct xenvif_rx_meta { */ #define MAX_XEN_SKB_FRAGS (65536 / XEN_PAGE_SIZE + 1) -/* It's possible for an skb to have a maximal number of frags - * but still be less than MAX_BUFFER_OFFSET in size. Thus the - * worst-case number of copy operations is MAX_XEN_SKB_FRAGS per - * ring slot. - */ -#define MAX_GRANT_COPY_OPS (MAX_XEN_SKB_FRAGS * XEN_NETIF_RX_RING_SIZE) - #define NETBACK_INVALID_HANDLE -1 /* To avoid confusion, we define XEN_NETBK_LEGACY_SLOTS_MAX indicating @@ -133,6 +126,14 @@ struct xenvif_stats { unsigned long tx_frag_overflow; }; +#define COPY_BATCH_SIZE 64 + +struct xenvif_copy_state { + struct gnttab_copy op[COPY_BATCH_SIZE]; + RING_IDX idx[COPY_BATCH_SIZE]; + unsigned int num; +}; + struct xenvif_queue { /* Per-queue data for xenvif */ unsigned int id; /* Queue ID, 0-based */ char name[QUEUE_NAME_SIZE]; /* DEVNAME-qN */ @@ -189,12 +190,7 @@ struct xenvif_queue { /* Per-queue data for xenvif */ unsigned long last_rx_time; bool stalled; - struct gnttab_copy grant_copy_op[MAX_GRANT_COPY_OPS]; - - /* We create one meta structure per ring request we consume, so -* the maximum number is the same as the ring size. -*/ - struct xenvif_rx_meta meta[XEN_NETIF_RX_RING_SIZE]; + struct xenvif_copy_state rx_copy; /* Transmit shaping: allow 'credit_bytes' every 'credit_usec'. */ unsigned long credit_bytes; @@ -360,6 +356,7 @@ int xenvif_dealloc_kthread(void *data); int xenvif_ctrl_kthread(void *data); +void xenvif_rx_action(struct xenvif_queue *queue); void xenvif_rx_queue_tail(struct xenvif_queue *queue, struct sk_buff *skb); void xenvif_carrier_on(struct xenvif *vif); diff --git a/drivers/net/xen-netback/rx.c b/drivers/net/xen-netback/rx.c index 6bd7d6e..b0ce4c6 100644 --- a/drivers/net/xen-netback/rx.c +++ b/drivers/net/xen-netback/rx.c @@ -26,7 +26,6 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ - #include "common.h" #include @@ -137,464 +136,299 @@ static void xenvif_rx_queue_drop_expired(struct xenvif_queue *queue) } } -struct netrx_pending_operations { - unsigned int copy_prod, copy_cons; - unsigned int meta_prod, meta_cons; - struct gnttab_copy *copy; - struct xenvif_rx_meta *meta; - int copy_off; - grant_ref_t copy_gref; -}; - -static struct xenvif_rx_meta *get_next_rx_buffer( - struct xenvif_queue *queue, - struct netrx_pending_operations *npo) +static void xenvif_rx_copy_flush(struct xenvif_queue *queue) { - struct xenvif_rx_meta *meta; - struct xen_netif_rx_request req; + unsigned int i; - RING_COPY_REQUEST(&queue->rx, queue->rx.req_cons++, &req); + gnttab_batch_copy(queue->rx_copy.op, queue->rx_copy.num); - meta = npo->meta + npo->meta_prod++; - meta->gso_type = XEN_NETIF_GSO_TYPE_NONE; - meta->gso_size = 0; - meta->size = 0; - meta->id = req.id; + for (i = 0; i < queue->rx_copy.num; i++) { + struct gnttab_copy *op; - npo->copy_off = 0; - npo->copy_gref = req.gref; + op = &queue->rx_copy.op[i]; - return meta; + /* If the copy failed, overwrite the status field in +* the corresponding response. +*/ + if (unlikely(op->status != GNTST_okay)) { + struct xen_netif_rx_response *rsp; + + rsp = RING_GET_RESPONSE(&queue->rx, + queue->rx_copy.idx[i]); + rsp->status = op->status; + } + } + + queue->rx_copy.num = 0; } -struct gop_frag_copy { - struct xenvif_queue *queue; - struct netrx_pending_operations *npo; - struct xenvif_rx_meta *meta; - int head; - int gso_type; - int protocol; - int hash_present; - - struct page *page; -}; - -static void xenvif_setup_copy_gop(unsigned long gfn, - unsigned int offset, -
[Xen-devel] [PATCH net-next 1/7] xen-netback: separate guest side rx code into separate module
The netback source module has become very large and somewhat confusing. This patch simply moves all code related to the backend to frontend (i.e guest side rx) data-path into a separate rx source module. This patch contains no functional change, it is code movement and minimal changes to avoid patch style-check issues. Signed-off-by: Paul Durrant --- Cc: Wei Liu --- drivers/net/xen-netback/Makefile | 2 +- drivers/net/xen-netback/netback.c | 754 drivers/net/xen-netback/rx.c | 789 ++ 3 files changed, 790 insertions(+), 755 deletions(-) create mode 100644 drivers/net/xen-netback/rx.c diff --git a/drivers/net/xen-netback/Makefile b/drivers/net/xen-netback/Makefile index 11e02be..d49798a 100644 --- a/drivers/net/xen-netback/Makefile +++ b/drivers/net/xen-netback/Makefile @@ -1,3 +1,3 @@ obj-$(CONFIG_XEN_NETDEV_BACKEND) := xen-netback.o -xen-netback-y := netback.o xenbus.o interface.o hash.o +xen-netback-y := netback.o xenbus.o interface.o hash.o rx.o diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c index edbae0b..1f9d92e 100644 --- a/drivers/net/xen-netback/netback.c +++ b/drivers/net/xen-netback/netback.c @@ -106,13 +106,6 @@ static void push_tx_responses(struct xenvif_queue *queue); static inline int tx_work_todo(struct xenvif_queue *queue); -static struct xen_netif_rx_response *make_rx_response(struct xenvif_queue *queue, -u16 id, -s8 st, -u16 offset, -u16 size, -u16 flags); - static inline unsigned long idx_to_pfn(struct xenvif_queue *queue, u16 idx) { @@ -155,571 +148,11 @@ static inline pending_ring_idx_t pending_index(unsigned i) return i & (MAX_PENDING_REQS-1); } -static bool xenvif_rx_ring_slots_available(struct xenvif_queue *queue) -{ - RING_IDX prod, cons; - struct sk_buff *skb; - int needed; - - skb = skb_peek(&queue->rx_queue); - if (!skb) - return false; - - needed = DIV_ROUND_UP(skb->len, XEN_PAGE_SIZE); - if (skb_is_gso(skb)) - needed++; - if (skb->sw_hash) - needed++; - - do { - prod = queue->rx.sring->req_prod; - cons = queue->rx.req_cons; - - if (prod - cons >= needed) - return true; - - queue->rx.sring->req_event = prod + 1; - - /* Make sure event is visible before we check prod -* again. -*/ - mb(); - } while (queue->rx.sring->req_prod != prod); - - return false; -} - -void xenvif_rx_queue_tail(struct xenvif_queue *queue, struct sk_buff *skb) -{ - unsigned long flags; - - spin_lock_irqsave(&queue->rx_queue.lock, flags); - - __skb_queue_tail(&queue->rx_queue, skb); - - queue->rx_queue_len += skb->len; - if (queue->rx_queue_len > queue->rx_queue_max) - netif_tx_stop_queue(netdev_get_tx_queue(queue->vif->dev, queue->id)); - - spin_unlock_irqrestore(&queue->rx_queue.lock, flags); -} - -static struct sk_buff *xenvif_rx_dequeue(struct xenvif_queue *queue) -{ - struct sk_buff *skb; - - spin_lock_irq(&queue->rx_queue.lock); - - skb = __skb_dequeue(&queue->rx_queue); - if (skb) - queue->rx_queue_len -= skb->len; - - spin_unlock_irq(&queue->rx_queue.lock); - - return skb; -} - -static void xenvif_rx_queue_maybe_wake(struct xenvif_queue *queue) -{ - spin_lock_irq(&queue->rx_queue.lock); - - if (queue->rx_queue_len < queue->rx_queue_max) - netif_tx_wake_queue(netdev_get_tx_queue(queue->vif->dev, queue->id)); - - spin_unlock_irq(&queue->rx_queue.lock); -} - - -static void xenvif_rx_queue_purge(struct xenvif_queue *queue) -{ - struct sk_buff *skb; - while ((skb = xenvif_rx_dequeue(queue)) != NULL) - kfree_skb(skb); -} - -static void xenvif_rx_queue_drop_expired(struct xenvif_queue *queue) -{ - struct sk_buff *skb; - - for(;;) { - skb = skb_peek(&queue->rx_queue); - if (!skb) - break; - if (time_before(jiffies, XENVIF_RX_CB(skb)->expires)) - break; - xenvif_rx_dequeue(queue); - kfree_skb(skb); - } -} - -struct netrx_pending_operations { - unsigned copy_prod, copy_cons; - unsigned meta_prod, meta_cons; - struct gnttab_copy *copy; - struct xenvif_rx_meta *meta; - int copy_off; - grant_ref_t copy_gref; -}; - -static struct xenvif_rx_meta *get_next_rx_buffer(struct xenvif_queue *queue, -
[Xen-devel] [PATCH net-next 0/7] xen-netback: guest rx side refactor
This series refactors the guest rx side of xen-netback: - The code is moved into its own source module. - The prefix variant of GSO handling is retired (since it is no longer in common use, and alternatives exist). - The code is then simplified and modifications made to improve performance. David Vrabel (4): xen-netback: refactor guest rx xen-netback: immediately wake tx queue when guest rx queue has space xen-netback: process guest rx packets in batches xen-netback: batch copies for multiple to-guest rx packets Paul Durrant (2): xen-netback: separate guest side rx code into separate module xen-netback: retire guest rx side prefix GSO feature Ross Lagerwall (1): xen/netback: add fraglist support for to-guest rx drivers/net/xen-netback/Makefile| 2 +- drivers/net/xen-netback/common.h| 25 +- drivers/net/xen-netback/interface.c | 6 +- drivers/net/xen-netback/netback.c | 754 drivers/net/xen-netback/rx.c| 628 ++ drivers/net/xen-netback/xenbus.c| 21 - 6 files changed, 643 insertions(+), 793 deletions(-) create mode 100644 drivers/net/xen-netback/rx.c -- 2.1.4 ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
[Xen-devel] [PATCH net-next 5/7] xen-netback: process guest rx packets in batches
From: David Vrabel Instead of only placing one skb on the guest rx ring at a time, process a batch of up-to 64. This improves performance by ~10% in some tests. Signed-off-by: David Vrabel [re-based] Signed-off-by: Paul Durrant --- Cc: Wei Liu --- drivers/net/xen-netback/rx.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/net/xen-netback/rx.c b/drivers/net/xen-netback/rx.c index 9548709..ae822b8 100644 --- a/drivers/net/xen-netback/rx.c +++ b/drivers/net/xen-netback/rx.c @@ -399,7 +399,7 @@ static void xenvif_rx_extra_slot(struct xenvif_queue *queue, BUG(); } -void xenvif_rx_action(struct xenvif_queue *queue) +void xenvif_rx_skb(struct xenvif_queue *queue) { struct xenvif_pkt_state pkt; @@ -425,6 +425,19 @@ void xenvif_rx_action(struct xenvif_queue *queue) xenvif_rx_complete(queue, &pkt); } +#define RX_BATCH_SIZE 64 + +void xenvif_rx_action(struct xenvif_queue *queue) +{ + unsigned int work_done = 0; + + while (xenvif_rx_ring_slots_available(queue) && + work_done < RX_BATCH_SIZE) { + xenvif_rx_skb(queue); + work_done++; + } +} + static bool xenvif_rx_queue_stalled(struct xenvif_queue *queue) { RING_IDX prod, cons; -- 2.1.4 ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
[Xen-devel] [PATCH net-next 4/7] xen-netback: immediately wake tx queue when guest rx queue has space
From: David Vrabel When an skb is removed from the guest rx queue, immediately wake the tx queue, instead of after processing them. Signed-off-by: David Vrabel [re-based] Signed-off-by: Paul Durrant --- Cc: Wei Liu --- drivers/net/xen-netback/rx.c | 24 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/drivers/net/xen-netback/rx.c b/drivers/net/xen-netback/rx.c index b0ce4c6..9548709 100644 --- a/drivers/net/xen-netback/rx.c +++ b/drivers/net/xen-netback/rx.c @@ -92,27 +92,21 @@ static struct sk_buff *xenvif_rx_dequeue(struct xenvif_queue *queue) spin_lock_irq(&queue->rx_queue.lock); skb = __skb_dequeue(&queue->rx_queue); - if (skb) + if (skb) { queue->rx_queue_len -= skb->len; + if (queue->rx_queue_len < queue->rx_queue_max) { + struct netdev_queue *txq; + + txq = netdev_get_tx_queue(queue->vif->dev, queue->id); + netif_tx_wake_queue(txq); + } + } spin_unlock_irq(&queue->rx_queue.lock); return skb; } -static void xenvif_rx_queue_maybe_wake(struct xenvif_queue *queue) -{ - spin_lock_irq(&queue->rx_queue.lock); - - if (queue->rx_queue_len < queue->rx_queue_max) { - struct net_device *dev = queue->vif->dev; - - netif_tx_wake_queue(netdev_get_tx_queue(dev, queue->id)); - } - - spin_unlock_irq(&queue->rx_queue.lock); -} - static void xenvif_rx_queue_purge(struct xenvif_queue *queue) { struct sk_buff *skb; @@ -585,8 +579,6 @@ int xenvif_kthread_guest_rx(void *data) */ xenvif_rx_queue_drop_expired(queue); - xenvif_rx_queue_maybe_wake(queue); - cond_resched(); } -- 2.1.4 ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
[Xen-devel] [PATCH net-next 7/7] xen/netback: add fraglist support for to-guest rx
From: Ross Lagerwall This allows full 64K skbuffs (with 1500 mtu ethernet, composed of 45 fragments) to be handled by netback for to-guest rx. Signed-off-by: Ross Lagerwall [re-based] Signed-off-by: Paul Durrant --- Cc: Wei Liu --- drivers/net/xen-netback/interface.c | 2 +- drivers/net/xen-netback/rx.c| 38 - 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c index 1a009e7..8fef4fe 100644 --- a/drivers/net/xen-netback/interface.c +++ b/drivers/net/xen-netback/interface.c @@ -476,7 +476,7 @@ struct xenvif *xenvif_alloc(struct device *parent, domid_t domid, dev->netdev_ops = &xenvif_netdev_ops; dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | - NETIF_F_TSO | NETIF_F_TSO6; + NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_FRAGLIST; dev->features = dev->hw_features | NETIF_F_RXCSUM; dev->ethtool_ops = &xenvif_ethtool_ops; diff --git a/drivers/net/xen-netback/rx.c b/drivers/net/xen-netback/rx.c index 8c8c5b5..8e9ade6 100644 --- a/drivers/net/xen-netback/rx.c +++ b/drivers/net/xen-netback/rx.c @@ -215,7 +215,8 @@ static unsigned int xenvif_gso_type(struct sk_buff *skb) struct xenvif_pkt_state { struct sk_buff *skb; size_t remaining_len; - int frag; /* frag == -1 => skb->head */ + struct sk_buff *frag_iter; + int frag; /* frag == -1 => frag_iter->head */ unsigned int frag_offset; struct xen_netif_extra_info extras[XEN_NETIF_EXTRA_TYPE_MAX - 1]; unsigned int extra_count; @@ -237,6 +238,7 @@ static void xenvif_rx_next_skb(struct xenvif_queue *queue, memset(pkt, 0, sizeof(struct xenvif_pkt_state)); pkt->skb = skb; + pkt->frag_iter = skb; pkt->remaining_len = skb->len; pkt->frag = -1; @@ -293,20 +295,40 @@ static void xenvif_rx_complete(struct xenvif_queue *queue, __skb_queue_tail(queue->rx_copy.completed, pkt->skb); } +static void xenvif_rx_next_frag(struct xenvif_pkt_state *pkt) +{ + struct sk_buff *frag_iter = pkt->frag_iter; + unsigned int nr_frags = skb_shinfo(frag_iter)->nr_frags; + + pkt->frag++; + pkt->frag_offset = 0; + + if (pkt->frag >= nr_frags) { + if (frag_iter == pkt->skb) + pkt->frag_iter = skb_shinfo(frag_iter)->frag_list; + else + pkt->frag_iter = frag_iter->next; + + pkt->frag = -1; + } +} + static void xenvif_rx_next_chunk(struct xenvif_queue *queue, struct xenvif_pkt_state *pkt, unsigned int offset, void **data, size_t *len) { - struct sk_buff *skb = pkt->skb; + struct sk_buff *frag_iter = pkt->frag_iter; void *frag_data; size_t frag_len, chunk_len; + BUG_ON(!frag_iter); + if (pkt->frag == -1) { - frag_data = skb->data; - frag_len = skb_headlen(skb); + frag_data = frag_iter->data; + frag_len = skb_headlen(frag_iter); } else { - skb_frag_t *frag = &skb_shinfo(skb)->frags[pkt->frag]; + skb_frag_t *frag = &skb_shinfo(frag_iter)->frags[pkt->frag]; frag_data = skb_frag_address(frag); frag_len = skb_frag_size(frag); @@ -322,10 +344,8 @@ static void xenvif_rx_next_chunk(struct xenvif_queue *queue, pkt->frag_offset += chunk_len; /* Advance to next frag? */ - if (frag_len == chunk_len) { - pkt->frag++; - pkt->frag_offset = 0; - } + if (frag_len == chunk_len) + xenvif_rx_next_frag(pkt); *data = frag_data; *len = chunk_len; -- 2.1.4 ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
[Xen-devel] [PATCH net-next 2/7] xen-netback: retire guest rx side prefix GSO feature
As far as I am aware only very old Windows network frontends make use of this style of passing GSO packets from backend to frontend. These frontends can easily be replaced by the freely available Xen Project Windows PV network frontend, which uses the 'default' mechanism for passing GSO packets, which is also used by all Linux frontends. NOTE: Removal of this feature will not cause breakage in old Windows frontends. They simply will no longer receive GSO packets - the packets instead being fragmented in the backend. Signed-off-by: Paul Durrant --- Cc: Wei Liu --- drivers/net/xen-netback/common.h| 1 - drivers/net/xen-netback/interface.c | 4 ++-- drivers/net/xen-netback/rx.c| 26 -- drivers/net/xen-netback/xenbus.c| 21 - 4 files changed, 2 insertions(+), 50 deletions(-) diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h index 3a56268..e16004a 100644 --- a/drivers/net/xen-netback/common.h +++ b/drivers/net/xen-netback/common.h @@ -260,7 +260,6 @@ struct xenvif { /* Frontend feature information. */ int gso_mask; - int gso_prefix_mask; u8 can_sg:1; u8 ip_csum:1; diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c index 83deeeb..1a009e7 100644 --- a/drivers/net/xen-netback/interface.c +++ b/drivers/net/xen-netback/interface.c @@ -328,9 +328,9 @@ static netdev_features_t xenvif_fix_features(struct net_device *dev, if (!vif->can_sg) features &= ~NETIF_F_SG; - if (~(vif->gso_mask | vif->gso_prefix_mask) & GSO_BIT(TCPV4)) + if (~(vif->gso_mask) & GSO_BIT(TCPV4)) features &= ~NETIF_F_TSO; - if (~(vif->gso_mask | vif->gso_prefix_mask) & GSO_BIT(TCPV6)) + if (~(vif->gso_mask) & GSO_BIT(TCPV6)) features &= ~NETIF_F_TSO6; if (!vif->ip_csum) features &= ~NETIF_F_IP_CSUM; diff --git a/drivers/net/xen-netback/rx.c b/drivers/net/xen-netback/rx.c index 03836aa..6bd7d6e 100644 --- a/drivers/net/xen-netback/rx.c +++ b/drivers/net/xen-netback/rx.c @@ -347,16 +347,6 @@ static int xenvif_gop_skb(struct sk_buff *skb, gso_type = XEN_NETIF_GSO_TYPE_TCPV6; } - /* Set up a GSO prefix descriptor, if necessary */ - if ((1 << gso_type) & vif->gso_prefix_mask) { - RING_COPY_REQUEST(&queue->rx, queue->rx.req_cons++, &req); - meta = npo->meta + npo->meta_prod++; - meta->gso_type = gso_type; - meta->gso_size = skb_shinfo(skb)->gso_size; - meta->size = 0; - meta->id = req.id; - } - RING_COPY_REQUEST(&queue->rx, queue->rx.req_cons++, &req); meta = npo->meta + npo->meta_prod++; @@ -511,22 +501,6 @@ static void xenvif_rx_action(struct xenvif_queue *queue) while ((skb = __skb_dequeue(&rxq)) != NULL) { struct xen_netif_extra_info *extra = NULL; - if ((1 << queue->meta[npo.meta_cons].gso_type) & - vif->gso_prefix_mask) { - resp = RING_GET_RESPONSE(&queue->rx, -queue->rx.rsp_prod_pvt++); - - resp->flags = XEN_NETRXF_gso_prefix | - XEN_NETRXF_more_data; - - resp->offset = queue->meta[npo.meta_cons].gso_size; - resp->id = queue->meta[npo.meta_cons].id; - resp->status = XENVIF_RX_CB(skb)->meta_slots_used; - - npo.meta_cons++; - XENVIF_RX_CB(skb)->meta_slots_used--; - } - queue->stats.tx_bytes += skb->len; queue->stats.tx_packets++; diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c index bacf6e0..6c57b02 100644 --- a/drivers/net/xen-netback/xenbus.c +++ b/drivers/net/xen-netback/xenbus.c @@ -1154,7 +1154,6 @@ static int read_xenbus_vif_flags(struct backend_info *be) vif->can_sg = !!val; vif->gso_mask = 0; - vif->gso_prefix_mask = 0; if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-gso-tcpv4", "%d", &val) < 0) @@ -1162,32 +1161,12 @@ static int read_xenbus_vif_flags(struct backend_info *be) if (val) vif->gso_mask |= GSO_BIT(TCPV4); - if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-gso-tcpv4-prefix", -"%d", &val) < 0) - val = 0; - if (val) - vif->gso_prefix_mask |= GSO_BIT(TCPV4); - if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-gso-tcpv6", "%d", &val) < 0) val = 0; if (val) vif->gso_mask |= GSO_BIT(TCPV6); - if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-gso-tcpv6-prefix", -"%d", &val)
[Xen-devel] [PATCH net-next 6/7] xen-netback: batch copies for multiple to-guest rx packets
From: David Vrabel Instead of flushing the copy ops when an packet is complete, complete packets when their copy ops are done. This improves performance by reducing the number of grant copy hypercalls. Latency is still limited by the relatively small size of the copy batch. Signed-off-by: David Vrabel [re-based] Signed-off-by: Paul Durrant --- Cc: Wei Liu --- drivers/net/xen-netback/common.h | 1 + drivers/net/xen-netback/rx.c | 27 +-- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h index adef482..5d40603 100644 --- a/drivers/net/xen-netback/common.h +++ b/drivers/net/xen-netback/common.h @@ -132,6 +132,7 @@ struct xenvif_copy_state { struct gnttab_copy op[COPY_BATCH_SIZE]; RING_IDX idx[COPY_BATCH_SIZE]; unsigned int num; + struct sk_buff_head *completed; }; struct xenvif_queue { /* Per-queue data for xenvif */ diff --git a/drivers/net/xen-netback/rx.c b/drivers/net/xen-netback/rx.c index ae822b8..8c8c5b5 100644 --- a/drivers/net/xen-netback/rx.c +++ b/drivers/net/xen-netback/rx.c @@ -133,6 +133,7 @@ static void xenvif_rx_queue_drop_expired(struct xenvif_queue *queue) static void xenvif_rx_copy_flush(struct xenvif_queue *queue) { unsigned int i; + int notify; gnttab_batch_copy(queue->rx_copy.op, queue->rx_copy.num); @@ -154,6 +155,13 @@ static void xenvif_rx_copy_flush(struct xenvif_queue *queue) } queue->rx_copy.num = 0; + + /* Push responses for all completed packets. */ + RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&queue->rx, notify); + if (notify) + notify_remote_via_irq(queue->rx_irq); + + __skb_queue_purge(queue->rx_copy.completed); } static void xenvif_rx_copy_add(struct xenvif_queue *queue, @@ -279,18 +287,10 @@ static void xenvif_rx_next_skb(struct xenvif_queue *queue, static void xenvif_rx_complete(struct xenvif_queue *queue, struct xenvif_pkt_state *pkt) { - int notify; - - /* Complete any outstanding copy ops for this skb. */ - xenvif_rx_copy_flush(queue); - - /* Push responses and notify. */ + /* All responses are ready to be pushed. */ queue->rx.rsp_prod_pvt = queue->rx.req_cons; - RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&queue->rx, notify); - if (notify) - notify_remote_via_irq(queue->rx_irq); - dev_kfree_skb(pkt->skb); + __skb_queue_tail(queue->rx_copy.completed, pkt->skb); } static void xenvif_rx_next_chunk(struct xenvif_queue *queue, @@ -429,13 +429,20 @@ void xenvif_rx_skb(struct xenvif_queue *queue) void xenvif_rx_action(struct xenvif_queue *queue) { + struct sk_buff_head completed_skbs; unsigned int work_done = 0; + __skb_queue_head_init(&completed_skbs); + queue->rx_copy.completed = &completed_skbs; + while (xenvif_rx_ring_slots_available(queue) && work_done < RX_BATCH_SIZE) { xenvif_rx_skb(queue); work_done++; } + + /* Flush any pending copies and complete all skbs. */ + xenvif_rx_copy_flush(queue); } static bool xenvif_rx_queue_stalled(struct xenvif_queue *queue) -- 2.1.4 ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
Re: [Xen-devel] [PATCH v2 03/30] xen/x86: fix parameters and return value of *_set_allocation functions
> -Original Message- > From: Xen-devel [mailto:xen-devel-boun...@lists.xen.org] On Behalf Of > Roger Pau Monne > Sent: 27 September 2016 16:57 > To: xen-de...@lists.xenproject.org > Cc: George Dunlap ; Andrew Cooper > ; Tim (Xen.org) ; Jan Beulich > ; boris.ostrov...@oracle.com; Roger Pau Monne > > Subject: [Xen-devel] [PATCH v2 03/30] xen/x86: fix parameters and return > value of *_set_allocation functions > > Return should be an int, and the number of pages should be an unsigned > long. > > Signed-off-by: Roger Pau Monné > --- > Cc: George Dunlap > Cc: Jan Beulich > Cc: Andrew Cooper > Cc: Tim Deegan > --- > xen/arch/x86/mm/hap/hap.c | 6 +++--- > xen/arch/x86/mm/shadow/common.c | 7 +++ > xen/include/asm-x86/domain.h| 12 ++-- > 3 files changed, 12 insertions(+), 13 deletions(-) > > diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c > index 3218fa2..b6d2c61 100644 > --- a/xen/arch/x86/mm/hap/hap.c > +++ b/xen/arch/x86/mm/hap/hap.c > @@ -325,7 +325,7 @@ static void hap_free_p2m_page(struct domain *d, > struct page_info *pg) > static unsigned int > hap_get_allocation(struct domain *d) > { > -unsigned int pg = d->arch.paging.hap.total_pages > +unsigned long pg = d->arch.paging.hap.total_pages > + d->arch.paging.hap.p2m_pages; You are modifying this calculation (by including hap.p2m_pages as well as hap.total_pages) so the comment should probably mention this. > > return ((pg >> (20 - PAGE_SHIFT)) > @@ -334,8 +334,8 @@ hap_get_allocation(struct domain *d) > > /* Set the pool of pages to the required number of pages. > * Returns 0 for success, non-zero for failure. */ > -static unsigned int > -hap_set_allocation(struct domain *d, unsigned int pages, int *preempted) > +static int > +hap_set_allocation(struct domain *d, unsigned long pages, int > *preempted) > { > struct page_info *pg; > > diff --git a/xen/arch/x86/mm/shadow/common.c > b/xen/arch/x86/mm/shadow/common.c > index 21607bf..d3cc2cc 100644 > --- a/xen/arch/x86/mm/shadow/common.c > +++ b/xen/arch/x86/mm/shadow/common.c > @@ -1613,9 +1613,8 @@ shadow_free_p2m_page(struct domain *d, struct > page_info *pg) > * Input will be rounded up to at least shadow_min_acceptable_pages(), > * plus space for the p2m table. > * Returns 0 for success, non-zero for failure. */ > -static unsigned int sh_set_allocation(struct domain *d, > - unsigned int pages, > - int *preempted) > +static int sh_set_allocation(struct domain *d, unsigned long pages, > + int *preempted) > { > struct page_info *sp; > unsigned int lower_bound; > @@ -1692,7 +1691,7 @@ static unsigned int sh_set_allocation(struct domain > *d, > /* Return the size of the shadow pool, rounded up to the nearest MB */ > static unsigned int shadow_get_allocation(struct domain *d) > { > -unsigned int pg = d->arch.paging.shadow.total_pages > +unsigned long pg = d->arch.paging.shadow.total_pages > + d->arch.paging.shadow.p2m_pages; Same here. > return ((pg >> (20 - PAGE_SHIFT)) > + ((pg & ((1 << (20 - PAGE_SHIFT)) - 1)) ? 1 : 0)); OMG. Is there no rounding macro you can use for this? Paul > diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h > index 5807a1f..11ac2a5 100644 > --- a/xen/include/asm-x86/domain.h > +++ b/xen/include/asm-x86/domain.h > @@ -93,9 +93,9 @@ struct shadow_domain { > > /* Memory allocation */ > struct page_list_head freelist; > -unsigned int total_pages; /* number of pages allocated */ > -unsigned int free_pages; /* number of pages on freelists */ > -unsigned int p2m_pages;/* number of pages allocates to p2m */ > +unsigned long total_pages; /* number of pages allocated */ > +unsigned long free_pages; /* number of pages on freelists */ > +unsigned long p2m_pages;/* number of pages allocates to p2m */ > > /* 1-to-1 map for use when HVM vcpus have paging disabled */ > pagetable_t unpaged_pagetable; > @@ -155,9 +155,9 @@ struct shadow_vcpu { > // > struct hap_domain { > struct page_list_head freelist; > -unsigned int total_pages; /* number of pages allocated */ > -unsigned int free_pages; /* number of pages on freelists */ > -unsigned int p2m_pages;/* number of pages allocates to p2m */ > +unsigned long total_pages; /* number of pages allocated */ > +unsigned long free_pages; /* number of pages on freelists */ > +unsigned long p2m_pages;/* number of pages allocates to p2m */ > }; > > // > -- > 2.7.4 (Apple Git-66) > > > ___ > Xen-devel mailing list > Xen-devel@lists.xen.org > https://lists.xen.org/xen-devel
Re: [Xen-devel] [PATCH v2 13/30] xen: introduce a new format specifier to print sizes in human-readable form
> -Original Message- > From: Xen-devel [mailto:xen-devel-boun...@lists.xen.org] On Behalf Of > Roger Pau Monne > Sent: 27 September 2016 16:57 > To: xen-de...@lists.xenproject.org > Cc: Stefano Stabellini ; Wei Liu > ; George Dunlap ; > Andrew Cooper ; Ian Jackson > ; Tim (Xen.org) ; Jan Beulich > ; boris.ostrov...@oracle.com; Roger Pau Monne > > Subject: [Xen-devel] [PATCH v2 13/30] xen: introduce a new format specifier > to print sizes in human-readable form > > Introduce a new %pB format specifier to print sizes (in bytes) in a human- > readable form. > This comment does not seem to match the code. You use 'Z' below... Paul > Signed-off-by: Roger Pau Monné > --- > Cc: Andrew Cooper > Cc: George Dunlap > Cc: Ian Jackson > Cc: Jan Beulich > Cc: Konrad Rzeszutek Wilk > Cc: Stefano Stabellini > Cc: Tim Deegan > Cc: Wei Liu > --- > docs/misc/printk-formats.txt | 5 + > xen/common/vsprintf.c| 15 +++ > 2 files changed, 20 insertions(+) > > diff --git a/docs/misc/printk-formats.txt b/docs/misc/printk-formats.txt > index 525108f..0ee3504 100644 > --- a/docs/misc/printk-formats.txt > +++ b/docs/misc/printk-formats.txt > @@ -30,3 +30,8 @@ Domain and vCPU information: > > %pv Domain and vCPU ID from a 'struct vcpu *' (printed as > "dv") > + > +Size in human readable form: > + > + %pZ Size in human-readable form (input size must be in bytes). > + e.g. 24MB > diff --git a/xen/common/vsprintf.c b/xen/common/vsprintf.c index > f92fb67..2dadaec 100644 > --- a/xen/common/vsprintf.c > +++ b/xen/common/vsprintf.c > @@ -386,6 +386,21 @@ static char *pointer(char *str, char *end, const char > **fmt_ptr, > *str = 'v'; > return number(str + 1, end, v->vcpu_id, 10, -1, -1, 0); > } > +case 'Z': > +{ > +static const char units[][3] = {"B", "KB", "MB", "GB", "TB"}; > +size_t size = (size_t)arg; > +int i = 0; > + > +/* Advance parents fmt string, as we have consumed 'B' */ > +++*fmt_ptr; > + > +while ( ++i < sizeof(units) && size >= 1024 ) > +size >>= 10; /* size /= 1024 */ > + > +str = number(str, end, size, 10, -1, -1, 0); > +return string(str, end, units[i-1], -1, -1, 0); > +} > } > > if ( field_width == -1 ) > -- > 2.7.4 (Apple Git-66) > > > ___ > Xen-devel mailing list > Xen-devel@lists.xen.org > https://lists.xen.org/xen-devel ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
Re: [Xen-devel] [PATCH] xen/x86: Initialize per_cpu(xen_vcpu, 0) a little earlier
On 2016-10-03 00:45, Boris Ostrovsky wrote: xen_cpuhp_setup() calls mutex_lock() which, when CONFIG_DEBUG_MUTEXES is defined, ends up calling xen_save_fl(). That routine expects per_cpu(xen_vcpu, 0) to be already initialized. Signed-off-by: Boris Ostrovsky Reported-by: Sander Eikelenboom --- Sander, please see if this fixes the problem. Thanks. Hi Boris, I have tested it and it fixes the dom0 crash in early boot for me. Thanks again for investigating and the swift fix ! -- Sander arch/x86/xen/enlighten.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 366b6ae..96c2dea 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c @@ -1644,7 +1644,6 @@ asmlinkage __visible void __init xen_start_kernel(void) xen_initial_gdt = &per_cpu(gdt_page, 0); xen_smp_init(); - WARN_ON(xen_cpuhp_setup()); #ifdef CONFIG_ACPI_NUMA /* @@ -1658,6 +1657,8 @@ asmlinkage __visible void __init xen_start_kernel(void) possible map and a non-dummy shared_info. */ per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0]; + WARN_ON(xen_cpuhp_setup()); + local_irq_disable(); early_boot_irqs_disabled = true; ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
[Xen-devel] [xen-unstable test] 101244: tolerable FAIL
flight 101244 xen-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/101244/ Failures :-/ but no regressions. Tests which are failing intermittently (not blocking): test-amd64-amd64-xl-qemut-debianhvm-amd64 9 debian-hvm-install fail in 101242 pass in 101244 test-armhf-armhf-libvirt-raw 9 debian-di-install fail pass in 101242 Regressions which are regarded as allowable (not blocking): test-armhf-armhf-xl-rtds 15 guest-start/debian.repeatfail like 101242 test-amd64-i386-xl-qemut-win7-amd64 16 guest-stop fail like 101242 test-amd64-i386-xl-qemuu-win7-amd64 16 guest-stop fail like 101242 test-amd64-amd64-xl-qemut-win7-amd64 16 guest-stopfail like 101242 test-amd64-amd64-xl-qemuu-win7-amd64 16 guest-stopfail like 101242 test-amd64-amd64-xl-rtds 9 debian-install fail like 101242 Tests which did not succeed, but are not blocking: test-amd64-amd64-rumprun-amd64 1 build-check(1) blocked n/a test-amd64-i386-rumprun-i386 1 build-check(1) blocked n/a test-armhf-armhf-libvirt-raw 11 migrate-support-check fail in 101242 never pass test-armhf-armhf-libvirt-raw 13 guest-saverestorefail in 101242 never pass build-amd64-rumprun 5 rumprun-buildfail never pass test-armhf-armhf-libvirt-xsm 12 migrate-support-checkfail never pass test-armhf-armhf-libvirt-xsm 14 guest-saverestorefail never pass build-i386-rumprun5 rumprun-buildfail never pass test-armhf-armhf-libvirt 12 migrate-support-checkfail never pass test-armhf-armhf-libvirt 14 guest-saverestorefail never pass test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 10 migrate-support-check fail never pass test-armhf-armhf-libvirt-qcow2 11 migrate-support-checkfail never pass test-armhf-armhf-libvirt-qcow2 13 guest-saverestorefail never pass test-armhf-armhf-xl 12 migrate-support-checkfail never pass test-armhf-armhf-xl 13 saverestore-support-checkfail never pass test-armhf-armhf-xl-credit2 12 migrate-support-checkfail never pass test-armhf-armhf-xl-credit2 13 saverestore-support-checkfail never pass test-armhf-armhf-xl-vhd 11 migrate-support-checkfail never pass test-armhf-armhf-xl-vhd 12 saverestore-support-checkfail never pass test-armhf-armhf-xl-arndale 12 migrate-support-checkfail never pass test-armhf-armhf-xl-arndale 13 saverestore-support-checkfail never pass test-armhf-armhf-xl-rtds 12 migrate-support-checkfail never pass test-armhf-armhf-xl-rtds 13 saverestore-support-checkfail never pass test-armhf-armhf-xl-multivcpu 12 migrate-support-checkfail never pass test-armhf-armhf-xl-multivcpu 13 saverestore-support-checkfail never pass test-armhf-armhf-xl-cubietruck 12 migrate-support-checkfail never pass test-armhf-armhf-xl-cubietruck 13 saverestore-support-checkfail never pass test-armhf-armhf-xl-xsm 12 migrate-support-checkfail never pass test-armhf-armhf-xl-xsm 13 saverestore-support-checkfail never pass test-amd64-amd64-libvirt-vhd 11 migrate-support-checkfail never pass test-amd64-amd64-libvirt-xsm 12 migrate-support-checkfail never pass test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 10 migrate-support-check fail never pass test-amd64-amd64-libvirt 12 migrate-support-checkfail never pass test-amd64-amd64-xl-pvh-amd 11 guest-start fail never pass test-amd64-i386-libvirt-xsm 12 migrate-support-checkfail never pass test-amd64-i386-libvirt 12 migrate-support-checkfail never pass test-amd64-amd64-qemuu-nested-amd 16 debian-hvm-install/l1/l2 fail never pass test-amd64-amd64-xl-pvh-intel 11 guest-start fail never pass version targeted for testing: xen b3d54cead6459567d9786ad415149868ee7f2f5b baseline version: xen b3d54cead6459567d9786ad415149868ee7f2f5b Last test of basis 101244 2016-10-03 01:56:58 Z0 days Testing same since0 1970-01-01 00:00:00 Z 17077 days0 attempts jobs: build-amd64-xsm pass build-armhf-xsm pass build-i386-xsm pass build-amd64-xtf pass build-amd64 pass build-armhf pass build-i386 pass build-amd64-libvirt pass build-armhf-libvirt pass build-i386-libvirt
Re: [Xen-devel] [PATCH v2 19/30] xen/dcpi: add a dpci passthrough handler for hardware domain
> -Original Message- > From: Roger Pau Monne [mailto:roger@citrix.com] > Sent: 27 September 2016 16:57 > To: xen-de...@lists.xenproject.org > Cc: konrad.w...@oracle.com; boris.ostrov...@oracle.com; Roger Pau Monne > ; Paul Durrant ; Jan > Beulich ; Andrew Cooper > > Subject: [PATCH v2 19/30] xen/dcpi: add a dpci passthrough handler for > hardware domain > > This is very similar to the PCI trap used for the traditional PV(H) Dom0. > > Signed-off-by: Roger Pau Monné > --- > Cc: Paul Durrant > Cc: Jan Beulich > Cc: Andrew Cooper > --- > xen/arch/x86/hvm/io.c | 72 > ++- > xen/arch/x86/traps.c | 39 --- > xen/drivers/passthrough/pci.c | 39 +++ > xen/include/xen/pci.h | 2 ++ > 4 files changed, 112 insertions(+), 40 deletions(-) > > diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c index > 1e7a5f9..31d54dc 100644 > --- a/xen/arch/x86/hvm/io.c > +++ b/xen/arch/x86/hvm/io.c > @@ -247,12 +247,79 @@ static int dpci_portio_write(const struct > hvm_io_handler *handler, > return X86EMUL_OKAY; > } > > +static bool_t hw_dpci_portio_accept(const struct hvm_io_handler > *handler, > +const ioreq_t *p) { > +if ( (p->addr == 0xcf8 && p->size == 4) || (p->addr & 0xfffc) == 0xcfc) > +{ > +return 1; > +} > + > +return 0; Why not just return the value of the boolean expression? > +} > + > +static int hw_dpci_portio_read(const struct hvm_io_handler *handler, > +uint64_t addr, > +uint32_t size, > +uint64_t *data) { > +struct domain *currd = current->domain; > + > +if ( addr == 0xcf8 ) > +{ > +ASSERT(size == 4); > +*data = currd->arch.pci_cf8; > +return X86EMUL_OKAY; > +} > + > +ASSERT((addr & 0xfffc) == 0xcfc); You could do 'addr &= 3' and simplify the expressions below. > +size = min(size, 4 - ((uint32_t)addr & 3)); > +if ( size == 3 ) > +size = 2; > +if ( pci_cfg_ok(currd, addr & 3, size, NULL) ) Is this the right place to do the check. Can this not be done in the accept op? > +*data = pci_conf_read(currd->arch.pci_cf8, addr & 3, size); > + > +return X86EMUL_OKAY; > +} > + > +static int hw_dpci_portio_write(const struct hvm_io_handler *handler, > +uint64_t addr, > +uint32_t size, > +uint64_t data) { > +struct domain *currd = current->domain; > +uint32_t data32; > + > +if ( addr == 0xcf8 ) > +{ > +ASSERT(size == 4); > +currd->arch.pci_cf8 = data; > +return X86EMUL_OKAY; > +} > + > +ASSERT((addr & 0xfffc) == 0xcfc); 'addr &= 3' again here. Paul > +size = min(size, 4 - ((uint32_t)addr & 3)); > +if ( size == 3 ) > +size = 2; > +data32 = data; > +if ( pci_cfg_ok(currd, addr & 3, size, &data32) ) > +pci_conf_write(currd->arch.pci_cf8, addr & 3, size, data); > + > +return X86EMUL_OKAY; > +} > + > static const struct hvm_io_ops dpci_portio_ops = { > .accept = dpci_portio_accept, > .read = dpci_portio_read, > .write = dpci_portio_write > }; > > +static const struct hvm_io_ops hw_dpci_portio_ops = { > +.accept = hw_dpci_portio_accept, > +.read = hw_dpci_portio_read, > +.write = hw_dpci_portio_write > +}; > + > void register_dpci_portio_handler(struct domain *d) { > struct hvm_io_handler *handler = hvm_next_io_handler(d); @@ -261,7 > +328,10 @@ void register_dpci_portio_handler(struct domain *d) > return; > > handler->type = IOREQ_TYPE_PIO; > -handler->ops = &dpci_portio_ops; > +if ( is_hardware_domain(d) ) > +handler->ops = &hw_dpci_portio_ops; > +else > +handler->ops = &dpci_portio_ops; > } > > /* > diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index > 24d173f..f3c5c9e 100644 > --- a/xen/arch/x86/traps.c > +++ b/xen/arch/x86/traps.c > @@ -2076,45 +2076,6 @@ static bool_t admin_io_okay(unsigned int port, > unsigned int bytes, > return ioports_access_permitted(d, port, port + bytes - 1); } > > -static bool_t pci_cfg_ok(struct domain *currd, unsigned int start, > - unsigned int size, uint32_t *write) > -{ > -uint32_t machine_bdf; > - > -if ( !is_hardware_domain(currd) ) > -return 0; > - > -if ( !CF8_ENABLED(currd->arch.pci_cf8) ) > -return 1; > - > -machine_bdf = CF8_BDF(currd->arch.pci_cf8); > -if ( write ) > -{ > -const unsigned long *ro_map = pci_get_ro_map(0); > - > -if ( ro_map && test_bit(machine_bdf, ro_map) ) > -return 0; > -} > -start |= CF8_ADDR_LO(currd->arch.pci_cf8); > -/* AMD extended configuration space access? */ > -if ( CF8_ADDR_HI(currd->arch.pci_cf8) && > -
Re: [Xen-devel] [PATCH v2 20/30] xen/x86: add the basic infrastructure to import QEMU passthrough code
> -Original Message- > From: Roger Pau Monne [mailto:roger@citrix.com] > Sent: 27 September 2016 16:57 > To: xen-de...@lists.xenproject.org > Cc: konrad.w...@oracle.com; boris.ostrov...@oracle.com; Roger Pau Monne > ; Jan Beulich ; Andrew Cooper > ; Paul Durrant > Subject: [PATCH v2 20/30] xen/x86: add the basic infrastructure to import > QEMU passthrough code > > Most of this code has been picked up from QEMU and modified so it can be > plugged into the internal Xen IO handlers. The structure of the handlers has > been keep quite similar to QEMU, so existing handlers can be imported > without a lot of effort. > If you lifted code from QEMU then one assumes there is no problem with license, but do you need to amend copyrights for any of the files where you put the code? > Signed-off-by: Roger Pau Monné > --- > Cc: Jan Beulich > Cc: Andrew Cooper > Cc: Paul Durrant > --- > docs/misc/xen-command-line.markdown | 8 + > xen/arch/x86/hvm/hvm.c | 2 + > xen/arch/x86/hvm/io.c | 621 > > xen/include/asm-x86/hvm/domain.h| 4 + > xen/include/asm-x86/hvm/io.h| 176 ++ > xen/include/xen/pci.h | 5 + > 6 files changed, 816 insertions(+) > > diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen- > command-line.markdown > index 59d7210..78130c8 100644 > --- a/docs/misc/xen-command-line.markdown > +++ b/docs/misc/xen-command-line.markdown > @@ -670,6 +670,14 @@ Flag that makes a 64bit dom0 boot in PVH mode. No > 32bit support at present. > > Flag that makes a dom0 boot in PVHv2 mode. > > +### dom0permissive > +> `= ` > + > +> Default: `true` > + > +Select mode of PCI pass-through when using a PVHv2 Dom0, either > permissive or > +not. > + > ### dtuart (ARM) > > `= path [:options]` > > diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c > index a291f82..bc4f7bc 100644 > --- a/xen/arch/x86/hvm/hvm.c > +++ b/xen/arch/x86/hvm/hvm.c > @@ -632,6 +632,8 @@ int hvm_domain_initialise(struct domain *d) > goto fail1; > } > memset(d->arch.hvm_domain.io_bitmap, ~0, HVM_IOBITMAP_SIZE); > +INIT_LIST_HEAD(&d->arch.hvm_domain.pt_devices); > +rwlock_init(&d->arch.hvm_domain.pt_lock); > } > else > d->arch.hvm_domain.io_bitmap = hvm_io_bitmap; > diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c > index 31d54dc..7de1de3 100644 > --- a/xen/arch/x86/hvm/io.c > +++ b/xen/arch/x86/hvm/io.c > @@ -46,6 +46,10 @@ > #include > #include > > +/* Set permissive mode for HVM Dom0 PCI pass-through by default */ > +static bool_t opt_dom0permissive = 1; > +boolean_param("dom0permissive", opt_dom0permissive); > + > void send_timeoffset_req(unsigned long timeoff) > { > ioreq_t p = { > @@ -258,12 +262,403 @@ static bool_t hw_dpci_portio_accept(const struct > hvm_io_handler *handler, > return 0; > } > > +static struct hvm_pt_device *hw_dpci_get_device(struct domain *d) > +{ > +uint8_t bus, slot, func; > +uint32_t addr; > +struct hvm_pt_device *dev; > + > +/* Decode bus, slot and func. */ > +addr = CF8_BDF(d->arch.pci_cf8); > +bus = PCI_BUS(addr); > +slot = PCI_SLOT(addr); > +func = PCI_FUNC(addr); > + > +list_for_each_entry( dev, &d->arch.hvm_domain.pt_devices, entries ) > +{ > +if ( dev->pdev->seg != 0 || dev->pdev->bus != bus || > + dev->pdev->devfn != PCI_DEVFN(slot,func) ) > +continue; > + > +return dev; > +} > + > +return NULL; > +} > + > +/* Dispatchers */ > + > +/* Find emulate register group entry */ > +struct hvm_pt_reg_group *hvm_pt_find_reg_grp(struct hvm_pt_device > *d, > + uint32_t address) > +{ > +struct hvm_pt_reg_group *entry = NULL; > + > +/* Find register group entry */ > +list_for_each_entry( entry, &d->register_groups, entries ) > +{ > +/* check address */ > +if ( (entry->base_offset <= address) > + && ((entry->base_offset + entry->size) > address) ) > +return entry; > +} > + > +/* Group entry not found */ > +return NULL; > +} > + > +/* Find emulate register entry */ > +struct hvm_pt_reg *hvm_pt_find_reg(struct hvm_pt_reg_group *reg_grp, > + uint32_t address) > +{ > +struct hvm_pt_reg *reg_entry = NULL; > +struct hvm_pt_reg_handler *handler = NULL; > +uint32_t real_offset = 0; > + > +/* Find register entry */ > +list_for_each_entry( reg_entry, ®_grp->registers, entries ) > +{ > +handler = reg_entry->handler; > +real_offset = reg_grp->base_offset + handler->offset; > +/* Check address */ > +if ( (real_offset <= address) > + && ((real_offset + handler->size) > address) ) > +return reg_entry; > +} > + > +return NULL; > +} > + > +static int hvm_pt_pci_config_access_check(struct hvm_pt
[Xen-devel] [distros-debian-sid test] 67789: regressions - FAIL
flight 67789 distros-debian-sid real [real] http://osstest.xs.citrite.net/~osstest/testlogs/logs/67789/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-armhf-pvops 5 kernel-build fail REGR. vs. 67762 Regressions which are regarded as allowable (not blocking): test-amd64-i386-amd64-sid-netboot-pygrub 9 debian-di-install fail like 67762 test-amd64-i386-i386-sid-netboot-pvgrub 9 debian-di-install fail like 67762 test-amd64-amd64-amd64-sid-netboot-pvgrub 9 debian-di-install fail like 67762 test-amd64-amd64-i386-sid-netboot-pygrub 9 debian-di-install fail like 67762 Tests which did not succeed, but are not blocking: test-armhf-armhf-armhf-sid-netboot-pygrub 1 build-check(1)blocked n/a baseline version: flight 67762 jobs: build-amd64 pass build-armhf pass build-i386 pass build-amd64-pvopspass build-armhf-pvopsfail build-i386-pvops pass test-amd64-amd64-amd64-sid-netboot-pvgrubfail test-amd64-i386-i386-sid-netboot-pvgrub fail test-amd64-i386-amd64-sid-netboot-pygrub fail test-armhf-armhf-armhf-sid-netboot-pygrubblocked test-amd64-amd64-i386-sid-netboot-pygrub fail sg-report-flight on osstest.xs.citrite.net logs: /home/osstest/logs images: /home/osstest/images Logs, config files, etc. are available at http://osstest.xs.citrite.net/~osstest/testlogs/logs Test harness code can be found at http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary Push not applicable. ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
Re: [Xen-devel] [PATCH v2 11/30] xen/x86: split Dom0 build into PV and PVHv2
On Fri, Sep 30, 2016 at 09:03:34AM -0600, Jan Beulich wrote: > >>> On 27.09.16 at 17:57, wrote: > > --- a/docs/misc/xen-command-line.markdown > > +++ b/docs/misc/xen-command-line.markdown > > @@ -663,6 +663,13 @@ Pin dom0 vcpus to their respective pcpus > > > > Flag that makes a 64bit dom0 boot in PVH mode. No 32bit support at present. > > > > +### dom0hvm > > +> `= ` > > + > > +> Default: `false` > > + > > +Flag that makes a dom0 boot in PVHv2 mode. > > Considering sorting aspects this clearly wants to go at least ahead of > dom0pvh. > > > --- a/xen/arch/x86/setup.c > > +++ b/xen/arch/x86/setup.c > > @@ -75,6 +75,10 @@ unsigned long __read_mostly cr4_pv32_mask; > > static bool_t __initdata opt_dom0pvh; > > boolean_param("dom0pvh", opt_dom0pvh); > > > > +/* Boot dom0 in HVM mode */ > > +static bool_t __initdata opt_dom0hvm; > > Plain bool please. > > > @@ -1495,6 +1499,11 @@ void __init noreturn __start_xen(unsigned long mbi_p) > > if ( opt_dom0pvh ) > > domcr_flags |= DOMCRF_pvh | DOMCRF_hap; > > > > +if ( opt_dom0hvm ) { > > Coding style. Fixed all the above. > > +domcr_flags |= DOMCRF_hvm | (hvm_funcs.hap_supported ? DOMCRF_hap > > : 0); > > So you mean to support PVHv2 on shadow (including for Dom0) > right away. Are you also testing that? I've added the following patch to my queue, in order to allow the user to select whether they want to use HAP or shadow, I've tested it locally and there seems to be no issues in building a PVHv2 Dom0 using shadow. --- diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c index 80e20fa..17956e2 100644 --- a/xen/arch/x86/domain_build.c +++ b/xen/arch/x86/domain_build.c @@ -203,13 +203,6 @@ struct vcpu *__init alloc_dom0_vcpu0(struct domain *dom0) return setup_dom0_vcpu(dom0, 0, cpumask_first(&dom0_cpus)); } -#ifdef CONFIG_SHADOW_PAGING -static bool_t __initdata opt_dom0_shadow; -boolean_param("dom0_shadow", opt_dom0_shadow); -#else -#define opt_dom0_shadow 0 -#endif - static char __initdata opt_dom0_ioports_disable[200] = ""; string_param("dom0_ioports_disable", opt_dom0_ioports_disable); diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 9272318..252125d 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -79,6 +79,11 @@ boolean_param("dom0pvh", opt_dom0pvh); static bool_t __initdata opt_dom0hvm; boolean_param("dom0hvm", opt_dom0hvm); +#ifdef CONFIG_SHADOW_PAGING +bool __initdata opt_dom0_shadow; +boolean_param("dom0_shadow", opt_dom0_shadow); +#endif + /* Linux config option: propagated to domain0. */ /* "acpi=off":Sisables both ACPI table parsing and interpreter. */ /* "acpi=force": Override the disable blacklist. */ @@ -1500,7 +1505,9 @@ void __init noreturn __start_xen(unsigned long mbi_p) domcr_flags |= DOMCRF_pvh | DOMCRF_hap; if ( opt_dom0hvm ) { -domcr_flags |= DOMCRF_hvm | (hvm_funcs.hap_supported ? DOMCRF_hap : 0); +domcr_flags |= DOMCRF_hvm | + (hvm_funcs.hap_supported && !opt_dom0_shadow ? + DOMCRF_hap : 0); config.emulation_flags = XEN_X86_EMU_LAPIC|XEN_X86_EMU_IOAPIC; } diff --git a/xen/include/asm-x86/setup.h b/xen/include/asm-x86/setup.h index c65b79c..888d952 100644 --- a/xen/include/asm-x86/setup.h +++ b/xen/include/asm-x86/setup.h @@ -51,6 +51,12 @@ void microcode_grab_module( extern uint8_t kbd_shift_flags; +#ifdef CONFIG_SHADOW_PAGING +extern bool opt_dom0_shadow; +#else +#define opt_dom0_shadow 0 +#endif + #ifdef NDEBUG # define highmem_start 0 #else ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
Re: [Xen-devel] [PATCH v2 22/30] xen/x86: support PVHv2 Dom0 BAR remapping
> -Original Message- > From: Roger Pau Monne [mailto:roger@citrix.com] > Sent: 27 September 2016 16:57 > To: xen-de...@lists.xenproject.org > Cc: konrad.w...@oracle.com; boris.ostrov...@oracle.com; Roger Pau Monne > ; Paul Durrant ; Jan > Beulich ; Andrew Cooper > > Subject: [PATCH v2 22/30] xen/x86: support PVHv2 Dom0 BAR remapping > > Add handlers to detect attemps from a PVHv2 Dom0 to change the position > of the PCI BARs and properly remap them. > > Signed-off-by: Roger Pau Monné > --- > Cc: Paul Durrant > Cc: Jan Beulich > Cc: Andrew Cooper > --- > xen/arch/x86/hvm/io.c | 2 + > xen/drivers/passthrough/pci.c | 307 > ++ > xen/include/asm-x86/hvm/io.h | 19 +++ > xen/include/xen/pci.h | 3 + > 4 files changed, 331 insertions(+) > > diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c index > 7de1de3..4db0266 100644 > --- a/xen/arch/x86/hvm/io.c > +++ b/xen/arch/x86/hvm/io.c > @@ -862,6 +862,8 @@ static int hvm_pt_add_register(struct hvm_pt_device > *dev, } > > static struct hvm_pt_handler_init *hwdom_pt_handlers[] = { > +&hvm_pt_bar_init, > +&hvm_pt_vf_bar_init, > }; > > int hwdom_add_device(struct pci_dev *pdev) diff --git > a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c index > 6d831dd..60c9e74 100644 > --- a/xen/drivers/passthrough/pci.c > +++ b/xen/drivers/passthrough/pci.c > @@ -633,6 +633,313 @@ static int pci_size_bar(unsigned int seg, unsigned > int bus, unsigned int slot, > return 0; > } > > +static bool bar_reg_is_vf(uint32_t real_offset, uint32_t > +handler_offset) { > +if ( real_offset - handler_offset == PCI_SRIOV_BAR ) > +return true; > +else > +return false; > +} > + Return the bool expression rather than the if-then-else? > +static int bar_reg_init(struct hvm_pt_device *s, > +struct hvm_pt_reg_handler *handler, > +uint32_t real_offset, uint32_t *data) { > +uint8_t seg, bus, slot, func; > +uint64_t addr, size; > +uint32_t val; > +unsigned int index = handler->offset / 4; > +bool vf = bar_reg_is_vf(real_offset, handler->offset); > +struct hvm_pt_bar *bars = (vf ? s->vf_bars : s->bars); > +int num_bars = (vf ? PCI_SRIOV_NUM_BARS : s->num_bars); > +int rc; > + > +if ( index >= num_bars ) > +{ > +*data = HVM_PT_INVALID_REG; > +return 0; > +} > + > +seg = s->pdev->seg; > +bus = s->pdev->bus; > +slot = PCI_SLOT(s->pdev->devfn); > +func = PCI_FUNC(s->pdev->devfn); > +val = pci_conf_read32(seg, bus, slot, func, real_offset); > + > +if ( index > 0 && bars[index - 1].type == HVM_PT_BAR_MEM64_LO ) > +bars[index].type = HVM_PT_BAR_MEM64_HI; > +else if ( (val & PCI_BASE_ADDRESS_SPACE) == > PCI_BASE_ADDRESS_SPACE_IO ) > +{ > +bars[index].type = HVM_PT_BAR_UNUSED; > +} > +else if ( (val & PCI_BASE_ADDRESS_MEM_TYPE_MASK) == > + PCI_BASE_ADDRESS_MEM_TYPE_64 ) > +bars[index].type = HVM_PT_BAR_MEM64_LO; > +else > +bars[index].type = HVM_PT_BAR_MEM32; > + > +if ( bars[index].type == HVM_PT_BAR_MEM32 || > + bars[index].type == HVM_PT_BAR_MEM64_LO ) > +{ > +/* Size the BAR and map it. */ > +rc = pci_size_bar(seg, bus, slot, func, real_offset - > handler->offset, > + num_bars, &index, &addr, &size); > +if ( rc ) > +{ > +printk_pdev(s->pdev, XENLOG_ERR, "unable to size BAR#%d\n", > +index); > +return rc; > +} > + > +if ( size == 0 ) > +bars[index].type = HVM_PT_BAR_UNUSED; > +else > +{ > +printk_pdev(s->pdev, XENLOG_DEBUG, > +"Mapping BAR#%u: %#lx size: %u\n", index, addr, > size); > +rc = modify_mmio_11(s->pdev->domain, PFN_DOWN(addr), > +DIV_ROUND_UP(size, PAGE_SIZE), true); > +if ( rc ) > +{ > +printk_pdev(s->pdev, XENLOG_ERR, > +"failed to map BAR#%d into memory map: %d\n", > +index, rc); > +return rc; > +} > +} > +} > + > +*data = bars[index].type == HVM_PT_BAR_UNUSED ? > HVM_PT_INVALID_REG : val; > +return 0; > +} > + > +/* Only allow writes to check the size of the BARs */ static int > +allow_bar_write(struct hvm_pt_bar *bar, struct hvm_pt_reg *reg, > + struct pci_dev *pdev, uint32_t val) { > +uint32_t mask; > + > +if ( bar->type == HVM_PT_BAR_MEM64_HI ) > +mask = ~0; > +else > +mask = (uint32_t) PCI_BASE_ADDRESS_MEM_MASK; > + > +if ( val != ~0 && (val & mask) != (reg->val.dword & mask) ) > +{ > +printk_pdev(pdev, XENLOG_ERR, > +"changing the position of the BARs is not yet supported: > %#x\n
Re: [Xen-devel] [PATCH v2 26/30] xen/x86: add PCIe emulation
> -Original Message- > From: Roger Pau Monne [mailto:roger@citrix.com] > Sent: 27 September 2016 16:57 > To: xen-de...@lists.xenproject.org > Cc: konrad.w...@oracle.com; boris.ostrov...@oracle.com; Roger Pau Monne > ; Paul Durrant ; Jan > Beulich ; Andrew Cooper > > Subject: [PATCH v2 26/30] xen/x86: add PCIe emulation > > Add a new MMIO handler that traps accesses to PCIe regions, as discovered > by > Xen from the MCFG ACPI table. The handler used is the same as the one > used > for accesses to the IO PCI configuration space. > > Signed-off-by: Roger Pau Monné > --- > Cc: Paul Durrant > Cc: Jan Beulich > Cc: Andrew Cooper > --- > xen/arch/x86/hvm/io.c | 177 > -- > 1 file changed, 171 insertions(+), 6 deletions(-) > > diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c > index 779babb..088e3ec 100644 > --- a/xen/arch/x86/hvm/io.c > +++ b/xen/arch/x86/hvm/io.c > @@ -46,6 +46,8 @@ > #include > #include > > +#include "../x86_64/mmconfig.h" > + > /* Set permissive mode for HVM Dom0 PCI pass-through by default */ > static bool_t opt_dom0permissive = 1; > boolean_param("dom0permissive", opt_dom0permissive); > @@ -363,7 +365,7 @@ static int hvm_pt_pci_config_access_check(struct > hvm_pt_device *d, > } > > static int hvm_pt_pci_read_config(struct hvm_pt_device *d, uint32_t addr, > - uint32_t *data, int len) > + uint32_t *data, int len, bool pcie) > { > uint32_t val = 0; > struct hvm_pt_reg_group *reg_grp_entry = NULL; > @@ -377,7 +379,7 @@ static int hvm_pt_pci_read_config(struct > hvm_pt_device *d, uint32_t addr, > unsigned int func = PCI_FUNC(d->pdev->devfn); > > /* Sanity checks. */ > -if ( hvm_pt_pci_config_access_check(d, addr, len) ) > +if ( !pcie && hvm_pt_pci_config_access_check(d, addr, len) ) > return X86EMUL_UNHANDLEABLE; > > /* Find register group entry. */ > @@ -468,7 +470,7 @@ static int hvm_pt_pci_read_config(struct > hvm_pt_device *d, uint32_t addr, > } > > static int hvm_pt_pci_write_config(struct hvm_pt_device *d, uint32_t addr, > -uint32_t val, int len) > +uint32_t val, int len, bool pcie) > { > int index = 0; > struct hvm_pt_reg_group *reg_grp_entry = NULL; > @@ -485,7 +487,7 @@ static int hvm_pt_pci_write_config(struct > hvm_pt_device *d, uint32_t addr, > unsigned int func = PCI_FUNC(d->pdev->devfn); > > /* Sanity checks. */ > -if ( hvm_pt_pci_config_access_check(d, addr, len) ) > +if ( !pcie && hvm_pt_pci_config_access_check(d, addr, len) ) > return X86EMUL_UNHANDLEABLE; > > /* Find register group entry. */ > @@ -677,7 +679,7 @@ static int hw_dpci_portio_read(const struct > hvm_io_handler *handler, > if ( dev != NULL ) > { > reg = (currd->arch.pci_cf8 & 0xfc) | (addr & 0x3); > -rc = hvm_pt_pci_read_config(dev, reg, &data32, size); > +rc = hvm_pt_pci_read_config(dev, reg, &data32, size, false); > if ( rc == X86EMUL_OKAY ) > { > read_unlock(&currd->arch.hvm_domain.pt_lock); > @@ -722,7 +724,7 @@ static int hw_dpci_portio_write(const struct > hvm_io_handler *handler, > if ( dev != NULL ) > { > reg = (currd->arch.pci_cf8 & 0xfc) | (addr & 0x3); > -rc = hvm_pt_pci_write_config(dev, reg, data32, size); > +rc = hvm_pt_pci_write_config(dev, reg, data32, size, false); > if ( rc == X86EMUL_OKAY ) > { > read_unlock(&currd->arch.hvm_domain.pt_lock); > @@ -1002,6 +1004,166 @@ static const struct hvm_io_ops > hw_dpci_portio_ops = { > .write = hw_dpci_portio_write > }; > > +static struct acpi_mcfg_allocation *pcie_find_mmcfg(unsigned long addr) > +{ > +int i; > + > +for ( i = 0; i < pci_mmcfg_config_num; i++ ) > +{ > +unsigned long start, end; > + > +start = pci_mmcfg_config[i].address; > +end = pci_mmcfg_config[i].address + > + ((pci_mmcfg_config[i].end_bus_number + 1) << 20); > +if ( addr >= start && addr < end ) > +return &pci_mmcfg_config[i]; > +} > + > +return NULL; > +} > + > +static struct hvm_pt_device *hw_pcie_get_device(unsigned int seg, > +unsigned int bus, > +unsigned int slot, > +unsigned int func) > +{ > +struct hvm_pt_device *dev; > +struct domain *d = current->domain; > + > +list_for_each_entry( dev, &d->arch.hvm_domain.pt_devices, entries ) > +{ > +if ( dev->pdev->seg != seg || dev->pdev->bus != bus || > + dev->pdev->devfn != PCI_DEVFN(slot, func) ) > +continue; > + > +return dev; > +} > + > +return NULL; > +} > + > +static void pcie_decode_addr(unsigned long ad
Re: [Xen-devel] [PATCH v2 28/30] xen/x86: add MSI-X emulation to PVHv2 Dom0
> -Original Message- > From: Xen-devel [mailto:xen-devel-boun...@lists.xen.org] On Behalf Of > Roger Pau Monne > Sent: 27 September 2016 16:57 > To: xen-de...@lists.xenproject.org > Cc: boris.ostrov...@oracle.com; Roger Pau Monne > Subject: [Xen-devel] [PATCH v2 28/30] xen/x86: add MSI-X emulation to > PVHv2 Dom0 > > This requires adding handlers to the PCI configuration space, plus a MMIO > handler for the MSI-X table, the PBA is left mapped directly into the guest. > The implementation is based on the one already found in the passthrough > code from QEMU. > > Signed-off-by: Roger Pau Monné > --- > Paul Durrant > Jan Beulich > Andrew Cooper > --- > xen/arch/x86/hvm/io.c | 2 + > xen/arch/x86/hvm/vmsi.c | 498 > ++ > xen/drivers/passthrough/pci.c | 6 +- > xen/include/asm-x86/hvm/io.h | 26 +++ > xen/include/asm-x86/msi.h | 4 +- > 5 files changed, 534 insertions(+), 2 deletions(-) > > diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c > index 088e3ec..11b7313 100644 > --- a/xen/arch/x86/hvm/io.c > +++ b/xen/arch/x86/hvm/io.c > @@ -867,6 +867,7 @@ static struct hvm_pt_handler_init > *hwdom_pt_handlers[] = { > &hvm_pt_bar_init, > &hvm_pt_vf_bar_init, > &hvm_pt_msi_init, > +&hvm_pt_msix_init, > }; > > int hwdom_add_device(struct pci_dev *pdev) > @@ -1176,6 +1177,7 @@ void register_dpci_portio_handler(struct domain > *d) > { > handler->ops = &hw_dpci_portio_ops; > register_mmio_handler(d, &pcie_mmio_ops); > +register_mmio_handler(d, &vmsix_mmio_ops); Again, this is a somewhat counterintuitive place to make this call. Paul > } > else > handler->ops = &dpci_portio_ops; > diff --git a/xen/arch/x86/hvm/vmsi.c b/xen/arch/x86/hvm/vmsi.c > index 75ba429..92c3b50 100644 > --- a/xen/arch/x86/hvm/vmsi.c > +++ b/xen/arch/x86/hvm/vmsi.c > @@ -40,6 +40,7 @@ > #include > #include > #include > +#include > > static void vmsi_inj_irq( > struct vlapic *target, > @@ -1162,3 +1163,500 @@ struct hvm_pt_handler_init hvm_pt_msi_init = { > .handlers = vmsi_handler, > .init = vmsi_group_init, > }; > + > +/* MSI-X */ > +#define latch(fld) latch[PCI_MSIX_ENTRY_##fld / sizeof(uint32_t)] > + > +static int vmsix_update_one(struct hvm_pt_device *s, int entry_nr, > +uint32_t vec_ctrl) > +{ > +struct hvm_pt_msix_entry *entry = NULL; > +xen_domctl_bind_pt_irq_t bind; > +bool bound = true; > +struct irq_desc *desc; > +unsigned long flags; > +int irq; > +int pirq; > +int rc; > + > +if ( entry_nr < 0 || entry_nr >= s->msix->total_entries ) > +return -EINVAL; > + > +entry = &s->msix->msix_entry[entry_nr]; > + > +if ( !entry->updated ) > +goto mask; > + > +pirq = entry->pirq; > + > +/* > + * Update the entry addr and data to the latest values only when the > + * entry is masked or they are all masked, as required by the spec. > + * Addr and data changes while the MSI-X entry is unmasked get deferred > + * until the next masked -> unmasked transition. > + */ > +if ( s->msix->maskall || > + (entry->latch(VECTOR_CTRL_OFFSET) & PCI_MSIX_VECTOR_BITMASK) > ) > +{ > +entry->addr = entry->latch(LOWER_ADDR_OFFSET) | > + ((uint64_t)entry->latch(UPPER_ADDR_OFFSET) << 32); > +entry->data = entry->latch(DATA_OFFSET); > +} > + > +if ( pirq == -1 ) > +{ > +struct msi_info msi_info; > +//struct irq_desc *desc; > +int index = -1; > + > +/* Init physical one */ > +printk_pdev(s->pdev, XENLOG_DEBUG, "setup MSI-X (entry: %d).\n", > +entry_nr); > + > +memset(&msi_info, 0, sizeof(msi_info)); > +msi_info.seg = s->pdev->seg; > +msi_info.bus = s->pdev->bus; > +msi_info.devfn = s->pdev->devfn; > +msi_info.table_base = s->msix->table_base; > +msi_info.entry_nr = entry_nr; > + > +rc = physdev_map_pirq(DOMID_SELF, MAP_PIRQ_TYPE_MSI, &index, > + &pirq, &msi_info); > +if ( rc ) > +{ > +/* > + * Do not broadcast this error, since there's nothing else > + * that can be done (MSI-X setup should have been successful). > + * Guest MSI would be actually not working. > + */ > + > +printk_pdev(s->pdev, XENLOG_ERR, > + "can not map MSI-X (entry: %d)!\n", entry_nr); > +return rc; > +} > +entry->pirq = pirq; > +bound = false; > +} > + > +ASSERT(entry->pirq != -1); > + > +if ( bound ) > +{ > +printk_pdev(s->pdev, XENLOG_DEBUG, "destroy bind MSI-X entry > %d\n", > +entry_nr); > +bind.hvm_domid = DOMID_SELF; > +bind.machine_irq = entry->pirq; > +bind.irq_type = PT_IRQ_T
[Xen-devel] [PATCH] Xen 4.8.0-rc1 preparation
* Change QEMU_UPSTREAM_REVISION MINIOS_UPSTREAM_REVISION and QEMU_TRADITIONAL_REVISION to refer to the Xen 4.8.0-rc1 tags. * Change README and xen/Makefile to refer to Xen 4.8.0-rc (note, the RC number is not included, so we do not have to update these again). I reran autogen.sh as per the release checklist and this produced no changes, as expected. (Debian jessie i386.) Signed-off-by: Ian Jackson CC: Wei Liu --- Config.mk| 6 +++--- README | 12 ++-- xen/Makefile | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Config.mk b/Config.mk index acb7f95..3c3ff68 100644 --- a/Config.mk +++ b/Config.mk @@ -276,8 +276,8 @@ SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git endif OVMF_UPSTREAM_REVISION ?= bc54e50e0fe03c570014f363b547426913e92449 -QEMU_UPSTREAM_REVISION ?= master -MINIOS_UPSTREAM_REVISION ?= e20998fbec0af4d783abb1a0695ab4614064c520 +QEMU_UPSTREAM_REVISION ?= qemu-xen-4.8.0-rc1 +MINIOS_UPSTREAM_REVISION ?= xen-4.8.0-rc1 # Wed Sep 28 11:50:04 2016 +0200 # minios: fix build issue with xen_*mb defines @@ -288,7 +288,7 @@ SEABIOS_UPSTREAM_REVISION ?= rel-1.9.3 ETHERBOOT_NICS ?= rtl8139 8086100e -QEMU_TRADITIONAL_REVISION ?= c4e0d84d3c92923fdbc7fa922638d54e5e834753 +QEMU_TRADITIONAL_REVISION ?= xen-4.8.0-rc1 # Tue Jul 26 15:31:59 2016 +0100 # virtio: error out if guest exceeds virtqueue size diff --git a/README b/README index e1ac04a..91f4a8b 100644 --- a/README +++ b/README @@ -1,10 +1,10 @@ # -__ ___ ______ _ -\ \/ /___ _ __ | || | ( _ ) _ _ _ __ ___| |_ __ _| |__ | | ___ - \ // _ \ '_ \ | || |_ / _ \ _| | | | '_ \/ __| __/ _` | '_ \| |/ _ \ - / \ __/ | | | |__ _| (_) |_| |_| | | | \__ \ || (_| | |_) | | __/ -/_/\_\___|_| |_||_|(_)___/ \__,_|_| |_|___/\__\__,_|_.__/|_|\___| - +__ ___ ____ ___ +\ \/ /___ _ __ | || | ( _ ) / _ \ _ __ ___ + \ // _ \ '_ \ | || |_ / _ \| | | |_| '__/ __| + / \ __/ | | | |__ _| (_) | |_| |_| | | (__ +/_/\_\___|_| |_||_|(_)___(_)___/ |_| \___| + # http://www.xen.org/ diff --git a/xen/Makefile b/xen/Makefile index e989a20..c511330 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -2,7 +2,7 @@ # All other places this is stored (eg. compile.h) should be autogenerated. export XEN_VERSION = 4 export XEN_SUBVERSION= 8 -export XEN_EXTRAVERSION ?= -unstable$(XEN_VENDORVERSION) +export XEN_EXTRAVERSION ?= .0-rc$(XEN_VENDORVERSION) export XEN_FULLVERSION = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION) -include xen-version -- 2.1.4 ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
Re: [Xen-devel] [PATCH v2 30/30] xen: allow setting the store pfn HVM parameter
> -Original Message- > From: Xen-devel [mailto:xen-devel-boun...@lists.xen.org] On Behalf Of > Roger Pau Monne > Sent: 27 September 2016 16:57 > To: xen-de...@lists.xenproject.org > Cc: Andrew Cooper ; > boris.ostrov...@oracle.com; Roger Pau Monne ; Jan > Beulich > Subject: [Xen-devel] [PATCH v2 30/30] xen: allow setting the store pfn HVM > parameter > > Xen already allows setting the store event channel, and this parameter is not > used by Xen at all. > > Signed-off-by: Roger Pau Monné > --- > Cc: Jan Beulich > Cc: Andrew Cooper > --- > xen/arch/x86/hvm/hvm.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index > bc4f7bc..5c3aa2a 100644 > --- a/xen/arch/x86/hvm/hvm.c > +++ b/xen/arch/x86/hvm/hvm.c > @@ -4982,6 +4982,7 @@ static int hvm_allow_set_param(struct domain *d, > case HVM_PARAM_STORE_EVTCHN: > case HVM_PARAM_CONSOLE_EVTCHN: > case HVM_PARAM_X87_FIP_WIDTH: > +case HVM_PARAM_STORE_PFN: Why does a guest need to be able set this? It needs to to be able to reset the store evtchn because of the need to be able to handle an evtchn reset, which blows way the guests local port, but what is going move the store ring such that the guest needs to play with it? Paul > break; > /* > * The following parameters must not be set by the guest > -- > 2.7.4 (Apple Git-66) > > > ___ > Xen-devel mailing list > Xen-devel@lists.xen.org > https://lists.xen.org/xen-devel ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
Re: [Xen-devel] [PATCH] Xen 4.8.0-rc1 preparation
On Mon, Oct 03, 2016 at 11:59:49AM +0100, Ian Jackson wrote: > * Change QEMU_UPSTREAM_REVISION MINIOS_UPSTREAM_REVISION and > QEMU_TRADITIONAL_REVISION to refer to the Xen 4.8.0-rc1 tags. > > * Change README and xen/Makefile to refer to Xen 4.8.0-rc (note, the > RC number is not included, so we do not have to update these again). > > I reran autogen.sh as per the release checklist and this produced no > changes, as expected. (Debian jessie i386.) > > Signed-off-by: Ian Jackson > CC: Wei Liu Acked-by: Wei Liu ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
[Xen-devel] [ANNOUNCEMENT] Xen 4.8 RC1
Hi all Xen 4.8 RC1 is tagged. You can check that out from xen.git: git://xenbits.xen.org/xen.git 4.8.0-rc1 For you convenience there is also tarball at: http://bits.xensource.com/oss-xen/release/4.8.0-rc1/xen-4.8.0-rc1.tar.gz And the signature is at: http://bits.xensource.com/oss-xen/release/4.8.0-rc1/xen-4.8.0-rc1.tar.gz.sig Please send bug reports and test reports to xen-de...@lists.xenproject.org. When sending bug reports, please CC relevant maintainers and me (wei.l...@citrix.com). Thanks Wei. ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
[Xen-devel] [xen-unstable-smoke test] 101245: tolerable all pass - PUSHED
flight 101245 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/101245/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-amd64-amd64-libvirt 12 migrate-support-checkfail never pass test-armhf-armhf-xl 12 migrate-support-checkfail never pass test-armhf-armhf-xl 13 saverestore-support-checkfail never pass version targeted for testing: xen 40277cded320efa32b86c0c9f01e33145eab5ee4 baseline version: xen b3d54cead6459567d9786ad415149868ee7f2f5b Last test of basis 101229 2016-09-30 21:02:32 Z2 days Testing same since 101245 2016-10-03 12:01:53 Z0 days1 attempts People who touched revisions under test: Ian Jackson Wei Liu jobs: build-amd64 pass build-armhf pass build-amd64-libvirt pass test-armhf-armhf-xl pass test-amd64-amd64-xl-qemuu-debianhvm-i386 pass test-amd64-amd64-libvirt pass sg-report-flight on osstest.test-lab.xenproject.org logs: /home/logs/logs images: /home/logs/images Logs, config files, etc. are available at http://logs.test-lab.xenproject.org/osstest/logs Explanation of these reports, and of osstest in general, is at http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master Test harness code can be found at http://xenbits.xen.org/gitweb?p=osstest.git;a=summary Pushing revision : + branch=xen-unstable-smoke + revision=40277cded320efa32b86c0c9f01e33145eab5ee4 + . ./cri-lock-repos ++ . ./cri-common +++ . ./cri-getconfig +++ umask 002 +++ getrepos getconfig Repos perl -e ' use Osstest; readglobalconfig(); print $c{"Repos"} or die $!; ' +++ local repos=/home/osstest/repos +++ '[' -z /home/osstest/repos ']' +++ '[' '!' -d /home/osstest/repos ']' +++ echo /home/osstest/repos ++ repos=/home/osstest/repos ++ repos_lock=/home/osstest/repos/lock ++ '[' x '!=' x/home/osstest/repos/lock ']' ++ OSSTEST_REPOS_LOCK_LOCKED=/home/osstest/repos/lock ++ exec with-lock-ex -w /home/osstest/repos/lock ./ap-push xen-unstable-smoke 40277cded320efa32b86c0c9f01e33145eab5ee4 + branch=xen-unstable-smoke + revision=40277cded320efa32b86c0c9f01e33145eab5ee4 + . ./cri-lock-repos ++ . ./cri-common +++ . ./cri-getconfig +++ umask 002 +++ getrepos getconfig Repos perl -e ' use Osstest; readglobalconfig(); print $c{"Repos"} or die $!; ' +++ local repos=/home/osstest/repos +++ '[' -z /home/osstest/repos ']' +++ '[' '!' -d /home/osstest/repos ']' +++ echo /home/osstest/repos ++ repos=/home/osstest/repos ++ repos_lock=/home/osstest/repos/lock ++ '[' x/home/osstest/repos/lock '!=' x/home/osstest/repos/lock ']' + . ./cri-common ++ . ./cri-getconfig ++ umask 002 + select_xenbranch + case "$branch" in + tree=xen + xenbranch=xen-unstable-smoke + qemuubranch=qemu-upstream-unstable + '[' xxen = xlinux ']' + linuxbranch= + '[' xqemu-upstream-unstable = x ']' + select_prevxenbranch ++ ./cri-getprevxenbranch xen-unstable-smoke + prevxenbranch=xen-4.7-testing + '[' x40277cded320efa32b86c0c9f01e33145eab5ee4 = x ']' + : tested/2.6.39.x + . ./ap-common ++ : osst...@xenbits.xen.org +++ getconfig OsstestUpstream +++ perl -e ' use Osstest; readglobalconfig(); print $c{"OsstestUpstream"} or die $!; ' ++ : ++ : git://xenbits.xen.org/xen.git ++ : osst...@xenbits.xen.org:/home/xen/git/xen.git ++ : git://xenbits.xen.org/qemu-xen-traditional.git ++ : git://git.kernel.org ++ : git://git.kernel.org/pub/scm/linux/kernel/git ++ : git ++ : git://xenbits.xen.org/xtf.git ++ : osst...@xenbits.xen.org:/home/xen/git/xtf.git ++ : git://xenbits.xen.org/xtf.git ++ : git://xenbits.xen.org/libvirt.git ++ : osst...@xenbits.xen.org:/home/xen/git/libvirt.git ++ : git://xenbits.xen.org/libvirt.git ++ : git://xenbits.xen.org/osstest/rumprun.git ++ : git ++ : git://xenbits.xen.org/osstest/rumprun.git ++ : osst...@xenbits.xen.org:/home/xen/git/osstest/rumprun.git ++ : git://git.seabios.org/seabios.git ++ : osst...@xenbits.xen.org:/home/xen/git/osstest/seabios.git ++ : git://xenbits.xen.org/osstest/seabios.git ++ : https://github.com/tianocore/edk2.git ++ : osst...@xenbits.xen.org:/home/xen/git/osstest/ovmf.git ++ : git://xenbits.xen.org/osstest/ovmf.git ++ : git://xenbits.xen.org/osstest/linux-firmware.git ++ : osst...@xenbits.xen.org:/home/osstest/ext/linux-firmware.git ++ : git://git.kernel.org/pub/scm/linux/kernel/gi
[Xen-devel] [PATCH RFC] xen: make it possible to disable XEN_TMEM
XEN_TMEM config option has no prompt and it is enabled as module by default if CLEANCACHE or FRONTSWAP options are set with no way to disable it. The only in-tree user of the tmem interface is xen-selfballoon which can itself be disabled so it makes sense to make it possible to disable XEN_TMEM too. In theory, both these options could be unified under the XEN_SELFBALLOONING but other (out-of-tree) users of the tmem interface may exist and someone may want to keep them supported without enabling XEN_SELFBALLOONING. Signed-off-by: Vitaly Kuznetsov --- - I don't know much about tmem and its users thus RFC. --- drivers/xen/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig index f15bb3b7..0ea1df8 100644 --- a/drivers/xen/Kconfig +++ b/drivers/xen/Kconfig @@ -166,7 +166,7 @@ config SWIOTLB_XEN select SWIOTLB config XEN_TMEM - tristate + tristate "Transcendent Memory support for Xen" depends on !ARM && !ARM64 default m if (CLEANCACHE || FRONTSWAP) help -- 2.7.4 ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
[Xen-devel] Livepatch for Xen 4.9
Hey! [CC-ing xen-devel] Xen 4.8-rc1 is out and means taking a break from some of the Livepatch hypervisor parts for me. My plan for 4.8 is to concentrate on any livepatch fallout and doing OSSTest along with Marcos (CC-ed) and see if we can wrestle it to expand on what we want to have done. However going forward (Xen 4.9) I believe the top issues we need to get addressed are: a) "A better mechanism to "mask" NMIs during patching. The existing mechanism looses NMI if they have been sent and we don't have a mechanism to replay them. Note that this is also fixes alternative section patching. Could (like Linux) annotate handlers don't get patched." (https://wiki.xenproject.org/wiki/LivePatch). b) Restart the shrinking of code using__LINE__ c) When figuring out the new_addr, take into account name being +. d) Make asm code be in its own section. That eases the livepatch tools work in figuring out a change. See https://lkml.org/lkml/2009/2/24/364 e) ? g) Make XENPF_get_symbol also include Live Patch symbols. I was wondering if folks could put in their preference and what they are thinking to work on during 4.9? During 4.8 I took a stab at a) and c). The 'a)' is a thorny one as: 1) If we get an NMI during patching we better not be patching MCE/NMI code! This could be avoided by annotating all the MCE/NMI code and have a 'blacklist' of functions that MUST NEVER BE PATCHED. But that may be difficult as that code can reach in many parts (especially MCE which wants to send an event channel, hence touches normal event channel code). 2) We could also do some form of restartable patching. That is seed the code (where we are going to put a trampoline) with 'CC'. Then do memcpy over the the 'CC' the new instructions (jump). If the NMI/MCE handler hits that code it would call the int3 - which we expand now to take over and check whether the EIP is in the location which we just seeded with 'CC' - and if so it can memcpy the trampoline code in (with a slight twist - we first memcpy the displacement, so the start of a function would be say: CC 00 23 00 10 - and then we do a single write to replace 'CC' with 'E9'). We could also (to combat bitrotting) change this a bit more - the debugger handler is in charge of actually memcpying and the arch_livepatch_apply just calls 'int 3' (after it has seeded the area with 'CC'). Either of this would would require some global livepatch->debugger handler handover structure with the EIP to patch over and the insns. The 'c)' needs a bit more work. Also I was thinking we can drop the IRC meeting we have setup. It has been quite useful during the starting stage to re-sync patches but at this point I think emails are more suited? ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
Re: [Xen-devel] [PATCH RFC] xen: make it possible to disable XEN_TMEM
On Mon, Oct 03, 2016 at 04:02:48PM +0200, Vitaly Kuznetsov wrote: > XEN_TMEM config option has no prompt and it is enabled as module by > default if CLEANCACHE or FRONTSWAP options are set with no way to disable > it. The only in-tree user of the tmem interface is xen-selfballoon which And if CONFIG_XEN=y . > can itself be disabled so it makes sense to make it possible to disable During boot-time with arguments. > XEN_TMEM too. In theory, both these options could be unified under the > XEN_SELFBALLOONING but other (out-of-tree) users of the tmem interface > may exist and someone may want to keep them supported without enabling > XEN_SELFBALLOONING. I think going the route of XEN_SELFBALLOONING may be better. > > Signed-off-by: Vitaly Kuznetsov > --- > - I don't know much about tmem and its users thus RFC. > --- > drivers/xen/Kconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig > index f15bb3b7..0ea1df8 100644 > --- a/drivers/xen/Kconfig > +++ b/drivers/xen/Kconfig > @@ -166,7 +166,7 @@ config SWIOTLB_XEN > select SWIOTLB > > config XEN_TMEM > - tristate > + tristate "Transcendent Memory support for Xen" > depends on !ARM && !ARM64 > default m if (CLEANCACHE || FRONTSWAP) > help > -- > 2.7.4 > > > ___ > Xen-devel mailing list > Xen-devel@lists.xen.org > https://lists.xen.org/xen-devel ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
Re: [Xen-devel] Livepatch for Xen 4.9
>>> Konrad Rzeszutek Wilk 10/03/16 4:18 PM >>> >2) We could also do some form of restartable patching. That is seed the code >(where we are going to >put a trampoline) with 'CC'. Then do memcpy over the the 'CC' the new >instructions (jump). If the >NMI/MCE handler hits that code it would call the int3 - which we expand now to >take over and check >whether the EIP is in the location which we just seeded with 'CC' - and if so >it can memcpy the >trampoline code in (with a slight twist - we first memcpy the displacement, so >the start of a function >would be say: CC 00 23 00 10 - and then we do a single write to replace 'CC' >with 'E9'). Careful here: How do you mean to return from the int3 handler? You mustn't use IRET there, or else you unmask further NMIs. Jan ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
[Xen-devel] [PATCH] libxl: fix issues in 38cd0664
A few issues were introduced in 38cd0664 ("libxl/arm: Add the size of ACPI tables to maxmem"): 1. d_config was not properly initialised and disposed of. 2. using libxl_retrieve_domain_configuration caused thread to deadlock itself. Fix those issues by: 1. properly initialise and dispose of d_config. 2. switch to use libxl__get_domain_configuration. Note that in theory we can refactor libxl_retrieve_domain_configuration a bit to get a function without locking, but up until the calculation of extra memory only relies on static configuration, hence we use the stored configuration only. Reported-by: Anthony PERARD Signed-off-by: Wei Liu Tested-by: Anthony PERARD --- Cc: Ian Jackson CC: Shannon Zhao Cc: Anthony PERARD --- tools/libxl/libxl.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 432e5d9..33c5e4c 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -4029,6 +4029,8 @@ int libxl_domain_setmaxmem(libxl_ctx *ctx, uint32_t domid, uint64_t max_memkb) libxl__domain_userdata_lock *lock = NULL; libxl_domain_config d_config; +libxl_domain_config_init(&d_config); + CTX_LOCK; lock = libxl__lock_domain_userdata(gc, domid); @@ -4054,7 +4056,7 @@ int libxl_domain_setmaxmem(libxl_ctx *ctx, uint32_t domid, uint64_t max_memkb) goto out; } -rc = libxl_retrieve_domain_configuration(ctx, domid, &d_config); +rc = libxl__get_domain_configuration(gc, domid, &d_config); if (rc < 0) { LOGE(ERROR, "unable to retrieve domain configuration"); goto out; @@ -4076,6 +4078,7 @@ int libxl_domain_setmaxmem(libxl_ctx *ctx, uint32_t domid, uint64_t max_memkb) rc = 0; out: +libxl_domain_config_dispose(&d_config); if (lock) libxl__unlock_domain_userdata(lock); CTX_UNLOCK; GC_FREE; @@ -4177,6 +4180,8 @@ int libxl_set_memory_target(libxl_ctx *ctx, uint32_t domid, libxl__domain_userdata_lock *lock; libxl_domain_config d_config; +libxl_domain_config_init(&d_config); + CTX_LOCK; lock = libxl__lock_domain_userdata(gc, domid); @@ -4185,7 +4190,7 @@ int libxl_set_memory_target(libxl_ctx *ctx, uint32_t domid, goto out_no_transaction; } -rc = libxl_retrieve_domain_configuration(ctx, domid, &d_config); +rc = libxl__get_domain_configuration(gc, domid, &d_config); if (rc < 0) { LOGE(ERROR, "unable to retrieve domain configuration"); goto out_no_transaction; @@ -4318,6 +4323,7 @@ out: goto retry_transaction; out_no_transaction: +libxl_domain_config_dispose(&d_config); if (lock) libxl__unlock_domain_userdata(lock); CTX_UNLOCK; GC_FREE; -- 2.1.4 ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
Re: [Xen-devel] [PATCH RFC] xen: make it possible to disable XEN_TMEM
Konrad Rzeszutek Wilk writes: > On Mon, Oct 03, 2016 at 04:02:48PM +0200, Vitaly Kuznetsov wrote: >> XEN_TMEM config option has no prompt and it is enabled as module by >> default if CLEANCACHE or FRONTSWAP options are set with no way to disable >> it. The only in-tree user of the tmem interface is xen-selfballoon which > > And if CONFIG_XEN=y . > Yes, of course) >> can itself be disabled so it makes sense to make it possible to disable > > During boot-time with arguments. I see, I rather meant we need a way to disable building the module, not just loading it. >> XEN_TMEM too. In theory, both these options could be unified under the >> XEN_SELFBALLOONING but other (out-of-tree) users of the tmem interface >> may exist and someone may want to keep them supported without enabling >> XEN_SELFBALLOONING. > > I think going the route of XEN_SELFBALLOONING may be better. Ok, if you say so) >> >> Signed-off-by: Vitaly Kuznetsov >> --- >> - I don't know much about tmem and its users thus RFC. >> --- >> drivers/xen/Kconfig | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig >> index f15bb3b7..0ea1df8 100644 >> --- a/drivers/xen/Kconfig >> +++ b/drivers/xen/Kconfig >> @@ -166,7 +166,7 @@ config SWIOTLB_XEN >> select SWIOTLB >> >> config XEN_TMEM >> -tristate >> +tristate "Transcendent Memory support for Xen" >> depends on !ARM && !ARM64 >> default m if (CLEANCACHE || FRONTSWAP) >> help >> -- >> 2.7.4 >> >> >> ___ >> Xen-devel mailing list >> Xen-devel@lists.xen.org >> https://lists.xen.org/xen-devel -- Vitaly ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
Re: [Xen-devel] Livepatch for Xen 4.9
On 03/10/16 15:16, Konrad Rzeszutek Wilk wrote: > Hey! > > [CC-ing xen-devel] > > Xen 4.8-rc1 is out and means taking a break from some of the Livepatch > hypervisor > parts for me. > > My plan for 4.8 is to concentrate on any livepatch fallout and doing OSSTest > along > with Marcos (CC-ed) and see if we can wrestle it to expand on what > we want to have done. > > However going forward (Xen 4.9) I believe the top issues we need > to get addressed are: > > a) "A better mechanism to "mask" NMIs during patching. The existing > mechanism looses >NMI if they have been sent and we don't have a mechanism to replay them. > Note that >this is also fixes alternative section patching. Could (like Linux) > annotate handlers don't get patched." >(https://wiki.xenproject.org/wiki/LivePatch). You cant mask NMIs, and as we have alternatives at the head of the entrypoints, we need to work towards making patching safe on these paths. The traditional way is with 0xcc and magic in the debug trap handler to take over the responsibility of patching. > b) Restart the shrinking of code using__LINE__ +1 (shame these patches missed 4.8) > c) When figuring out the new_addr, take into account name being > +. > d) Make asm code be in its own section. That eases the livepatch tools work > in figuring out a change. > See https://lkml.org/lkml/2009/2/24/364 d.1) Reducing the quantity of ASM code outright. As a start, {,compat_}create_bounce_frame() should definitely be written in C, and would half the quantity of runtime ASM we have. (Worse, we already have C versions of create_bounce_frame() with ever-so-slighty-different semantics). I also have my eye on the general exception handling path, which I think can safely move up into C. ~Andrew ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
Re: [Xen-devel] [PATCH v2 12/30] xen/x86: make print_e820_memory_map global
On Fri, Sep 30, 2016 at 09:04:24AM -0600, Jan Beulich wrote: > >>> On 27.09.16 at 17:57, wrote: > > So that it can be called from the Dom0 builder. > > Why would the Dom0 builder need to call it, when it doesn't so far? IMHO, I find it useful to print the domain 0 memory map during creation. It wasn't useful for a PV Dom0, because the PV Dom0 memory map is just the native memory map, which is already printed earlier during the boot process. If it doesn't seem useful to you or others I can leave it out. Roger. ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
Re: [Xen-devel] [PATCH v3 4/4] Addressed comments on quorum and security team members
Lars Kurth writes ("[PATCH v3 4/4] Addressed comments on quorum and security team members"): > Main changes > Leadership team decisions: express quorum in terms of +1 votes > Security Team Members: election > Project Wide Decision Making: minor text changes The resulting series is a little odd because your v3 4/4 patch only changes things that are introduced in v3 3/4 and agreed to be probably wrong there. I would have been more usual to fold these changes in, at least if the series related to code. > --- a/governance.pandoc > +++ b/governance.pandoc > @@ -410,18 +410,26 @@ resolution. There is no differentiation between **+1**/ > **+2** and > **-1**/**-2**: in other words a **+2** is counted as a vote for, a **-2** as > a > vote against the resolution. The number of votes for and against a > resolution > is called **active vote**. **0** votes **are not counted** as an active vote. > -- A **quorum of more than 50% of active votes** is required for a > resolution > -to pass. In other words, if the leadership team has 7 members, at least 4 > -active votes are required for a resolution to pass. > +- A **quorum of at least 1/3 of +1 votes for a proposal** is required for > a > +resolution to pass. In other words, if the leadership team has 7 members, at > +least 3 members need to vote for the resolution. This paragraph should say `positive' rather than `+1', since as written it appears to exclude +2. (Same in the table.) > Project Lead Elections > > @@ -553,10 +568,10 @@ as outlined below. > - Project leadership team members vote for or against a proposal (there is > no > differentiation between **-1**/**-2** and **+1**/**+2**). A **0** vote is > not > counted as a valid vote. > -- A **quorum of more than 50%** of each project's leadership team members > is > -required. In other words: if more than half of a project's leadership team > +- A **quorum of at least 50%** of each project's leadership team members > is > +required. In other words: if fewer than half of a project's leadership team > members do not vote or abstain, the entire sub-project's vote is not > counted. > -This avoids situations where only a minority of leadership team members > votes, > +This avoids situations where only a minority of leadership team members > vote, This still has the non-monotonicity problem. I would suggest to deal with this issue by, when calculating the percentage, dividing all the votes by the larger of (a) the number of people voting (including `0' votes); (b) one third of the size of the project leadership team. So if only two out of a 10-person leadership team vote, and they both votes in favour, that subproject's overall vote is 2 / max(10/3, 2) which = 2 / max(10/3, 6/3) = 2 / (max(10,6) / 3) = 2 / (10/3) = 2 * (3/10) = 6 / 10 = 0.6 = 60% I would add a further backstop that a successful resolution must have positive votes from at least three (or maybe, two) separate people. Ian. ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
[Xen-devel] [xen-unstable baseline-only test] 67784: regressions - FAIL
This run is configured for baseline tests only. flight 67784 xen-unstable real [real] http://osstest.xs.citrite.net/~osstest/testlogs/logs/67784/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-xl-qemuu-ovmf-amd64 6 xen-boot fail REGR. vs. 67780 test-armhf-armhf-xl-credit2 15 guest-start/debian.repeat fail REGR. vs. 67780 test-amd64-amd64-i386-pvgrub 10 guest-start fail REGR. vs. 67780 Regressions which are regarded as allowable (not blocking): test-amd64-amd64-qemuu-nested-intel 16 debian-hvm-install/l1/l2 fail like 67780 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 9 debian-hvm-install fail like 67780 test-amd64-amd64-xl-qemut-debianhvm-amd64 9 debian-hvm-install fail like 67780 test-amd64-i386-xl-qemut-debianhvm-amd64 9 debian-hvm-install fail like 67780 test-amd64-amd64-xl-qemut-winxpsp3 9 windows-install fail like 67780 test-amd64-amd64-xl-qemut-debianhvm-amd64-xsm 9 debian-hvm-install fail like 67780 test-amd64-i386-xl-qemuu-win7-amd64 16 guest-stop fail like 67780 test-amd64-i386-qemut-rhel6hvm-intel 9 redhat-install fail like 67780 test-amd64-i386-xl-qemut-winxpsp3 9 windows-install fail like 67780 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm 9 debian-hvm-install fail like 67780 test-amd64-i386-xl-qemut-debianhvm-amd64-xsm 9 debian-hvm-install fail like 67780 test-amd64-i386-xl-qemut-winxpsp3-vcpus1 9 windows-installfail like 67780 Tests which did not succeed, but are not blocking: test-amd64-amd64-rumprun-amd64 1 build-check(1) blocked n/a test-amd64-i386-rumprun-i386 1 build-check(1) blocked n/a build-amd64-rumprun 5 rumprun-buildfail never pass build-i386-rumprun5 rumprun-buildfail never pass test-amd64-i386-libvirt-xsm 12 migrate-support-checkfail never pass test-amd64-i386-libvirt 12 migrate-support-checkfail never pass test-armhf-armhf-xl 12 migrate-support-checkfail never pass test-armhf-armhf-xl 13 saverestore-support-checkfail never pass test-amd64-amd64-qemuu-nested-amd 16 debian-hvm-install/l1/l2 fail never pass test-armhf-armhf-libvirt 12 migrate-support-checkfail never pass test-armhf-armhf-libvirt 14 guest-saverestorefail never pass test-armhf-armhf-libvirt-xsm 12 migrate-support-checkfail never pass test-armhf-armhf-libvirt-xsm 14 guest-saverestorefail never pass test-armhf-armhf-xl-credit2 12 migrate-support-checkfail never pass test-armhf-armhf-xl-credit2 13 saverestore-support-checkfail never pass test-armhf-armhf-libvirt-qcow2 11 migrate-support-checkfail never pass test-armhf-armhf-libvirt-qcow2 13 guest-saverestorefail never pass test-amd64-amd64-libvirt-vhd 11 migrate-support-checkfail never pass test-armhf-armhf-libvirt-raw 11 migrate-support-checkfail never pass test-armhf-armhf-libvirt-raw 13 guest-saverestorefail never pass test-armhf-armhf-xl-midway 12 migrate-support-checkfail never pass test-armhf-armhf-xl-midway 13 saverestore-support-checkfail never pass test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 10 migrate-support-check fail never pass test-amd64-amd64-xl-pvh-amd 11 guest-start fail never pass test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 10 migrate-support-check fail never pass test-armhf-armhf-xl-multivcpu 12 migrate-support-checkfail never pass test-armhf-armhf-xl-multivcpu 13 saverestore-support-checkfail never pass test-amd64-amd64-xl-pvh-intel 11 guest-start fail never pass test-armhf-armhf-xl-rtds 12 migrate-support-checkfail never pass test-armhf-armhf-xl-rtds 13 saverestore-support-checkfail never pass test-amd64-amd64-libvirt-xsm 12 migrate-support-checkfail never pass test-armhf-armhf-xl-vhd 11 migrate-support-checkfail never pass test-armhf-armhf-xl-vhd 12 saverestore-support-checkfail never pass test-armhf-armhf-xl-xsm 12 migrate-support-checkfail never pass test-armhf-armhf-xl-xsm 13 saverestore-support-checkfail never pass test-amd64-amd64-xl-qemuu-win7-amd64 16 guest-stop fail never pass test-amd64-amd64-xl-qemut-win7-amd64 16 guest-stop fail never pass test-amd64-amd64-libvirt 12 migrate-support-checkfail never pass test-amd64-i386-xl-qemut-win7-amd64 16 guest-stop fail never pass version targeted for testing: xen eabe1c39d1cd4fcef18ec50571db3c70c055c1fb baseline version: xen 1e75ed8b64bc1a9b47e540e6f100f17ec6d97f1b Last test of basis67780 2016-09-28 18:47:02 Z4 days Testing same since67
[Xen-devel] [xen-unstable test] 101246: trouble: blocked/broken/fail/pass
flight 101246 xen-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/101246/ Failures and problems with tests :-( Tests which did not succeed and are blocking, including tests which could not be run: test-armhf-armhf-xl-arndale 3 host-install(3)broken REGR. vs. 101244 Regressions which are regarded as allowable (not blocking): test-armhf-armhf-xl-rtds 15 guest-start/debian.repeatfail like 101244 test-amd64-i386-xl-qemut-win7-amd64 16 guest-stop fail like 101244 test-amd64-i386-xl-qemuu-win7-amd64 16 guest-stop fail like 101244 test-amd64-amd64-xl-qemut-win7-amd64 16 guest-stopfail like 101244 test-amd64-amd64-xl-qemuu-win7-amd64 16 guest-stopfail like 101244 test-amd64-amd64-xl-rtds 9 debian-install fail like 101244 Tests which did not succeed, but are not blocking: test-amd64-amd64-rumprun-amd64 1 build-check(1) blocked n/a test-amd64-i386-rumprun-i386 1 build-check(1) blocked n/a build-amd64-rumprun 5 rumprun-buildfail never pass test-armhf-armhf-libvirt-xsm 12 migrate-support-checkfail never pass test-armhf-armhf-libvirt-xsm 14 guest-saverestorefail never pass build-i386-rumprun5 rumprun-buildfail never pass test-armhf-armhf-libvirt 12 migrate-support-checkfail never pass test-armhf-armhf-libvirt 14 guest-saverestorefail never pass test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 10 migrate-support-check fail never pass test-armhf-armhf-libvirt-qcow2 11 migrate-support-checkfail never pass test-armhf-armhf-libvirt-qcow2 13 guest-saverestorefail never pass test-armhf-armhf-xl 12 migrate-support-checkfail never pass test-armhf-armhf-xl 13 saverestore-support-checkfail never pass test-armhf-armhf-xl-credit2 12 migrate-support-checkfail never pass test-armhf-armhf-xl-credit2 13 saverestore-support-checkfail never pass test-armhf-armhf-xl-vhd 11 migrate-support-checkfail never pass test-armhf-armhf-xl-vhd 12 saverestore-support-checkfail never pass test-armhf-armhf-libvirt-raw 11 migrate-support-checkfail never pass test-armhf-armhf-libvirt-raw 13 guest-saverestorefail never pass test-armhf-armhf-xl-rtds 12 migrate-support-checkfail never pass test-armhf-armhf-xl-rtds 13 saverestore-support-checkfail never pass test-armhf-armhf-xl-multivcpu 12 migrate-support-checkfail never pass test-armhf-armhf-xl-multivcpu 13 saverestore-support-checkfail never pass test-armhf-armhf-xl-cubietruck 12 migrate-support-checkfail never pass test-armhf-armhf-xl-cubietruck 13 saverestore-support-checkfail never pass test-armhf-armhf-xl-xsm 12 migrate-support-checkfail never pass test-armhf-armhf-xl-xsm 13 saverestore-support-checkfail never pass test-amd64-amd64-libvirt-vhd 11 migrate-support-checkfail never pass test-amd64-amd64-libvirt-xsm 12 migrate-support-checkfail never pass test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 10 migrate-support-check fail never pass test-amd64-amd64-libvirt 12 migrate-support-checkfail never pass test-amd64-amd64-xl-pvh-amd 11 guest-start fail never pass test-amd64-i386-libvirt-xsm 12 migrate-support-checkfail never pass test-amd64-i386-libvirt 12 migrate-support-checkfail never pass test-amd64-amd64-qemuu-nested-amd 16 debian-hvm-install/l1/l2 fail never pass test-amd64-amd64-xl-pvh-intel 11 guest-start fail never pass version targeted for testing: xen 40277cded320efa32b86c0c9f01e33145eab5ee4 baseline version: xen b3d54cead6459567d9786ad415149868ee7f2f5b Last test of basis 101244 2016-10-03 01:56:58 Z0 days Testing same since 101246 2016-10-03 14:14:12 Z0 days1 attempts People who touched revisions under test: Ian Jackson Wei Liu jobs: build-amd64-xsm pass build-armhf-xsm pass build-i386-xsm pass build-amd64-xtf pass build-amd64 pass build-armhf pass build-i386 pass build-amd64-libvirt pass build-armhf-libvirt pass build-i386-libvirt pass build-amd64-oldkern
[Xen-devel] [PATCH RFC] x86/Intel: virtualize support for cpuid faulting
rr (http://rr-project.org/), a Linux userspace record-and-replay reverse- execution debugger, would like to trap and emulate the CPUID instruction. This would allow us to a) mask away certain hardware features that rr does not support (e.g. RDRAND) and b) enable trace portability across machines by providing constant results. Patches for support in the Linux kernel are in flight, and we'd like to be able to use this feature on virtualized Linux instances as well. On HVM guests, the cpuid triggers a vm exit, so we can check the emulated faulting state in vmx_do_cpuid and inject a GP(0) if CPL > 0. Notably no hardware support for faulting on cpuid is necessary to emulate support with an HVM guest. On PV guests, hardware support is required so that userspace cpuid will trap to xen. Xen already enables cpuid faulting on supported CPUs for pv guests (that aren't the control domain, see the comment in intel_ctxt_switch_levelling). Every userspace cpuid will trap via a GP(0) to emulate_privileged_op (via do_general_protection). Once there we can simply decline to emulate the cpuid and instead pass the GP(0) along to the guest kernel, thus emulating the cpuid faulting behavior. PV guest kernels enter pv_cpuid via a different path, so we do not need to check the CPL here. Signed-off-by: Kyle Huey --- xen/arch/x86/domain.c| 2 ++ xen/arch/x86/hvm/vmx/vmx.c | 24 +++- xen/arch/x86/traps.c | 31 ++- xen/include/asm-x86/domain.h | 3 +++ 4 files changed, 54 insertions(+), 6 deletions(-) diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 3c4b094..f2bac10 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -1095,6 +1095,8 @@ int arch_set_info_guest( for ( i = 0; i < 8; i++ ) (void)set_debugreg(v, i, c(debugreg[i])); +v->arch.cpuid_fault = 0; + if ( v->is_initialised ) goto out; diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index 50cbfed..f1e04c1 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -2430,11 +2430,16 @@ static void vmx_cpuid_intercept( HVMTRACE_5D (CPUID, input, *eax, *ebx, *ecx, *edx); } -static int vmx_do_cpuid(struct cpu_user_regs *regs) +static int vmx_do_cpuid(struct vcpu *v, struct cpu_user_regs *regs) { unsigned int eax, ebx, ecx, edx; unsigned int leaf, subleaf; +if ( v->arch.cpuid_fault && !ring_0(regs) ) { +hvm_inject_hw_exception(TRAP_gp_fault, 0); +return 0; +} + eax = regs->eax; ebx = regs->ebx; ecx = regs->ecx; @@ -2701,9 +2706,13 @@ static int vmx_msr_read_intercept(unsigned int msr, uint64_t *msr_content) break; case MSR_INTEL_PLATFORM_INFO: -if ( rdmsr_safe(MSR_INTEL_PLATFORM_INFO, *msr_content) ) -goto gp_fault; -*msr_content = 0; +if ( is_pvh_vcpu(current) && !cpu_has_cpuid_faulting ) +*msr_content = 0; +else +*msr_content = 0x8000ULL; +break; +case MSR_INTEL_MISC_FEATURES_ENABLES: +*msr_content = current->arch.cpuid_fault ? 1ULL : 0; break; default: @@ -2931,6 +2940,11 @@ static int vmx_msr_write_intercept(unsigned int msr, uint64_t msr_content) rdmsr_safe(MSR_INTEL_PLATFORM_INFO, msr_content) ) goto gp_fault; break; +case MSR_INTEL_MISC_FEATURES_ENABLES: +if ( msr_content > 1 ) +goto gp_fault; +v->arch.cpuid_fault = msr_content; +break; default: if ( passive_domain_do_wrmsr(msr, msr_content) ) @@ -3605,7 +3619,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs) rc = 0; } else -rc = vmx_do_cpuid(regs); +rc = vmx_do_cpuid(v, regs); /* * rc < 0 error in monitor/vm_event, crash diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 24d173f..d5a348e 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -2945,6 +2945,16 @@ static int emulate_privileged_op(struct cpu_user_regs *regs) rdmsr_safe(MSR_INTEL_PLATFORM_INFO, msr_content) ) goto fail; break; +case MSR_INTEL_MISC_FEATURES_ENABLES: +if ( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL || + rdmsr_safe(MSR_INTEL_MISC_FEATURES_ENABLES, val) || + msr_content > 1 ) +goto fail; +if ( msr_content == 1 && + (!cpu_has_cpuid_faulting || is_control_domain(v->domain)) ) +goto fail; +v->arch.cpuid_fault = msr_content; +break; case MSR_P6_PERFCTR(0)...MSR_P6_PERFCTR(7): case MSR_P6_EVNTSEL(0)...MSR_P6_EVNTSEL(3): @@ -3079,7 +3089,22 @@ static int emulate_privileged_op(struct cpu_user_regs *regs) if ( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL || rdmsr_safe(MSR_INTEL_
[Xen-devel] [ovmf test] 101248: all pass - PUSHED
flight 101248 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/101248/ Perfect :-) All tests in this flight passed as required version targeted for testing: ovmf 8550b5f0810f306850f9a07ee551099155d89ae0 baseline version: ovmf ed72804638c9b240477c5235d72c3823483813b2 Last test of basis 101220 2016-09-30 06:45:26 Z3 days Testing same since 101248 2016-10-03 21:45:40 Z0 days1 attempts People who touched revisions under test: Cinnamon Shia jobs: build-amd64-xsm pass build-i386-xsm pass build-amd64 pass build-i386 pass build-amd64-libvirt pass build-i386-libvirt pass build-amd64-pvopspass build-i386-pvops pass test-amd64-amd64-xl-qemuu-ovmf-amd64 pass test-amd64-i386-xl-qemuu-ovmf-amd64 pass sg-report-flight on osstest.test-lab.xenproject.org logs: /home/logs/logs images: /home/logs/images Logs, config files, etc. are available at http://logs.test-lab.xenproject.org/osstest/logs Explanation of these reports, and of osstest in general, is at http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master Test harness code can be found at http://xenbits.xen.org/gitweb?p=osstest.git;a=summary Pushing revision : + branch=ovmf + revision=8550b5f0810f306850f9a07ee551099155d89ae0 + . ./cri-lock-repos ++ . ./cri-common +++ . ./cri-getconfig +++ umask 002 +++ getrepos getconfig Repos perl -e ' use Osstest; readglobalconfig(); print $c{"Repos"} or die $!; ' +++ local repos=/home/osstest/repos +++ '[' -z /home/osstest/repos ']' +++ '[' '!' -d /home/osstest/repos ']' +++ echo /home/osstest/repos ++ repos=/home/osstest/repos ++ repos_lock=/home/osstest/repos/lock ++ '[' x '!=' x/home/osstest/repos/lock ']' ++ OSSTEST_REPOS_LOCK_LOCKED=/home/osstest/repos/lock ++ exec with-lock-ex -w /home/osstest/repos/lock ./ap-push ovmf 8550b5f0810f306850f9a07ee551099155d89ae0 + branch=ovmf + revision=8550b5f0810f306850f9a07ee551099155d89ae0 + . ./cri-lock-repos ++ . ./cri-common +++ . ./cri-getconfig +++ umask 002 +++ getrepos getconfig Repos perl -e ' use Osstest; readglobalconfig(); print $c{"Repos"} or die $!; ' +++ local repos=/home/osstest/repos +++ '[' -z /home/osstest/repos ']' +++ '[' '!' -d /home/osstest/repos ']' +++ echo /home/osstest/repos ++ repos=/home/osstest/repos ++ repos_lock=/home/osstest/repos/lock ++ '[' x/home/osstest/repos/lock '!=' x/home/osstest/repos/lock ']' + . ./cri-common ++ . ./cri-getconfig ++ umask 002 + select_xenbranch + case "$branch" in + tree=ovmf + xenbranch=xen-unstable + '[' xovmf = xlinux ']' + linuxbranch= + '[' x = x ']' + qemuubranch=qemu-upstream-unstable + select_prevxenbranch ++ ./cri-getprevxenbranch xen-unstable + prevxenbranch=xen-4.7-testing + '[' x8550b5f0810f306850f9a07ee551099155d89ae0 = x ']' + : tested/2.6.39.x + . ./ap-common ++ : osst...@xenbits.xen.org +++ getconfig OsstestUpstream +++ perl -e ' use Osstest; readglobalconfig(); print $c{"OsstestUpstream"} or die $!; ' ++ : ++ : git://xenbits.xen.org/xen.git ++ : osst...@xenbits.xen.org:/home/xen/git/xen.git ++ : git://xenbits.xen.org/qemu-xen-traditional.git ++ : git://git.kernel.org ++ : git://git.kernel.org/pub/scm/linux/kernel/git ++ : git ++ : git://xenbits.xen.org/xtf.git ++ : osst...@xenbits.xen.org:/home/xen/git/xtf.git ++ : git://xenbits.xen.org/xtf.git ++ : git://xenbits.xen.org/libvirt.git ++ : osst...@xenbits.xen.org:/home/xen/git/libvirt.git ++ : git://xenbits.xen.org/libvirt.git ++ : git://xenbits.xen.org/osstest/rumprun.git ++ : git ++ : git://xenbits.xen.org/osstest/rumprun.git ++ : osst...@xenbits.xen.org:/home/xen/git/osstest/rumprun.git ++ : git://git.seabios.org/seabios.git ++ : osst...@xenbits.xen.org:/home/xen/git/osstest/seabios.git ++ : git://xenbits.xen.org/osstest/seabios.git ++ : https://github.com/tianocore/edk2.git ++ : osst...@xenbits.xen.org:/home/xen/git/osstest/ovmf.git ++ : git://xenbits.xen.org/osstest/ovmf.git ++ : git://xenbits.xen.org/osstest/linux-firmware.git ++ : osst...@xenbits.xen.org:/home/osstest/ext/linux-firmware.git ++ : git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git ++ : osst...@xenbits.xen.org:/home/xen/git/linux-pvop
[Xen-devel] [xen-unstable baseline-only test] 67790: regressions - FAIL
This run is configured for baseline tests only. flight 67790 xen-unstable real [real] http://osstest.xs.citrite.net/~osstest/testlogs/logs/67790/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-armhf-armhf-libvirt-qcow2 9 debian-di-install fail REGR. vs. 67784 test-amd64-i386-freebsd10-amd64 21 leak-check/check fail REGR. vs. 67784 Regressions which are regarded as allowable (not blocking): test-amd64-amd64-qemuu-nested-intel 16 debian-hvm-install/l1/l2 fail like 67784 test-amd64-i386-xl-qemuu-win7-amd64 16 guest-stop fail like 67784 test-amd64-amd64-i386-pvgrub 10 guest-start fail like 67784 Tests which did not succeed, but are not blocking: test-amd64-amd64-rumprun-amd64 1 build-check(1) blocked n/a test-amd64-i386-rumprun-i386 1 build-check(1) blocked n/a build-amd64-rumprun 5 rumprun-buildfail never pass build-i386-rumprun5 rumprun-buildfail never pass test-amd64-i386-libvirt-xsm 12 migrate-support-checkfail never pass test-amd64-i386-libvirt 12 migrate-support-checkfail never pass test-armhf-armhf-xl 12 migrate-support-checkfail never pass test-armhf-armhf-xl 13 saverestore-support-checkfail never pass test-amd64-amd64-qemuu-nested-amd 16 debian-hvm-install/l1/l2 fail never pass test-armhf-armhf-libvirt 12 migrate-support-checkfail never pass test-armhf-armhf-libvirt 14 guest-saverestorefail never pass test-armhf-armhf-libvirt-xsm 12 migrate-support-checkfail never pass test-armhf-armhf-libvirt-xsm 14 guest-saverestorefail never pass test-armhf-armhf-xl-credit2 12 migrate-support-checkfail never pass test-armhf-armhf-xl-credit2 13 saverestore-support-checkfail never pass test-amd64-amd64-libvirt-vhd 11 migrate-support-checkfail never pass test-armhf-armhf-libvirt-raw 11 migrate-support-checkfail never pass test-armhf-armhf-libvirt-raw 13 guest-saverestorefail never pass test-armhf-armhf-xl-midway 12 migrate-support-checkfail never pass test-armhf-armhf-xl-midway 13 saverestore-support-checkfail never pass test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 10 migrate-support-check fail never pass test-amd64-amd64-xl-pvh-amd 11 guest-start fail never pass test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 10 migrate-support-check fail never pass test-armhf-armhf-xl-multivcpu 12 migrate-support-checkfail never pass test-armhf-armhf-xl-multivcpu 13 saverestore-support-checkfail never pass test-amd64-amd64-xl-pvh-intel 11 guest-start fail never pass test-armhf-armhf-xl-rtds 12 migrate-support-checkfail never pass test-armhf-armhf-xl-rtds 13 saverestore-support-checkfail never pass test-amd64-amd64-libvirt-xsm 12 migrate-support-checkfail never pass test-armhf-armhf-xl-vhd 11 migrate-support-checkfail never pass test-armhf-armhf-xl-vhd 12 saverestore-support-checkfail never pass test-armhf-armhf-xl-xsm 12 migrate-support-checkfail never pass test-armhf-armhf-xl-xsm 13 saverestore-support-checkfail never pass test-amd64-amd64-xl-qemuu-win7-amd64 16 guest-stop fail never pass test-amd64-amd64-xl-qemut-win7-amd64 16 guest-stop fail never pass test-amd64-amd64-libvirt 12 migrate-support-checkfail never pass test-amd64-i386-xl-qemut-win7-amd64 16 guest-stop fail never pass version targeted for testing: xen b3d54cead6459567d9786ad415149868ee7f2f5b baseline version: xen eabe1c39d1cd4fcef18ec50571db3c70c055c1fb Last test of basis67784 2016-09-30 15:17:19 Z3 days Testing same since67790 2016-10-03 16:44:46 Z0 days1 attempts People who touched revisions under test: Andrew Cooper Dario Faggioli George Dunlap George Dunlap Ian Jackson Jan Beulich Julien Grall Konrad Rzeszutek Wilk Lars Kurth Mihai DonÈu Shannon Zhao Wei Liu Zhi Wang jobs: build-amd64-xsm pass build-armhf-xsm pass build-i386-xsm pass build-amd64-xtf pass build-amd64 pass build-armhf pass build-i386 pass build-amd64-libvirt pass build-armhf-libvirt
[Xen-devel] [xen-unstable test] 101247: tolerable FAIL - PUSHED
flight 101247 xen-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/101247/ Failures :-/ but no regressions. Tests which are failing intermittently (not blocking): test-armhf-armhf-xl-arndale 3 host-install(3) broken in 101246 pass in 101247 test-armhf-armhf-xl-credit2 16 guest-start.2 fail pass in 101246 Regressions which are regarded as allowable (not blocking): test-armhf-armhf-xl-rtds 15 guest-start/debian.repeat fail in 101246 like 101244 test-amd64-i386-xl-qemut-win7-amd64 16 guest-stop fail like 101244 test-amd64-i386-xl-qemuu-win7-amd64 16 guest-stop fail like 101244 test-amd64-amd64-xl-qemut-win7-amd64 16 guest-stopfail like 101244 test-amd64-amd64-xl-qemuu-win7-amd64 16 guest-stopfail like 101244 test-amd64-amd64-xl-rtds 9 debian-install fail like 101244 Tests which did not succeed, but are not blocking: test-amd64-amd64-rumprun-amd64 1 build-check(1) blocked n/a test-amd64-i386-rumprun-i386 1 build-check(1) blocked n/a build-amd64-rumprun 5 rumprun-buildfail never pass test-armhf-armhf-libvirt-xsm 12 migrate-support-checkfail never pass test-armhf-armhf-libvirt-xsm 14 guest-saverestorefail never pass build-i386-rumprun5 rumprun-buildfail never pass test-armhf-armhf-libvirt 12 migrate-support-checkfail never pass test-armhf-armhf-libvirt 14 guest-saverestorefail never pass test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 10 migrate-support-check fail never pass test-armhf-armhf-libvirt-qcow2 11 migrate-support-checkfail never pass test-armhf-armhf-libvirt-qcow2 13 guest-saverestorefail never pass test-armhf-armhf-xl 12 migrate-support-checkfail never pass test-armhf-armhf-xl 13 saverestore-support-checkfail never pass test-armhf-armhf-xl-credit2 12 migrate-support-checkfail never pass test-armhf-armhf-xl-credit2 13 saverestore-support-checkfail never pass test-armhf-armhf-xl-vhd 11 migrate-support-checkfail never pass test-armhf-armhf-xl-vhd 12 saverestore-support-checkfail never pass test-armhf-armhf-xl-arndale 12 migrate-support-checkfail never pass test-armhf-armhf-xl-arndale 13 saverestore-support-checkfail never pass test-armhf-armhf-libvirt-raw 11 migrate-support-checkfail never pass test-armhf-armhf-libvirt-raw 13 guest-saverestorefail never pass test-armhf-armhf-xl-rtds 12 migrate-support-checkfail never pass test-armhf-armhf-xl-rtds 13 saverestore-support-checkfail never pass test-armhf-armhf-xl-multivcpu 12 migrate-support-checkfail never pass test-armhf-armhf-xl-multivcpu 13 saverestore-support-checkfail never pass test-armhf-armhf-xl-cubietruck 12 migrate-support-checkfail never pass test-armhf-armhf-xl-cubietruck 13 saverestore-support-checkfail never pass test-armhf-armhf-xl-xsm 12 migrate-support-checkfail never pass test-armhf-armhf-xl-xsm 13 saverestore-support-checkfail never pass test-amd64-amd64-libvirt-vhd 11 migrate-support-checkfail never pass test-amd64-amd64-libvirt-xsm 12 migrate-support-checkfail never pass test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 10 migrate-support-check fail never pass test-amd64-amd64-libvirt 12 migrate-support-checkfail never pass test-amd64-amd64-xl-pvh-amd 11 guest-start fail never pass test-amd64-i386-libvirt-xsm 12 migrate-support-checkfail never pass test-amd64-i386-libvirt 12 migrate-support-checkfail never pass test-amd64-amd64-qemuu-nested-amd 16 debian-hvm-install/l1/l2 fail never pass test-amd64-amd64-xl-pvh-intel 11 guest-start fail never pass version targeted for testing: xen 40277cded320efa32b86c0c9f01e33145eab5ee4 baseline version: xen b3d54cead6459567d9786ad415149868ee7f2f5b Last test of basis 101244 2016-10-03 01:56:58 Z1 days Testing same since 101246 2016-10-03 14:14:12 Z0 days2 attempts People who touched revisions under test: Ian Jackson Wei Liu jobs: build-amd64-xsm pass build-armhf-xsm pass build-i386-xsm pass build-amd64-xtf pass build-amd64 pass build-armhf pass build-i386 pass build-amd64-libvirt
[Xen-devel] [ovmf baseline-only test] 67791: regressions - FAIL
This run is configured for baseline tests only. flight 67791 ovmf real [real] http://osstest.xs.citrite.net/~osstest/testlogs/logs/67791/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-xl-qemuu-ovmf-amd64 15 guest-localmigrate/x10 fail REGR. vs. 67786 version targeted for testing: ovmf 8550b5f0810f306850f9a07ee551099155d89ae0 baseline version: ovmf ed72804638c9b240477c5235d72c3823483813b2 Last test of basis67786 2016-09-30 15:18:53 Z3 days Testing same since67791 2016-10-04 01:20:23 Z0 days1 attempts People who touched revisions under test: Cinnamon Shia jobs: build-amd64-xsm pass build-i386-xsm pass build-amd64 pass build-i386 pass build-amd64-libvirt pass build-i386-libvirt pass build-amd64-pvopspass build-i386-pvops pass test-amd64-amd64-xl-qemuu-ovmf-amd64 fail test-amd64-i386-xl-qemuu-ovmf-amd64 pass sg-report-flight on osstest.xs.citrite.net logs: /home/osstest/logs images: /home/osstest/images Logs, config files, etc. are available at http://osstest.xs.citrite.net/~osstest/testlogs/logs Test harness code can be found at http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary Push not applicable. commit 8550b5f0810f306850f9a07ee551099155d89ae0 Author: Cinnamon Shia Date: Mon Oct 3 09:37:17 2016 -0700 ShellPkg/Shell: Update CRC32 in the EFI System Table header Update CRC32 in the EFI System Table header after shell changes the value of gST->ConsoleOutHandle and gST->ConOut Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Cinnamon Shia Reviewed-By: Tapan Shah Reviewed-By: Jaben Carsey ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
[Xen-devel] [ovmf test] 101249: all pass - PUSHED
flight 101249 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/101249/ Perfect :-) All tests in this flight passed as required version targeted for testing: ovmf c0b7e2b2bfc2748112607bfe83fc99cf48c97b48 baseline version: ovmf 8550b5f0810f306850f9a07ee551099155d89ae0 Last test of basis 101248 2016-10-03 21:45:40 Z0 days Testing same since 101249 2016-10-04 01:14:18 Z0 days1 attempts People who touched revisions under test: Michael Kinney jobs: build-amd64-xsm pass build-i386-xsm pass build-amd64 pass build-i386 pass build-amd64-libvirt pass build-i386-libvirt pass build-amd64-pvopspass build-i386-pvops pass test-amd64-amd64-xl-qemuu-ovmf-amd64 pass test-amd64-i386-xl-qemuu-ovmf-amd64 pass sg-report-flight on osstest.test-lab.xenproject.org logs: /home/logs/logs images: /home/logs/images Logs, config files, etc. are available at http://logs.test-lab.xenproject.org/osstest/logs Explanation of these reports, and of osstest in general, is at http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master Test harness code can be found at http://xenbits.xen.org/gitweb?p=osstest.git;a=summary Pushing revision : + branch=ovmf + revision=c0b7e2b2bfc2748112607bfe83fc99cf48c97b48 + . ./cri-lock-repos ++ . ./cri-common +++ . ./cri-getconfig +++ umask 002 +++ getrepos getconfig Repos perl -e ' use Osstest; readglobalconfig(); print $c{"Repos"} or die $!; ' +++ local repos=/home/osstest/repos +++ '[' -z /home/osstest/repos ']' +++ '[' '!' -d /home/osstest/repos ']' +++ echo /home/osstest/repos ++ repos=/home/osstest/repos ++ repos_lock=/home/osstest/repos/lock ++ '[' x '!=' x/home/osstest/repos/lock ']' ++ OSSTEST_REPOS_LOCK_LOCKED=/home/osstest/repos/lock ++ exec with-lock-ex -w /home/osstest/repos/lock ./ap-push ovmf c0b7e2b2bfc2748112607bfe83fc99cf48c97b48 + branch=ovmf + revision=c0b7e2b2bfc2748112607bfe83fc99cf48c97b48 + . ./cri-lock-repos ++ . ./cri-common +++ . ./cri-getconfig +++ umask 002 +++ getrepos getconfig Repos perl -e ' use Osstest; readglobalconfig(); print $c{"Repos"} or die $!; ' +++ local repos=/home/osstest/repos +++ '[' -z /home/osstest/repos ']' +++ '[' '!' -d /home/osstest/repos ']' +++ echo /home/osstest/repos ++ repos=/home/osstest/repos ++ repos_lock=/home/osstest/repos/lock ++ '[' x/home/osstest/repos/lock '!=' x/home/osstest/repos/lock ']' + . ./cri-common ++ . ./cri-getconfig ++ umask 002 + select_xenbranch + case "$branch" in + tree=ovmf + xenbranch=xen-unstable + '[' xovmf = xlinux ']' + linuxbranch= + '[' x = x ']' + qemuubranch=qemu-upstream-unstable + select_prevxenbranch ++ ./cri-getprevxenbranch xen-unstable + prevxenbranch=xen-4.7-testing + '[' xc0b7e2b2bfc2748112607bfe83fc99cf48c97b48 = x ']' + : tested/2.6.39.x + . ./ap-common ++ : osst...@xenbits.xen.org +++ getconfig OsstestUpstream +++ perl -e ' use Osstest; readglobalconfig(); print $c{"OsstestUpstream"} or die $!; ' ++ : ++ : git://xenbits.xen.org/xen.git ++ : osst...@xenbits.xen.org:/home/xen/git/xen.git ++ : git://xenbits.xen.org/qemu-xen-traditional.git ++ : git://git.kernel.org ++ : git://git.kernel.org/pub/scm/linux/kernel/git ++ : git ++ : git://xenbits.xen.org/xtf.git ++ : osst...@xenbits.xen.org:/home/xen/git/xtf.git ++ : git://xenbits.xen.org/xtf.git ++ : git://xenbits.xen.org/libvirt.git ++ : osst...@xenbits.xen.org:/home/xen/git/libvirt.git ++ : git://xenbits.xen.org/libvirt.git ++ : git://xenbits.xen.org/osstest/rumprun.git ++ : git ++ : git://xenbits.xen.org/osstest/rumprun.git ++ : osst...@xenbits.xen.org:/home/xen/git/osstest/rumprun.git ++ : git://git.seabios.org/seabios.git ++ : osst...@xenbits.xen.org:/home/xen/git/osstest/seabios.git ++ : git://xenbits.xen.org/osstest/seabios.git ++ : https://github.com/tianocore/edk2.git ++ : osst...@xenbits.xen.org:/home/xen/git/osstest/ovmf.git ++ : git://xenbits.xen.org/osstest/ovmf.git ++ : git://xenbits.xen.org/osstest/linux-firmware.git ++ : osst...@xenbits.xen.org:/home/osstest/ext/linux-firmware.git ++ : git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git ++ : osst...@xenbits.xen.org:/home/xen/git/linux-pvo
Re: [Xen-devel] [PATCH net-next 0/7] xen-netback: guest rx side refactor
From: Paul Durrant Date: Mon, 3 Oct 2016 08:31:05 +0100 > This series refactors the guest rx side of xen-netback: > > - The code is moved into its own source module. > > - The prefix variant of GSO handling is retired (since it is no longer > in common use, and alternatives exist). > > - The code is then simplified and modifications made to improve > performance. This doesn't apply cleanly to net-next, please respin. ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
[Xen-devel] [PATCH 02/15] xen: Fix coding style warnings
Fixes: * WARNING: line over 80 characters Signed-off-by: Emil Condrea --- hw/block/xen_disk.c | 3 ++- hw/char/xen_console.c| 6 -- hw/display/xenfb.c | 30 -- hw/net/xen_nic.c | 12 hw/xen/xen_backend.c | 15 ++- include/hw/xen/xen_backend.h | 8 +--- 6 files changed, 49 insertions(+), 25 deletions(-) diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c index 5aa350a..24edeb2 100644 --- a/hw/block/xen_disk.c +++ b/hw/block/xen_disk.c @@ -1068,7 +1068,8 @@ static int blk_connect(struct XenDevice *xendev) blk_set_enable_write_cache(blkdev->blk, !writethrough); } else { /* setup via qemu cmdline -> already setup for us */ -xen_be_printf(&blkdev->xendev, 2, "get configured bdrv (cmdline setup)\n"); +xen_be_printf(&blkdev->xendev, 2, + "get configured bdrv (cmdline setup)\n"); blkdev->blk = blk_by_legacy_dinfo(blkdev->dinfo); if (blk_is_read_only(blkdev->blk) && !readonly) { xen_be_printf(&blkdev->xendev, 0, "Unexpected read-only drive"); diff --git a/hw/char/xen_console.c b/hw/char/xen_console.c index 4e35c82..399bb5d 100644 --- a/hw/char/xen_console.c +++ b/hw/char/xen_console.c @@ -156,7 +156,8 @@ static void xencons_send(struct XenConsole *con) if (len < 1) { if (!con->backlog) { con->backlog = 1; -xen_be_printf(&con->xendev, 1, "backlog piling up, nobody listening?\n"); +xen_be_printf(&con->xendev, 1, + "backlog piling up, nobody listening?\n"); } } else { buffer_advance(&con->buffer, len); @@ -247,7 +248,8 @@ static int con_initialise(struct XenDevice *xendev) } } -xen_be_printf(xendev, 1, "ring mfn %d, remote port %d, local port %d, limit %zd\n", +xen_be_printf(xendev, 1, + "ring mfn %d, remote port %d, local port %d, limit %zd\n", con->ring_ref, con->xendev.remote_port, con->xendev.local_port, diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c index a9a93f9..9bcf60b 100644 --- a/hw/display/xenfb.c +++ b/hw/display/xenfb.c @@ -511,38 +511,45 @@ static int xenfb_configure_fb(struct XenFB *xenfb, size_t fb_len_lim, int max_width, max_height; if (fb_len_lim > fb_len_max) { -xen_be_printf(&xenfb->c.xendev, 0, "fb size limit %zu exceeds %zu, corrected\n", +xen_be_printf(&xenfb->c.xendev, 0, + "fb size limit %zu exceeds %zu, corrected\n", fb_len_lim, fb_len_max); fb_len_lim = fb_len_max; } if (fb_len_lim && fb_len > fb_len_lim) { -xen_be_printf(&xenfb->c.xendev, 0, "frontend fb size %zu limited to %zu\n", +xen_be_printf(&xenfb->c.xendev, 0, + "frontend fb size %zu limited to %zu\n", fb_len, fb_len_lim); fb_len = fb_len_lim; } if (depth != 8 && depth != 16 && depth != 24 && depth != 32) { -xen_be_printf(&xenfb->c.xendev, 0, "can't handle frontend fb depth %d\n", +xen_be_printf(&xenfb->c.xendev, 0, + "can't handle frontend fb depth %d\n", depth); return -1; } if (row_stride <= 0 || row_stride > fb_len) { -xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend stride %d\n", row_stride); +xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend stride %d\n", + row_stride); return -1; } max_width = row_stride / (depth / 8); if (width < 0 || width > max_width) { -xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend width %d limited to %d\n", +xen_be_printf(&xenfb->c.xendev, 0, + "invalid frontend width %d limited to %d\n", width, max_width); width = max_width; } if (offset < 0 || offset >= fb_len) { -xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend offset %d (max %zu)\n", +xen_be_printf(&xenfb->c.xendev, 0, + "invalid frontend offset %d (max %zu)\n", offset, fb_len - 1); return -1; } max_height = (fb_len - offset) / row_stride; if (height < 0 || height > max_height) { -xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend height %d limited to %d\n", +xen_be_printf(&xenfb->c.xendev, 0, + "invalid frontend height %d limited to %d\n", height, max_height); height = max_height; } @@ -554,7 +561,8 @@ static int xenfb_configure_fb(struct XenFB *xenfb, size_t fb_len_lim, xenfb->offset = offset; xenfb->up_fullscreen = 1; xenfb->do_resize = 1; -xen_be_printf(&xenfb->c.xendev, 1, "framebuffer %dx%dx%d offset %d stride %d\n", +xen_be_printf(&xenfb->c.xendev, 1, +
[Xen-devel] [PATCH 04/15] xen: Create a new file xen_frontend.c
Its purpose is to store frontend related functions. Signed-off-by: Quan Xu Signed-off-by: Emil Condrea --- hw/block/xen_disk.c | 1 + hw/display/xenfb.c| 1 + hw/net/xen_nic.c | 1 + hw/usb/xen-usb.c | 1 + hw/xen/Makefile.objs | 2 +- hw/xen/xen_backend.c | 49 + hw/xen/xen_frontend.c | 72 +++ include/hw/xen/xen_backend.h | 4 --- include/hw/xen/xen_frontend.h | 11 +++ 9 files changed, 89 insertions(+), 53 deletions(-) create mode 100644 hw/xen/xen_frontend.c create mode 100644 include/hw/xen/xen_frontend.h diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c index 24edeb2..0b2db3b 100644 --- a/hw/block/xen_disk.c +++ b/hw/block/xen_disk.c @@ -25,6 +25,7 @@ #include "hw/hw.h" #include "hw/xen/xen_backend.h" +#include "hw/xen/xen_frontend.h" #include "xen_blkif.h" #include "sysemu/blockdev.h" #include "sysemu/block-backend.h" diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c index 9bcf60b..9b10b35 100644 --- a/hw/display/xenfb.c +++ b/hw/display/xenfb.c @@ -30,6 +30,7 @@ #include "ui/console.h" #include "sysemu/char.h" #include "hw/xen/xen_backend.h" +#include "hw/xen/xen_frontend.h" #include #include diff --git a/hw/net/xen_nic.c b/hw/net/xen_nic.c index 30efe47..8db3448 100644 --- a/hw/net/xen_nic.c +++ b/hw/net/xen_nic.c @@ -29,6 +29,7 @@ #include "net/checksum.h" #include "net/util.h" #include "hw/xen/xen_backend.h" +#include "hw/xen/xen_frontend.h" #include diff --git a/hw/usb/xen-usb.c b/hw/usb/xen-usb.c index 174d715..10773f2 100644 --- a/hw/usb/xen-usb.c +++ b/hw/usb/xen-usb.c @@ -28,6 +28,7 @@ #include "hw/sysbus.h" #include "hw/usb.h" #include "hw/xen/xen_backend.h" +#include "hw/xen/xen_frontend.h" #include "monitor/qdev.h" #include "qapi/qmp/qbool.h" #include "qapi/qmp/qint.h" diff --git a/hw/xen/Makefile.objs b/hw/xen/Makefile.objs index 591cdc2..1000294 100644 --- a/hw/xen/Makefile.objs +++ b/hw/xen/Makefile.objs @@ -1,5 +1,5 @@ # xen backend driver support -common-obj-$(CONFIG_XEN_BACKEND) += xen_backend.o xen_devconfig.o xen_pvdev.o +common-obj-$(CONFIG_XEN_BACKEND) += xen_backend.o xen_frontend.o xen_devconfig.o xen_pvdev.o obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen-host-pci-device.o obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen_pt.o xen_pt_config_init.o xen_pt_graphics.o xen_pt_msi.o diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c index 84142d8..d4880e1 100644 --- a/hw/xen/xen_backend.c +++ b/hw/xen/xen_backend.c @@ -30,6 +30,7 @@ #include "sysemu/char.h" #include "qemu/log.h" #include "hw/xen/xen_backend.h" +#include "hw/xen/xen_frontend.h" #include "hw/xen/xen_pvdev.h" #include @@ -125,22 +126,6 @@ int xenstore_read_be_int(struct XenDevice *xendev, const char *node, int *ival) return xenstore_read_int(xendev->be, node, ival); } -char *xenstore_read_fe_str(struct XenDevice *xendev, const char *node) -{ -return xenstore_read_str(xendev->fe, node); -} - -int xenstore_read_fe_int(struct XenDevice *xendev, const char *node, int *ival) -{ -return xenstore_read_int(xendev->fe, node, ival); -} - -int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node, -uint64_t *uval) -{ -return xenstore_read_uint64(xendev->fe, node, uval); -} - /* - */ int xen_be_set_state(struct XenDevice *xendev, enum xenbus_state state) @@ -283,38 +268,6 @@ static void xen_be_backend_changed(struct XenDevice *xendev, const char *node) } } -static void xen_be_frontend_changed(struct XenDevice *xendev, const char *node) -{ -int fe_state; - -if (node == NULL || strcmp(node, "state") == 0) { -if (xenstore_read_fe_int(xendev, "state", &fe_state) == -1) { -fe_state = XenbusStateUnknown; -} -if (xendev->fe_state != fe_state) { -xen_be_printf(xendev, 1, "frontend state: %s -> %s\n", - xenbus_strstate(xendev->fe_state), - xenbus_strstate(fe_state)); -} -xendev->fe_state = fe_state; -} -if (node == NULL || strcmp(node, "protocol") == 0) { -g_free(xendev->protocol); -xendev->protocol = xenstore_read_fe_str(xendev, "protocol"); -if (xendev->protocol) { -xen_be_printf(xendev, 1, "frontend protocol: %s\n", -xendev->protocol); -} -} - -if (node) { -xen_be_printf(xendev, 2, "frontend update: %s\n", node); -if (xendev->ops->frontend_changed) { -xendev->ops->frontend_changed(xendev, node); -} -} -} - /* - */ /* Check for possible state transitions and perform them.*/ diff --git a/hw/xen/xen_frontend.c b/hw/xen/xen_frontend.c new
[Xen-devel] [PATCH 07/15] xen: Prepare xendev qtail to be shared with frontends
* move xendevs qtail to xen_pvdev.c * change xen_be_get_xendev to use a new function: xen_pv_insert_xendev Signed-off-by: Emil Condrea --- hw/xen/xen_backend.c | 51 +- hw/xen/xen_pvdev.c| 57 +++ include/hw/xen/xen_backend.h | 1 - include/hw/xen/xen_frontend.h | 2 ++ include/hw/xen/xen_pvdev.h| 4 +++ 5 files changed, 64 insertions(+), 51 deletions(-) diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c index c7db068..d572cd0 100644 --- a/hw/xen/xen_backend.c +++ b/hw/xen/xen_backend.c @@ -55,8 +55,6 @@ struct xs_dirs { static QTAILQ_HEAD(xs_dirs_head, xs_dirs) xs_cleanup = QTAILQ_HEAD_INITIALIZER(xs_cleanup); -static QTAILQ_HEAD(XenDeviceHead, XenDevice) xendevs = -QTAILQ_HEAD_INITIALIZER(xendevs); static int debug; static void xenstore_cleanup_dir(char *dir) @@ -142,27 +140,6 @@ int xen_be_set_state(struct XenDevice *xendev, enum xenbus_state state) return 0; } -/* - */ - -struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev) -{ -struct XenDevice *xendev; - -QTAILQ_FOREACH(xendev, &xendevs, next) { -if (xendev->dom != dom) { -continue; -} -if (xendev->dev != dev) { -continue; -} -if (strcmp(xendev->type, type) != 0) { -continue; -} -return xendev; -} -return NULL; -} - /* * get xen backend device, allocate a new one if it doesn't exist. */ @@ -211,7 +188,7 @@ static struct XenDevice *xen_be_get_xendev(const char *type, int dom, int dev, xendev->gnttabdev = NULL; } -QTAILQ_INSERT_TAIL(&xendevs, xendev, next); +xen_pv_insert_xendev(xendev); if (xendev->ops->alloc) { xendev->ops->alloc(xendev); @@ -220,32 +197,6 @@ static struct XenDevice *xen_be_get_xendev(const char *type, int dom, int dev, return xendev; } -/* - * release xen backend device. - */ -static void xen_be_del_xendev(struct XenDevice *xendev) -{ -if (xendev->ops->free) { -xendev->ops->free(xendev); -} - -if (xendev->fe) { -char token[XEN_BUFSIZE]; -snprintf(token, sizeof(token), "fe:%p", xendev); -xs_unwatch(xenstore, xendev->fe, token); -g_free(xendev->fe); -} - -if (xendev->evtchndev != NULL) { -xenevtchn_close(xendev->evtchndev); -} -if (xendev->gnttabdev != NULL) { -xengnttab_close(xendev->gnttabdev); -} - -QTAILQ_REMOVE(&xendevs, xendev, next); -g_free(xendev); -} /* * Sync internal data structures on xenstore updates. diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c index 91101fd..72e2e79 100644 --- a/hw/xen/xen_pvdev.c +++ b/hw/xen/xen_pvdev.c @@ -23,7 +23,11 @@ #include "hw/xen/xen_frontend.h" #include "hw/xen/xen_pvdev.h" +/* private */ static int debug; +static QTAILQ_HEAD(XenDeviceHead, XenDevice) xendevs = +QTAILQ_HEAD_INITIALIZER(xendevs); + /* - */ int xenstore_write_str(const char *base, const char *node, const char *val) @@ -207,3 +211,56 @@ int xen_be_send_notify(struct XenDevice *xendev) { return xenevtchn_notify(xendev->evtchndev, xendev->local_port); } + +/* - */ + +struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev) +{ +struct XenDevice *xendev; + +QTAILQ_FOREACH(xendev, &xendevs, next) { +if (xendev->dom != dom) { +continue; +} +if (xendev->dev != dev) { +continue; +} +if (strcmp(xendev->type, type) != 0) { +continue; +} +return xendev; +} +return NULL; +} + +/* + * release xen backend device. + */ +void xen_be_del_xendev(struct XenDevice *xendev) +{ +if (xendev->ops->free) { +xendev->ops->free(xendev); +} + +if (xendev->fe) { +char token[XEN_BUFSIZE]; +snprintf(token, sizeof(token), "fe:%p", xendev); +xs_unwatch(xenstore, xendev->fe, token); +g_free(xendev->fe); +} + +if (xendev->evtchndev != NULL) { +xenevtchn_close(xendev->evtchndev); +} +if (xendev->gnttabdev != NULL) { +xengnttab_close(xendev->gnttabdev); +} + +QTAILQ_REMOVE(&xendevs, xendev, next); +g_free(xendev); +} + +void xen_pv_insert_xendev(struct XenDevice *xendev) +{ +QTAILQ_INSERT_TAIL(&xendevs, xendev, next); +} diff --git a/include/hw/xen/xen_backend.h b/include/hw/xen/xen_backend.h index d0dbee5..64d4fe3 100644 --- a/include/hw/xen/xen_backend.h +++ b/include/hw/xen/xen_backend.h @@ -22,7 +22,6 @@ int xenstore_read_be_int(struct XenDevice *xendev, const char *node, int *ival); void xenstore_update_be(char *watch, char *type, int dom, struct XenDevOps *ops); -struct XenDevice *x
[Xen-devel] [PATCH 06/15] xen: Move evtchn functions to xen_pvdev.c
The name of the functions moved: * xen_be_evtchn_event * xen_be_unbind_evtchn * xen_be_send_notify Signed-off-by: Emil Condrea --- hw/xen/xen_backend.c | 35 --- hw/xen/xen_pvdev.c | 35 +++ include/hw/xen/xen_backend.h | 2 -- include/hw/xen/xen_pvdev.h | 4 4 files changed, 39 insertions(+), 37 deletions(-) diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c index 6b03c50..c7db068 100644 --- a/hw/xen/xen_backend.c +++ b/hw/xen/xen_backend.c @@ -543,25 +543,6 @@ void xenstore_update_be(char *watch, char *type, int dom, } } -static void xen_be_evtchn_event(void *opaque) -{ -struct XenDevice *xendev = opaque; -evtchn_port_t port; - -port = xenevtchn_pending(xendev->evtchndev); -if (port != xendev->local_port) { -xen_be_printf(xendev, 0, - "xenevtchn_pending returned %d (expected %d)\n", - port, xendev->local_port); -return; -} -xenevtchn_unmask(xendev->evtchndev, port); - -if (xendev->ops->event) { -xendev->ops->event(xendev); -} -} - /* */ int xen_be_init(void) @@ -638,22 +619,6 @@ int xen_be_bind_evtchn(struct XenDevice *xendev) return 0; } -void xen_be_unbind_evtchn(struct XenDevice *xendev) -{ -if (xendev->local_port == -1) { -return; -} -qemu_set_fd_handler(xenevtchn_fd(xendev->evtchndev), NULL, NULL, NULL); -xenevtchn_unbind(xendev->evtchndev, xendev->local_port); -xen_be_printf(xendev, 2, "unbind evtchn port %d\n", xendev->local_port); -xendev->local_port = -1; -} - -int xen_be_send_notify(struct XenDevice *xendev) -{ -return xenevtchn_notify(xendev->evtchndev, xendev->local_port); -} - static int xen_sysdev_init(SysBusDevice *dev) { diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c index 35d3be6..91101fd 100644 --- a/hw/xen/xen_pvdev.c +++ b/hw/xen/xen_pvdev.c @@ -172,3 +172,38 @@ void xen_be_printf(struct XenDevice *xendev, int msg_level, } qemu_log_flush(); } + +void xen_be_evtchn_event(void *opaque) +{ +struct XenDevice *xendev = opaque; +evtchn_port_t port; + +port = xenevtchn_pending(xendev->evtchndev); +if (port != xendev->local_port) { +xen_be_printf(xendev, 0, + "xenevtchn_pending returned %d (expected %d)\n", + port, xendev->local_port); +return; +} +xenevtchn_unmask(xendev->evtchndev, port); + +if (xendev->ops->event) { +xendev->ops->event(xendev); +} +} + +void xen_be_unbind_evtchn(struct XenDevice *xendev) +{ +if (xendev->local_port == -1) { +return; +} +qemu_set_fd_handler(xenevtchn_fd(xendev->evtchndev), NULL, NULL, NULL); +xenevtchn_unbind(xendev->evtchndev, xendev->local_port); +xen_be_printf(xendev, 2, "unbind evtchn port %d\n", xendev->local_port); +xendev->local_port = -1; +} + +int xen_be_send_notify(struct XenDevice *xendev) +{ +return xenevtchn_notify(xendev->evtchndev, xendev->local_port); +} diff --git a/include/hw/xen/xen_backend.h b/include/hw/xen/xen_backend.h index 965a39a..d0dbee5 100644 --- a/include/hw/xen/xen_backend.h +++ b/include/hw/xen/xen_backend.h @@ -31,8 +31,6 @@ void xen_be_register_common(void); int xen_be_register(const char *type, struct XenDevOps *ops); int xen_be_set_state(struct XenDevice *xendev, enum xenbus_state state); int xen_be_bind_evtchn(struct XenDevice *xendev); -void xen_be_unbind_evtchn(struct XenDevice *xendev); -int xen_be_send_notify(struct XenDevice *xendev); /* actual backend drivers */ extern struct XenDevOps xen_console_ops; /* xen_console.c */ diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h index 3a9a4a4..cf44a87 100644 --- a/include/hw/xen/xen_pvdev.h +++ b/include/hw/xen/xen_pvdev.h @@ -64,6 +64,10 @@ void xenstore_update(void *unused); const char *xenbus_strstate(enum xenbus_state state); +void xen_be_evtchn_event(void *opaque); +void xen_be_unbind_evtchn(struct XenDevice *xendev); +int xen_be_send_notify(struct XenDevice *xendev); + void xen_be_printf(struct XenDevice *xendev, int msg_level, const char *fmt, ...) GCC_FMT_ATTR(3, 4); -- 1.9.1 ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
[Xen-devel] [PATCH 01/15] xen: Fix coding style errors
Fixes the following errors: * ERROR: line over 90 characters * ERROR: code indent should never use tabs * ERROR: space prohibited after that open square bracket '[' * ERROR: do not initialise statics to 0 or NULL * ERROR: "(foo*)" should be "(foo *)" Signed-off-by: Emil Condrea --- hw/char/xen_console.c | 20 ++--- hw/display/xenfb.c| 83 ++- hw/net/xen_nic.c | 8 +++-- hw/xen/xen_backend.c | 20 ++--- 4 files changed, 67 insertions(+), 64 deletions(-) diff --git a/hw/char/xen_console.c b/hw/char/xen_console.c index 83108b0..4e35c82 100644 --- a/hw/char/xen_console.c +++ b/hw/char/xen_console.c @@ -154,16 +154,16 @@ static void xencons_send(struct XenConsole *con) else len = size; if (len < 1) { - if (!con->backlog) { - con->backlog = 1; - xen_be_printf(&con->xendev, 1, "backlog piling up, nobody listening?\n"); - } +if (!con->backlog) { +con->backlog = 1; +xen_be_printf(&con->xendev, 1, "backlog piling up, nobody listening?\n"); +} } else { - buffer_advance(&con->buffer, len); - if (con->backlog && len == size) { - con->backlog = 0; - xen_be_printf(&con->xendev, 1, "backlog is gone\n"); - } +buffer_advance(&con->buffer, len); +if (con->backlog && len == size) { +con->backlog = 0; +xen_be_printf(&con->xendev, 1, "backlog is gone\n"); +} } } @@ -187,7 +187,7 @@ static int con_init(struct XenDevice *xendev) type = xenstore_read_str(con->console, "type"); if (!type || strcmp(type, "ioemu") != 0) { - xen_be_printf(xendev, 1, "not for me (type=%s)\n", type); +xen_be_printf(xendev, 1, "not for me (type=%s)\n", type); ret = -1; goto out; } diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c index 46b7d5e..a9a93f9 100644 --- a/hw/display/xenfb.c +++ b/hw/display/xenfb.c @@ -90,21 +90,22 @@ static int common_bind(struct common *c) xen_pfn_t mfn; if (xenstore_read_fe_uint64(&c->xendev, "page-ref", &val) == -1) - return -1; +return -1; mfn = (xen_pfn_t)val; assert(val == mfn); if (xenstore_read_fe_int(&c->xendev, "event-channel", &c->xendev.remote_port) == -1) - return -1; +return -1; c->page = xenforeignmemory_map(xen_fmem, c->xendev.dom, PROT_READ | PROT_WRITE, 1, &mfn, NULL); if (c->page == NULL) - return -1; +return -1; xen_be_bind_evtchn(&c->xendev); -xen_be_printf(&c->xendev, 1, "ring mfn %"PRI_xen_pfn", remote-port %d, local-port %d\n", - mfn, c->xendev.remote_port, c->xendev.local_port); +xen_be_printf(&c->xendev, 1, + "ring mfn %"PRI_xen_pfn", remote-port %d, local-port %d\n", + mfn, c->xendev.remote_port, c->xendev.local_port); return 0; } @@ -500,8 +501,8 @@ out: } static int xenfb_configure_fb(struct XenFB *xenfb, size_t fb_len_lim, - int width, int height, int depth, - size_t fb_len, int offset, int row_stride) + int width, int height, int depth, + size_t fb_len, int offset, int row_stride) { size_t mfn_sz = sizeof(*((struct xenfb_page *)0)->pd); size_t pd_len = sizeof(((struct xenfb_page *)0)->pd) / mfn_sz; @@ -510,40 +511,40 @@ static int xenfb_configure_fb(struct XenFB *xenfb, size_t fb_len_lim, int max_width, max_height; if (fb_len_lim > fb_len_max) { - xen_be_printf(&xenfb->c.xendev, 0, "fb size limit %zu exceeds %zu, corrected\n", - fb_len_lim, fb_len_max); - fb_len_lim = fb_len_max; +xen_be_printf(&xenfb->c.xendev, 0, "fb size limit %zu exceeds %zu, corrected\n", + fb_len_lim, fb_len_max); +fb_len_lim = fb_len_max; } if (fb_len_lim && fb_len > fb_len_lim) { - xen_be_printf(&xenfb->c.xendev, 0, "frontend fb size %zu limited to %zu\n", - fb_len, fb_len_lim); - fb_len = fb_len_lim; +xen_be_printf(&xenfb->c.xendev, 0, "frontend fb size %zu limited to %zu\n", + fb_len, fb_len_lim); +fb_len = fb_len_lim; } if (depth != 8 && depth != 16 && depth != 24 && depth != 32) { - xen_be_printf(&xenfb->c.xendev, 0, "can't handle frontend fb depth %d\n", - depth); - return -1; +xen_be_printf(&xenfb->c.xendev, 0, "can't handle frontend fb depth %d\n", + depth); +return -1; } if (row_stride <= 0 || row_stride > fb_len) { - xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend stride %d\n", row_stride); - return -1; +xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend stride %d\n", row_stride); +return
[Xen-devel] [PATCH 00/15] Refactor common part of xen backend and frontend
This patch series was splitted from QEMU:Xen stubdom vTPM for HVM virtual machine http://markmail.org/message/fkix7g3a5zdj7lvr It contains a reorganization of xen backend and frontend functions together with code style fixes. Common functions shared by backends and frontends are moved to xen_pvdev file. Emil Condrea (15): xen: Fix coding style errors xen: Fix coding style warnings xen: Create a new file xen_pvdev.c xen: Create a new file xen_frontend.c xen: Move xenstore_update to xen_pvdev.c xen: Move evtchn functions to xen_pvdev.c xen: Prepare xendev qtail to be shared with frontends xen: Move xenstore cleanup and mkdir functions xen: Rename xen_be_printf to xen_pv_printf xen: Rename xen_be_unbind_evtchn xen: Rename xen_be_send_notify xen: Rename xen_be_evtchn_event xen: Rename xen_be_find_xendev xen: Rename xen_be_del_xendev xen: Rename xen_be_frontend_changed hw/block/xen_disk.c | 66 +++ hw/char/xen_console.c | 32 ++-- hw/display/xenfb.c| 128 -- hw/net/xen_nic.c | 37 ++-- hw/usb/xen-usb.c | 47 ++--- hw/xen/Makefile.objs | 2 +- hw/xen/xen_backend.c | 400 -- hw/xen/xen_devconfig.c| 4 +- hw/xen/xen_frontend.c | 90 ++ hw/xen/xen_pvdev.c| 317 + include/hw/xen/xen_backend.h | 71 +--- include/hw/xen/xen_frontend.h | 14 ++ include/hw/xen/xen_pvdev.h| 78 xen-common.c | 4 +- 14 files changed, 704 insertions(+), 586 deletions(-) create mode 100644 hw/xen/xen_frontend.c create mode 100644 hw/xen/xen_pvdev.c create mode 100644 include/hw/xen/xen_frontend.h create mode 100644 include/hw/xen/xen_pvdev.h -- 1.9.1 ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
[Xen-devel] [PATCH 11/15] xen: Rename xen_be_send_notify
Prepare xen_be_send_notify to be shared with frontends: * xen_be_send_notify -> xen_pv_send_notify Signed-off-by: Emil Condrea --- hw/block/xen_disk.c| 4 ++-- hw/char/xen_console.c | 4 ++-- hw/display/xenfb.c | 8 hw/net/xen_nic.c | 4 ++-- hw/usb/xen-usb.c | 6 +++--- hw/xen/xen_pvdev.c | 2 +- include/hw/xen/xen_pvdev.h | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c index 3688a4b..799ee25 100644 --- a/hw/block/xen_disk.c +++ b/hw/block/xen_disk.c @@ -797,7 +797,7 @@ static void blk_send_response_all(struct XenBlkDev *blkdev) ioreq_release(ioreq, true); } if (send_notify) { -xen_be_send_notify(&blkdev->xendev); +xen_pv_send_notify(&blkdev->xendev); } } @@ -867,7 +867,7 @@ static void blk_handle_requests(struct XenBlkDev *blkdev) }; if (blk_send_response_one(ioreq)) { -xen_be_send_notify(&blkdev->xendev); +xen_pv_send_notify(&blkdev->xendev); } ioreq_release(ioreq, false); continue; diff --git a/hw/char/xen_console.c b/hw/char/xen_console.c index 6dc2d81..dbe4755 100644 --- a/hw/char/xen_console.c +++ b/hw/char/xen_console.c @@ -72,7 +72,7 @@ static void buffer_append(struct XenConsole *con) xen_mb(); intf->out_cons = cons; -xen_be_send_notify(&con->xendev); +xen_pv_send_notify(&con->xendev); if (buffer->max_capacity && buffer->size > buffer->max_capacity) { @@ -140,7 +140,7 @@ static void xencons_receive(void *opaque, const uint8_t *buf, int len) } xen_wmb(); intf->in_prod = prod; -xen_be_send_notify(&con->xendev); +xen_pv_send_notify(&con->xendev); } static void xencons_send(struct XenConsole *con) diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c index a86d990..9a7b298 100644 --- a/hw/display/xenfb.c +++ b/hw/display/xenfb.c @@ -216,7 +216,7 @@ static int xenfb_kbd_event(struct XenInput *xenfb, XENKBD_IN_RING_REF(page, prod) = *event; xen_wmb(); /* ensure ring contents visible */ page->in_prod = prod + 1; -return xen_be_send_notify(&xenfb->c.xendev); +return xen_pv_send_notify(&xenfb->c.xendev); } /* Send a keyboard (or mouse button) event */ @@ -398,7 +398,7 @@ static void input_event(struct XenDevice *xendev) if (page->out_prod == page->out_cons) return; page->out_cons = page->out_prod; -xen_be_send_notify(&xenfb->c.xendev); +xen_pv_send_notify(&xenfb->c.xendev); } /* */ @@ -673,7 +673,7 @@ static void xenfb_send_event(struct XenFB *xenfb, union xenfb_in_event *event) xen_wmb(); /* ensure ring contents visible */ page->in_prod = prod + 1; -xen_be_send_notify(&xenfb->c.xendev); +xen_pv_send_notify(&xenfb->c.xendev); } static void xenfb_send_refresh_period(struct XenFB *xenfb, int period) @@ -946,7 +946,7 @@ static void fb_event(struct XenDevice *xendev) struct XenFB *xenfb = container_of(xendev, struct XenFB, c.xendev); xenfb_handle_events(xenfb); -xen_be_send_notify(&xenfb->c.xendev); +xen_pv_send_notify(&xenfb->c.xendev); } /* */ diff --git a/hw/net/xen_nic.c b/hw/net/xen_nic.c index c6af5dc..89a2f43 100644 --- a/hw/net/xen_nic.c +++ b/hw/net/xen_nic.c @@ -70,7 +70,7 @@ static void net_tx_response(struct XenNetDev *netdev, netif_tx_request_t *txp, i netdev->tx_ring.rsp_prod_pvt = ++i; RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&netdev->tx_ring, notify); if (notify) { -xen_be_send_notify(&netdev->xendev); +xen_pv_send_notify(&netdev->xendev); } if (i == netdev->tx_ring.req_cons) { @@ -222,7 +222,7 @@ static void net_rx_response(struct XenNetDev *netdev, netdev->rx_ring.rsp_prod_pvt = ++i; RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&netdev->rx_ring, notify); if (notify) { -xen_be_send_notify(&netdev->xendev); +xen_pv_send_notify(&netdev->xendev); } } diff --git a/hw/usb/xen-usb.c b/hw/usb/xen-usb.c index f93c73d..7b0abf4 100644 --- a/hw/usb/xen-usb.c +++ b/hw/usb/xen-usb.c @@ -315,7 +315,7 @@ static void usbback_do_response(struct usbback_req *usbback_req, int32_t status, RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&usbif->urb_ring, notify); if (notify) { -xen_be_send_notify(xendev); +xen_pv_send_notify(xendev); } } @@ -591,7 +591,7 @@ static void usbback_hotplug_notify(struct usbback_info *usbif) /* Check for full ring. */ if ((RING_SIZE(ring) - ring->rsp_prod_pvt - ring->req_cons) == 0) { -xen_be_send_notify(&usbif->xendev); +xen_pv_send_notify(&usbif->xendev); return; } @@ -610,7 +610,7 @@ static void usbback_hotplug_notify(struct usbb
[Xen-devel] [PATCH 03/15] xen: Create a new file xen_pvdev.c
The purpose of the new file is to store generic functions shared by frontend and backends such as xenstore operations, xendevs. Signed-off-by: Quan Xu Signed-off-by: Emil Condrea --- hw/xen/Makefile.objs | 2 +- hw/xen/xen_backend.c | 126 +--- hw/xen/xen_pvdev.c | 150 +++ include/hw/xen/xen_backend.h | 64 +- include/hw/xen/xen_pvdev.h | 69 5 files changed, 222 insertions(+), 189 deletions(-) create mode 100644 hw/xen/xen_pvdev.c create mode 100644 include/hw/xen/xen_pvdev.h diff --git a/hw/xen/Makefile.objs b/hw/xen/Makefile.objs index d367094..591cdc2 100644 --- a/hw/xen/Makefile.objs +++ b/hw/xen/Makefile.objs @@ -1,5 +1,5 @@ # xen backend driver support -common-obj-$(CONFIG_XEN_BACKEND) += xen_backend.o xen_devconfig.o +common-obj-$(CONFIG_XEN_BACKEND) += xen_backend.o xen_devconfig.o xen_pvdev.o obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen-host-pci-device.o obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen_pt.o xen_pt_config_init.o xen_pt_graphics.o xen_pt_msi.o diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c index 0aca6ae..84142d8 100644 --- a/hw/xen/xen_backend.c +++ b/hw/xen/xen_backend.c @@ -30,6 +30,7 @@ #include "sysemu/char.h" #include "qemu/log.h" #include "hw/xen/xen_backend.h" +#include "hw/xen/xen_pvdev.h" #include @@ -57,8 +58,6 @@ static QTAILQ_HEAD(XenDeviceHead, XenDevice) xendevs = QTAILQ_HEAD_INITIALIZER(xendevs); static int debug; -/* - */ - static void xenstore_cleanup_dir(char *dir) { struct xs_dirs *d; @@ -77,34 +76,6 @@ void xen_config_cleanup(void) } } -int xenstore_write_str(const char *base, const char *node, const char *val) -{ -char abspath[XEN_BUFSIZE]; - -snprintf(abspath, sizeof(abspath), "%s/%s", base, node); -if (!xs_write(xenstore, 0, abspath, val, strlen(val))) { -return -1; -} -return 0; -} - -char *xenstore_read_str(const char *base, const char *node) -{ -char abspath[XEN_BUFSIZE]; -unsigned int len; -char *str, *ret = NULL; - -snprintf(abspath, sizeof(abspath), "%s/%s", base, node); -str = xs_read(xenstore, 0, abspath, &len); -if (str != NULL) { -/* move to qemu-allocated memory to make sure - * callers can savely g_free() stuff. */ -ret = g_strdup(str); -free(str); -} -return ret; -} - int xenstore_mkdir(char *path, int p) { struct xs_permissions perms[2] = { @@ -129,48 +100,6 @@ int xenstore_mkdir(char *path, int p) return 0; } -int xenstore_write_int(const char *base, const char *node, int ival) -{ -char val[12]; - -snprintf(val, sizeof(val), "%d", ival); -return xenstore_write_str(base, node, val); -} - -int xenstore_write_int64(const char *base, const char *node, int64_t ival) -{ -char val[21]; - -snprintf(val, sizeof(val), "%"PRId64, ival); -return xenstore_write_str(base, node, val); -} - -int xenstore_read_int(const char *base, const char *node, int *ival) -{ -char *val; -int rc = -1; - -val = xenstore_read_str(base, node); -if (val && 1 == sscanf(val, "%d", ival)) { -rc = 0; -} -g_free(val); -return rc; -} - -int xenstore_read_uint64(const char *base, const char *node, uint64_t *uval) -{ -char *val; -int rc = -1; - -val = xenstore_read_str(base, node); -if (val && 1 == sscanf(val, "%"SCNu64, uval)) { -rc = 0; -} -g_free(val); -return rc; -} - int xenstore_write_be_str(struct XenDevice *xendev, const char *node, const char *val) { return xenstore_write_str(xendev->be, node, val); @@ -214,20 +143,6 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node, /* - */ -const char *xenbus_strstate(enum xenbus_state state) -{ -static const char *const name[] = { -[XenbusStateUnknown] = "Unknown", -[XenbusStateInitialising] = "Initialising", -[XenbusStateInitWait] = "InitWait", -[XenbusStateInitialised] = "Initialised", -[XenbusStateConnected] = "Connected", -[XenbusStateClosing] = "Closing", -[XenbusStateClosed]= "Closed", -}; -return (state < ARRAY_SIZE(name)) ? name[state] : "INVALID"; -} - int xen_be_set_state(struct XenDevice *xendev, enum xenbus_state state) { int rc; @@ -827,45 +742,6 @@ int xen_be_send_notify(struct XenDevice *xendev) return xenevtchn_notify(xendev->evtchndev, xendev->local_port); } -/* - * msg_level: - * 0 == errors (stderr + logfile). - * 1 == informative debug messages (logfile only). - * 2 == noisy debug messages (logfile only). - * 3 == will flood your log (logfile only). - */ -void xen_be_printf(struct XenDevice *xendev, int msg_level, -const char *fm
[Xen-devel] [PATCH 13/15] xen: Rename xen_be_find_xendev
Prepare xen_be_find_xendev to be shared with frontends: * xen_be_find_xendev -> xen_pv_find_xendev Signed-off-by: Emil Condrea --- hw/display/xenfb.c | 4 ++-- hw/xen/xen_backend.c | 2 +- hw/xen/xen_pvdev.c | 2 +- include/hw/xen/xen_pvdev.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c index 9a7b298..52020b3 100644 --- a/hw/display/xenfb.c +++ b/hw/display/xenfb.c @@ -989,8 +989,8 @@ void xen_init_display(int domid) wait_more: i++; main_loop_wait(true); -xfb = xen_be_find_xendev("vfb", domid, 0); -xin = xen_be_find_xendev("vkbd", domid, 0); +xfb = xen_pv_find_xendev("vfb", domid, 0); +xin = xen_pv_find_xendev("vkbd", domid, 0); if (!xfb || !xin) { if (i < 256) { usleep(1); diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c index b6c11a1..5c41524 100644 --- a/hw/xen/xen_backend.c +++ b/hw/xen/xen_backend.c @@ -99,7 +99,7 @@ static struct XenDevice *xen_be_get_xendev(const char *type, int dom, int dev, { struct XenDevice *xendev; -xendev = xen_be_find_xendev(type, dom, dev); +xendev = xen_pv_find_xendev(type, dom, dev); if (xendev) { return xendev; } diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c index 1c2cb98..69cf7af 100644 --- a/hw/xen/xen_pvdev.c +++ b/hw/xen/xen_pvdev.c @@ -265,7 +265,7 @@ int xen_pv_send_notify(struct XenDevice *xendev) /* - */ -struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev) +struct XenDevice *xen_pv_find_xendev(const char *type, int dom, int dev) { struct XenDevice *xendev; diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h index 46560a1..550bf69 100644 --- a/include/hw/xen/xen_pvdev.h +++ b/include/hw/xen/xen_pvdev.h @@ -67,7 +67,7 @@ const char *xenbus_strstate(enum xenbus_state state); void xen_pv_evtchn_event(void *opaque); void xen_pv_insert_xendev(struct XenDevice *xendev); void xen_be_del_xendev(struct XenDevice *xendev); -struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev); +struct XenDevice *xen_pv_find_xendev(const char *type, int dom, int dev); void xen_pv_unbind_evtchn(struct XenDevice *xendev); int xen_pv_send_notify(struct XenDevice *xendev); -- 1.9.1 ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
[Xen-devel] [PATCH 09/15] xen: Rename xen_be_printf to xen_pv_printf
Prepare xen_be_printf to be used by both backend and frontends: * xen_be_printf -> xen_pv_printf Signed-off-by: Emil Condrea --- hw/block/xen_disk.c| 58 +++--- hw/char/xen_console.c | 10 hw/display/xenfb.c | 42 - hw/net/xen_nic.c | 22 +- hw/usb/xen-usb.c | 38 +++--- hw/xen/xen_backend.c | 40 hw/xen/xen_devconfig.c | 4 ++-- hw/xen/xen_frontend.c | 6 ++--- hw/xen/xen_pvdev.c | 10 include/hw/xen/xen_pvdev.h | 2 +- xen-common.c | 4 ++-- 11 files changed, 118 insertions(+), 118 deletions(-) diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c index 0b2db3b..425efba 100644 --- a/hw/block/xen_disk.c +++ b/hw/block/xen_disk.c @@ -168,12 +168,12 @@ static void destroy_grant(gpointer pgnt) xengnttab_handle *gnt = grant->blkdev->xendev.gnttabdev; if (xengnttab_unmap(gnt, grant->page, 1) != 0) { -xen_be_printf(&grant->blkdev->xendev, 0, +xen_pv_printf(&grant->blkdev->xendev, 0, "xengnttab_unmap failed: %s\n", strerror(errno)); } grant->blkdev->persistent_gnt_count--; -xen_be_printf(&grant->blkdev->xendev, 3, +xen_pv_printf(&grant->blkdev->xendev, 3, "unmapped grant %p\n", grant->page); g_free(grant); } @@ -185,11 +185,11 @@ static void remove_persistent_region(gpointer data, gpointer dev) xengnttab_handle *gnt = blkdev->xendev.gnttabdev; if (xengnttab_unmap(gnt, region->addr, region->num) != 0) { -xen_be_printf(&blkdev->xendev, 0, +xen_pv_printf(&blkdev->xendev, 0, "xengnttab_unmap region %p failed: %s\n", region->addr, strerror(errno)); } -xen_be_printf(&blkdev->xendev, 3, +xen_pv_printf(&blkdev->xendev, 3, "unmapped grant region %p with %d pages\n", region->addr, region->num); g_free(region); @@ -256,7 +256,7 @@ static int ioreq_parse(struct ioreq *ioreq) size_t len; int i; -xen_be_printf(&blkdev->xendev, 3, +xen_pv_printf(&blkdev->xendev, 3, "op %d, nr %d, handle %d, id %" PRId64 ", sector %" PRId64 "\n", ioreq->req.operation, ioreq->req.nr_segments, ioreq->req.handle, ioreq->req.id, ioreq->req.sector_number); @@ -276,28 +276,28 @@ static int ioreq_parse(struct ioreq *ioreq) case BLKIF_OP_DISCARD: return 0; default: -xen_be_printf(&blkdev->xendev, 0, "error: unknown operation (%d)\n", +xen_pv_printf(&blkdev->xendev, 0, "error: unknown operation (%d)\n", ioreq->req.operation); goto err; }; if (ioreq->req.operation != BLKIF_OP_READ && blkdev->mode[0] != 'w') { -xen_be_printf(&blkdev->xendev, 0, "error: write req for ro device\n"); +xen_pv_printf(&blkdev->xendev, 0, "error: write req for ro device\n"); goto err; } ioreq->start = ioreq->req.sector_number * blkdev->file_blk; for (i = 0; i < ioreq->req.nr_segments; i++) { if (i == BLKIF_MAX_SEGMENTS_PER_REQUEST) { -xen_be_printf(&blkdev->xendev, 0, "error: nr_segments too big\n"); +xen_pv_printf(&blkdev->xendev, 0, "error: nr_segments too big\n"); goto err; } if (ioreq->req.seg[i].first_sect > ioreq->req.seg[i].last_sect) { -xen_be_printf(&blkdev->xendev, 0, "error: first > last sector\n"); +xen_pv_printf(&blkdev->xendev, 0, "error: first > last sector\n"); goto err; } if (ioreq->req.seg[i].last_sect * BLOCK_SIZE >= XC_PAGE_SIZE) { -xen_be_printf(&blkdev->xendev, 0, "error: page crossing\n"); +xen_pv_printf(&blkdev->xendev, 0, "error: page crossing\n"); goto err; } @@ -309,7 +309,7 @@ static int ioreq_parse(struct ioreq *ioreq) qemu_iovec_add(&ioreq->v, (void*)mem, len); } if (ioreq->start + ioreq->v.size > blkdev->file_size) { -xen_be_printf(&blkdev->xendev, 0, "error: access beyond end of file\n"); +xen_pv_printf(&blkdev->xendev, 0, "error: access beyond end of file\n"); goto err; } return 0; @@ -332,7 +332,7 @@ static void ioreq_unmap(struct ioreq *ioreq) return; } if (xengnttab_unmap(gnt, ioreq->pages, ioreq->num_unmap) != 0) { -xen_be_printf(&ioreq->blkdev->xendev, 0, +xen_pv_printf(&ioreq->blkdev->xendev, 0, "xengnttab_unmap failed: %s\n", strerror(errno)); } @@ -344,7 +344,7 @@ static void ioreq_unmap(struct ioreq *ioreq) continue; } if (xengnttab_unmap(gnt, ioreq->page[i], 1) != 0) { -
[Xen-devel] [PATCH 14/15] xen: Rename xen_be_del_xendev
Prepare xen_be_del_xendev to be shared with frontends: * xen_be_del_xendev -> xen_pv_del_xendev Signed-off-by: Emil Condrea --- hw/xen/xen_backend.c | 2 +- hw/xen/xen_pvdev.c | 2 +- include/hw/xen/xen_pvdev.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c index 5c41524..30d3aaa 100644 --- a/hw/xen/xen_backend.c +++ b/hw/xen/xen_backend.c @@ -436,7 +436,7 @@ void xenstore_update_be(char *watch, char *type, int dom, if (xendev != NULL) { bepath = xs_read(xenstore, 0, xendev->be, &len); if (bepath == NULL) { -xen_be_del_xendev(xendev); +xen_pv_del_xendev(xendev); } else { free(bepath); xen_be_backend_changed(xendev, path); diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c index 69cf7af..9bc4b38 100644 --- a/hw/xen/xen_pvdev.c +++ b/hw/xen/xen_pvdev.c @@ -287,7 +287,7 @@ struct XenDevice *xen_pv_find_xendev(const char *type, int dom, int dev) /* * release xen backend device. */ -void xen_be_del_xendev(struct XenDevice *xendev) +void xen_pv_del_xendev(struct XenDevice *xendev) { if (xendev->ops->free) { xendev->ops->free(xendev); diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h index 550bf69..dfe91c1 100644 --- a/include/hw/xen/xen_pvdev.h +++ b/include/hw/xen/xen_pvdev.h @@ -66,7 +66,7 @@ const char *xenbus_strstate(enum xenbus_state state); void xen_pv_evtchn_event(void *opaque); void xen_pv_insert_xendev(struct XenDevice *xendev); -void xen_be_del_xendev(struct XenDevice *xendev); +void xen_pv_del_xendev(struct XenDevice *xendev); struct XenDevice *xen_pv_find_xendev(const char *type, int dom, int dev); void xen_pv_unbind_evtchn(struct XenDevice *xendev); -- 1.9.1 ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
[Xen-devel] [PATCH 10/15] xen: Rename xen_be_unbind_evtchn
Prepare xen_be_unbind_evtchn to be shared with frontends: * xen_be_unbind_evtchn -> xen_pv_unbind_evtchn Signed-off-by: Emil Condrea --- hw/block/xen_disk.c| 2 +- hw/char/xen_console.c | 2 +- hw/display/xenfb.c | 2 +- hw/net/xen_nic.c | 2 +- hw/usb/xen-usb.c | 2 +- hw/xen/xen_pvdev.c | 2 +- include/hw/xen/xen_pvdev.h | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c index 425efba..3688a4b 100644 --- a/hw/block/xen_disk.c +++ b/hw/block/xen_disk.c @@ -1195,7 +1195,7 @@ static void blk_disconnect(struct XenDevice *xendev) blk_unref(blkdev->blk); blkdev->blk = NULL; } -xen_be_unbind_evtchn(&blkdev->xendev); +xen_pv_unbind_evtchn(&blkdev->xendev); if (blkdev->sring) { xengnttab_unmap(blkdev->xendev.gnttabdev, blkdev->sring, 1); diff --git a/hw/char/xen_console.c b/hw/char/xen_console.c index b705a06..6dc2d81 100644 --- a/hw/char/xen_console.c +++ b/hw/char/xen_console.c @@ -265,7 +265,7 @@ static void con_disconnect(struct XenDevice *xendev) qemu_chr_add_handlers(con->chr, NULL, NULL, NULL, NULL); qemu_chr_fe_release(con->chr); } -xen_be_unbind_evtchn(&con->xendev); +xen_pv_unbind_evtchn(&con->xendev); if (con->sring) { if (!xendev->dev) { diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c index 55aca85..a86d990 100644 --- a/hw/display/xenfb.c +++ b/hw/display/xenfb.c @@ -113,7 +113,7 @@ static int common_bind(struct common *c) static void common_unbind(struct common *c) { -xen_be_unbind_evtchn(&c->xendev); +xen_pv_unbind_evtchn(&c->xendev); if (c->page) { xenforeignmemory_unmap(xen_fmem, c->page, 1); c->page = NULL; diff --git a/hw/net/xen_nic.c b/hw/net/xen_nic.c index 7418a7b..c6af5dc 100644 --- a/hw/net/xen_nic.c +++ b/hw/net/xen_nic.c @@ -373,7 +373,7 @@ static void net_disconnect(struct XenDevice *xendev) { struct XenNetDev *netdev = container_of(xendev, struct XenNetDev, xendev); -xen_be_unbind_evtchn(&netdev->xendev); +xen_pv_unbind_evtchn(&netdev->xendev); if (netdev->txs) { xengnttab_unmap(netdev->xendev.gnttabdev, netdev->txs, 1); diff --git a/hw/usb/xen-usb.c b/hw/usb/xen-usb.c index a245355..f93c73d 100644 --- a/hw/usb/xen-usb.c +++ b/hw/usb/xen-usb.c @@ -835,7 +835,7 @@ static void usbback_disconnect(struct XenDevice *xendev) usbif = container_of(xendev, struct usbback_info, xendev); -xen_be_unbind_evtchn(xendev); +xen_pv_unbind_evtchn(xendev); if (usbif->urb_sring) { xengnttab_unmap(xendev->gnttabdev, usbif->urb_sring, 1); diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c index 15bf95c..85f7430 100644 --- a/hw/xen/xen_pvdev.c +++ b/hw/xen/xen_pvdev.c @@ -247,7 +247,7 @@ void xen_be_evtchn_event(void *opaque) } } -void xen_be_unbind_evtchn(struct XenDevice *xendev) +void xen_pv_unbind_evtchn(struct XenDevice *xendev) { if (xendev->local_port == -1) { return; diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h index cf26ce5..bc8a3ea 100644 --- a/include/hw/xen/xen_pvdev.h +++ b/include/hw/xen/xen_pvdev.h @@ -69,7 +69,7 @@ void xen_pv_insert_xendev(struct XenDevice *xendev); void xen_be_del_xendev(struct XenDevice *xendev); struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev); -void xen_be_unbind_evtchn(struct XenDevice *xendev); +void xen_pv_unbind_evtchn(struct XenDevice *xendev); int xen_be_send_notify(struct XenDevice *xendev); void xen_pv_printf(struct XenDevice *xendev, int msg_level, -- 1.9.1 ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
[Xen-devel] [PATCH 15/15] xen: Rename xen_be_frontend_changed
xen_be_frontend_changed -> xen_fe_frontend_changed Signed-off-by: Emil Condrea --- hw/xen/xen_backend.c | 2 +- hw/xen/xen_frontend.c | 4 ++-- include/hw/xen/xen_frontend.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c index 30d3aaa..b79e83e 100644 --- a/hw/xen/xen_backend.c +++ b/hw/xen/xen_backend.c @@ -213,7 +213,7 @@ static int xen_be_try_setup(struct XenDevice *xendev) xen_be_set_state(xendev, XenbusStateInitialising); xen_be_backend_changed(xendev, NULL); -xen_be_frontend_changed(xendev, NULL); +xen_fe_frontend_changed(xendev, NULL); return 0; } diff --git a/hw/xen/xen_frontend.c b/hw/xen/xen_frontend.c index 1407f5f..761688b 100644 --- a/hw/xen/xen_frontend.c +++ b/hw/xen/xen_frontend.c @@ -39,7 +39,7 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node, return xenstore_read_uint64(xendev->fe, node, uval); } -void xen_be_frontend_changed(struct XenDevice *xendev, const char *node) +void xen_fe_frontend_changed(struct XenDevice *xendev, const char *node) { int fe_state; @@ -85,6 +85,6 @@ void xenstore_update_fe(char *watch, struct XenDevice *xendev) } node = watch + len + 1; -xen_be_frontend_changed(xendev, node); +xen_fe_frontend_changed(xendev, node); xen_be_check_state(xendev); } diff --git a/include/hw/xen/xen_frontend.h b/include/hw/xen/xen_frontend.h index bb0bc23..2a5f03f 100644 --- a/include/hw/xen/xen_frontend.h +++ b/include/hw/xen/xen_frontend.h @@ -9,6 +9,6 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node, uint64_t *uval); void xenstore_update_fe(char *watch, struct XenDevice *xendev); -void xen_be_frontend_changed(struct XenDevice *xendev, const char *node); +void xen_fe_frontend_changed(struct XenDevice *xendev, const char *node); #endif /* QEMU_HW_XEN_FRONTEND_H */ -- 1.9.1 ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
[Xen-devel] [PATCH 12/15] xen: Rename xen_be_evtchn_event
Prepare xen_be_evtchn_event to be shared with frontends: * xen_be_evtchn_event -> xen_pv_evtchn_event Signed-off-by: Emil Condrea --- hw/xen/xen_backend.c | 2 +- hw/xen/xen_pvdev.c | 2 +- include/hw/xen/xen_pvdev.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c index 97869cf..b6c11a1 100644 --- a/hw/xen/xen_backend.c +++ b/hw/xen/xen_backend.c @@ -517,7 +517,7 @@ int xen_be_bind_evtchn(struct XenDevice *xendev) } xen_pv_printf(xendev, 2, "bind evtchn port %d\n", xendev->local_port); qemu_set_fd_handler(xenevtchn_fd(xendev->evtchndev), -xen_be_evtchn_event, NULL, xendev); +xen_pv_evtchn_event, NULL, xendev); return 0; } diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c index 61e40c9..1c2cb98 100644 --- a/hw/xen/xen_pvdev.c +++ b/hw/xen/xen_pvdev.c @@ -228,7 +228,7 @@ void xen_pv_printf(struct XenDevice *xendev, int msg_level, qemu_log_flush(); } -void xen_be_evtchn_event(void *opaque) +void xen_pv_evtchn_event(void *opaque) { struct XenDevice *xendev = opaque; evtchn_port_t port; diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h index 0ebcda7..46560a1 100644 --- a/include/hw/xen/xen_pvdev.h +++ b/include/hw/xen/xen_pvdev.h @@ -64,7 +64,7 @@ void xenstore_update(void *unused); const char *xenbus_strstate(enum xenbus_state state); -void xen_be_evtchn_event(void *opaque); +void xen_pv_evtchn_event(void *opaque); void xen_pv_insert_xendev(struct XenDevice *xendev); void xen_be_del_xendev(struct XenDevice *xendev); struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev); -- 1.9.1 ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
[Xen-devel] [PATCH 08/15] xen: Move xenstore cleanup and mkdir functions
The name of the functions moved to xen_pvdev.c: * xenstore_cleanup_dir * xen_config_cleanup * xenstore_mkdir Signed-off-by: Emil Condrea --- hw/xen/xen_backend.c | 49 - hw/xen/xen_pvdev.c | 51 +++ 2 files changed, 51 insertions(+), 49 deletions(-) diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c index d572cd0..3518aac 100644 --- a/hw/xen/xen_backend.c +++ b/hw/xen/xen_backend.c @@ -48,57 +48,8 @@ struct xs_handle *xenstore = NULL; const char *xen_protocol; /* private */ -struct xs_dirs { -char *xs_dir; -QTAILQ_ENTRY(xs_dirs) list; -}; -static QTAILQ_HEAD(xs_dirs_head, xs_dirs) xs_cleanup = -QTAILQ_HEAD_INITIALIZER(xs_cleanup); - static int debug; -static void xenstore_cleanup_dir(char *dir) -{ -struct xs_dirs *d; - -d = g_malloc(sizeof(*d)); -d->xs_dir = dir; -QTAILQ_INSERT_TAIL(&xs_cleanup, d, list); -} - -void xen_config_cleanup(void) -{ -struct xs_dirs *d; - -QTAILQ_FOREACH(d, &xs_cleanup, list) { -xs_rm(xenstore, 0, d->xs_dir); -} -} - -int xenstore_mkdir(char *path, int p) -{ -struct xs_permissions perms[2] = { -{ -.id= 0, /* set owner: dom0 */ -}, { -.id= xen_domid, -.perms = p, -} -}; - -if (!xs_mkdir(xenstore, 0, path)) { -xen_be_printf(NULL, 0, "xs_mkdir %s: failed\n", path); -return -1; -} -xenstore_cleanup_dir(g_strdup(path)); - -if (!xs_set_permissions(xenstore, 0, path, perms, 2)) { -xen_be_printf(NULL, 0, "xs_set_permissions %s: failed\n", path); -return -1; -} -return 0; -} - int xenstore_write_be_str(struct XenDevice *xendev, const char *node, const char *val) { return xenstore_write_str(xendev->be, node, val); diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c index 72e2e79..6c92624 100644 --- a/hw/xen/xen_pvdev.c +++ b/hw/xen/xen_pvdev.c @@ -25,11 +25,62 @@ /* private */ static int debug; + +struct xs_dirs { +char *xs_dir; +QTAILQ_ENTRY(xs_dirs) list; +}; + +static QTAILQ_HEAD(xs_dirs_head, xs_dirs) xs_cleanup = +QTAILQ_HEAD_INITIALIZER(xs_cleanup); + static QTAILQ_HEAD(XenDeviceHead, XenDevice) xendevs = QTAILQ_HEAD_INITIALIZER(xendevs); /* - */ +static void xenstore_cleanup_dir(char *dir) +{ +struct xs_dirs *d; + +d = g_malloc(sizeof(*d)); +d->xs_dir = dir; +QTAILQ_INSERT_TAIL(&xs_cleanup, d, list); +} + +void xen_config_cleanup(void) +{ +struct xs_dirs *d; + +QTAILQ_FOREACH(d, &xs_cleanup, list) { +xs_rm(xenstore, 0, d->xs_dir); +} +} + +int xenstore_mkdir(char *path, int p) +{ +struct xs_permissions perms[2] = { +{ +.id= 0, /* set owner: dom0 */ +}, { +.id= xen_domid, +.perms = p, +} +}; + +if (!xs_mkdir(xenstore, 0, path)) { +xen_be_printf(NULL, 0, "xs_mkdir %s: failed\n", path); +return -1; +} +xenstore_cleanup_dir(g_strdup(path)); + +if (!xs_set_permissions(xenstore, 0, path, perms, 2)) { +xen_be_printf(NULL, 0, "xs_set_permissions %s: failed\n", path); +return -1; +} +return 0; +} + int xenstore_write_str(const char *base, const char *node, const char *val) { char abspath[XEN_BUFSIZE]; -- 1.9.1 ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
[Xen-devel] [PATCH 05/15] xen: Move xenstore_update to xen_pvdev.c
* xenstore_update -> xen_pvdev.c * xenstore_update_fe -> xen_frontend.c Signed-off-by: Emil Condrea --- hw/xen/xen_backend.c | 43 +-- hw/xen/xen_frontend.c | 18 ++ hw/xen/xen_pvdev.c| 24 include/hw/xen/xen_backend.h | 2 ++ include/hw/xen/xen_frontend.h | 1 + include/hw/xen/xen_pvdev.h| 1 + 6 files changed, 47 insertions(+), 42 deletions(-) diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c index d4880e1..6b03c50 100644 --- a/hw/xen/xen_backend.c +++ b/hw/xen/xen_backend.c @@ -509,7 +509,7 @@ static int xenstore_scan(const char *type, int dom, struct XenDevOps *ops) return 0; } -static void xenstore_update_be(char *watch, char *type, int dom, +void xenstore_update_be(char *watch, char *type, int dom, struct XenDevOps *ops) { struct XenDevice *xendev; @@ -543,47 +543,6 @@ static void xenstore_update_be(char *watch, char *type, int dom, } } -static void xenstore_update_fe(char *watch, struct XenDevice *xendev) -{ -char *node; -unsigned int len; - -len = strlen(xendev->fe); -if (strncmp(xendev->fe, watch, len) != 0) { -return; -} -if (watch[len] != '/') { -return; -} -node = watch + len + 1; - -xen_be_frontend_changed(xendev, node); -xen_be_check_state(xendev); -} - -static void xenstore_update(void *unused) -{ -char **vec = NULL; -intptr_t type, ops, ptr; -unsigned int dom, count; - -vec = xs_read_watch(xenstore, &count); -if (vec == NULL) { -goto cleanup; -} - -if (sscanf(vec[XS_WATCH_TOKEN], "be:%" PRIxPTR ":%d:%" PRIxPTR, - &type, &dom, &ops) == 3) { -xenstore_update_be(vec[XS_WATCH_PATH], (void *)type, dom, (void*)ops); -} -if (sscanf(vec[XS_WATCH_TOKEN], "fe:%" PRIxPTR, &ptr) == 1) { -xenstore_update_fe(vec[XS_WATCH_PATH], (void *)ptr); -} - -cleanup: -free(vec); -} - static void xen_be_evtchn_event(void *opaque) { struct XenDevice *xendev = opaque; diff --git a/hw/xen/xen_frontend.c b/hw/xen/xen_frontend.c index c8ff9ae..d42e57b 100644 --- a/hw/xen/xen_frontend.c +++ b/hw/xen/xen_frontend.c @@ -70,3 +70,21 @@ void xen_be_frontend_changed(struct XenDevice *xendev, const char *node) } } } + +void xenstore_update_fe(char *watch, struct XenDevice *xendev) +{ +char *node; +unsigned int len; + +len = strlen(xendev->fe); +if (strncmp(xendev->fe, watch, len) != 0) { +return; +} +if (watch[len] != '/') { +return; +} +node = watch + len + 1; + +xen_be_frontend_changed(xendev, node); +xen_be_check_state(xendev); +} diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c index 78960a9..35d3be6 100644 --- a/hw/xen/xen_pvdev.c +++ b/hw/xen/xen_pvdev.c @@ -20,6 +20,7 @@ #include "qemu/osdep.h" #include "hw/xen/xen_backend.h" +#include "hw/xen/xen_frontend.h" #include "hw/xen/xen_pvdev.h" static int debug; @@ -95,6 +96,29 @@ int xenstore_read_uint64(const char *base, const char *node, uint64_t *uval) return rc; } +void xenstore_update(void *unused) +{ +char **vec = NULL; +intptr_t type, ops, ptr; +unsigned int dom, count; + +vec = xs_read_watch(xenstore, &count); +if (vec == NULL) { +goto cleanup; +} + +if (sscanf(vec[XS_WATCH_TOKEN], "be:%" PRIxPTR ":%d:%" PRIxPTR, + &type, &dom, &ops) == 3) { +xenstore_update_be(vec[XS_WATCH_PATH], (void *)type, dom, (void*)ops); +} +if (sscanf(vec[XS_WATCH_TOKEN], "fe:%" PRIxPTR, &ptr) == 1) { +xenstore_update_fe(vec[XS_WATCH_PATH], (void *)ptr); +} + +cleanup: +free(vec); +} + const char *xenbus_strstate(enum xenbus_state state) { static const char *const name[] = { diff --git a/include/hw/xen/xen_backend.h b/include/hw/xen/xen_backend.h index ffd8772..965a39a 100644 --- a/include/hw/xen/xen_backend.h +++ b/include/hw/xen/xen_backend.h @@ -19,6 +19,8 @@ int xenstore_write_be_int(struct XenDevice *xendev, const char *node, int ival); int xenstore_write_be_int64(struct XenDevice *xendev, const char *node, int64_t ival); char *xenstore_read_be_str(struct XenDevice *xendev, const char *node); int xenstore_read_be_int(struct XenDevice *xendev, const char *node, int *ival); +void xenstore_update_be(char *watch, char *type, int dom, + struct XenDevOps *ops); struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev); void xen_be_check_state(struct XenDevice *xendev); diff --git a/include/hw/xen/xen_frontend.h b/include/hw/xen/xen_frontend.h index 86243b9..69a7694 100644 --- a/include/hw/xen/xen_frontend.h +++ b/include/hw/xen/xen_frontend.h @@ -5,6 +5,7 @@ char *xenstore_read_fe_str(struct XenDevice *xendev, const char *node); int xenstore_read_fe_int(struct XenDevice *xendev, const char *node, int *ival); int xenstore_read_fe_ui
Re: [Xen-devel] [PATCH v2 12/30] xen/x86: make print_e820_memory_map global
>>> On 03.10.16 at 18:23, wrote: > On Fri, Sep 30, 2016 at 09:04:24AM -0600, Jan Beulich wrote: >> >>> On 27.09.16 at 17:57, wrote: >> > So that it can be called from the Dom0 builder. >> >> Why would the Dom0 builder need to call it, when it doesn't so far? > > IMHO, I find it useful to print the domain 0 memory map during creation. It > wasn't useful for a PV Dom0, because the PV Dom0 memory map is just the > native memory map, which is already printed earlier during the boot process. > If it doesn't seem useful to you or others I can leave it out. Well, I don't mean to nack the change if others agree with you. If this is to be made more widely available, it would want its first parameter constified though. Jan ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
Re: [Xen-devel] [Qemu-devel] [v9 00/19] QEMU:Xen stubdom vTPM for HVM virtual machine(QEMU Part)
Anthony, I've split the reorganization and code style issues in a separate patch series which I've posted today: http://markmail.org/message/feu6u3f7py5vt77v Thanks On Mon, Jul 25, 2016 at 5:09 PM, Anthony PERARD wrote: > On Sun, Jul 10, 2016 at 02:47:31PM +0300, Emil Condrea wrote: >> Emil Condrea (19): >> xen: Create a new file xen_pvdev.c >> xen: Create a new file xen_frontend.c >> xen: Move xenstore_update to xen_pvdev.c >> xen: Move evtchn functions to xen_pvdev.c >> xen: Prepare xendev qtail to be shared with frontends >> xen: Rename xen_be_printf to xen_pv_printf >> xen: Rename xen_be_unbind_evtchn >> xen: Rename xen_be_send_notify >> xen: Rename xen_be_evtchn_event >> xen: Rename xen_be_find_xendev >> xen: Rename xen_be_del_xendev >> xen: Rename xen_be_frontend_changed > > Patches from 1 to 12 looks fine but ./script/checkpatch.pl reveal some > coding style issue in the code that is moved. Could you fix those issues > in separate patches? (Having separate patches for code movement and for > coding style fix makes it easier to review.) > > I'll start reviewing the more complicated patches now. > > Thanks, > > -- > Anthony PERARD ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
Re: [Xen-devel] [PATCH v2 11/30] xen/x86: split Dom0 build into PV and PVHv2
>>> On 03.10.16 at 12:09, wrote: > I've added the following patch to my queue, in order to allow the user to > select whether they want to use HAP or shadow, I've tested it locally and > there seems to be no issues in building a PVHv2 Dom0 using shadow. Hmm, two remarks: For one, I'm not convinced of the need to move the definition. It being where it is now allows the string literal to be discarded post boot. And considering that the option has presumably been broken for PV for a long time and was never working for PVHv1, I'm also unconvinced using it (and hence retaining its existence) is a good idea - I'd much rather see "dom0hvm=hap" and "dom0hvm=shadow" supported along with the booleans which can be given to it right now. > --- a/xen/include/asm-x86/setup.h > +++ b/xen/include/asm-x86/setup.h > @@ -51,6 +51,12 @@ void microcode_grab_module( > > extern uint8_t kbd_shift_flags; > > +#ifdef CONFIG_SHADOW_PAGING > +extern bool opt_dom0_shadow; > +#else > +#define opt_dom0_shadow 0 Please use "false" here. Jan ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel