]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Revert "Merge branch 'stable/for-linus-3.7' into linux-next"
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Fri, 21 Sep 2012 18:55:28 +0000 (14:55 -0400)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Fri, 21 Sep 2012 18:55:55 +0000 (14:55 -0400)
This reverts commit f4f55c300e360cd4ebbc4b465376b46bedae3d59, reversing
changes made to 7a97c2ab334bfadb9ec713c7057f316871cfc17f.

When launching a PVHVM guest on Xen 4.1, we get:
 privcmd_fault: vma=ffff88002a31dce8 7f4edc095000-7f4edc195000, pgoff=c8, uv=00007f4edc15d000

and the guest is killed.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
drivers/net/xen-netback/netback.c
drivers/xen/grant-table.c
drivers/xen/xenbus/xenbus_client.c
include/xen/grant_table.h

index 05593d8820233b72681af9f76510cdc9a5eefb52..682633bfe00ff7fc35c7be97c427a6cf5d9dde45 100644 (file)
@@ -635,7 +635,9 @@ static void xen_netbk_rx_action(struct xen_netbk *netbk)
                return;
 
        BUG_ON(npo.copy_prod > ARRAY_SIZE(netbk->grant_copy_op));
-       gnttab_batch_copy(netbk->grant_copy_op, npo.copy_prod);
+       ret = HYPERVISOR_grant_table_op(GNTTABOP_copy, &netbk->grant_copy_op,
+                                       npo.copy_prod);
+       BUG_ON(ret != 0);
 
        while ((skb = __skb_dequeue(&rxq)) != NULL) {
                sco = (struct skb_cb_overlay *)skb->cb;
@@ -1458,15 +1460,18 @@ static void xen_netbk_tx_submit(struct xen_netbk *netbk)
 static void xen_netbk_tx_action(struct xen_netbk *netbk)
 {
        unsigned nr_gops;
+       int ret;
 
        nr_gops = xen_netbk_tx_build_gops(netbk);
 
        if (nr_gops == 0)
                return;
-
-       gnttab_batch_copy(netbk->tx_copy_ops, nr_gops);
+       ret = HYPERVISOR_grant_table_op(GNTTABOP_copy,
+                                       netbk->tx_copy_ops, nr_gops);
+       BUG_ON(ret);
 
        xen_netbk_tx_submit(netbk);
+
 }
 
 static void xen_netbk_idx_release(struct xen_netbk *netbk, u16 pending_idx)
index b2b0a375b3484b162b0c2ebc6cd09d5584f8ec60..f37faf6eac130cb92411def10d34fc2ffa3c7d0a 100644 (file)
@@ -38,7 +38,6 @@
 #include <linux/vmalloc.h>
 #include <linux/uaccess.h>
 #include <linux/io.h>
-#include <linux/delay.h>
 #include <linux/hardirq.h>
 
 #include <xen/xen.h>
@@ -824,52 +823,6 @@ unsigned int gnttab_max_grant_frames(void)
 }
 EXPORT_SYMBOL_GPL(gnttab_max_grant_frames);
 
-/* Handling of paged out grant targets (GNTST_eagain) */
-#define MAX_DELAY 256
-static inline void
-gnttab_retry_eagain_gop(unsigned int cmd, void *gop, int16_t *status,
-                                               const char *func)
-{
-       unsigned delay = 1;
-
-       do {
-               BUG_ON(HYPERVISOR_grant_table_op(cmd, gop, 1));
-               if (*status == GNTST_eagain)
-                       msleep(delay++);
-       } while ((*status == GNTST_eagain) && (delay < MAX_DELAY));
-
-       if (delay >= MAX_DELAY) {
-               printk(KERN_ERR "%s: %s eagain grant\n", func, current->comm);
-               *status = GNTST_bad_page;
-       }
-}
-
-void gnttab_batch_map(struct gnttab_map_grant_ref *batch, unsigned count)
-{
-       struct gnttab_map_grant_ref *op;
-
-       if (HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, batch, count))
-               BUG();
-       for (op = batch; op < batch + count; op++)
-               if (op->status == GNTST_eagain)
-                       gnttab_retry_eagain_gop(GNTTABOP_map_grant_ref, op,
-                                               &op->status, __func__);
-}
-EXPORT_SYMBOL_GPL(gnttab_batch_map);
-
-void gnttab_batch_copy(struct gnttab_copy *batch, unsigned count)
-{
-       struct gnttab_copy *op;
-
-       if (HYPERVISOR_grant_table_op(GNTTABOP_copy, batch, count))
-               BUG();
-       for (op = batch; op < batch + count; op++)
-               if (op->status == GNTST_eagain)
-                       gnttab_retry_eagain_gop(GNTTABOP_copy, op,
-                                               &op->status, __func__);
-}
-EXPORT_SYMBOL_GPL(gnttab_batch_copy);
-
 int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops,
                    struct gnttab_map_grant_ref *kmap_ops,
                    struct page **pages, unsigned int count)
@@ -883,12 +836,6 @@ int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops,
        if (ret)
                return ret;
 
-       /* Retry eagain maps */
-       for (i = 0; i < count; i++)
-               if (map_ops[i].status == GNTST_eagain)
-                       gnttab_retry_eagain_gop(GNTTABOP_map_grant_ref, map_ops + i,
-                                               &map_ops[i].status, __func__);
-
        if (xen_feature(XENFEAT_auto_translated_physmap))
                return ret;
 
index bcf3ba4a6ec1543a7500ef0de36269dec1ff728d..b3e146edb51d947b3bb7d22b63e52fac32adcbc3 100644 (file)
@@ -490,7 +490,8 @@ static int xenbus_map_ring_valloc_pv(struct xenbus_device *dev,
 
        op.host_addr = arbitrary_virt_to_machine(pte).maddr;
 
-       gnttab_batch_map(&op, 1);
+       if (HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, &op, 1))
+               BUG();
 
        if (op.status != GNTST_okay) {
                free_vm_area(area);
@@ -571,7 +572,8 @@ int xenbus_map_ring(struct xenbus_device *dev, int gnt_ref,
        gnttab_set_map_op(&op, (unsigned long)vaddr, GNTMAP_host_map, gnt_ref,
                          dev->otherend_id);
 
-       gnttab_batch_map(&op, 1);
+       if (HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, &op, 1))
+               BUG();
 
        if (op.status != GNTST_okay) {
                xenbus_dev_fatal(dev, op.status,
index aecee9d112cbe6aea2532652c8c3f768bb829cce..f19fff8650e93075aae1717034f29898f1199646 100644 (file)
@@ -190,16 +190,4 @@ int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops,
                      struct gnttab_map_grant_ref *kunmap_ops,
                      struct page **pages, unsigned int count);
 
-/* Perform a batch of grant map/copy operations. Retry every batch slot
- * for which the hypervisor returns GNTST_eagain. This is typically due
- * to paged out target frames.
- *
- * Will retry for 1, 2, ... 255 ms, i.e. 256 times during 32 seconds.
- *
- * Return value in each iand every status field of the batch guaranteed
- * to not be GNTST_eagain.
- */
-void gnttab_batch_map(struct gnttab_map_grant_ref *batch, unsigned count);
-void gnttab_batch_copy(struct gnttab_copy *batch, unsigned count);
-
 #endif /* __ASM_GNTTAB_H__ */