- bnc#837585 - xen* pkg update DISables xencommons and

`xendomains` systemd services 
  xen.spec

- remove unneeded patch, autoload is handled by PCI device, without
  PCI device xen_platform_pci would not work anyway
  xen.sles11sp1.fate311487.xen_platform_pci.dmistring.patch

- Update our xen-3.0.4 version of unplug code in qemu-trad
  add comments about the usage of the code
  rename handler function
  reenable handlers for writing/reading from emulated PCI device

- Change unplugging of emulated devices in PVonHVM guests
  Since 3.0.4 xen-platform-pci.ko triggerd the unplug by writing
  to the PCI space of the emulated PCI device. 3.3 introduced an
  official unplug protocol. The option to unplug wit the official
  protocol is disabled per default.
  Remove our version and enable the unplug via official protocol

OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=268
This commit is contained in:
Charles Arnold 2013-09-03 22:22:05 +00:00 committed by Git OBS Bridge
parent 0891920741
commit 86c3c4dd54
5 changed files with 91 additions and 69 deletions

View File

@ -1,14 +1,39 @@
--- a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
+++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
@@ -419,6 +419,11 @@ static int __devinit platform_pci_init(s
platform_mmio = mmio_addr;
platform_mmiolen = mmio_len;
From: Olaf Hering <olaf@aepfle.de>
Subject: [PATCH v2] unmodified_drivers: enable unplug per default
+ /*
+ * Disconnect the emulated devices.
+ */
+ outl(1, (ioaddr + 4));
Since xen-3.3 an official unplug protocol for emulated hardware is
available in the toolstack. The pvops kernel does the unplug per
default, so it is safe to do it also in the drivers for forward ported
xenlinux.
Currently its required to load xen-platform-pci with the module
parameter dev_unplug=all, which is cumbersome.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
unmodified_drivers/linux-2.6/platform-pci/platform-pci.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
Index: xen-4.3.0-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
===================================================================
--- xen-4.3.0-testing.orig/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
+++ xen-4.3.0-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
@@ -67,7 +67,7 @@ MODULE_LICENSE("GPL");
static char *dev_unplug;
module_param(dev_unplug, charp, 0644);
MODULE_PARM_DESC(dev_unplug, "Emulated devices to unplug: "
- "[all,][ide-disks,][aux-ide-disks,][nics]\n");
+ "[all,][ide-disks,][aux-ide-disks,][nics] (default is 'all')\n");
struct pci_dev *xen_platform_pdev;
@@ -291,6 +291,10 @@ static int check_platform_magic(struct d
short magic, unplug = 0;
char protocol, *p, *q, *err;
+ /* Unconditionally unplug everything */
+ if (!dev_unplug)
+ unplug = UNPLUG_ALL;
+
ret = init_hypercall_stubs();
if (ret < 0)
goto out;
for (p = dev_unplug; p; p = q) {
q = strchr(dev_unplug, ',');
if (q)

View File

@ -1,3 +1,35 @@
-------------------------------------------------------------------
Tue Sep 3 16:23:16 MDT 2013 - carnold@suse.com
- bnc#837585 - xen* pkg update DISables `xencommons` and
`xendomains` systemd services
xen.spec
-------------------------------------------------------------------
Fri Aug 30 20:11:46 CEST 2013 - ohering@suse.de
- remove unneeded patch, autoload is handled by PCI device, without
PCI device xen_platform_pci would not work anyway
xen.sles11sp1.fate311487.xen_platform_pci.dmistring.patch
-------------------------------------------------------------------
Fri Aug 30 20:07:41 CEST 2013 - ohering@suse.de
- Update our xen-3.0.4 version of unplug code in qemu-trad
add comments about the usage of the code
rename handler function
reenable handlers for writing/reading from emulated PCI device
-------------------------------------------------------------------
Fri Aug 30 19:51:03 CEST 2013 - ohering@suse.de
- Change unplugging of emulated devices in PVonHVM guests
Since 3.0.4 xen-platform-pci.ko triggerd the unplug by writing
to the PCI space of the emulated PCI device. 3.3 introduced an
official unplug protocol. The option to unplug wit the official
protocol is disabled per default.
Remove our version and enable the unplug via official protocol
-------------------------------------------------------------------
Fri Aug 30 08:11:55 MDT 2013 - carnold@suse.com

View File

@ -1,40 +0,0 @@
References: fate#311487
Provide a modalias entry in xen-plaform-pci.ko to allow early autoloading in
initrd based on /sys/class/dmi/id/modalias
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
unmodified_drivers/linux-2.6/platform-pci/platform-pci.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
--- a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
+++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
@@ -27,6 +27,7 @@
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/version.h>
+#include <linux/dmi.h>
#include <linux/interrupt.h>
#include <linux/vmalloc.h>
#include <linux/mm.h>
@@ -472,6 +473,18 @@ static struct pci_device_id platform_pci
MODULE_DEVICE_TABLE(pci, platform_pci_tbl);
+static const struct dmi_system_id platform_dmi_tbl[] = {
+ {
+ .ident = "Xen PV-on-HVM",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Xen"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "HVM domU"),
+ },
+ },
+ { },
+};
+MODULE_DEVICE_TABLE(dmi, platform_dmi_tbl);
+
static struct pci_driver platform_driver = {
name: DRV_NAME,
probe: platform_pci_init,

View File

@ -196,8 +196,8 @@ Source20000: xenalyze.hg.tar.bz2
Patch1: 51d277a3-x86-don-t-pass-negative-time-to-gtime_to_gtsc-try-2.patch
Patch2: 51d27807-iommu-amd-Fix-logic-for-clearing-the-IOMMU-interrupt-bits.patch
Patch3: 51d27841-iommu-amd-Workaround-for-erratum-787.patch
Patch4: 51daa074-Revert-hvmloader-always-include-HPET-table.patch
Patch5: 51d5334e-x86-mm-Ensure-useful-progress-in-alloc_l2_table.patch
Patch4: 51d5334e-x86-mm-Ensure-useful-progress-in-alloc_l2_table.patch
Patch5: 51daa074-Revert-hvmloader-always-include-HPET-table.patch
Patch6: 51dd155c-adjust-x86-EFI-build.patch
Patch7: 51e517e6-AMD-IOMMU-allocate-IRTEs.patch
Patch8: 51e5183f-AMD-IOMMU-untie-remap-and-vector-maps.patch
@ -208,9 +208,9 @@ Patch12: 51e7963f-x86-time-Update-wallclock-in-shared-info-when-altering-
Patch13: 51ffd577-fix-off-by-one-mistakes-in-vm_alloc.patch
Patch14: 51ffd5fd-x86-refine-FPU-selector-handling-code-for-XSAVEOPT.patch
Patch15: 520114bb-Nested-VMX-Flush-TLBs-and-Caches-if-paging-mode-changed.patch
Patch16: 520a5504-VMX-add-boot-parameter-to-enable-disable-APIC-v-dynamically.patch
Patch17: 520a24f6-x86-AMD-Fix-nested-svm-crash-due-to-assertion-in-__virt_to_maddr.patch
Patch18: 520a2570-x86-AMD-Inject-GP-instead-of-UD-when-unable-to-map-vmcb.patch
Patch16: 520a24f6-x86-AMD-Fix-nested-svm-crash-due-to-assertion-in-__virt_to_maddr.patch
Patch17: 520a2570-x86-AMD-Inject-GP-instead-of-UD-when-unable-to-map-vmcb.patch
Patch18: 520a5504-VMX-add-boot-parameter-to-enable-disable-APIC-v-dynamically.patch
Patch19: 520b4b60-VT-d-protect-against-bogus-information-coming-from-BIOS.patch
Patch20: 520b4bda-x86-MTRR-fix-range-check-in-mtrr_add_page.patch
Patch21: 520cb8b6-x86-time-fix-check-for-negative-time-in-__update_vcpu_system_time.patch
@ -258,7 +258,6 @@ Patch503: x86-dom-print.patch
Patch504: x86-extra-trap-info.patch
Patch520: supported_module.patch
Patch521: magic_ioport_compat.patch
Patch522: xen.sles11sp1.fate311487.xen_platform_pci.dmistring.patch
Patch523: disable_emulated_device.patch
# Legacy Xend and Qemu patches
Patch800: xend-traditional-qemu.patch
@ -570,7 +569,6 @@ Authors
%patch504 -p1
%patch520 -p1
%patch521 -p1
%patch522 -p1
%patch523 -p1
%patch800 -p1
%patch99997 -p1
@ -1220,9 +1218,11 @@ fi
%preun tools
%if %{?with_systemd}0
if [ $1 -eq 0 ]; then
/bin/systemctl disable xend.service
/bin/systemctl disable xencommons.service
/bin/systemctl disable xendomains.service
fi
%else
%{stop_on_removal xendomains xend xencommons}
%endif

View File

@ -4022,13 +4022,13 @@ Index: xen-4.3.0-testing/tools/qemu-xen-traditional-dir-remote/hw/xen_platform.c
#include <assert.h>
#include <xenguest.h>
@@ -335,11 +337,66 @@ static void xen_platform_ioport_writeb(v
@@ -335,11 +337,71 @@ static void xen_platform_ioport_writeb(v
}
}
+static uint32_t ioport_base;
+
+static void platform_ioport_write(void *opaque, uint32_t addr, uint32_t val)
+static void suse_platform_ioport_write(void *opaque, uint32_t addr, uint32_t val)
+{
+ DECLARE_DOMCTL;
+ int rc;
@ -4038,6 +4038,7 @@ Index: xen-4.3.0-testing/tools/qemu-xen-traditional-dir-remote/hw/xen_platform.c
+
+ switch (addr - ioport_base) {
+ case 0:
+ /* FIXME Unknown who makes use of this code! */
+ fprintf(logfile, "Init hypercall page %x, addr %x.\n", val, addr);
+ domctl.domain = (domid_t)domid;
+ domctl.u.hypercall_init.gmfn = val;
@ -4046,6 +4047,10 @@ Index: xen-4.3.0-testing/tools/qemu-xen-traditional-dir-remote/hw/xen_platform.c
+ fprintf(logfile, "result -> %d.\n", rc);
+ break;
+ case 4:
+ /* xen-kmp used this since xen-3.0.4, instead the official protocol from xen-3.3+
+ * pre vmdp 1.7 made use of 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. */
+ fprintf(logfile, "Disconnect IDE hard disk...\n");
+ ide_unplug_harddisks();
+ fprintf(logfile, "Disconnect SCSI hard disk...\n");
@ -4070,8 +4075,8 @@ Index: xen-4.3.0-testing/tools/qemu-xen-traditional-dir-remote/hw/xen_platform.c
+ }
+ break;
+ default:
+ fprintf(logfile, "Write to bad port %x (base %x) on evtchn device.\n",
+ addr, ioport_base);
+ fprintf(logfile, "Write %x to bad port %x (base %x) on evtchn device.\n",
+ val, addr, ioport_base);
+ break;
+ }
+}
@ -4080,12 +4085,12 @@ Index: xen-4.3.0-testing/tools/qemu-xen-traditional-dir-remote/hw/xen_platform.c
{
+ ioport_base = addr;
+
+ register_ioport_write(addr, 16, 4, platform_ioport_write, NULL);
+/*
+ register_ioport_write(addr, 16, 4, suse_platform_ioport_write, NULL);
+
PCIXenPlatformState *d = (PCIXenPlatformState *)pci_dev;
register_ioport_write(addr, size, 1, xen_platform_ioport_writeb, d);
register_ioport_read(addr, size, 1, xen_platform_ioport_readb, d);
+*/
+
}
static uint32_t platform_mmio_read(void *opaque, target_phys_addr_t addr)