All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olaf Hering <olaf@aepfle.de>
To: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: xen-devel@lists.xenproject.org, Olaf Hering <ohering@suse.de>
Subject: [PATCH qemu-xen-traditional 2/2] xen_platform: SUSE xenlinux unplug for emulated PCI
Date: Thu, 24 Nov 2016 20:11:30 +0000	[thread overview]
Message-ID: <20161124201130.16558-3-olaf@aepfle.de> (raw)
In-Reply-To: <20161124201130.16558-1-olaf@aepfle.de>

From: Olaf Hering <ohering@suse.de>

Implement SUSE specific unplug protocol for emulated PCI devices
in PVonHVM guests. Its a simple 'outl(1, (ioaddr + 4));'.
This protocol was implemented and used since Xen 3.0.4.
It is used in all SUSE/SLES/openSUSE releases up to SLES11SP3 and
openSUSE 12.3.
In addition old (pre-2011) VMDP versions are handled as well.

Upstream commit 35132016dc1c27de2b1354b161df6cc22f3ac5bf

Signed-off-by: Olaf Hering <ohering@suse.de>
---
 hw/xen_platform.c | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/hw/xen_platform.c b/hw/xen_platform.c
index 0a94e0d..3c2fc0e 100644
--- a/hw/xen_platform.c
+++ b/hw/xen_platform.c
@@ -337,9 +337,42 @@ static void xen_platform_ioport_writeb(void *opaque, uint32_t addr, uint32_t val
     }
 }
 
+static void suse_platform_ioport_writel(void *opaque, uint32_t addr, uint32_t val)
+{
+    addr &= 0x0f;
+    switch (addr) {
+    case 4:
+        /*
+         * SUSE unplug for Xenlinux
+         * xen-kmp used this since xen-3.0.4, instead the official protocol
+         * from xen-3.3+ It did an unconditional "outl(1, (ioaddr + 4));"
+         * Pre VMDP 1.7 used 4 and 8 depending on how VMDP was configured.
+         * If VMDP was to control both disk and LAN it would use 4.
+         * If it controlled just disk or just LAN, it would use 8 below.
+         * */
+        ide_unplug_harddisks();
+        pci_unplug_scsi();
+        pci_unplug_netifs();
+        net_tap_shutdown_all();
+        break;
+    case 8:
+        if (val ==1 ) {
+            ide_unplug_harddisks();
+            pci_unplug_scsi();
+        } else if (val == 2) {
+            pci_unplug_netifs();
+            net_tap_shutdown_all();
+        }
+        break;
+    default:
+        break;
+    }
+}
+
 static void platform_ioport_map(PCIDevice *pci_dev, int region_num, uint32_t addr, uint32_t size, int type)
 {
     PCIXenPlatformState *d = (PCIXenPlatformState *)pci_dev;
+    register_ioport_write(addr, 16, 4, suse_platform_ioport_writel, d);
     register_ioport_write(addr, size, 1, xen_platform_ioport_writeb, d);
     register_ioport_read(addr, size, 1, xen_platform_ioport_readb, d);
 }

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2016-11-24 20:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-24 20:11 [PATCH qemu-xen-traditional 0/2] Xen HVM unplug changes Olaf Hering
2016-11-24 20:11 ` [PATCH qemu-xen-traditional 1/2] xen_platform: unplug also SCSI disks Olaf Hering
2016-11-24 20:11 ` Olaf Hering [this message]
2017-01-09 14:34   ` [PATCH qemu-xen-traditional 1/2] xen_platform: unplug also SCSI disks [and 1 more messages] Ian Jackson
2017-01-09 16:39     ` Olaf Hering
2017-01-10 10:34       ` George Dunlap
2017-01-31 17:14         ` Olaf Hering
2017-01-31 17:32           ` Ian Jackson
2017-01-31 17:44             ` Olaf Hering
2017-01-09 11:23 ` [PATCH qemu-xen-traditional 0/2] Xen HVM unplug changes Olaf Hering
2017-01-09 14:26   ` Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161124201130.16558-3-olaf@aepfle.de \
    --to=olaf@aepfle.de \
    --cc=ian.jackson@eu.citrix.com \
    --cc=ohering@suse.de \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.