History

Merge tag 'for-linus-4.16a-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip

Pull xen fixes from Juergen Gross: "Five minor fixes for Xen-specific drivers" * tag 'for-linus-4.16a-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: pvcalls-front: 64-bit align flags x86/xen: add tty0 and hvc0 as preferred consoles for dom0 xen-netfront: Fix hang on device removal xen/pirq: fix error path cleanup when binding MSIs xen/pvcalls: fix null pointer dereference on map->sock

Linus Torvalds committed 8 years ago

Commit 0573fed2 parents 2833419 d811bce5 files · +21 −9Browse files

Unified · Split

5 files
  1. arch/x86/xen/enlighten_pv.c +4 −2
  2. drivers/net/xen-netfront.c +6 −1
  3. drivers/xen/events/events_base.c +2 −2
  4. drivers/xen/pvcalls-back.c +1 −1
  5. drivers/xen/pvcalls-front.c +8 −3
arch/x86/xen/enlighten_pv.c+4−2
@@ -1376,8 +1376,6 @@ asmlinkage __visible void __init xen_start_kernel(void) · 1375 unmodified lines
13761376
13771377 if (!xen_initial_domain()) {
13781378 add_preferred_console("xenboot", 0, NULL);
1379− add_preferred_console("tty", 0, NULL);
1380− add_preferred_console("hvc", 0, NULL);
13811379 if (pci_xen)
13821380 x86_init.pci.arch_init = pci_xen_init;
13831381 } else {
@@ -1410,6 +1408,10 @@ asmlinkage __visible void __init xen_start_kernel(void) · 26 unmodified lines
14101408
14111409 xen_boot_params_init_edd();
14121410 }
1411+
1412+ add_preferred_console("tty", 0, NULL);
1413+ add_preferred_console("hvc", 0, NULL);
1414+
14131415 #ifdef CONFIG_PCI
14141416 /* PCI BIOS service won't work from a PV guest. */
14151417 pci_probe &= ~PCI_PROBE_BIOS;
drivers/net/xen-netfront.c+6−1
@@ -2005,7 +2005,10 @@ static void netback_changed(struct xenbus_device *dev, · 2004 unmodified lines
20052005 case XenbusStateInitialised:
20062006 case XenbusStateReconfiguring:
20072007 case XenbusStateReconfigured:
2008+ break;
2009+
20082010 case XenbusStateUnknown:
2011+ wake_up_all(&module_unload_q);
20092012 break;
20102013
20112014 case XenbusStateInitWait:
@@ -2136,7 +2139,9 @@ static int xennet_remove(struct xenbus_device *dev) · 124 unmodified lines
21362139 xenbus_switch_state(dev, XenbusStateClosing);
21372140 wait_event(module_unload_q,
21382141 xenbus_read_driver_state(dev->otherend) ==
2139− XenbusStateClosing);
2142+ XenbusStateClosing ||
2143+ xenbus_read_driver_state(dev->otherend) ==
2144+ XenbusStateUnknown);
21402145
21412146 xenbus_switch_state(dev, XenbusStateClosed);
21422147 wait_event(module_unload_q,
drivers/xen/events/events_base.c+2−2
@@ -755,8 +755,8 @@ out: · 754 unmodified lines
755755 mutex_unlock(&irq_mapping_update_lock);
756756 return irq;
757757 error_irq:
758− for (; i >= 0; i--)
759− __unbind_from_irq(irq + i);
758+ while (nvec--)
759+ __unbind_from_irq(irq + nvec);
760760 mutex_unlock(&irq_mapping_update_lock);
761761 return ret;
762762 }
drivers/xen/pvcalls-back.c+1−1
@@ -416,7 +416,7 @@ static int pvcalls_back_connect(struct xenbus_device *dev, · 415 unmodified lines
416416 sock);
417417 if (!map) {
418418 ret = -EFAULT;
419− sock_release(map->sock);
419+ sock_release(sock);
420420 }
421421
422422 out:
drivers/xen/pvcalls-front.c+8−3
@@ -73,20 +73,25 @@ struct sock_mapping { · 72 unmodified lines
7373 wait_queue_head_t inflight_conn_req;
7474 } active;
7575 struct {
76− /* Socket status */
76+ /*
77+ * Socket status, needs to be 64-bit aligned due to the
78+ * test_and_* functions which have this requirement on arm64.
79+ */
7780 #define PVCALLS_STATUS_UNINITALIZED 0
7881 #define PVCALLS_STATUS_BIND 1
7982 #define PVCALLS_STATUS_LISTEN 2
80− uint8_t status;
83+ uint8_t status __attribute__((aligned(8)));
8184 /*
8285 * Internal state-machine flags.
8386 * Only one accept operation can be inflight for a socket.
8487 * Only one poll operation can be inflight for a given socket.
88+ * flags needs to be 64-bit aligned due to the test_and_*
89+ * functions which have this requirement on arm64.
8590 */
8691 #define PVCALLS_FLAG_ACCEPT_INFLIGHT 0
8792 #define PVCALLS_FLAG_POLL_INFLIGHT 1
8893 #define PVCALLS_FLAG_POLL_RET 2
89− uint8_t flags;
94+ uint8_t flags __attribute__((aligned(8)));
9095 uint32_t inflight_req_id;
9196 struct sock_mapping *accept_map;
9297 wait_queue_head_t inflight_accept_req;