Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2017-09-22 14:53:30 +0200
committerJan Beulich <jbeulich@suse.com>2017-09-22 14:53:30 +0200
commit44d3ee08e2dd1ba2f54669567b51e2e2bb7e190c (patch)
tree4327da790f47153b27410942a6c1620a7b83dc70
parentc1e13ef0d51d633886d4e588d0560cd05204f6ce (diff)
- Update Xen patches to 4.13 and c/s 1337.
- xen/x86/entry/64: Refactor IRQ stacks and make them NMI-safe (bnc#1018348). - xen/x86/unwind: Add the ORC unwinder (bnc#1018348). - xen/x86/entry/64: Initialize the top of the IRQ stack before switching stacks (bnc#1018348). - xen/x86/entry/64: Add unwind hint annotations (bnc#1018348). - xen/x86/asm: Add unwind hint annotations to sync_core() (bnc#1018348). - Delete patches.xen/xen-cpufreq-report.
-rw-r--r--patches.xen/ipv6-no-autoconf4
-rw-r--r--patches.xen/kexec-move-segment-code-i386.patch4
-rw-r--r--patches.xen/kexec-move-segment-code-x86_64.patch4
-rw-r--r--patches.xen/pci-guestdev41
-rw-r--r--patches.xen/pci-reserve6
-rw-r--r--patches.xen/xen-blkback-indirect2
-rw-r--r--patches.xen/xen-blkfront-cdrom9
-rw-r--r--patches.xen/xen-blkfront-indirect65
-rw-r--r--patches.xen/xen-blkfront-multi-page-ring32
-rw-r--r--patches.xen/xen-blkif-op-packet26
-rw-r--r--patches.xen/xen-blktap2-configurable-nr-devs2
-rw-r--r--patches.xen/xen-clockevents12
-rw-r--r--patches.xen/xen-configurable-guest-devices2
-rw-r--r--patches.xen/xen-cpufreq-report122
-rw-r--r--patches.xen/xen-cxgb32
-rw-r--r--patches.xen/xen-ipi-per-cpu-irq38
-rw-r--r--patches.xen/xen-netback-notify-multi6
-rw-r--r--patches.xen/xen-pcpu12
-rw-r--r--patches.xen/xen-privcmd-hcall-preemption21
-rw-r--r--patches.xen/xen-privcmd-truly-batch14
-rw-r--r--patches.xen/xen-pv-on-hvm-skip-initialization-of-emulated-devices10
-rw-r--r--patches.xen/xen-setup-gsi2
-rw-r--r--patches.xen/xen-sys-suspend8
-rw-r--r--patches.xen/xen-unpriv-build24
-rw-r--r--patches.xen/xen-virq-per-cpu-irq52
-rw-r--r--patches.xen/xen-vscsi-large-requests24
-rw-r--r--patches.xen/xen-x86-EFI89
-rw-r--r--patches.xen/xen-x86-bigmem40
-rw-r--r--patches.xen/xen-x86-bzImage26
-rw-r--r--patches.xen/xen-x86-dcr-fallback2
-rw-r--r--patches.xen/xen-x86-exit-mmap2
-rw-r--r--patches.xen/xen-x86-no-lapic41
-rw-r--r--patches.xen/xen-x86-panic-no-reboot8
-rw-r--r--patches.xen/xen-x86-pcpu4
-rw-r--r--patches.xen/xen-x86-per-cpu-vcpu-info32
-rw-r--r--patches.xen/xen-x86-pmd-handling305
-rw-r--r--patches.xen/xen-x86_64-dump-user-pgt16
-rw-r--r--patches.xen/xen-x86_64-m2p-strict6
-rw-r--r--patches.xen/xen-x86_64-note-init-p2m69
-rw-r--r--patches.xen/xen-x86_64-pgd-alloc-order247
-rw-r--r--patches.xen/xen-x86_64-pgd-pin29
-rw-r--r--patches.xen/xen-x86_64-unmapped-initrd8
-rw-r--r--patches.xen/xen3-0001-x86-entry-64-Refactor-IRQ-stacks-and-make-them-NMI-s.patch138
-rw-r--r--patches.xen/xen3-0001-x86-unwind-Add-the-ORC-unwinder.patch60
-rw-r--r--patches.xen/xen3-0002-x86-entry-64-Initialize-the-top-of-the-IRQ-stack-bef.patch79
-rw-r--r--patches.xen/xen3-0003-DWARF-EH-frame-based-stack-unwinding.patch4
-rw-r--r--patches.xen/xen3-0007-x86-entry-64-Add-unwind-hint-annotations.patch241
-rw-r--r--patches.xen/xen3-0008-x86-asm-Add-unwind-hint-annotations-to-sync_core.patch51
-rw-r--r--patches.xen/xen3-auto-arch-i386.diff18
-rw-r--r--patches.xen/xen3-auto-arch-x86.diff48
-rw-r--r--patches.xen/xen3-auto-arch-x86_64.diff10
-rw-r--r--patches.xen/xen3-auto-common.diff124
-rw-r--r--patches.xen/xen3-auto-include-xen-interface.diff707
-rw-r--r--patches.xen/xen3-auto-xen-arch.diff28
-rw-r--r--patches.xen/xen3-auto-xen-drivers.diff101
-rw-r--r--patches.xen/xen3-auto-xen-kconfig.diff86
-rw-r--r--patches.xen/xen3-fixup-arch-x864
-rw-r--r--patches.xen/xen3-fixup-common20
-rw-r--r--patches.xen/xen3-fixup-kconfig2
-rw-r--r--patches.xen/xen3-fixup-xen961
-rw-r--r--patches.xen/xen3-patch-2.6.1810
-rw-r--r--patches.xen/xen3-patch-2.6.1922
-rw-r--r--patches.xen/xen3-patch-2.6.208
-rw-r--r--patches.xen/xen3-patch-2.6.214
-rw-r--r--patches.xen/xen3-patch-2.6.2220
-rw-r--r--patches.xen/xen3-patch-2.6.2346
-rw-r--r--patches.xen/xen3-patch-2.6.24102
-rw-r--r--patches.xen/xen3-patch-2.6.2558
-rw-r--r--patches.xen/xen3-patch-2.6.2630
-rw-r--r--patches.xen/xen3-patch-2.6.27111
-rw-r--r--patches.xen/xen3-patch-2.6.2834
-rw-r--r--patches.xen/xen3-patch-2.6.2934
-rw-r--r--patches.xen/xen3-patch-2.6.30117
-rw-r--r--patches.xen/xen3-patch-2.6.3188
-rw-r--r--patches.xen/xen3-patch-2.6.32122
-rw-r--r--patches.xen/xen3-patch-2.6.3345
-rw-r--r--patches.xen/xen3-patch-2.6.346
-rw-r--r--patches.xen/xen3-patch-2.6.3530
-rw-r--r--patches.xen/xen3-patch-2.6.3678
-rw-r--r--patches.xen/xen3-patch-2.6.3764
-rw-r--r--patches.xen/xen3-patch-2.6.3814
-rw-r--r--patches.xen/xen3-patch-2.6.3936
-rw-r--r--patches.xen/xen3-patch-3.020
-rw-r--r--patches.xen/xen3-patch-3.132
-rw-r--r--patches.xen/xen3-patch-3.1046
-rw-r--r--patches.xen/xen3-patch-3.1134
-rw-r--r--patches.xen/xen3-patch-3.1228
-rw-r--r--patches.xen/xen3-patch-3.1330
-rw-r--r--patches.xen/xen3-patch-3.1437
-rw-r--r--patches.xen/xen3-patch-3.1512
-rw-r--r--patches.xen/xen3-patch-3.1622
-rw-r--r--patches.xen/xen3-patch-3.1716
-rw-r--r--patches.xen/xen3-patch-3.1814
-rw-r--r--patches.xen/xen3-patch-3.1930
-rw-r--r--patches.xen/xen3-patch-3.2101
-rw-r--r--patches.xen/xen3-patch-3.341
-rw-r--r--patches.xen/xen3-patch-3.456
-rw-r--r--patches.xen/xen3-patch-3.56
-rw-r--r--patches.xen/xen3-patch-3.614
-rw-r--r--patches.xen/xen3-patch-3.746
-rw-r--r--patches.xen/xen3-patch-3.830
-rw-r--r--patches.xen/xen3-patch-3.930
-rw-r--r--patches.xen/xen3-patch-4.06
-rw-r--r--patches.xen/xen3-patch-4.142
-rw-r--r--patches.xen/xen3-patch-4.1047
-rw-r--r--patches.xen/xen3-patch-4.1145
-rw-r--r--patches.xen/xen3-patch-4.126244
-rw-r--r--patches.xen/xen3-patch-4.132855
-rw-r--r--patches.xen/xen3-patch-4.244
-rw-r--r--patches.xen/xen3-patch-4.320
-rw-r--r--patches.xen/xen3-patch-4.448
-rw-r--r--patches.xen/xen3-patch-4.538
-rw-r--r--patches.xen/xen3-patch-4.671
-rw-r--r--patches.xen/xen3-patch-4.714
-rw-r--r--patches.xen/xen3-patch-4.833
-rw-r--r--patches.xen/xen3-patch-4.920
-rw-r--r--series.conf10
117 files changed, 12728 insertions, 2683 deletions
diff --git a/patches.xen/ipv6-no-autoconf b/patches.xen/ipv6-no-autoconf
index 9329421b17..c4c44e06ae 100644
--- a/patches.xen/ipv6-no-autoconf
+++ b/patches.xen/ipv6-no-autoconf
@@ -17,7 +17,7 @@ interface before bringing it up will suppress autoconfiguration.
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
-@@ -3799,6 +3799,7 @@ static void addrconf_dad_begin(struct in
+@@ -3852,6 +3852,7 @@ static void addrconf_dad_begin(struct in
goto out;
if (dev->flags&(IFF_NOARP|IFF_LOOPBACK) ||
@@ -25,7 +25,7 @@ interface before bringing it up will suppress autoconfiguration.
idev->cnf.accept_dad < 1 ||
!(ifp->flags&IFA_F_TENTATIVE) ||
ifp->flags & IFA_F_NODAD) {
-@@ -4004,7 +4005,8 @@ static void addrconf_dad_completed(struc
+@@ -4057,7 +4058,8 @@ static void addrconf_dad_completed(struc
send_rs = send_mld &&
ipv6_accept_ra(ifp->idev) &&
ifp->idev->cnf.rtr_solicits != 0 &&
diff --git a/patches.xen/kexec-move-segment-code-i386.patch b/patches.xen/kexec-move-segment-code-i386.patch
index dcaa348911..9b7eaef4df 100644
--- a/patches.xen/kexec-move-segment-code-i386.patch
+++ b/patches.xen/kexec-move-segment-code-i386.patch
@@ -20,7 +20,7 @@ Acked-by: jbeulich@novell.com
--- a/arch/x86/kernel/machine_kexec_32.c
+++ b/arch/x86/kernel/machine_kexec_32.c
@@ -26,48 +26,6 @@
- #include <asm/cacheflush.h>
+ #include <asm/set_memory.h>
#include <asm/debugreg.h>
-static void set_idt(void *newidt, __u16 limit)
@@ -68,7 +68,7 @@ Acked-by: jbeulich@novell.com
static void machine_kexec_free_page_tables(struct kimage *image)
{
free_page((unsigned long)image->arch.pgd);
-@@ -227,24 +185,6 @@ void machine_kexec(struct kimage *image)
+@@ -229,24 +187,6 @@ void machine_kexec(struct kimage *image)
page_list[PA_SWAP_PAGE] = (page_to_pfn(image->swap_page)
<< PAGE_SHIFT);
diff --git a/patches.xen/kexec-move-segment-code-x86_64.patch b/patches.xen/kexec-move-segment-code-x86_64.patch
index a0f950a2fa..4d3939ffca 100644
--- a/patches.xen/kexec-move-segment-code-x86_64.patch
+++ b/patches.xen/kexec-move-segment-code-x86_64.patch
@@ -19,7 +19,7 @@ Acked-by: jbeulich@novell.com
--- a/arch/x86/kernel/machine_kexec_64.c
+++ b/arch/x86/kernel/machine_kexec_64.c
-@@ -142,47 +142,6 @@ static int init_pgtable(struct kimage *i
+@@ -157,47 +157,6 @@ static int init_pgtable(struct kimage *i
return init_transition_pgtable(image, level4p);
}
@@ -67,7 +67,7 @@ Acked-by: jbeulich@novell.com
#ifdef CONFIG_KEXEC_FILE
/* Update purgatory as needed after various image segments have been prepared */
static int arch_update_purgatory(struct kimage *image)
-@@ -297,24 +256,6 @@ void machine_kexec(struct kimage *image)
+@@ -312,24 +271,6 @@ void machine_kexec(struct kimage *image)
page_list[PA_SWAP_PAGE] = (page_to_pfn(image->swap_page)
<< PAGE_SHIFT);
diff --git a/patches.xen/pci-guestdev b/patches.xen/pci-guestdev
index ea3c03e071..c9445ecc13 100644
--- a/patches.xen/pci-guestdev
+++ b/patches.xen/pci-guestdev
@@ -10,10 +10,12 @@ jb: split /dev/xen/pci_iomul driver to be separate (so it can be a module)
Acked-by: jbeulich@novell.com
3.8/drivers/acpi/scan.c (pnp.unique_id handling now present)
+4.12/include/uapi/xen/Kbuild
+4.12/include/uapi/xen/public/Kbuild
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
-@@ -1241,6 +1241,24 @@
+@@ -1265,6 +1265,24 @@
[HW] Sets the ranges of gpiochip of for this device.
Format: <start1>,<end1>,<start2>,<end2>...
@@ -38,7 +40,7 @@ Acked-by: jbeulich@novell.com
hardlockup_all_cpu_backtrace=
[KNL] Should the hard-lockup detector generate
backtraces on all cpus.
-@@ -3514,6 +3532,10 @@
+@@ -3598,6 +3616,10 @@
Run specified binary instead of /init from the ramdisk,
used for early userspace startup. See initrd.
@@ -92,9 +94,9 @@ Acked-by: jbeulich@novell.com
+#endif
+
pci_acpi_add_bus_pm_notifier(device);
- if (device->wakeup.flags.run_wake)
- device_set_run_wake(root->bus->bridge, true);
-@@ -917,3 +946,45 @@ void __init acpi_pci_root_init(void)
+ device_set_wakeup_capable(root->bus->bridge, device->wakeup.flags.valid);
+
+@@ -916,3 +945,45 @@ void __init acpi_pci_root_init(void)
pci_acpi_crs_quirks();
acpi_scan_add_handler_with_hotplug(&pci_root_handler, "pci_root");
}
@@ -165,8 +167,8 @@ Acked-by: jbeulich@novell.com
depends on PCI
--- a/drivers/pci/Makefile
+++ b/drivers/pci/Makefile
-@@ -7,6 +7,10 @@ obj-y += access.o bus.o probe.o host-br
- irq.o vpd.o setup-bus.o vc.o
+@@ -8,6 +8,10 @@ obj-y += access.o bus.o probe.o host-br
+
obj-$(CONFIG_PROC_FS) += proc.o
obj-$(CONFIG_SYSFS) += slot.o
+obj-$(CONFIG_PCI_GUESTDEV) += guestdev.o
@@ -2085,10 +2087,10 @@ Acked-by: jbeulich@novell.com
+ struct pci_iomul_slot **);
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
-@@ -5068,7 +5068,7 @@ void pci_reassigndev_resource_alignment(
+@@ -5264,7 +5264,7 @@ void pci_reassigndev_resource_alignment(
/* check if specified PCI is target device to reassign */
- align = pci_specified_resource_alignment(dev);
+ align = pci_specified_resource_alignment(dev, &resize);
- if (!align)
+ if (!align && !pci_is_guestdev_to_reassign(dev))
return;
@@ -2096,7 +2098,7 @@ Acked-by: jbeulich@novell.com
if (dev->hdr_type == PCI_HEADER_TYPE_NORMAL &&
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
-@@ -353,4 +353,12 @@ int acpi_get_rc_resources(struct device
+@@ -365,4 +365,12 @@ int acpi_get_rc_resources(struct device
struct resource *res);
#endif
@@ -2135,7 +2137,7 @@ Acked-by: jbeulich@novell.com
+#include <linux/fs.h>
+#include <linux/miscdevice.h>
+#include <linux/module.h>
-+#include <asm/uaccess.h>
++#include <linux/uaccess.h>
+#include <xen/public/iomulti.h>
+
+struct pci_iomul_data {
@@ -2554,7 +2556,7 @@ Acked-by: jbeulich@novell.com
+MODULE_DESCRIPTION("PCI IO space multiplexing driver");
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
-@@ -444,6 +444,8 @@ int acpi_check_region(resource_size_t st
+@@ -445,6 +445,8 @@ int acpi_check_region(resource_size_t st
int acpi_resources_are_enforced(void);
@@ -2565,8 +2567,8 @@ Acked-by: jbeulich@novell.com
#endif
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
-@@ -2160,6 +2160,12 @@ static inline bool pci_ari_enabled(struc
- return bus->self && bus->self->ari_enabled;
+@@ -2224,6 +2224,12 @@ static inline bool pci_is_thunderbolt_at
+ return false;
}
+#ifdef CONFIG_PCI_GUESTDEV
@@ -2578,17 +2580,6 @@ Acked-by: jbeulich@novell.com
/* provide the legacy pci_dma_* API */
#include <linux/pci-dma-compat.h>
---- a/include/uapi/xen/Kbuild
-+++ b/include/uapi/xen/Kbuild
-@@ -3,3 +3,4 @@ header-y += evtchn.h
- header-y += gntalloc.h
- header-y += gntdev.h
- header-y += privcmd.h
-+header-y += public/
---- /dev/null
-+++ b/include/uapi/xen/public/Kbuild
-@@ -0,0 +1 @@
-+header-y += iomulti.h
--- /dev/null
+++ b/include/uapi/xen/public/iomulti.h
@@ -0,0 +1,50 @@
diff --git a/patches.xen/pci-reserve b/patches.xen/pci-reserve
index 22e40d70c4..a966b48f96 100644
--- a/patches.xen/pci-reserve
+++ b/patches.xen/pci-reserve
@@ -11,7 +11,7 @@ Acked-by: jbeulich@novell.com
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
-@@ -3001,6 +3001,13 @@
+@@ -3067,6 +3067,13 @@
only look for one device below a PCIe downstream
port.
@@ -43,7 +43,7 @@ Acked-by: jbeulich@novell.com
depends on PCI
--- a/drivers/pci/Makefile
+++ b/drivers/pci/Makefile
-@@ -11,6 +11,7 @@ obj-$(CONFIG_PCI_GUESTDEV) += guestdev.o
+@@ -12,6 +12,7 @@ obj-$(CONFIG_PCI_GUESTDEV) += guestdev.o
obj-$(CONFIG_PCI_IOMULTI) += pci-iomul.o
iomul-$(CONFIG_PCI_IOMULTI) := iomulti.o
obj-y += $(iomul-y) $(iomul-m)
@@ -53,7 +53,7 @@ Acked-by: jbeulich@novell.com
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
-@@ -361,4 +361,19 @@ extern int pci_is_iomuldev(struct pci_de
+@@ -373,4 +373,19 @@ extern int pci_is_iomuldev(struct pci_de
#define pci_is_iomuldev(dev) 0
#endif
diff --git a/patches.xen/xen-blkback-indirect b/patches.xen/xen-blkback-indirect
index 2eeadff763..09cb1943e3 100644
--- a/patches.xen/xen-blkback-indirect
+++ b/patches.xen/xen-blkback-indirect
@@ -204,7 +204,7 @@ References: fate#316871
DPRINTK("Bad number of segments in request (%d)\n", nseg);
goto fail_response;
}
-@@ -744,17 +818,23 @@ static void make_response(blkif_t *blkif
+@@ -746,17 +820,23 @@ static void make_response(blkif_t *blkif
static int __init blkif_init(void)
{
diff --git a/patches.xen/xen-blkfront-cdrom b/patches.xen/xen-blkfront-cdrom
index d95cdb9610..c2e3e9038f 100644
--- a/patches.xen/xen-blkfront-cdrom
+++ b/patches.xen/xen-blkfront-cdrom
@@ -35,7 +35,7 @@ References: fate#300964
pr_info("Setting capacity to %Lu\n", sectors);
set_capacity(info->gd, sectors);
revalidate_disk(info->gd);
-@@ -633,6 +638,8 @@ static void connect(struct blkfront_info
+@@ -635,6 +640,8 @@ static void connect(struct blkfront_info
device_add_disk(&info->xbdev->dev, info->gd);
info->is_ready = 1;
@@ -44,7 +44,7 @@ References: fate#300964
}
/**
-@@ -662,6 +669,8 @@ static void blkfront_closing(struct blkf
+@@ -664,6 +671,8 @@ static void blkfront_closing(struct blkf
xlvbd_sysfs_delif(info);
@@ -105,7 +105,7 @@ References: fate#300964
--- /dev/null
+++ b/drivers/xen/blkfront/vcd.c
-@@ -0,0 +1,510 @@
+@@ -0,0 +1,511 @@
+/*******************************************************************************
+ * vcd.c
+ *
@@ -175,7 +175,8 @@ References: fate#300964
+ goto out;
+
+ req->rq_disk = info->gd;
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,13,0)
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
+ scsi_req_init(req);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)
+ req->cmd_type = REQ_TYPE_BLOCK_PC;
diff --git a/patches.xen/xen-blkfront-indirect b/patches.xen/xen-blkfront-indirect
index cf2a4bd8f9..2bfa7c67e7 100644
--- a/patches.xen/xen-blkfront-indirect
+++ b/patches.xen/xen-blkfront-indirect
@@ -5,7 +5,7 @@ References: fate#316871
--- a/drivers/xen/blkfront/blkfront.c
+++ b/drivers/xen/blkfront/blkfront.c
-@@ -41,9 +41,11 @@
+@@ -41,10 +41,12 @@
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/log2.h>
@@ -13,11 +13,12 @@ References: fate#316871
#include <linux/scatterlist.h>
#include <linux/vmalloc.h>
#include <scsi/scsi.h>
+ #include <scsi/scsi_request.h>
+#include <xen/blkif.h>
#include <xen/evtchn.h>
#include <xen/xenbus.h>
#include <xen/interface/grant_table.h>
-@@ -59,6 +61,7 @@
+@@ -60,6 +62,7 @@
struct blk_resume_entry {
struct list_head list;
struct blk_shadow copy;
@@ -25,7 +26,7 @@ References: fate#316871
};
#define BLKIF_STATE_DISCONNECTED 0
-@@ -70,7 +73,8 @@ static void connect(struct blkfront_info
+@@ -71,7 +74,8 @@ static void connect(struct blkfront_info
static void blkfront_closing(struct blkfront_info *);
static int blkfront_remove(struct xenbus_device *);
static int talk_to_backend(struct xenbus_device *, struct blkfront_info *);
@@ -35,7 +36,7 @@ References: fate#316871
static void kick_pending_request_queues(struct blkfront_info *);
-@@ -78,9 +82,14 @@ static irqreturn_t blkif_int(int irq, vo
+@@ -79,9 +83,14 @@ static irqreturn_t blkif_int(int irq, vo
static void blkif_restart_queue(struct work_struct *arg);
static int blkif_recover(struct blkfront_info *, unsigned int old_ring_size,
unsigned int new_ring_size);
@@ -51,7 +52,7 @@ References: fate#316871
/**
* Entry point to this code when a new device is created. Allocate the basic
-@@ -121,6 +130,7 @@ static int blkfront_probe(struct xenbus_
+@@ -122,6 +131,7 @@ static int blkfront_probe(struct xenbus_
info->connected = BLKIF_STATE_DISCONNECTED;
INIT_WORK(&info->work, blkif_restart_queue);
INIT_LIST_HEAD(&info->resume_list);
@@ -59,7 +60,7 @@ References: fate#316871
/* Front end dir is a number, which is used as the id. */
info->handle = simple_strtoul(strrchr(dev->nodename,'/')+1, NULL, 0);
-@@ -185,7 +195,7 @@ static void shadow_init(struct blk_shado
+@@ -186,7 +196,7 @@ static void shadow_init(struct blk_shado
static int talk_to_backend(struct xenbus_device *dev,
struct blkfront_info *info)
{
@@ -68,7 +69,7 @@ References: fate#316871
unsigned int old_ring_size = RING_SIZE(&info->ring);
const char *what = NULL;
struct xenbus_transaction xbt;
-@@ -222,8 +232,20 @@ static int talk_to_backend(struct xenbus
+@@ -223,8 +233,20 @@ static int talk_to_backend(struct xenbus
*/
info->ring_size = ring_size = 1U << ring_order;
@@ -90,7 +91,7 @@ References: fate#316871
if (err)
goto out;
-@@ -295,8 +317,8 @@ again:
+@@ -296,8 +318,8 @@ again:
break;
}
@@ -101,7 +102,7 @@ References: fate#316871
return 0;
-@@ -312,11 +334,12 @@ again:
+@@ -313,11 +335,12 @@ again:
static int setup_blkring(struct xenbus_device *dev,
@@ -116,7 +117,7 @@ References: fate#316871
for (nr = 0; nr < info->ring_size; nr++) {
info->ring_refs[nr] = GRANT_INVALID_REF;
-@@ -338,7 +361,54 @@ static int setup_blkring(struct xenbus_d
+@@ -339,7 +362,54 @@ static int setup_blkring(struct xenbus_d
SHARED_RING_INIT(sring);
FRONT_RING_INIT(&info->ring, sring, nr * PAGE_SIZE);
@@ -172,7 +173,7 @@ References: fate#316871
err = xenbus_multi_grant_ring(dev, nr, info->ring_pages,
info->ring_refs);
-@@ -686,6 +756,7 @@ static const char *op_name(unsigned int
+@@ -689,6 +759,7 @@ static const char *op_name(unsigned int
[BLKIF_OP_WRITE_BARRIER] = "barrier",
[BLKIF_OP_FLUSH_DISKCACHE] = "flush",
[BLKIF_OP_DISCARD] = "discard",
@@ -180,7 +181,7 @@ References: fate#316871
};
if (op >= ARRAY_SIZE(names))
-@@ -704,6 +775,28 @@ static inline void flush_requests(struct
+@@ -707,6 +778,28 @@ static inline void flush_requests(struct
notify_remote_via_irq(info->irq);
}
@@ -209,7 +210,7 @@ References: fate#316871
static void kick_pending_request_queues(struct blkfront_info *info)
{
bool queued = false;
-@@ -716,22 +809,67 @@ static void kick_pending_request_queues(
+@@ -719,22 +812,67 @@ static void kick_pending_request_queues(
struct blk_resume_entry, list);
blkif_request_t *req =
RING_GET_REQUEST(&info->ring, info->ring.req_prod_pvt);
@@ -278,7 +279,7 @@ References: fate#316871
info->ring.req_prod_pvt++;
queued = true;
-@@ -744,7 +882,8 @@ static void kick_pending_request_queues(
+@@ -747,7 +885,8 @@ static void kick_pending_request_queues(
if (queued)
flush_requests(info);
@@ -288,7 +289,7 @@ References: fate#316871
/* Re-enable calldowns. */
blk_start_queue(info->rq);
/* Kick things off immediately. */
-@@ -953,7 +1092,7 @@ static int blkif_queue_request(struct re
+@@ -956,7 +1095,7 @@ static int blkif_queue_request(struct re
unsigned long buffer_mfn;
blkif_request_t *ring_req;
unsigned long id;
@@ -297,7 +298,7 @@ References: fate#316871
int i, ref;
grant_ref_t gref_head;
struct scatterlist *sg;
-@@ -961,13 +1100,15 @@ static int blkif_queue_request(struct re
+@@ -964,13 +1103,15 @@ static int blkif_queue_request(struct re
if (unlikely(info->connected != BLKIF_STATE_CONNECTED))
return 1;
@@ -316,7 +317,7 @@ References: fate#316871
return 1;
}
-@@ -978,7 +1119,6 @@ static int blkif_queue_request(struct re
+@@ -981,7 +1122,6 @@ static int blkif_queue_request(struct re
ring_req->id = id;
ring_req->sector_number = (blkif_sector_t)blk_rq_pos(req);
@@ -324,7 +325,7 @@ References: fate#316871
ring_req->operation = rq_data_dir(req) ?
BLKIF_OP_WRITE : BLKIF_OP_READ;
-@@ -1008,14 +1148,42 @@ static int blkif_queue_request(struct re
+@@ -1011,14 +1151,42 @@ static int blkif_queue_request(struct re
/* id, sector_number and handle are set above. */
discard->operation = BLKIF_OP_DISCARD;
discard->flag = 0;
@@ -370,7 +371,7 @@ References: fate#316871
buffer_mfn = page_to_phys(sg_page(sg)) >> PAGE_SHIFT;
fsect = sg->offset >> 9;
lsect = fsect + (sg->length >> 9) - 1;
-@@ -1030,8 +1198,7 @@ static int blkif_queue_request(struct re
+@@ -1033,8 +1201,7 @@ static int blkif_queue_request(struct re
rq_data_dir(req) ? GTF_readonly : 0 );
info->shadow[id].frame[i] = mfn_to_pfn(buffer_mfn);
@@ -380,7 +381,7 @@ References: fate#316871
.gref = ref,
.first_sect = fsect,
.last_sect = lsect };
-@@ -1127,6 +1294,7 @@ static irqreturn_t blkif_int(int irq, vo
+@@ -1131,6 +1298,7 @@ static irqreturn_t blkif_int(int irq, vo
for (i = info->ring.rsp_cons; i != rp; i++) {
unsigned long id;
int ret;
@@ -388,7 +389,7 @@ References: fate#316871
bret = RING_GET_RESPONSE(&info->ring, i);
if (unlikely(bret->id >= RING_SIZE(&info->ring))) {
-@@ -1144,7 +1312,7 @@ static irqreturn_t blkif_int(int irq, vo
+@@ -1148,7 +1316,7 @@ static irqreturn_t blkif_int(int irq, vo
id = bret->id;
req = info->shadow[id].request;
@@ -397,19 +398,19 @@ References: fate#316871
ret = ADD_ID_TO_FREELIST(info, id);
if (unlikely(ret)) {
-@@ -1154,6 +1322,9 @@ static irqreturn_t blkif_int(int irq, vo
+@@ -1158,6 +1326,9 @@ static irqreturn_t blkif_int(int irq, vo
continue;
}
+ if (!done)
+ continue;
+
- ret = bret->status == BLKIF_RSP_OKAY ? 0 : -EIO;
+ ret = bret->status == BLKIF_RSP_OKAY
+ ? BLK_STS_OK : BLK_STS_IOERR;
switch (bret->operation) {
- const char *kind;
-@@ -1164,7 +1335,10 @@ static irqreturn_t blkif_int(int irq, vo
+@@ -1169,7 +1340,10 @@ static irqreturn_t blkif_int(int irq, vo
if (unlikely(bret->status == BLKIF_RSP_EOPNOTSUPP))
- ret = -EOPNOTSUPP;
+ ret = BLK_STS_NOTSUPP;
if (unlikely(bret->status == BLKIF_RSP_ERROR &&
- info->shadow[id].req.nr_segments == 0)) {
+ !(info->shadow[id].req.operation ==
@@ -417,9 +418,9 @@ References: fate#316871
+ ? info->shadow[id].ind.nr_segments
+ : info->shadow[id].req.nr_segments))) {
kind = "empty ";
- ret = -EOPNOTSUPP;
+ ret = BLK_STS_NOTSUPP;
}
-@@ -1245,6 +1419,19 @@ static void blkif_free(struct blkfront_i
+@@ -1250,6 +1424,19 @@ static void blkif_free(struct blkfront_i
flush_work(&info->work);
/* Free resources associated with old device channel. */
@@ -439,7 +440,7 @@ References: fate#316871
vunmap(info->ring.sring);
info->ring.sring = NULL;
gnttab_multi_end_foreign_access(info->ring_size,
-@@ -1252,16 +1439,69 @@ static void blkif_free(struct blkfront_i
+@@ -1257,16 +1444,69 @@ static void blkif_free(struct blkfront_i
if (info->irq)
unbind_from_irqhandler(info->irq, info);
info->irq = 0;
@@ -515,7 +516,7 @@ References: fate#316871
}
static int blkif_recover(struct blkfront_info *info,
-@@ -1274,14 +1514,35 @@ static int blkif_recover(struct blkfront
+@@ -1279,14 +1519,35 @@ static int blkif_recover(struct blkfront
/* Stage 1: Make a safe copy of the shadow state. */
for (i = 0; i < old_ring_size; i++) {
@@ -552,7 +553,7 @@ References: fate#316871
list_add_tail(&ent->list, &list);
}
if (i < old_ring_size) {
-@@ -1296,7 +1557,13 @@ static int blkif_recover(struct blkfront
+@@ -1301,7 +1562,13 @@ static int blkif_recover(struct blkfront
list_splice_tail(&list, &info->resume_list);
/* Stage 2: Set up free list. */
@@ -567,7 +568,7 @@ References: fate#316871
shadow_init(info->shadow, ring_size);
info->shadow_free = info->ring.req_prod_pvt;
-@@ -1312,6 +1579,13 @@ static int blkif_recover(struct blkfront
+@@ -1317,6 +1584,13 @@ static int blkif_recover(struct blkfront
spin_unlock_irq(&info->io_lock);
diff --git a/patches.xen/xen-blkfront-multi-page-ring b/patches.xen/xen-blkfront-multi-page-ring
index 8cc7512afb..3ea891f759 100644
--- a/patches.xen/xen-blkfront-multi-page-ring
+++ b/patches.xen/xen-blkfront-multi-page-ring
@@ -19,9 +19,9 @@ Acked-by: jbeulich@suse.com
#include <linux/scatterlist.h>
+#include <linux/vmalloc.h>
#include <scsi/scsi.h>
+ #include <scsi/scsi_request.h>
#include <xen/evtchn.h>
- #include <xen/xenbus.h>
-@@ -54,12 +56,15 @@
+@@ -55,12 +57,15 @@
#include <xen/platform-compat.h>
#endif
@@ -39,7 +39,7 @@ Acked-by: jbeulich@suse.com
static void connect(struct blkfront_info *);
static void blkfront_closing(struct blkfront_info *);
-@@ -71,7 +76,8 @@ static void kick_pending_request_queues(
+@@ -72,7 +77,8 @@ static void kick_pending_request_queues(
static irqreturn_t blkif_int(int irq, void *dev_id);
static void blkif_restart_queue(struct work_struct *arg);
@@ -49,7 +49,7 @@ Acked-by: jbeulich@suse.com
static void blkif_completion(struct blk_shadow *);
static void blkif_free(struct blkfront_info *, int);
-@@ -85,8 +91,9 @@ static void blkif_free(struct blkfront_i
+@@ -86,8 +92,9 @@ static void blkif_free(struct blkfront_i
static int blkfront_probe(struct xenbus_device *dev,
const struct xenbus_device_id *id)
{
@@ -60,7 +60,7 @@ Acked-by: jbeulich@suse.com
/* FIXME: Use dynamic device id if this is not set. */
err = xenbus_scanf(XBT_NIL, dev->nodename,
-@@ -113,15 +120,21 @@ static int blkfront_probe(struct xenbus_
+@@ -114,15 +121,21 @@ static int blkfront_probe(struct xenbus_
info->vdevice = vdevice;
info->connected = BLKIF_STATE_DISCONNECTED;
INIT_WORK(&info->work, blkif_restart_queue);
@@ -86,7 +86,7 @@ Acked-by: jbeulich@suse.com
err = talk_to_backend(dev, info);
if (err) {
kfree(info);
-@@ -142,28 +155,73 @@ static int blkfront_probe(struct xenbus_
+@@ -143,28 +156,73 @@ static int blkfront_probe(struct xenbus_
static int blkfront_resume(struct xenbus_device *dev)
{
struct blkfront_info *info = dev_get_drvdata(&dev->dev);
@@ -166,7 +166,7 @@ Acked-by: jbeulich@suse.com
/* Create shared ring, alloc event channel. */
err = setup_blkring(dev, info);
if (err)
-@@ -176,24 +234,44 @@ again:
+@@ -177,24 +235,44 @@ again:
goto destroy_blkring;
}
@@ -225,7 +225,7 @@ Acked-by: jbeulich@suse.com
err = xenbus_transaction_end(xbt, 0);
if (err) {
-@@ -205,12 +283,27 @@ again:
+@@ -206,12 +284,27 @@ again:
xenbus_switch_state(dev, XenbusStateInitialised);
@@ -255,7 +255,7 @@ Acked-by: jbeulich@suse.com
destroy_blkring:
blkif_free(info, 0);
out:
-@@ -223,26 +316,34 @@ static int setup_blkring(struct xenbus_d
+@@ -224,26 +317,34 @@ static int setup_blkring(struct xenbus_d
{
blkif_sring_t *sring;
int err;
@@ -299,7 +299,7 @@ Acked-by: jbeulich@suse.com
err = bind_listening_port_to_irqhandler(
dev->otherend_id, blkif_int, 0, "blkif", info);
-@@ -273,13 +374,19 @@ static void backend_changed(struct xenbu
+@@ -274,13 +375,19 @@ static void backend_changed(struct xenbu
switch (backend_state) {
case XenbusStateInitialising:
@@ -320,7 +320,7 @@ Acked-by: jbeulich@suse.com
case XenbusStateConnected:
connect(info);
break;
-@@ -552,7 +659,7 @@ static inline int GET_ID_FROM_FREELIST(
+@@ -555,7 +662,7 @@ static inline int GET_ID_FROM_FREELIST(
struct blkfront_info *info)
{
unsigned long free = info->shadow_free;
@@ -329,7 +329,7 @@ Acked-by: jbeulich@suse.com
info->shadow_free = info->shadow[free].req.id;
info->shadow[free].req.id = 0x0fffffee; /* debug */
return free;
-@@ -599,6 +706,44 @@ static inline void flush_requests(struct
+@@ -602,6 +709,44 @@ static inline void flush_requests(struct
static void kick_pending_request_queues(struct blkfront_info *info)
{
@@ -374,7 +374,7 @@ Acked-by: jbeulich@suse.com
if (!RING_FULL(&info->ring)) {
/* Re-enable calldowns. */
blk_start_queue(info->rq);
-@@ -984,11 +1129,11 @@ static irqreturn_t blkif_int(int irq, vo
+@@ -988,11 +1133,11 @@ static irqreturn_t blkif_int(int irq, vo
int ret;
bret = RING_GET_RESPONSE(&info->ring, i);
@@ -388,7 +388,7 @@ Acked-by: jbeulich@suse.com
*/
pr_warning("%s: response to %s has incorrect id (%#Lx)\n",
info->gd->disk_name,
-@@ -1100,12 +1245,10 @@ static void blkif_free(struct blkfront_i
+@@ -1105,12 +1250,10 @@ static void blkif_free(struct blkfront_i
flush_work(&info->work);
/* Free resources associated with old device channel. */
@@ -405,7 +405,7 @@ Acked-by: jbeulich@suse.com
if (info->irq)
unbind_from_irqhandler(info->irq, info);
info->irq = 0;
-@@ -1121,55 +1264,41 @@ static void blkif_completion(struct blk_
+@@ -1126,55 +1269,41 @@ static void blkif_completion(struct blk_
gnttab_end_foreign_access(s->req.seg[i].gref, 0UL);
}
@@ -489,7 +489,7 @@ Acked-by: jbeulich@suse.com
(void)xenbus_switch_state(info->xbdev, XenbusStateConnected);
-@@ -1178,9 +1307,6 @@ static int blkif_recover(struct blkfront
+@@ -1183,9 +1312,6 @@ static int blkif_recover(struct blkfront
/* Now safe for us to use the shared ring */
info->connected = BLKIF_STATE_CONNECTED;
diff --git a/patches.xen/xen-blkif-op-packet b/patches.xen/xen-blkif-op-packet
index c598de6cf0..9997734493 100644
--- a/patches.xen/xen-blkif-op-packet
+++ b/patches.xen/xen-blkif-op-packet
@@ -71,15 +71,7 @@ References: fate#300964
NULL
--- a/drivers/xen/blkfront/blkfront.c
+++ b/drivers/xen/blkfront/blkfront.c
-@@ -45,6 +45,7 @@
- #include <linux/scatterlist.h>
- #include <linux/vmalloc.h>
- #include <scsi/scsi.h>
-+#include <scsi/scsi_request.h>
- #include <xen/blkif.h>
- #include <xen/evtchn.h>
- #include <xen/xenbus.h>
-@@ -755,6 +756,7 @@ static const char *op_name(unsigned int
+@@ -758,6 +758,7 @@ static const char *op_name(unsigned int
[BLKIF_OP_WRITE] = "write",
[BLKIF_OP_WRITE_BARRIER] = "barrier",
[BLKIF_OP_FLUSH_DISKCACHE] = "flush",
@@ -87,7 +79,7 @@ References: fate#300964
[BLKIF_OP_DISCARD] = "discard",
[BLKIF_OP_INDIRECT] = "indirect",
};
-@@ -1140,6 +1142,8 @@ static int blkif_queue_request(struct re
+@@ -1143,6 +1144,8 @@ static int blkif_queue_request(struct re
if (req->cmd_flags & REQ_HARDBARRIER)
ring_req->operation = BLKIF_OP_WRITE_BARRIER;
#endif
@@ -96,7 +88,7 @@ References: fate#300964
if (unlikely(req_op(req) == REQ_OP_DISCARD) ||
unlikely(req_op(req) == REQ_OP_SECURE_ERASE)) {
-@@ -1237,7 +1241,7 @@ void do_blkif_request(struct request_que
+@@ -1240,7 +1243,7 @@ void do_blkif_request(struct request_que
blk_start_request(req);
@@ -105,7 +97,7 @@ References: fate#300964
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)
(((req_op(req) == REQ_OP_FLUSH ? REQ_PREFLUSH : 0) |
(req->cmd_flags & REQ_FUA)) >
-@@ -1359,6 +1363,7 @@ static irqreturn_t blkif_int(int irq, vo
+@@ -1364,6 +1367,7 @@ static irqreturn_t blkif_int(int irq, vo
/* fall through */
case BLKIF_OP_READ:
case BLKIF_OP_WRITE:
@@ -184,7 +176,7 @@ References: fate#300964
s64 st_rd_cnt;
--- a/drivers/xen/blktap2/device.c
+++ b/drivers/xen/blktap2/device.c
-@@ -342,7 +342,8 @@ blktap_device_fail_pending_requests(stru
+@@ -353,7 +353,8 @@ blktap_device_fail_pending_requests(stru
BTERR("%u:%u: failing pending %s of %d pages\n",
blktap_device_major, tap->minor,
@@ -194,7 +186,7 @@ References: fate#300964
"read" : "write"), request->nr_pages);
blktap_unmap(tap, request);
-@@ -383,6 +384,7 @@ blktap_device_finish_request(struct blkt
+@@ -394,6 +395,7 @@ blktap_device_finish_request(struct blkt
switch (request->operation) {
case BLKIF_OP_READ:
case BLKIF_OP_WRITE:
@@ -202,7 +194,7 @@ References: fate#300964
if (unlikely(res->status != BLKIF_RSP_OKAY))
BTERR("Bad return from device data "
"request: %x\n", res->status);
-@@ -620,6 +622,8 @@ blktap_device_process_request(struct blk
+@@ -631,6 +633,8 @@ blktap_device_process_request(struct blk
blkif_req.handle = 0;
blkif_req.operation = rq_data_dir(req) ?
BLKIF_OP_WRITE : BLKIF_OP_READ;
@@ -211,7 +203,7 @@ References: fate#300964
request->id = (unsigned long)req;
request->operation = blkif_req.operation;
-@@ -685,7 +689,9 @@ blktap_device_process_request(struct blk
+@@ -696,7 +700,9 @@ blktap_device_process_request(struct blk
wmb(); /* blktap_poll() reads req_prod_pvt asynchronously */
ring->ring.req_prod_pvt++;
@@ -234,7 +226,7 @@ References: fate#300964
s64 st_rd_cnt;
--- a/drivers/xen/blktap2-new/device.c
+++ b/drivers/xen/blktap2-new/device.c
-@@ -187,6 +187,8 @@ blktap_device_make_request(struct blktap
+@@ -188,6 +188,8 @@ blktap_device_make_request(struct blktap
request->rq = rq;
request->operation = write ? BLKIF_OP_WRITE : BLKIF_OP_READ;
diff --git a/patches.xen/xen-blktap2-configurable-nr-devs b/patches.xen/xen-blktap2-configurable-nr-devs
index 4097016fcb..d966cc1fc7 100644
--- a/patches.xen/xen-blktap2-configurable-nr-devs
+++ b/patches.xen/xen-blktap2-configurable-nr-devs
@@ -127,7 +127,7 @@ Patch-mainline: Never, SUSE-Xen specific
}
--- a/drivers/xen/blktap2/sysfs.c
+++ b/drivers/xen/blktap2/sysfs.c
-@@ -404,7 +404,7 @@ blktap_sysfs_show_devices(struct class *
+@@ -401,7 +401,7 @@ devices_show(struct class *class, struct
struct blktap *tap;
ret = 0;
diff --git a/patches.xen/xen-clockevents b/patches.xen/xen-clockevents
index 97944bd4c4..e43fdd53e1 100644
--- a/patches.xen/xen-clockevents
+++ b/patches.xen/xen-clockevents
@@ -7,7 +7,7 @@ This could be merged into the 2.6.?? patch.
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -79,7 +79,7 @@ config X86
+@@ -82,7 +82,7 @@ config X86
select DCACHE_WORD_ACCESS
select EDAC_ATOMIC_SCRUB
select EDAC_SUPPORT
@@ -613,7 +613,7 @@ This could be merged into the 2.6.?? patch.
void *data)
--- a/drivers/xen/Kconfig
+++ b/drivers/xen/Kconfig
-@@ -322,9 +322,6 @@ endmenu
+@@ -326,9 +326,6 @@ endmenu
config HAVE_IRQ_IGNORE_UNHANDLED
def_bool y
@@ -632,7 +632,7 @@ This could be merged into the 2.6.?? patch.
+obj-$(CONFIG_GENERIC_CLOCKEVENTS) += clockevents.o
--- /dev/null
+++ b/drivers/xen/core/clockevents.c
-@@ -0,0 +1,301 @@
+@@ -0,0 +1,303 @@
+/*
+ * Xen clockevent functions
+ *
@@ -760,7 +760,9 @@ This could be merged into the 2.6.?? patch.
+ .features = CLOCK_EVT_FEAT_ONESHOT,
+
+ .max_delta_ns = 0xffffffff,
++ .max_delta_ticks = 0xffffffff,
+ .min_delta_ns = TIMER_SLOP,
++ .min_delta_ticks = TIMER_SLOP,
+
+ .mult = 1,
+ .shift = 0,
@@ -936,7 +938,7 @@ This could be merged into the 2.6.?? patch.
+}
--- a/drivers/xen/core/evtchn.c
+++ b/drivers/xen/core/evtchn.c
-@@ -405,6 +405,7 @@ asmlinkage __visible void __irq_entry ev
+@@ -431,6 +431,7 @@ asmlinkage __visible void __irq_entry ev
wmb();
#endif
@@ -944,7 +946,7 @@ This could be merged into the 2.6.?? patch.
/*
* Handle timer interrupts before all others, so that all
* hardirq handlers see an up-to-date system time even if we
-@@ -430,6 +431,7 @@ asmlinkage __visible void __irq_entry ev
+@@ -456,6 +457,7 @@ asmlinkage __visible void __irq_entry ev
BUG();
}
}
diff --git a/patches.xen/xen-configurable-guest-devices b/patches.xen/xen-configurable-guest-devices
index 9b4b7682e2..d93df13093 100644
--- a/patches.xen/xen-configurable-guest-devices
+++ b/patches.xen/xen-configurable-guest-devices
@@ -59,7 +59,7 @@ configurable.
default XEN_COMPAT_040000_AND_LATER
--- a/drivers/xen/core/evtchn.c
+++ b/drivers/xen/core/evtchn.c
-@@ -1916,7 +1916,7 @@ EXPORT_SYMBOL_GPL(nr_pirqs);
+@@ -1944,7 +1944,7 @@ EXPORT_SYMBOL_GPL(nr_pirqs);
int __init arch_probe_nr_irqs(void)
{
diff --git a/patches.xen/xen-cpufreq-report b/patches.xen/xen-cpufreq-report
deleted file mode 100644
index 829ba14038..0000000000
--- a/patches.xen/xen-cpufreq-report
+++ /dev/null
@@ -1,122 +0,0 @@
-From: jbeulich@novell.com
-Subject: make /proc/cpuinfo track CPU speed
-Patch-mainline: Never, SUSE-Xen specific
-References: none
-
---- a/arch/x86/kernel/acpi/processor_extcntl_xen.c
-+++ b/arch/x86/kernel/acpi/processor_extcntl_xen.c
-@@ -27,7 +27,7 @@
- #include <linux/acpi.h>
- #include <linux/pm.h>
- #include <linux/cpu.h>
--
-+#include <linux/export.h>
- #include <linux/cpufreq.h>
- #include <acpi/processor.h>
- #include <asm/hypercall.h>
-@@ -284,3 +284,22 @@ static int __init init_extcntl(void)
- return 0;
- }
- arch_initcall(init_extcntl);
-+
-+unsigned int cpufreq_quick_get(unsigned int cpu)
-+{
-+ xen_platform_op_t op;
-+
-+ op.cmd = XENPF_get_cpu_freq;
-+ op.u.get_cpu_freq.vcpu = cpu;
-+ return HYPERVISOR_platform_op(&op) == 0 ? op.u.get_cpu_freq.freq : 0;
-+}
-+
-+unsigned int cpufreq_quick_get_max(unsigned int cpu)
-+{
-+ xen_platform_op_t op;
-+
-+ op.cmd = XENPF_get_cpu_freq_max;
-+ op.u.get_cpu_freq.vcpu = cpu;
-+ return HYPERVISOR_platform_op(&op) == 0 ? op.u.get_cpu_freq.freq : 0;
-+}
-+EXPORT_SYMBOL(cpufreq_quick_get_max);
---- a/drivers/cpufreq/cpufreq.c
-+++ b/drivers/cpufreq/cpufreq.c
-@@ -30,6 +30,10 @@
- #include <linux/syscore_ops.h>
- #include <linux/tick.h>
- #include <trace/events/power.h>
-+#ifdef CONFIG_PARAVIRT_XEN
-+#include <xen/xen.h>
-+#include <asm/xen/hypercall.h>
-+#endif
-
- static LIST_HEAD(cpufreq_policy_list);
-
-@@ -1455,6 +1459,15 @@ unsigned int cpufreq_quick_get(unsigned
- if (policy) {
- ret_freq = policy->cur;
- cpufreq_cpu_put(policy);
-+#ifdef CONFIG_PARAVIRT_XEN
-+ } else if (xen_domain()) {
-+ struct xen_platform_op op;
-+
-+ op.cmd = XENPF_get_cpu_freq;
-+ op.u.get_cpu_freq.vcpu = cpu;
-+ if (HYPERVISOR_platform_op(&op) == 0)
-+ ret_freq = op.u.get_cpu_freq.freq;
-+#endif
- }
-
- return ret_freq;
-@@ -1475,6 +1488,15 @@ unsigned int cpufreq_quick_get_max(unsig
- if (policy) {
- ret_freq = policy->max;
- cpufreq_cpu_put(policy);
-+#ifdef CONFIG_PARAVIRT_XEN
-+ } else if (xen_domain()) {
-+ struct xen_platform_op op;
-+
-+ op.cmd = XENPF_get_cpu_freq_max;
-+ op.u.get_cpu_freq.vcpu = cpu;
-+ if (HYPERVISOR_platform_op(&op) == 0)
-+ ret_freq = op.u.get_cpu_freq.freq;
-+#endif
- }
-
- return ret_freq;
---- a/include/linux/cpufreq.h
-+++ b/include/linux/cpufreq.h
-@@ -167,7 +167,7 @@ static inline bool policy_is_shared(stru
- /* /sys/devices/system/cpu/cpufreq: entry point for global variables */
- extern struct kobject *cpufreq_global_kobject;
-
--#ifdef CONFIG_CPU_FREQ
-+#if defined(CONFIG_CPU_FREQ) || defined(CONFIG_PROCESSOR_EXTERNAL_CONTROL)
- unsigned int cpufreq_get(unsigned int cpu);
- unsigned int cpufreq_quick_get(unsigned int cpu);
- unsigned int cpufreq_quick_get_max(unsigned int cpu);
---- a/include/xen/interface/platform.h
-+++ b/include/xen/interface/platform.h
-@@ -621,6 +621,16 @@ DEFINE_GUEST_HANDLE_STRUCT(xenpf_symdata
- typedef struct xenpf_symdata xenpf_symdata_t;
- DEFINE_XEN_GUEST_HANDLE(xenpf_symdata_t);
-
-+#define XENPF_get_cpu_freq ('N' << 24)
-+#define XENPF_get_cpu_freq_min (XENPF_get_cpu_freq + 1)
-+#define XENPF_get_cpu_freq_max (XENPF_get_cpu_freq_min + 1)
-+struct xenpf_get_cpu_freq {
-+ /* IN variables */
-+ uint32_t vcpu;
-+ /* OUT variables */
-+ uint32_t freq; /* in kHz */
-+};
-+
- /*
- * ` enum neg_errnoval
- * ` HYPERVISOR_platform_op(const struct xen_platform_op*);
-@@ -651,6 +661,7 @@ struct xen_platform_op {
- struct xenpf_core_parking core_parking;
- struct xenpf_resource_op resource_op;
- struct xenpf_symdata symdata;
-+ struct xenpf_get_cpu_freq get_cpu_freq;
- uint8_t pad[128];
- } u;
- };
diff --git a/patches.xen/xen-cxgb3 b/patches.xen/xen-cxgb3
index 8549cd5e8b..0f034afabe 100644
--- a/patches.xen/xen-cxgb3
+++ b/patches.xen/xen-cxgb3
@@ -19,7 +19,7 @@ Acked-by: bphilips@suse.de
--- a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
-@@ -3319,7 +3319,17 @@ static int init_one(struct pci_dev *pdev
+@@ -3315,7 +3315,17 @@ static int init_one(struct pci_dev *pdev
* register at least one net device.
*/
for_each_port(adapter, i) {
diff --git a/patches.xen/xen-ipi-per-cpu-irq b/patches.xen/xen-ipi-per-cpu-irq
index afc600dbb8..6b58995ffb 100644
--- a/patches.xen/xen-ipi-per-cpu-irq
+++ b/patches.xen/xen-ipi-per-cpu-irq
@@ -5,7 +5,7 @@ References: none
--- a/arch/x86/include/asm/hw_irq.h
+++ b/arch/x86/include/asm/hw_irq.h
-@@ -46,12 +46,11 @@ extern asmlinkage void call_function_int
+@@ -47,12 +47,11 @@ extern asmlinkage void call_function_int
extern asmlinkage void call_function_single_interrupt(void);
#if defined(CONFIG_XEN) && defined(CONFIG_SMP)
@@ -269,7 +269,7 @@ References: none
}
clear_bit(chn, per_cpu(cpu_evtchn_mask, cpu_evtchn[chn]));
-@@ -396,7 +430,10 @@ asmlinkage __visible void __irq_entry ev
+@@ -422,7 +456,10 @@ asmlinkage __visible void __irq_entry ev
port = (l1i * BITS_PER_LONG) + l2i;
mask_evtchn(port);
if ((irq = evtchn_to_irq[port]) != -1) {
@@ -281,7 +281,7 @@ References: none
handled = handle_irq(irq_to_desc(irq), regs);
}
if (!handled)
-@@ -449,6 +486,9 @@ static int find_unbound_irq(unsigned int
+@@ -475,6 +512,9 @@ static int find_unbound_irq(unsigned int
spin_lock(&irq_mapping_update_lock);
if ((data->chip == &no_irq_chip || data->chip == chip) &&
!cfg->bindcount) {
@@ -291,7 +291,7 @@ References: none
cfg->bindcount = 1;
spin_unlock(&irq_mapping_update_lock);
if (nr > 1) {
-@@ -461,9 +501,15 @@ static int find_unbound_irq(unsigned int
+@@ -487,9 +527,15 @@ static int find_unbound_irq(unsigned int
*pcfg = cfg;
irq_set_noprobe(irq);
@@ -309,7 +309,7 @@ References: none
return irq;
}
while (count)
-@@ -615,6 +661,7 @@ static int bind_virq_to_irq(unsigned int
+@@ -641,6 +687,7 @@ static int bind_virq_to_irq(unsigned int
return irq;
}
@@ -317,7 +317,7 @@ References: none
static int bind_ipi_to_irq(unsigned int ipi, unsigned int cpu)
{
int irq;
-@@ -654,12 +701,14 @@ static int bind_ipi_to_irq(unsigned int
+@@ -680,12 +727,14 @@ static int bind_ipi_to_irq(unsigned int
spin_unlock(&irq_mapping_update_lock);
return irq;
}
@@ -332,7 +332,7 @@ References: none
spin_lock(&irq_mapping_update_lock);
if (!--cfg->bindcount && VALID_EVTCHN(evtchn)) {
-@@ -672,10 +721,12 @@ static void unbind_from_irq(unsigned int
+@@ -698,10 +747,12 @@ static void unbind_from_irq(unsigned int
per_cpu(virq_to_irq, cpu_from_evtchn(evtchn))
[index_from_irq_cfg(cfg)] = -1;
break;
@@ -345,7 +345,7 @@ References: none
default:
break;
}
-@@ -692,6 +743,46 @@ static void unbind_from_irq(unsigned int
+@@ -718,6 +769,46 @@ static void unbind_from_irq(unsigned int
spin_unlock(&irq_mapping_update_lock);
}
@@ -392,7 +392,7 @@ References: none
int bind_caller_port_to_irqhandler(
unsigned int caller_port,
irq_handler_t handler,
-@@ -786,6 +877,8 @@ int bind_virq_to_irqhandler(
+@@ -812,6 +903,8 @@ int bind_virq_to_irqhandler(
}
EXPORT_SYMBOL_GPL(bind_virq_to_irqhandler);
@@ -401,7 +401,7 @@ References: none
int bind_ipi_to_irqhandler(
unsigned int ipi,
unsigned int cpu,
-@@ -809,7 +902,73 @@ int bind_ipi_to_irqhandler(
+@@ -835,7 +928,73 @@ int bind_ipi_to_irqhandler(
return irq;
}
@@ -476,7 +476,7 @@ References: none
void unbind_from_irqhandler(unsigned int irq, void *dev_id)
{
-@@ -822,12 +981,14 @@ EXPORT_SYMBOL_GPL(unbind_from_irqhandler
+@@ -848,12 +1007,14 @@ EXPORT_SYMBOL_GPL(unbind_from_irqhandler
static int set_affinity_irq(struct irq_data *data,
const struct cpumask *dest, bool force)
{
@@ -492,7 +492,7 @@ References: none
if (!VALID_EVTCHN(port))
return -ENXIO;
-@@ -1084,10 +1245,46 @@ int irq_ignore_unhandled(unsigned int ir
+@@ -1110,10 +1271,46 @@ int irq_ignore_unhandled(unsigned int ir
return !!(irq_status.flags & XENIRQSTAT_shared);
}
@@ -540,7 +540,7 @@ References: none
if (VALID_EVTCHN(evtchn))
notify_remote_via_evtchn(evtchn);
}
-@@ -1095,7 +1292,12 @@ EXPORT_SYMBOL_GPL(notify_remote_via_irq)
+@@ -1121,7 +1318,12 @@ EXPORT_SYMBOL_GPL(notify_remote_via_irq)
int irq_to_evtchn_port(int irq)
{
@@ -554,7 +554,7 @@ References: none
}
EXPORT_SYMBOL_GPL(irq_to_evtchn_port);
-@@ -1183,14 +1385,25 @@ static void restore_cpu_virqs(unsigned i
+@@ -1209,14 +1411,25 @@ static void restore_cpu_virqs(unsigned i
static void restore_cpu_ipis(unsigned int cpu)
{
@@ -583,7 +583,7 @@ References: none
data = irq_get_irq_data(irq);
BUG_ON(irqd_cfg(data)->info != mk_irq_info(IRQT_IPI, ipi, 0));
-@@ -1204,13 +1417,23 @@ static void restore_cpu_ipis(unsigned in
+@@ -1230,13 +1443,23 @@ static void restore_cpu_ipis(unsigned in
/* Record the new mapping. */
evtchn_to_irq[evtchn] = irq;
@@ -782,7 +782,7 @@ References: none
static void cpu_bringup(void)
--- a/include/xen/evtchn.h
+++ b/include/xen/evtchn.h
-@@ -97,6 +97,8 @@ int bind_virq_to_irqhandler(
+@@ -98,6 +98,8 @@ int bind_virq_to_irqhandler(
unsigned long irqflags,
const char *devname,
void *dev_id);
@@ -791,7 +791,7 @@ References: none
int bind_ipi_to_irqhandler(
unsigned int ipi,
unsigned int cpu,
-@@ -104,6 +106,13 @@ int bind_ipi_to_irqhandler(
+@@ -105,6 +107,13 @@ int bind_ipi_to_irqhandler(
unsigned long irqflags,
const char *devname,
void *dev_id);
@@ -805,7 +805,7 @@ References: none
/*
* Common unbind function for all event sources. Takes IRQ to unbind from.
-@@ -112,6 +121,11 @@ int bind_ipi_to_irqhandler(
+@@ -113,6 +122,11 @@ int bind_ipi_to_irqhandler(
*/
void unbind_from_irqhandler(unsigned int irq, void *dev_id);
@@ -817,7 +817,7 @@ References: none
#ifndef CONFIG_XEN
void irq_resume(void);
#endif
-@@ -177,5 +191,10 @@ int xen_test_irq_pending(int irq);
+@@ -178,5 +192,10 @@ int xen_test_irq_pending(int irq);
void notify_remote_via_irq(int irq);
int irq_to_evtchn_port(int irq);
diff --git a/patches.xen/xen-netback-notify-multi b/patches.xen/xen-netback-notify-multi
index 505eaa3273..99c7ec3448 100644
--- a/patches.xen/xen-netback-notify-multi
+++ b/patches.xen/xen-netback-notify-multi
@@ -8,7 +8,7 @@ get sent in the order requests came in rather than in the inverse one.
--- a/drivers/xen/core/evtchn.c
+++ b/drivers/xen/core/evtchn.c
-@@ -1556,6 +1556,27 @@ void notify_remote_via_irq(int irq)
+@@ -1582,6 +1582,27 @@ void notify_remote_via_irq(int irq)
}
EXPORT_SYMBOL_GPL(notify_remote_via_irq);
@@ -410,7 +410,7 @@ get sent in the order requests came in rather than in the inverse one.
static netif_rx_response_t *make_rx_response(netif_t *netif,
--- a/include/xen/evtchn.h
+++ b/include/xen/evtchn.h
-@@ -196,6 +196,18 @@ static inline void notify_remote_via_evt
+@@ -197,6 +197,18 @@ static inline void notify_remote_via_evt
VOID(HYPERVISOR_event_channel_op(EVTCHNOP_send, &send));
}
@@ -429,7 +429,7 @@ get sent in the order requests came in rather than in the inverse one.
static inline int close_evtchn(int port)
{
struct evtchn_close close = { .port = port };
-@@ -210,6 +222,7 @@ int xen_test_irq_pending(int irq);
+@@ -211,6 +223,7 @@ int xen_test_irq_pending(int irq);
* by bind_*_to_irqhandler().
*/
void notify_remote_via_irq(int irq);
diff --git a/patches.xen/xen-pcpu b/patches.xen/xen-pcpu
index e95cf62b46..718d8f8143 100644
--- a/patches.xen/xen-pcpu
+++ b/patches.xen/xen-pcpu
@@ -110,7 +110,7 @@ Acked-by: jbeulich@novell.com
cpu_maps_update_begin();
cpu_hotplug_begin();
-@@ -450,10 +461,6 @@ static int acpi_processor_add(struct acp
+@@ -449,10 +460,6 @@ static int acpi_processor_add(struct acp
goto err;
}
@@ -121,7 +121,7 @@ Acked-by: jbeulich@novell.com
/*
* processor_device_array is not cleared on errors to allow buggy BIOS
* checks.
-@@ -466,6 +473,10 @@ static int acpi_processor_add(struct acp
+@@ -465,6 +472,10 @@ static int acpi_processor_add(struct acp
per_cpu(processors, pr->id) = pr;
dev = get_cpu_device(pr->id);
@@ -132,7 +132,7 @@ Acked-by: jbeulich@novell.com
if (!dev) {
result = -ENODEV;
goto err;
-@@ -483,9 +494,6 @@ static int acpi_processor_add(struct acp
+@@ -482,9 +493,6 @@ static int acpi_processor_add(struct acp
dev_err(dev, "Processor driver could not be attached\n");
acpi_unbind_one(dev);
@@ -177,7 +177,7 @@ Acked-by: jbeulich@novell.com
static void acpi_processor_notify(acpi_handle handle, u32 event, void *data)
{
struct acpi_device *device = data;
-@@ -318,6 +328,14 @@ static int __init acpi_processor_driver_
+@@ -326,6 +336,14 @@ static int __init acpi_processor_driver_
if (acpi_disabled)
return 0;
@@ -192,7 +192,7 @@ Acked-by: jbeulich@novell.com
result = driver_register(&acpi_processor_driver);
if (result < 0)
return result;
-@@ -350,6 +368,10 @@ static void __exit acpi_processor_driver
+@@ -358,6 +376,10 @@ static void __exit acpi_processor_driver
cpuhp_remove_state_nocalls(hp_online);
cpuhp_remove_state_nocalls(CPUHP_ACPI_CPUDRV_DEAD);
driver_unregister(&acpi_processor_driver);
@@ -666,4 +666,4 @@ Acked-by: jbeulich@novell.com
+#endif
#ifdef CONFIG_HOTPLUG_CPU
- /* Stop CPUs going up and down. */
+ extern void cpus_write_lock(void);
diff --git a/patches.xen/xen-privcmd-hcall-preemption b/patches.xen/xen-privcmd-hcall-preemption
index 8851f39f3d..bf9850b7af 100644
--- a/patches.xen/xen-privcmd-hcall-preemption
+++ b/patches.xen/xen-privcmd-hcall-preemption
@@ -5,7 +5,7 @@ References: bnc#861093
--- a/arch/x86/entry/entry_32-xen.S
+++ b/arch/x86/entry/entry_32-xen.S
-@@ -789,6 +789,17 @@ ENTRY(hypervisor_callback)
+@@ -773,6 +773,17 @@ ENTRY(hypervisor_callback)
pushl %esp
call evtchn_do_upcall
add $4, %esp
@@ -25,10 +25,10 @@ References: bnc#861093
# [How we do the fixup]. We want to merge the current stack frame with the
--- a/arch/x86/entry/entry_64-xen.S
+++ b/arch/x86/entry/entry_64-xen.S
-@@ -546,6 +546,17 @@ ENTRY(do_hypervisor_callback) # do_hyp
+@@ -643,6 +643,18 @@ ENTRY(do_hypervisor_callback) # do_hyp
call evtchn_do_upcall
- popq %rsp
- decl PER_CPU_VAR(irq_count)
+ LEAVE_IRQ_STACK
+
+#ifndef CONFIG_PREEMPT
+ test %al, %al
+ jz error_exit
@@ -40,12 +40,13 @@ References: bnc#861093
+ call preempt_schedule_irq
+ movb $1, PER_CPU_VAR(privcmd_hcall)
+#endif
++
jmp error_exit
END(do_hypervisor_callback)
--- a/arch/x86/include/mach-xen/asm/hypervisor.h
+++ b/arch/x86/include/mach-xen/asm/hypervisor.h
-@@ -230,6 +230,9 @@ static inline int gnttab_post_map_adjust
+@@ -231,6 +231,9 @@ static inline int gnttab_post_map_adjust
#ifdef CONFIG_XEN
#define is_running_on_xen() 1
extern char hypercall_page[PAGE_SIZE];
@@ -57,7 +58,7 @@ References: bnc#861093
#define is_running_on_xen() (!!hypercall_stubs)
--- a/drivers/xen/core/evtchn.c
+++ b/drivers/xen/core/evtchn.c
-@@ -376,7 +376,14 @@ static DEFINE_PER_CPU(unsigned int, curr
+@@ -402,7 +402,14 @@ static DEFINE_PER_CPU(unsigned int, curr
static DEFINE_PER_CPU(unsigned int, current_l2i);
/* NB. Interrupts are disabled on entry. */
@@ -73,7 +74,7 @@ References: bnc#861093
{
unsigned long l1, l2;
unsigned long masked_l1, masked_l2;
-@@ -391,7 +398,7 @@ asmlinkage __visible void __irq_entry ev
+@@ -417,7 +424,7 @@ asmlinkage __visible void __irq_entry ev
__this_cpu_or(upcall_state, UPC_NESTED_LATCH);
/* Avoid a callback storm when we reenable delivery. */
vcpu_info->evtchn_upcall_pending = 0;
@@ -82,7 +83,7 @@ References: bnc#861093
}
old_regs = set_irq_regs(regs);
-@@ -504,6 +511,9 @@ asmlinkage __visible void __irq_entry ev
+@@ -530,6 +537,9 @@ asmlinkage __visible void __irq_entry ev
__this_cpu_write(upcall_state, UPC_INACTIVE);
irq_exit();
set_irq_regs(old_regs);
@@ -134,7 +135,7 @@ References: bnc#861093
--- a/include/xen/evtchn.h
+++ b/include/xen/evtchn.h
-@@ -146,7 +146,13 @@ void irq_resume(void);
+@@ -147,7 +147,13 @@ void irq_resume(void);
#endif
/* Entry point for notifications into Linux subsystems. */
@@ -149,7 +150,7 @@ References: bnc#861093
/* Mark a PIRQ as unavailable for dynamic allocation. */
int evtchn_register_pirq(int irq, unsigned int xen_pirq);
-@@ -211,5 +217,7 @@ void notify_remote_via_ipi(unsigned int
+@@ -212,5 +218,7 @@ void notify_remote_via_ipi(unsigned int
void clear_ipi_evtchn(void);
#endif
diff --git a/patches.xen/xen-privcmd-truly-batch b/patches.xen/xen-privcmd-truly-batch
index 55c0b85d96..a462f34895 100644
--- a/patches.xen/xen-privcmd-truly-batch
+++ b/patches.xen/xen-privcmd-truly-batch
@@ -7,7 +7,7 @@ Inspired by a functionally similar pv-ops patch from Mats Petersson.
--- a/arch/x86/include/mach-xen/asm/pgtable.h
+++ b/arch/x86/include/mach-xen/asm/pgtable.h
-@@ -1238,6 +1238,14 @@ int direct_remap_pfn_range(struct vm_are
+@@ -1357,6 +1357,14 @@ int direct_remap_pfn_range(struct vm_are
unsigned long size,
pgprot_t,
domid_t);
@@ -24,7 +24,7 @@ Inspired by a functionally similar pv-ops patch from Mats Petersson.
unsigned long size,
--- a/arch/x86/mm/ioremap-xen.c
+++ b/arch/x86/mm/ioremap-xen.c
-@@ -43,60 +43,79 @@ static int direct_remap_area_pte_fn(pte_
+@@ -44,60 +44,79 @@ static int direct_remap_area_pte_fn(pte_
static int __direct_remap_pfn_range(struct mm_struct *mm,
unsigned long address,
unsigned long mfn,
@@ -43,8 +43,8 @@ Inspired by a functionally similar pv-ops patch from Mats Petersson.
+ unsigned int i, idx;
+ mmu_update_t *u, *v;
-- u = v = w = (mmu_update_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
-+ u = (mmu_update_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
+- u = v = w = (mmu_update_t *)__get_free_page(GFP_KERNEL|__GFP_RETRY_MAYFAIL);
++ u = (mmu_update_t *)__get_free_page(GFP_KERNEL|__GFP_RETRY_MAYFAIL);
if (u == NULL)
return -ENOMEM;
@@ -136,7 +136,7 @@ Inspired by a functionally similar pv-ops patch from Mats Petersson.
flush_tlb_all();
free_page((unsigned long)u);
-@@ -120,8 +139,8 @@ int direct_remap_pfn_range(struct vm_are
+@@ -121,8 +140,8 @@ int direct_remap_pfn_range(struct vm_are
vma->vm_flags |= VM_IO | VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP;
vma->vm_mm->context.has_foreign_mappings = true;
@@ -147,7 +147,7 @@ Inspired by a functionally similar pv-ops patch from Mats Petersson.
}
EXPORT_SYMBOL(direct_remap_pfn_range);
-@@ -131,11 +150,41 @@ int direct_kernel_remap_pfn_range(unsign
+@@ -132,11 +151,41 @@ int direct_kernel_remap_pfn_range(unsign
pgprot_t prot,
domid_t domid)
{
@@ -191,7 +191,7 @@ Inspired by a functionally similar pv-ops patch from Mats Petersson.
static int lookup_pte_fn(
pte_t *pte, struct page *pmd_page, unsigned long addr, void *data)
{
-@@ -358,7 +407,7 @@ static void __iomem *__ioremap_caller(re
+@@ -359,7 +408,7 @@ static void __iomem *__ioremap_caller(re
goto err_free_area;
if (__direct_remap_pfn_range(&init_mm, vaddr, PFN_DOWN(phys_addr),
diff --git a/patches.xen/xen-pv-on-hvm-skip-initialization-of-emulated-devices b/patches.xen/xen-pv-on-hvm-skip-initialization-of-emulated-devices
index 2b9785adb8..b3baf42adc 100644
--- a/patches.xen/xen-pv-on-hvm-skip-initialization-of-emulated-devices
+++ b/patches.xen/xen-pv-on-hvm-skip-initialization-of-emulated-devices
@@ -105,7 +105,7 @@ Signed-off-by: Olaf Hering <ohering@suse.de>
/*
* PCI device identifiers for "new style" Linux PCI Device Drivers
-@@ -3006,6 +3007,9 @@ MODULE_LICENSE("GPL");
+@@ -3003,6 +3004,9 @@ MODULE_LICENSE("GPL");
static int __init pcnet32_init_module(void)
{
@@ -125,7 +125,7 @@ Signed-off-by: Olaf Hering <ohering@suse.de>
#define DRV_NAME "e100"
-@@ -3187,6 +3188,9 @@ static struct pci_driver e100_driver = {
+@@ -3190,6 +3191,9 @@ static struct pci_driver e100_driver = {
static int __init e100_init_module(void)
{
@@ -145,7 +145,7 @@ Signed-off-by: Olaf Hering <ohering@suse.de>
char e1000_driver_name[] = "e1000";
static char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver";
-@@ -249,6 +250,10 @@ struct net_device *e1000_get_hw_dev(stru
+@@ -248,6 +249,10 @@ struct net_device *e1000_get_hw_dev(stru
static int __init e1000_init_module(void)
{
int ret;
@@ -166,7 +166,7 @@ Signed-off-by: Olaf Hering <ohering@suse.de>
/* These identify the driver base version and may not be removed. */
static char version[] =
-@@ -1884,6 +1885,9 @@ static int cp_init_one (struct pci_dev *
+@@ -1885,6 +1886,9 @@ static int cp_init_one (struct pci_dev *
resource_size_t pciaddr;
unsigned int addr_len, i, pci_using_dac;
@@ -186,7 +186,7 @@ Signed-off-by: Olaf Hering <ohering@suse.de>
#define RTL8139_DRIVER_NAME DRV_NAME " Fast Ethernet driver " DRV_VERSION
-@@ -2666,6 +2667,9 @@ static struct pci_driver rtl8139_pci_dri
+@@ -2668,6 +2669,9 @@ static struct pci_driver rtl8139_pci_dri
static int __init rtl8139_init_module (void)
{
diff --git a/patches.xen/xen-setup-gsi b/patches.xen/xen-setup-gsi
index a73735a537..73ce8f7377 100644
--- a/patches.xen/xen-setup-gsi
+++ b/patches.xen/xen-setup-gsi
@@ -9,7 +9,7 @@ whether the kernel is also going to (try to) use those interrupts.
--- a/arch/x86/kernel/apic/io_apic-xen.c
+++ b/arch/x86/kernel/apic/io_apic-xen.c
-@@ -3075,7 +3075,28 @@ int mp_irqdomain_alloc(struct irq_domain
+@@ -3072,7 +3072,28 @@ int mp_irqdomain_alloc(struct irq_domain
ioapic, mpc_ioapic_id(ioapic), pin, cfg->vector,
virq, data->trigger, data->polarity, cfg->dest_apicid);
#else
diff --git a/patches.xen/xen-sys-suspend b/patches.xen/xen-sys-suspend
index a3f8d0e696..07bff3a155 100644
--- a/patches.xen/xen-sys-suspend
+++ b/patches.xen/xen-sys-suspend
@@ -138,7 +138,7 @@ References: none
--- a/drivers/xen/core/evtchn.c
+++ b/drivers/xen/core/evtchn.c
-@@ -1150,6 +1150,8 @@ int xen_test_irq_pending(int irq)
+@@ -1176,6 +1176,8 @@ int xen_test_irq_pending(int irq)
}
#ifdef CONFIG_PM_SLEEP
@@ -147,7 +147,7 @@ References: none
static void restore_cpu_virqs(unsigned int cpu)
{
struct evtchn_bind_virq bind_virq;
-@@ -1211,9 +1213,20 @@ static void restore_cpu_ipis(unsigned in
+@@ -1237,9 +1239,20 @@ static void restore_cpu_ipis(unsigned in
}
}
@@ -169,7 +169,7 @@ References: none
init_evtchn_cpu_bindings();
-@@ -1254,8 +1267,19 @@ void irq_resume(void)
+@@ -1280,8 +1293,19 @@ void irq_resume(void)
restore_cpu_virqs(cpu);
restore_cpu_ipis(cpu);
}
@@ -445,7 +445,7 @@ References: none
#endif
--- a/include/xen/evtchn.h
+++ b/include/xen/evtchn.h
-@@ -112,7 +112,9 @@ int bind_ipi_to_irqhandler(
+@@ -113,7 +113,9 @@ int bind_ipi_to_irqhandler(
*/
void unbind_from_irqhandler(unsigned int irq, void *dev_id);
diff --git a/patches.xen/xen-unpriv-build b/patches.xen/xen-unpriv-build
index 1bee8fbf63..21462da4f0 100644
--- a/patches.xen/xen-unpriv-build
+++ b/patches.xen/xen-unpriv-build
@@ -5,7 +5,7 @@ References: none
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -859,6 +859,7 @@ config DMI
+@@ -870,6 +870,7 @@ config DMI
default y
select DMI_SCAN_MACHINE_NON_EFI_FALLBACK
bool "Enable DMI scanning" if EXPERT
@@ -13,7 +13,7 @@ References: none
---help---
Enabled scanning of DMI to identify machine quirks. Say Y
here unless you have verified that your setup is not
-@@ -917,7 +918,8 @@ config CALGARY_IOMMU_ENABLED_BY_DEFAULT
+@@ -928,7 +929,8 @@ config CALGARY_IOMMU_ENABLED_BY_DEFAULT
# need this always selected by IOMMU for the VIA workaround
config SWIOTLB
@@ -23,7 +23,7 @@ References: none
---help---
Support for software bounce buffers used on x86-64 systems
which don't have a hardware IOMMU. Using this PCI devices
-@@ -1411,7 +1413,6 @@ config HIGHMEM
+@@ -1430,7 +1432,6 @@ config HIGHMEM
config X86_PAE
bool "PAE (Physical Address Extension) Support"
depends on X86_32 && !HIGHMEM4G
@@ -31,7 +31,7 @@ References: none
---help---
PAE is required for NX support, and furthermore enables
larger swapspace support for non-overcommit purposes. It
-@@ -2512,13 +2513,15 @@ config PCI_GOBIOS
+@@ -2531,13 +2532,15 @@ config PCI_GOBIOS
config PCI_GOMMCONFIG
bool "MMConfig"
@@ -48,7 +48,7 @@ References: none
config PCI_GOXEN_FE
bool "Xen PCI Frontend"
-@@ -2529,6 +2532,7 @@ config PCI_GOXEN_FE
+@@ -2548,6 +2551,7 @@ config PCI_GOXEN_FE
config PCI_GOANY
bool "Any"
@@ -56,7 +56,7 @@ References: none
endchoice
-@@ -2736,7 +2740,7 @@ endif # X86_32
+@@ -2755,7 +2759,7 @@ endif # X86_32
config AMD_NB
def_bool y
@@ -67,7 +67,7 @@ References: none
--- a/arch/x86/Kconfig.debug
+++ b/arch/x86/Kconfig.debug
-@@ -16,6 +16,7 @@ config X86_VERBOSE_BOOTUP
+@@ -19,6 +19,7 @@ config X86_VERBOSE_BOOTUP
config EARLY_PRINTK
bool "Early printk" if EXPERT
@@ -99,7 +99,7 @@ References: none
The PCI device frontend driver allows the kernel to import arbitrary
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
-@@ -760,7 +760,7 @@ config FB_UVESA
+@@ -758,7 +758,7 @@ config FB_UVESA
config FB_VESA
bool "VESA VGA graphics support"
@@ -230,7 +230,7 @@ References: none
--- a/drivers/xen/core/evtchn.c
+++ b/drivers/xen/core/evtchn.c
-@@ -2013,6 +2013,7 @@ int evtchn_register_pirq(int irq, unsign
+@@ -2041,6 +2041,7 @@ int evtchn_register_pirq(int irq, unsign
? HYPERVISOR_physdev_op(PHYSDEVOP_map_pirq, &map_pirq) : 0;
}
@@ -238,7 +238,7 @@ References: none
int evtchn_map_pirq(int irq, unsigned int xen_pirq, unsigned int nr)
{
if (irq < 0) {
-@@ -2095,6 +2096,7 @@ int evtchn_map_pirq(int irq, unsigned in
+@@ -2123,6 +2124,7 @@ int evtchn_map_pirq(int irq, unsigned in
}
return index_from_irq(irq) ? irq : -EINVAL;
}
@@ -415,7 +415,7 @@ References: none
return;
--- a/drivers/xen/xenbus/xenbus_xs.c
+++ b/drivers/xen/xenbus/xenbus_xs.c
-@@ -984,7 +984,11 @@ static struct notifier_block xs_reboot_n
+@@ -986,7 +986,11 @@ static struct notifier_block xs_reboot_n
.notifier_call = xs_reboot_notify,
};
@@ -430,7 +430,7 @@ References: none
struct task_struct *task;
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
-@@ -1511,7 +1511,7 @@ static long do_ioctl_trans(unsigned int
+@@ -1504,7 +1504,7 @@ static long do_ioctl_trans(unsigned int
return do_video_stillpicture(file, cmd, argp);
case VIDEO_SET_SPU_PALETTE:
return do_video_set_spu_palette(file, cmd, argp);
diff --git a/patches.xen/xen-virq-per-cpu-irq b/patches.xen/xen-virq-per-cpu-irq
index 7c4d50a84f..35553951e8 100644
--- a/patches.xen/xen-virq-per-cpu-irq
+++ b/patches.xen/xen-virq-per-cpu-irq
@@ -137,7 +137,7 @@ References: none
return cfg->info & ((1U << _EVTCHN_BITS) - 1);
}
-@@ -380,13 +410,22 @@ asmlinkage __visible void __irq_entry ev
+@@ -406,13 +436,22 @@ asmlinkage __visible void __irq_entry ev
* hardirq handlers see an up-to-date system time even if we
* have just woken from a long idle period.
*/
@@ -160,7 +160,7 @@ References: none
if (!handle_irq(irq_to_desc(irq), regs))
BUG();
}
-@@ -644,6 +683,15 @@ static int bind_virq_to_irq(unsigned int
+@@ -670,6 +709,15 @@ static int bind_virq_to_irq(unsigned int
BUG();
evtchn_to_irq[bind_virq.port] = irq;
@@ -176,7 +176,7 @@ References: none
cfg->info = mk_irq_info(IRQT_VIRQ, virq, bind_virq.port);
per_cpu(virq_to_irq, cpu)[virq] = irq;
-@@ -708,7 +756,9 @@ static void unbind_from_irq(unsigned int
+@@ -734,7 +782,9 @@ static void unbind_from_irq(unsigned int
struct irq_cfg *cfg = irq_cfg(irq);
unsigned int evtchn = evtchn_from_irq_cfg(cfg);
@@ -186,7 +186,7 @@ References: none
spin_lock(&irq_mapping_update_lock);
if (!--cfg->bindcount && VALID_EVTCHN(evtchn)) {
-@@ -720,6 +770,15 @@ static void unbind_from_irq(unsigned int
+@@ -746,6 +796,15 @@ static void unbind_from_irq(unsigned int
case IRQT_VIRQ:
per_cpu(virq_to_irq, cpu_from_evtchn(evtchn))
[index_from_irq_cfg(cfg)] = -1;
@@ -202,7 +202,7 @@ References: none
break;
#if defined(CONFIG_SMP) && defined(PER_CPU_IPI_IRQ)
case IRQT_IPI:
-@@ -743,13 +802,34 @@ static void unbind_from_irq(unsigned int
+@@ -769,13 +828,34 @@ static void unbind_from_irq(unsigned int
spin_unlock(&irq_mapping_update_lock);
}
@@ -239,7 +239,7 @@ References: none
spin_lock(&irq_mapping_update_lock);
-@@ -758,6 +838,34 @@ void unbind_from_per_cpu_irq(unsigned in
+@@ -784,6 +864,34 @@ void unbind_from_per_cpu_irq(unsigned in
BUG_ON(cfg->bindcount <= 1);
cfg->bindcount--;
@@ -274,7 +274,7 @@ References: none
cpumask_clear_cpu(cpu, irq_data_get_affinity_mask(data));
close.port = evtchn;
-@@ -765,9 +873,17 @@ void unbind_from_per_cpu_irq(unsigned in
+@@ -791,9 +899,17 @@ void unbind_from_per_cpu_irq(unsigned in
BUG();
switch (type_from_irq_cfg(cfg)) {
@@ -292,7 +292,7 @@ References: none
default:
BUG();
break;
-@@ -779,9 +895,20 @@ void unbind_from_per_cpu_irq(unsigned in
+@@ -805,9 +921,20 @@ void unbind_from_per_cpu_irq(unsigned in
evtchn_to_irq[evtchn] = -1;
}
@@ -314,7 +314,7 @@ References: none
int bind_caller_port_to_irqhandler(
unsigned int caller_port,
-@@ -863,6 +990,10 @@ int bind_virq_to_irqhandler(
+@@ -889,6 +1016,10 @@ int bind_virq_to_irqhandler(
{
int irq, retval;
@@ -325,7 +325,7 @@ References: none
irq = bind_virq_to_irq(virq, cpu);
if (irq < 0)
return irq;
-@@ -878,6 +1009,125 @@ int bind_virq_to_irqhandler(
+@@ -904,6 +1035,125 @@ int bind_virq_to_irqhandler(
EXPORT_SYMBOL_GPL(bind_virq_to_irqhandler);
#ifdef CONFIG_SMP
@@ -451,7 +451,7 @@ References: none
#ifdef PER_CPU_IPI_IRQ
int bind_ipi_to_irqhandler(
unsigned int ipi,
-@@ -959,7 +1209,7 @@ int bind_ipi_to_irqaction(
+@@ -985,7 +1235,7 @@ int bind_ipi_to_irqaction(
action->flags |= IRQF_PERCPU | IRQF_NO_SUSPEND;
retval = setup_irq(ipi_irq, action);
if (retval) {
@@ -460,7 +460,7 @@ References: none
BUG_ON(retval > 0);
ipi_irq = retval;
}
-@@ -988,7 +1238,9 @@ static int set_affinity_irq(struct irq_d
+@@ -1014,7 +1264,9 @@ static int set_affinity_irq(struct irq_d
bool masked;
int rc;
@@ -470,7 +470,7 @@ References: none
if (!VALID_EVTCHN(port))
return -ENXIO;
-@@ -1283,7 +1535,9 @@ void notify_remote_via_irq(int irq)
+@@ -1309,7 +1561,9 @@ void notify_remote_via_irq(int irq)
if (WARN_ON_ONCE(!cfg))
return;
@@ -480,7 +480,7 @@ References: none
evtchn = evtchn_from_irq_cfg(cfg);
if (VALID_EVTCHN(evtchn))
notify_remote_via_evtchn(evtchn);
-@@ -1296,6 +1550,7 @@ int irq_to_evtchn_port(int irq)
+@@ -1322,6 +1576,7 @@ int irq_to_evtchn_port(int irq)
if (!cfg)
return 0;
@@ -488,7 +488,7 @@ References: none
BUG_IF_IPI(cfg);
return evtchn_from_irq_cfg(cfg);
}
-@@ -1363,6 +1618,12 @@ static void restore_cpu_virqs(unsigned i
+@@ -1389,6 +1644,12 @@ static void restore_cpu_virqs(unsigned i
if ((irq = per_cpu(virq_to_irq, cpu)[virq]) == -1)
continue;
@@ -501,7 +501,7 @@ References: none
BUG_ON(irq_cfg(irq)->info != mk_irq_info(IRQT_VIRQ, virq, 0));
/* Get a new binding from Xen. */
-@@ -1375,7 +1636,20 @@ static void restore_cpu_virqs(unsigned i
+@@ -1401,7 +1662,20 @@ static void restore_cpu_virqs(unsigned i
/* Record the new mapping. */
evtchn_to_irq[evtchn] = irq;
@@ -522,7 +522,7 @@ References: none
_bind_evtchn_to_cpu(evtchn, cpu, NULL, NULL);
/* Ready for use. */
-@@ -1443,7 +1717,11 @@ static void evtchn_resume(void)
+@@ -1469,7 +1743,11 @@ static void evtchn_resume(void)
/* Avoid doing anything in the 'suspend cancelled' case. */
status.dom = DOMID_SELF;
@@ -534,7 +534,7 @@ References: none
if (HYPERVISOR_event_channel_op(EVTCHNOP_status, &status))
BUG();
if (status.status == EVTCHNSTAT_virq
-@@ -1821,6 +2099,15 @@ void __init xen_init_IRQ(void)
+@@ -1849,6 +2127,15 @@ void __init xen_init_IRQ(void)
unsigned int i;
struct physdev_pirq_eoi_gmfn eoi_gmfn;
@@ -603,7 +603,7 @@ References: none
return 0;
--- a/drivers/xen/xenoprof/xenoprofile.c
+++ b/drivers/xen/xenoprof/xenoprofile.c
-@@ -53,8 +53,9 @@ extern unsigned long oprofile_backtrace_
+@@ -54,8 +54,9 @@ extern unsigned long oprofile_backtrace_
/* Number of buffers in shared area (one per VCPU) */
static int nbuf;
@@ -615,7 +615,7 @@ References: none
/* cpu model type string - copied from Xen on XENOPROF_init command */
static char cpu_type[XENOPROF_CPU_TYPE_SIZE];
-@@ -202,17 +203,20 @@ static irqreturn_t xenoprof_ovf_interrup
+@@ -203,17 +204,20 @@ static irqreturn_t xenoprof_ovf_interrup
return IRQ_HANDLED;
}
@@ -640,7 +640,7 @@ References: none
}
-@@ -222,19 +226,22 @@ static int bind_virq(void)
+@@ -223,19 +227,22 @@ static int bind_virq(void)
int result;
for_each_online_cpu(i) {
@@ -670,7 +670,7 @@ References: none
}
return 0;
-@@ -531,9 +538,11 @@ static int using_xenoprof;
+@@ -532,9 +539,11 @@ static int using_xenoprof;
int __init xenoprofile_init(struct oprofile_operations * ops)
{
struct xenoprof_init init;
@@ -683,7 +683,7 @@ References: none
ret = HYPERVISOR_xenoprof_op(XENOPROF_init, &init);
if (!ret) {
xenoprof_arch_init_counter(&init);
-@@ -547,11 +556,9 @@ int __init xenoprofile_init(struct oprof
+@@ -548,11 +557,9 @@ int __init xenoprofile_init(struct oprof
using_xenoprof = 1;
*ops = xenoprof_ops;
@@ -697,7 +697,7 @@ References: none
pr_info("%s: ret %d, events %d, xenoprof_is_primary %d\n",
__func__, ret, init.num_events, xenoprof_is_primary);
-@@ -569,4 +576,6 @@ void xenoprofile_exit(void)
+@@ -570,4 +577,6 @@ void xenoprofile_exit(void)
unmap_passive_list();
WARN_ON(HYPERVISOR_xenoprof_op(XENOPROF_shutdown, NULL));
}
@@ -706,7 +706,7 @@ References: none
}
--- a/include/xen/evtchn.h
+++ b/include/xen/evtchn.h
-@@ -97,6 +97,17 @@ int bind_virq_to_irqhandler(
+@@ -98,6 +98,17 @@ int bind_virq_to_irqhandler(
unsigned long irqflags,
const char *devname,
void *dev_id);
@@ -724,7 +724,7 @@ References: none
#if defined(CONFIG_SMP) && !defined(MODULE)
#ifndef CONFIG_X86
int bind_ipi_to_irqhandler(
-@@ -121,9 +132,13 @@ DECLARE_PER_CPU(DECLARE_BITMAP(, NR_IPIS
+@@ -122,9 +133,13 @@ DECLARE_PER_CPU(DECLARE_BITMAP(, NR_IPIS
*/
void unbind_from_irqhandler(unsigned int irq, void *dev_id);
diff --git a/patches.xen/xen-vscsi-large-requests b/patches.xen/xen-vscsi-large-requests
index 0af1b70d4c..bc7980fe78 100644
--- a/patches.xen/xen-vscsi-large-requests
+++ b/patches.xen/xen-vscsi-large-requests
@@ -236,7 +236,7 @@ References: bnc#774818
if (err)
goto fail_flush;
}
-@@ -478,7 +501,7 @@ static void scsiback_device_reset_exec(p
+@@ -477,7 +500,7 @@ static void scsiback_device_reset_exec(p
set_fs(old_fs);
scsiback_do_resp_with_sense(NULL, err ? FAILED : SUCCESS, 0,
@@ -245,7 +245,7 @@ References: bnc#774818
scsiback_put(info);
return;
-@@ -496,13 +519,11 @@ static int prepare_pending_reqs(struct v
+@@ -495,13 +518,11 @@ static int prepare_pending_reqs(struct v
{
struct scsi_device *sdev;
struct ids_tuple vir;
@@ -260,7 +260,7 @@ References: bnc#774818
pending_req->info = info;
vir.chn = ring_req->channel;
-@@ -534,11 +555,10 @@ static int prepare_pending_reqs(struct v
+@@ -533,11 +554,10 @@ static int prepare_pending_reqs(struct v
goto invalid_value;
}
@@ -275,7 +275,7 @@ References: bnc#774818
err = -EINVAL;
goto invalid_value;
}
-@@ -555,7 +575,7 @@ static int prepare_pending_reqs(struct v
+@@ -554,7 +574,7 @@ static int prepare_pending_reqs(struct v
pending_req->timeout_per_command = ring_req->timeout_per_command;
@@ -284,7 +284,7 @@ References: bnc#774818
DPRINTK("scsiback: invalid buffer\n");
err = -EINVAL;
goto invalid_value;
-@@ -567,6 +587,20 @@ invalid_value:
+@@ -566,6 +586,20 @@ invalid_value:
return err;
}
@@ -305,7 +305,7 @@ References: bnc#774818
static int _scsiback_do_cmd_fn(struct vscsibk_info *info)
{
-@@ -593,9 +627,11 @@ static int _scsiback_do_cmd_fn(struct vs
+@@ -592,9 +626,11 @@ static int _scsiback_do_cmd_fn(struct vs
}
while ((rc != rp)) {
@@ -318,7 +318,7 @@ References: bnc#774818
if (NULL == pending_req) {
more_to_do = 1;
break;
-@@ -604,9 +640,26 @@ static int _scsiback_do_cmd_fn(struct vs
+@@ -603,9 +639,26 @@ static int _scsiback_do_cmd_fn(struct vs
ring_req = RING_GET_REQUEST(ring, rc);
ring->req_cons = ++rc;
@@ -348,7 +348,7 @@ References: bnc#774818
case VSCSIIF_ACT_SCSI_CDB:
/* The Host mode is through as for Emulation. */
if (info->feature == VSCSI_TYPE_HOST ?
-@@ -615,7 +668,8 @@ static int _scsiback_do_cmd_fn(struct vs
+@@ -614,7 +667,8 @@ static int _scsiback_do_cmd_fn(struct vs
scsiback_fast_flush_area(pending_req);
scsiback_do_resp_with_sense(NULL,
DRIVER_ERROR << 24,
@@ -358,7 +358,7 @@ References: bnc#774818
}
break;
case VSCSIIF_ACT_SCSI_RESET:
-@@ -623,19 +677,27 @@ static int _scsiback_do_cmd_fn(struct vs
+@@ -622,19 +676,27 @@ static int _scsiback_do_cmd_fn(struct vs
scsiback_fast_flush_area(pending_req);
scsiback_device_reset_exec(pending_req);
break;
@@ -389,7 +389,7 @@ References: bnc#774818
break;
}
-@@ -707,17 +769,32 @@ static int __init scsiback_init(void)
+@@ -706,17 +768,32 @@ static int __init scsiback_init(void)
if (!is_running_on_xen())
return -ENODEV;
@@ -424,7 +424,7 @@ References: bnc#774818
for (i = 0; i < mmap_pages; i++)
pending_grant_handles[i] = SCSIBACK_INVALID_HANDLE;
-@@ -739,6 +816,10 @@ static int __init scsiback_init(void)
+@@ -738,6 +815,10 @@ static int __init scsiback_init(void)
out_interface:
scsiback_interface_exit();
out_of_memory:
@@ -435,7 +435,7 @@ References: bnc#774818
kfree(pending_reqs);
kfree(pending_grant_handles);
free_empty_pages_and_pagevec(pending_pages, mmap_pages);
-@@ -749,12 +830,17 @@ out_of_memory:
+@@ -748,12 +829,17 @@ out_of_memory:
#if 0
static void __exit scsiback_exit(void)
{
diff --git a/patches.xen/xen-x86-EFI b/patches.xen/xen-x86-EFI
index 2beb4fcadf..7e5d4414ef 100644
--- a/patches.xen/xen-x86-EFI
+++ b/patches.xen/xen-x86-EFI
@@ -5,7 +5,7 @@ References: fate#311376, fate#311529, bnc#578927, bnc#628554
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -1825,9 +1825,9 @@ config X86_INTEL_MEMORY_PROTECTION_KEYS
+@@ -1844,9 +1844,9 @@ config X86_INTEL_MEMORY_PROTECTION_KEYS
config EFI
bool "EFI runtime service support"
@@ -17,7 +17,7 @@ References: fate#311376, fate#311529, bnc#578927, bnc#628554
---help---
This enables the kernel to use EFI runtime services that are
available (such as the EFI variable services).
-@@ -1841,7 +1841,7 @@ config EFI
+@@ -1860,7 +1860,7 @@ config EFI
config EFI_STUB
bool "EFI stub support"
@@ -54,7 +54,7 @@ References: fate#311376, fate#311529, bnc#578927, bnc#628554
#include_next <asm/setup.h>
--- a/arch/x86/kernel/setup-xen.c
+++ b/arch/x86/kernel/setup-xen.c
-@@ -1103,6 +1103,8 @@ void __init setup_arch(char **cmdline_p)
+@@ -1101,6 +1101,8 @@ void __init setup_arch(char **cmdline_p)
xen_start_info->console.dom0.info_size);
xen_start_info->console.domU.mfn = 0;
xen_start_info->console.domU.evtchn = 0;
@@ -89,15 +89,15 @@ References: fate#311376, fate#311529, bnc#578927, bnc#628554
--- a/arch/x86/platform/efi/Makefile
+++ b/arch/x86/platform/efi/Makefile
-@@ -4,3 +4,5 @@ obj-$(CONFIG_EFI) += quirks.o efi.o ef
- obj-$(CONFIG_ACPI_BGRT) += efi-bgrt.o
+@@ -4,3 +4,5 @@ OBJECT_FILES_NON_STANDARD_efi_stub_$(BIT
+ obj-$(CONFIG_EFI) += quirks.o efi.o efi_$(BITS).o efi_stub_$(BITS).o
obj-$(CONFIG_EARLY_PRINTK_EFI) += early_printk.o
obj-$(CONFIG_EFI_MIXED) += efi_thunk_$(BITS).o
+ccflags-$(CONFIG_XEN) += -fshort-wchar
+disabled-obj-$(CONFIG_XEN) := efi_%$(BITS).o
--- /dev/null
+++ b/arch/x86/platform/efi/efi-xen.c
-@@ -0,0 +1,494 @@
+@@ -0,0 +1,492 @@
+/*
+ * Common EFI (Extensible Firmware Interface) support functions
+ * Based on Extensible Firmware Interface Specification version 1.0
@@ -143,8 +143,6 @@ References: fate#311376, fate#311529, bnc#578927, bnc#628554
+#include <asm/setup.h>
+#include <asm/efi.h>
+#include <asm/time.h>
-+#include <asm/cacheflush.h>
-+#include <asm/tlbflush.h>
+#include <asm/x86_init.h>
+
+#include <xen/interface/platform.h>
@@ -594,7 +592,7 @@ References: fate#311376, fate#311529, bnc#578927, bnc#628554
+early_param("efi", arch_parse_efi_cmdline);
--- a/arch/x86/platform/efi/quirks.c
+++ b/arch/x86/platform/efi/quirks.c
-@@ -163,6 +163,7 @@ efi_status_t efi_query_variable_store(u3
+@@ -219,6 +219,7 @@ efi_status_t efi_query_variable_store(u3
}
EXPORT_SYMBOL_GPL(efi_query_variable_store);
@@ -602,7 +600,7 @@ References: fate#311376, fate#311529, bnc#578927, bnc#628554
/*
* The UEFI specification makes it clear that the operating system is
* free to do whatever it wants with boot services code after
-@@ -256,9 +257,11 @@ static bool can_free_region(u64 start, u
+@@ -312,9 +313,11 @@ static bool can_free_region(u64 start, u
return true;
}
@@ -614,7 +612,7 @@ References: fate#311376, fate#311529, bnc#578927, bnc#628554
efi_memory_desc_t *md;
for_each_efi_memory_desc(md) {
-@@ -309,10 +312,12 @@ void __init efi_reserve_boot_services(vo
+@@ -365,10 +368,12 @@ void __init efi_reserve_boot_services(vo
*/
md->attribute |= EFI_MEMORY_RUNTIME;
}
@@ -627,7 +625,7 @@ References: fate#311376, fate#311529, bnc#578927, bnc#628554
phys_addr_t new_phys, new_size;
efi_memory_desc_t *md;
int num_entries = 0;
-@@ -393,8 +398,10 @@ void __init efi_free_boot_services(void)
+@@ -452,8 +457,10 @@ void __init efi_free_boot_services(void)
pr_err("Could not install new EFI memmap\n");
return;
}
@@ -638,11 +636,14 @@ References: fate#311376, fate#311529, bnc#578927, bnc#628554
/*
* A number of config table entries get remapped to virtual addresses
* after entering EFI virtual mode. However, the kexec kernel requires
-@@ -499,3 +506,4 @@ bool efi_poweroff_required(void)
+@@ -558,6 +565,7 @@ bool efi_poweroff_required(void)
{
return acpi_gbl_reduced_hardware || acpi_no_s5;
}
+#endif /* !CONFIG_XEN */
+
+ #ifdef CONFIG_EFI_CAPSULE_QUIRK_QUARK_CSH
+
--- a/drivers/firmware/efi/Kconfig
+++ b/drivers/firmware/efi/Kconfig
@@ -54,7 +54,7 @@ config EFI_RUNTIME_MAP
@@ -656,7 +657,7 @@ References: fate#311376, fate#311529, bnc#578927, bnc#628554
Saying Y here will enable "efi_fake_mem" boot option.
--- a/drivers/firmware/efi/Makefile
+++ b/drivers/firmware/efi/Makefile
-@@ -24,6 +24,8 @@ obj-$(CONFIG_EFI_TEST) += test/
+@@ -25,6 +25,8 @@ obj-$(CONFIG_EFI_TEST) += test/
obj-$(CONFIG_EFI_DEV_PATH_PARSER) += dev-path-parser.o
obj-$(CONFIG_APPLE_PROPERTIES) += apple-properties.o
@@ -728,7 +729,7 @@ References: fate#311376, fate#311529, bnc#578927, bnc#628554
u64 table64;
guid = ((efi_config_table_64_t *)tablep)->guid;
table64 = ((efi_config_table_64_t *)tablep)->table;
-@@ -550,6 +559,7 @@ int __init efi_config_parse_tables(void
+@@ -551,6 +560,7 @@ int __init efi_config_parse_tables(void
return 0;
}
@@ -736,7 +737,7 @@ References: fate#311376, fate#311529, bnc#578927, bnc#628554
int __init efi_config_init(efi_config_table_type_t *arch_tables)
{
void *config_tables;
-@@ -576,6 +586,7 @@ int __init efi_config_init(efi_config_ta
+@@ -577,6 +587,7 @@ int __init efi_config_init(efi_config_ta
early_memunmap(config_tables, efi.systab->nr_tables * sz);
return ret;
}
@@ -744,7 +745,7 @@ References: fate#311376, fate#311529, bnc#578927, bnc#628554
#ifdef CONFIG_EFI_VARS_MODULE
static int __init efi_load_efivars(void)
-@@ -802,6 +813,7 @@ char * __init efi_md_typeattr_format(cha
+@@ -803,6 +814,7 @@ char * __init efi_md_typeattr_format(cha
* of ia64 which has a funky EFI memory map that doesn't work
* the same way as other architectures.
*/
@@ -752,7 +753,7 @@ References: fate#311376, fate#311529, bnc#578927, bnc#628554
u64 __weak efi_mem_attributes(unsigned long phys_addr)
{
efi_memory_desc_t *md;
-@@ -817,6 +829,7 @@ u64 __weak efi_mem_attributes(unsigned l
+@@ -818,6 +830,7 @@ u64 __weak efi_mem_attributes(unsigned l
}
return 0;
}
@@ -760,9 +761,47 @@ References: fate#311376, fate#311529, bnc#578927, bnc#628554
int efi_status_to_err(efi_status_t status)
{
+--- a/drivers/firmware/efi/efi-bgrt.c
++++ b/drivers/firmware/efi/efi-bgrt.c
+@@ -32,26 +32,6 @@ struct bmp_header {
+ u32 size;
+ } __packed;
+
+-static bool efi_bgrt_addr_valid(u64 addr)
+-{
+- efi_memory_desc_t *md;
+-
+- for_each_efi_memory_desc(md) {
+- u64 size;
+- u64 end;
+-
+- if (md->type != EFI_BOOT_SERVICES_DATA)
+- continue;
+-
+- size = md->num_pages << EFI_PAGE_SHIFT;
+- end = md->phys_addr + size;
+- if (addr >= md->phys_addr && addr < end)
+- return true;
+- }
+-
+- return false;
+-}
+-
+ void __init efi_bgrt_init(struct acpi_table_header *table)
+ {
+ void *image;
+@@ -90,7 +70,7 @@ void __init efi_bgrt_init(struct acpi_ta
+ goto out;
+ }
+
+- if (!efi_bgrt_addr_valid(bgrt->image_address)) {
++ if (efi_mem_type(bgrt->image_address) != EFI_BOOT_SERVICES_DATA) {
+ pr_notice("Ignoring BGRT: invalid image address\n");
+ goto out;
+ }
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
-@@ -1037,7 +1037,7 @@ config RTC_DRV_DA9063
+@@ -1064,7 +1064,7 @@ config RTC_DRV_DA9063
config RTC_DRV_EFI
tristate "EFI RTC"
@@ -780,8 +819,8 @@ References: fate#311376, fate#311529, bnc#578927, bnc#628554
+#include <linux/efi.h>
#include <linux/of.h>
#include <linux/of_platform.h>
-
-@@ -1358,6 +1359,11 @@ static int __init cmos_init(void)
+ #ifdef CONFIG_X86
+@@ -1367,6 +1368,11 @@ static int __init cmos_init(void)
{
int retval = 0;
@@ -816,7 +855,7 @@ References: fate#311376, fate#311529, bnc#578927, bnc#628554
+ sizeof(info->u.vesa_lfb.gbl_caps))
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
-@@ -877,7 +877,9 @@ typedef struct {
+@@ -889,7 +889,9 @@ typedef struct {
* All runtime access to EFI goes through this structure:
*/
extern struct efi {
@@ -826,7 +865,7 @@ References: fate#311376, fate#311529, bnc#578927, bnc#628554
unsigned int runtime_version; /* Runtime services version */
unsigned long mps; /* MPS table */
unsigned long acpi; /* ACPI table (IA64 ext 0.71) */
-@@ -909,9 +911,11 @@ extern struct efi {
+@@ -921,9 +923,11 @@ extern struct efi {
efi_update_capsule_t *update_capsule;
efi_query_capsule_caps_t *query_capsule_caps;
efi_get_next_high_mono_count_t *get_next_high_mono_count;
@@ -838,7 +877,7 @@ References: fate#311376, fate#311529, bnc#578927, bnc#628554
unsigned long flags;
} efi;
-@@ -995,6 +999,7 @@ extern void __init efi_fake_memmap(void)
+@@ -1007,6 +1011,7 @@ extern void __init efi_fake_memmap(void)
static inline void efi_fake_memmap(void) { }
#endif
@@ -846,7 +885,7 @@ References: fate#311376, fate#311529, bnc#578927, bnc#628554
/*
* efi_memattr_perm_setter - arch specific callback function passed into
* efi_memattr_apply_permissions() that updates the
-@@ -1007,6 +1012,9 @@ typedef int (*efi_memattr_perm_setter)(s
+@@ -1019,6 +1024,9 @@ typedef int (*efi_memattr_perm_setter)(s
extern int efi_memattr_init(void);
extern int efi_memattr_apply_permissions(struct mm_struct *mm,
efi_memattr_perm_setter fn);
diff --git a/patches.xen/xen-x86-bigmem b/patches.xen/xen-x86-bigmem
index 58e5f5229c..cc1ba90d5c 100644
--- a/patches.xen/xen-x86-bigmem
+++ b/patches.xen/xen-x86-bigmem
@@ -5,7 +5,7 @@ References: bnc#482614, bnc#537435, bnc#700856
--- a/arch/x86/include/mach-xen/asm/hypervisor.h
+++ b/arch/x86/include/mach-xen/asm/hypervisor.h
-@@ -105,6 +105,10 @@ void xen_pgd_pin(unsigned long ptr);
+@@ -106,6 +106,10 @@ void xen_pgd_pin(unsigned long ptr);
void xen_pgd_unpin(unsigned long ptr);
void xen_init_pgd_pin(void);
@@ -18,10 +18,10 @@ References: bnc#482614, bnc#537435, bnc#700856
--- a/arch/x86/kernel/e820-xen.c
+++ b/arch/x86/kernel/e820-xen.c
-@@ -957,6 +957,26 @@ static int __init parse_memopt(char *p)
- /* don't remove all of memory when handling "mem={invalid}" param */
+@@ -958,6 +958,26 @@ static int __init parse_memopt(char *p)
if (mem_size == 0)
return -EINVAL;
+
+#ifdef CONFIG_XEN
+ /*
+ * A little less than 2% of available memory are needed for page
@@ -42,25 +42,25 @@ References: bnc#482614, bnc#537435, bnc#700856
+ mem_size = size << PAGE_SHIFT;
+ }
+#endif
- e820_remove_range(mem_size, ULLONG_MAX - mem_size, E820_RAM, 1);
+ e820__range_remove(mem_size, ULLONG_MAX - mem_size, E820_TYPE_RAM, 1);
- i = e820->nr_map - 1;
-@@ -1229,6 +1249,7 @@ void __init e820_reserve_resources_late(
- char *__init default_machine_specific_memory_setup(void)
+ i = e820_table->nr_entries - 1;
+@@ -1276,6 +1296,7 @@ void __init e820__reserve_resources_late
+ char *__init e820__memory_setup_default(void)
{
- int rc, nr_map;
+ int rc;
+ unsigned long maxmem;
struct xen_memory_map memmap;
- static struct e820entry __initdata map[E820MAX];
+ static struct boot_e820_entry __initdata map[E820_MAX_ENTRIES];
-@@ -1254,6 +1275,30 @@ char *__init default_machine_specific_me
+@@ -1298,6 +1319,30 @@ char *__init e820__memory_setup_default(
BUG();
#ifdef CONFIG_XEN
+ /* See the comment in parse_memopt(). */
-+ for (maxmem = rc = 0; rc < e820->nr_map; ++rc)
-+ if (e820->map[rc].type == E820_RAM)
-+ maxmem += e820->map[rc].size >> PAGE_SHIFT;
++ for (maxmem = rc = 0; rc < e820_table->nr_entries; ++rc)
++ if (e820_table->entries[rc].type == E820_TYPE_RAM)
++ maxmem += e820_table->entries[rc].size >> PAGE_SHIFT;
+ if (is_initial_xendomain()) {
+ domid_t domid = DOMID_SELF;
+ long res = HYPERVISOR_memory_op(XENMEM_maximum_reservation,
@@ -78,15 +78,15 @@ References: bnc#482614, bnc#537435, bnc#700856
+ xen_start_info->nr_pages >> (20 - PAGE_SHIFT),
+ size >> (20 - PAGE_SHIFT));
+ size <<= PAGE_SHIFT;
-+ e820_remove_range(size, ULLONG_MAX - size, E820_RAM, 1);
++ e820__range_remove(size, ULLONG_MAX - size, E820_TYPE_RAM, true);
+ }
+
if (is_initial_xendomain()) {
- memmap.nr_entries = E820MAX;
- set_xen_guest_handle(memmap.buffer, machine_e820.map);
+ unsigned int i;
+
--- a/arch/x86/kernel/setup-xen.c
+++ b/arch/x86/kernel/setup-xen.c
-@@ -131,12 +131,7 @@ static struct notifier_block xen_panic_b
+@@ -133,12 +133,7 @@ static struct notifier_block xen_panic_b
unsigned long *phys_to_machine_mapping;
EXPORT_SYMBOL(phys_to_machine_mapping);
@@ -100,7 +100,7 @@ References: bnc#482614, bnc#537435, bnc#700856
/* Raw start-of-day parameters from the hypervisor. */
start_info_t *xen_start_info;
-@@ -175,6 +170,62 @@ int default_check_phys_apicid_present(in
+@@ -177,6 +172,62 @@ int default_check_phys_apicid_present(in
#endif
struct boot_params boot_params;
@@ -163,7 +163,7 @@ References: bnc#482614, bnc#537435, bnc#700856
#endif
/*
-@@ -1404,6 +1455,14 @@ void __init setup_arch(char **cmdline_p)
+@@ -1413,6 +1464,14 @@ void __init setup_arch(char **cmdline_p)
#ifdef CONFIG_XEN
#ifdef CONFIG_KEXEC
xen_machine_kexec_setup_resources();
@@ -178,7 +178,7 @@ References: bnc#482614, bnc#537435, bnc#700856
#endif
p2m_pages = max_pfn;
if (xen_start_info->nr_pages > max_pfn) {
-@@ -1438,45 +1497,20 @@ void __init setup_arch(char **cmdline_p)
+@@ -1447,45 +1506,20 @@ void __init setup_arch(char **cmdline_p)
p2m_pages = xen_start_info->nr_pages;
if (!xen_feature(XENFEAT_auto_translated_physmap)) {
diff --git a/patches.xen/xen-x86-bzImage b/patches.xen/xen-x86-bzImage
index f3817b5221..f4d676af0e 100644
--- a/patches.xen/xen-x86-bzImage
+++ b/patches.xen/xen-x86-bzImage
@@ -11,7 +11,7 @@ patch (but is probably better kept here).
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -1841,8 +1841,8 @@ config EFI
+@@ -1860,8 +1860,8 @@ config EFI
config EFI_STUB
bool "EFI stub support"
@@ -22,7 +22,7 @@ patch (but is probably better kept here).
---help---
This kernel feature allows a bzImage to be loaded directly
by EFI firmware without the use of a bootloader.
-@@ -2115,6 +2115,23 @@ config RANDOMIZE_MEMORY_PHYSICAL_PADDING
+@@ -2134,6 +2134,23 @@ config RANDOMIZE_MEMORY_PHYSICAL_PADDING
If unsure, leave at the default value.
@@ -48,7 +48,7 @@ patch (but is probably better kept here).
depends on SMP
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
-@@ -279,7 +279,9 @@ LDFLAGS_vmlinux += -e startup_64
+@@ -295,7 +295,9 @@ LDFLAGS_vmlinux += -e startup_64
else
LDFLAGS_vmlinux += -e startup_32
endif
@@ -69,7 +69,7 @@ patch (but is probably better kept here).
targets += $(setup-y)
hostprogs-y := tools/build
hostprogs-$(CONFIG_X86_FEATURE_NAMES) += mkcpustr
-@@ -196,7 +198,7 @@ $(obj)/vmlinux-stripped: OBJCOPYFLAGS :=
+@@ -197,7 +199,7 @@ $(obj)/vmlinux-stripped: OBJCOPYFLAGS :=
$(obj)/vmlinux-stripped: vmlinux FORCE
$(call if_changed,objcopy)
@@ -94,7 +94,7 @@ patch (but is probably better kept here).
#include "ctype.h"
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
-@@ -41,6 +41,9 @@ GCOV_PROFILE := n
+@@ -42,6 +42,9 @@ GCOV_PROFILE := n
UBSAN_SANITIZE :=n
LDFLAGS := -m elf_$(UTS_MACHINE)
@@ -104,7 +104,7 @@ patch (but is probably better kept here).
# Compressed kernel should be built as PIE since it may be loaded at any
# address by the bootloader.
ifeq ($(CONFIG_X86_32),y)
-@@ -85,6 +88,11 @@ vmlinux-objs-$(CONFIG_EFI_STUB) += $(obj
+@@ -86,6 +89,11 @@ vmlinux-objs-$(CONFIG_EFI_STUB) += $(obj
$(objtree)/drivers/firmware/efi/libstub/lib.a
vmlinux-objs-$(CONFIG_EFI_MIXED) += $(obj)/efi_thunk_$(BITS).o
@@ -118,18 +118,18 @@ patch (but is probably better kept here).
# it is executed as-is without any ELF relocation processing performed
--- a/arch/x86/boot/header.S
+++ b/arch/x86/boot/header.S
-@@ -522,6 +522,10 @@ pref_address: .quad LOAD_PHYSICAL_ADDR
+@@ -527,6 +527,10 @@ pref_address: .quad LOAD_PHYSICAL_ADDR
#
- # extra_bytes = (uncompressed_size >> 12) + 65536 + 128
+ # extra_bytes = (uncompressed_size >> 8) + 65536
+#ifdef CONFIG_XEN
+#define ZO_startup_32 0
+#endif
+
- #define ZO_z_extra_bytes ((ZO_z_output_len >> 12) + 65536 + 128)
+ #define ZO_z_extra_bytes ((ZO_z_output_len >> 8) + 65536)
#if ZO_z_output_len > ZO_z_input_len
# define ZO_z_extract_offset (ZO_z_output_len + ZO_z_extra_bytes - \
-@@ -557,6 +561,7 @@ handover_offset: .long 0 # Filled in b
+@@ -562,6 +566,7 @@ handover_offset: .long 0 # Filled in b
.section ".entrytext", "ax"
start_of_setup:
@@ -137,7 +137,7 @@ patch (but is probably better kept here).
# Force %es = %ds
movw %ds, %ax
movw %ax, %es
-@@ -629,3 +634,4 @@ die:
+@@ -634,3 +639,4 @@ die:
setup_corrupt:
.byte 7
.string "No setup signature found...\n"
@@ -179,7 +179,7 @@ patch (but is probably better kept here).
--- a/drivers/firmware/efi/libstub/Makefile
+++ b/drivers/firmware/efi/libstub/Makefile
-@@ -43,6 +43,8 @@ lib-$(CONFIG_ARM) += arm32-stub.o
+@@ -44,6 +44,8 @@ lib-$(CONFIG_ARM) += arm32-stub.o
lib-$(CONFIG_ARM64) += arm64-stub.o
CFLAGS_arm64-stub.o := -DTEXT_OFFSET=$(TEXT_OFFSET)
@@ -190,7 +190,7 @@ patch (but is probably better kept here).
# code indefinitely unless it is annotated as __init/__initdata/__initconst etc.
--- a/drivers/xen/Kconfig
+++ b/drivers/xen/Kconfig
-@@ -366,6 +366,10 @@ config XEN_VCPU_INFO_PLACEMENT
+@@ -370,6 +370,10 @@ config XEN_VCPU_INFO_PLACEMENT
This allows faster access to the per-vCPU shared info
structure.
diff --git a/patches.xen/xen-x86-dcr-fallback b/patches.xen/xen-x86-dcr-fallback
index 8bdea6d5a5..279cc1b635 100644
--- a/patches.xen/xen-x86-dcr-fallback
+++ b/patches.xen/xen-x86-dcr-fallback
@@ -8,7 +8,7 @@ used.
--- a/arch/x86/mm/hypervisor.c
+++ b/arch/x86/mm/hypervisor.c
-@@ -774,6 +774,77 @@ void xen_destroy_contiguous_region(unsig
+@@ -786,6 +786,77 @@ void xen_destroy_contiguous_region(unsig
BUG();
balloon_unlock(flags);
diff --git a/patches.xen/xen-x86-exit-mmap b/patches.xen/xen-x86-exit-mmap
index 67b4d27493..0d8d909a27 100644
--- a/patches.xen/xen-x86-exit-mmap
+++ b/patches.xen/xen-x86-exit-mmap
@@ -15,7 +15,7 @@ gets executed on, but also forcing remote CPUs to do so.
#include <xen/features.h>
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
-@@ -461,27 +462,44 @@ void arch_dup_mmap(struct mm_struct *old
+@@ -513,27 +514,44 @@ void arch_dup_mmap(struct mm_struct *old
mm_pin(mm);
}
diff --git a/patches.xen/xen-x86-no-lapic b/patches.xen/xen-x86-no-lapic
index 56f2f00493..a24b6a0124 100644
--- a/patches.xen/xen-x86-no-lapic
+++ b/patches.xen/xen-x86-no-lapic
@@ -48,7 +48,7 @@ References: bnc#191115
#endif /* !CONFIG_X86_LOCAL_APIC */
#ifdef CONFIG_X86_X2APIC
-@@ -277,16 +282,19 @@ static inline int x2apic_enabled(void) {
+@@ -273,16 +278,19 @@ struct irq_data;
struct apic {
char *name;
@@ -68,7 +68,7 @@ References: bnc#191115
int disable_esr;
int dest_logical;
-@@ -302,14 +310,17 @@ struct apic {
+@@ -298,8 +306,10 @@ struct apic {
int (*cpu_present_to_apicid)(int mps_cpu);
void (*apicid_to_cpu_present)(int phys_apicid, physid_mask_t *retmap);
int (*check_phys_apicid_present)(int phys_apicid);
@@ -77,16 +77,17 @@ References: bnc#191115
+#ifndef CONFIG_XEN
unsigned int (*get_apic_id)(unsigned long x);
+ /* Can't be NULL on 64-bit */
unsigned long (*set_apic_id)(unsigned int id);
-
- int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask,
- const struct cpumask *andmask,
- unsigned int *apicid);
+@@ -307,6 +317,7 @@ struct apic {
+ int (*cpu_mask_to_apicid)(const struct cpumask *cpumask,
+ struct irq_data *irqdata,
+ unsigned int *apicid);
+#endif
/* ipi */
void (*send_IPI)(int cpu, int vector);
-@@ -320,6 +331,7 @@ struct apic {
+@@ -317,6 +328,7 @@ struct apic {
void (*send_IPI_all)(int vector);
void (*send_IPI_self)(int vector);
@@ -94,7 +95,7 @@ References: bnc#191115
/* wakeup_secondary_cpu */
int (*wakeup_secondary_cpu)(int apicid, unsigned long start_eip);
-@@ -355,6 +367,7 @@ struct apic {
+@@ -352,6 +364,7 @@ struct apic {
*/
int (*x86_32_early_logical_apicid)(int cpu);
#endif
@@ -102,7 +103,7 @@ References: bnc#191115
};
/*
-@@ -364,6 +377,8 @@ struct apic {
+@@ -361,6 +374,8 @@ struct apic {
*/
extern struct apic *apic;
@@ -111,7 +112,7 @@ References: bnc#191115
/*
* APIC drivers are probed based on how they are listed in the .apicdrivers
* section. So the order is important and enforced by the ordering
-@@ -479,6 +494,7 @@ extern int default_check_phys_apicid_pre
+@@ -476,6 +491,7 @@ extern int default_check_phys_apicid_pre
extern void generic_bigsmp_probe(void);
@@ -119,7 +120,7 @@ References: bnc#191115
#ifdef CONFIG_X86_LOCAL_APIC
-@@ -500,6 +516,8 @@ static inline const struct cpumask *onli
+@@ -497,6 +513,8 @@ static inline const struct cpumask *onli
return cpu_online_mask;
}
@@ -128,7 +129,7 @@ References: bnc#191115
DECLARE_EARLY_PER_CPU_READ_MOSTLY(u16, x86_bios_cpu_apicid);
-@@ -637,6 +655,8 @@ extern int default_cpu_present_to_apicid
+@@ -618,6 +636,8 @@ extern int default_cpu_present_to_apicid
extern int default_check_phys_apicid_present(int phys_apicid);
#endif
@@ -137,7 +138,7 @@ References: bnc#191115
#endif /* CONFIG_X86_LOCAL_APIC */
extern void irq_enter(void);
extern void irq_exit(void);
-@@ -646,6 +666,7 @@ static inline void entering_irq(void)
+@@ -627,6 +647,7 @@ static inline void entering_irq(void)
irq_enter();
}
@@ -145,7 +146,7 @@ References: bnc#191115
static inline void entering_ack_irq(void)
{
entering_irq();
-@@ -657,17 +678,20 @@ static inline void ipi_entering_ack_irq(
+@@ -638,17 +659,20 @@ static inline void ipi_entering_ack_irq(
irq_enter();
ack_APIC_irq();
}
@@ -256,7 +257,7 @@ References: bnc#191115
static inline int logical_smp_processor_id(void)
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
-@@ -73,14 +73,14 @@ int acpi_sci_override_gsi __initdata;
+@@ -74,14 +74,14 @@ int acpi_sci_override_gsi __initdata;
int acpi_skip_timer_override __initdata;
int acpi_use_timer_override __initdata;
int acpi_fix_pin2_polarity __initdata;
@@ -275,7 +276,7 @@ References: bnc#191115
#ifdef CONFIG_X86_IO_APIC
/*
-@@ -153,6 +153,7 @@ static int __init acpi_parse_madt(struct
+@@ -154,6 +154,7 @@ static int __init acpi_parse_madt(struct
return -ENODEV;
}
@@ -283,7 +284,7 @@ References: bnc#191115
if (madt->address) {
acpi_lapic_addr = (u64) madt->address;
-@@ -160,7 +161,6 @@ static int __init acpi_parse_madt(struct
+@@ -161,7 +162,6 @@ static int __init acpi_parse_madt(struct
madt->address);
}
@@ -291,7 +292,7 @@ References: bnc#191115
default_acpi_madt_oem_check(madt->header.oem_id,
madt->header.oem_table_id);
#endif
-@@ -297,6 +297,7 @@ static int __init
+@@ -298,6 +298,7 @@ static int __init
acpi_parse_lapic_addr_ovr(struct acpi_subtable_header * header,
const unsigned long end)
{
@@ -299,7 +300,7 @@ References: bnc#191115
struct acpi_madt_local_apic_override *lapic_addr_ovr = NULL;
lapic_addr_ovr = (struct acpi_madt_local_apic_override *)header;
-@@ -307,6 +308,7 @@ acpi_parse_lapic_addr_ovr(struct acpi_su
+@@ -308,6 +309,7 @@ acpi_parse_lapic_addr_ovr(struct acpi_su
acpi_table_print_madt_entry(header);
acpi_lapic_addr = lapic_addr_ovr->address;
@@ -349,7 +350,7 @@ References: bnc#191115
#ifdef CONFIG_HAVE_KVM
seq_printf(p, "%*s: ", prec, "PIN");
for_each_online_cpu(j)
-@@ -219,8 +223,12 @@ u64 arch_irq_stat_cpu(unsigned int cpu)
+@@ -225,8 +229,12 @@ u64 arch_irq_stat_cpu(unsigned int cpu)
u64 arch_irq_stat(void)
{
diff --git a/patches.xen/xen-x86-panic-no-reboot b/patches.xen/xen-x86-panic-no-reboot
index e3ab4b7f4d..56e85cdd16 100644
--- a/patches.xen/xen-x86-panic-no-reboot
+++ b/patches.xen/xen-x86-panic-no-reboot
@@ -11,7 +11,7 @@ TBD: kexec_should_crash() should probably also be made functional
--- a/arch/x86/kernel/setup-xen.c
+++ b/arch/x86/kernel/setup-xen.c
-@@ -932,15 +932,17 @@ void __init setup_arch(char **cmdline_p)
+@@ -930,15 +930,17 @@ void __init setup_arch(char **cmdline_p)
unsigned long p2m_pages;
struct physdev_set_iopl set_iopl;
@@ -37,7 +37,7 @@ TBD: kexec_should_crash() should probably also be made functional
WARN_ON(HYPERVISOR_physdev_op(PHYSDEVOP_set_iopl, &set_iopl));
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
-@@ -17,6 +17,10 @@
+@@ -18,6 +18,10 @@
#include <asm/io.h>
#include <uapi/linux/kexec.h>
@@ -48,7 +48,7 @@ TBD: kexec_should_crash() should probably also be made functional
#ifdef CONFIG_KEXEC_CORE
#include <linux/list.h>
-@@ -400,7 +404,16 @@ static inline void *boot_phys_to_virt(un
+@@ -337,7 +341,16 @@ static inline void *boot_phys_to_virt(un
struct pt_regs;
struct task_struct;
static inline void __crash_kexec(struct pt_regs *regs) { }
@@ -68,7 +68,7 @@ TBD: kexec_should_crash() should probably also be made functional
#define kexec_in_progress false
--- a/kernel/kexec_core.c
+++ b/kernel/kexec_core.c
-@@ -936,6 +936,12 @@ void __crash_kexec(struct pt_regs *regs)
+@@ -966,6 +966,12 @@ void __noclone __crash_kexec(struct pt_r
crash_save_vmcoreinfo();
machine_crash_shutdown(&fixed_regs);
machine_kexec(kexec_crash_image);
diff --git a/patches.xen/xen-x86-pcpu b/patches.xen/xen-x86-pcpu
index 56c5ebe559..7af51ffa20 100644
--- a/patches.xen/xen-x86-pcpu
+++ b/patches.xen/xen-x86-pcpu
@@ -8,7 +8,7 @@ References: none
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -1289,6 +1289,7 @@ config MICROCODE_OLD_INTERFACE
+@@ -1308,6 +1308,7 @@ config MICROCODE_OLD_INTERFACE
config X86_MSR
tristate "/dev/cpu/*/msr - Model-specific register support"
@@ -456,7 +456,7 @@ References: none
+#endif /* CONFIG_XEN_PRIVILEGED_GUEST */
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
-@@ -619,7 +619,8 @@ config SENSORS_I5500
+@@ -629,7 +629,8 @@ config SENSORS_I5500
config SENSORS_CORETEMP
tristate "Intel Core/Core2/Atom temperature sensor"
diff --git a/patches.xen/xen-x86-per-cpu-vcpu-info b/patches.xen/xen-x86-per-cpu-vcpu-info
index 351338b0bf..bda5ccee5c 100644
--- a/patches.xen/xen-x86-per-cpu-vcpu-info
+++ b/patches.xen/xen-x86-per-cpu-vcpu-info
@@ -8,7 +8,7 @@ prerequisite for removing the limitation on 32 vCPU-s per guest.
--- a/arch/x86/entry/entry_32-xen.S
+++ b/arch/x86/entry/entry_32-xen.S
-@@ -825,7 +825,9 @@ critical_region_fixup:
+@@ -809,7 +809,9 @@ critical_region_fixup:
.section .rodata,"a"
critical_fixup_table:
@@ -19,7 +19,7 @@ prerequisite for removing the limitation on 32 vCPU-s per guest.
.byte -1,-1 # jnz 14f
.byte 0 # pop %ebx
.byte 1 # pop %ecx
-@@ -844,7 +846,9 @@ critical_fixup_table:
+@@ -828,7 +830,9 @@ critical_fixup_table:
.byte 10,10,10 # add $8,%esp
#endif
.byte 12 # iret
@@ -186,7 +186,7 @@ prerequisite for removing the limitation on 32 vCPU-s per guest.
#endif /* _ASM_X86_XEN_PERCPU_H */
--- a/arch/x86/include/mach-xen/asm/pgtable_64.h
+++ b/arch/x86/include/mach-xen/asm/pgtable_64.h
-@@ -141,6 +141,8 @@ static inline void xen_set_pgd(pgd_t *pg
+@@ -179,6 +179,8 @@ static inline void xen_set_pgd(pgd_t *pg
#define __pte_mfn(_pte) (((_pte).pte & PTE_PFN_MASK) >> PAGE_SHIFT)
@@ -206,7 +206,7 @@ prerequisite for removing the limitation on 32 vCPU-s per guest.
+#define xen_read_cr2() vcpu_info_read(arch.cr2)
+#define xen_write_cr2(val) vcpu_info_write(arch.cr2, val)
- static inline unsigned long xen_read_cr3(void)
+ static inline unsigned long __xen_read_cr3(void)
{
--- a/arch/x86/kernel/cpu/common-xen.c
+++ b/arch/x86/kernel/cpu/common-xen.c
@@ -230,7 +230,7 @@ prerequisite for removing the limitation on 32 vCPU-s per guest.
#else
--- a/arch/x86/kernel/head-xen.c
+++ b/arch/x86/kernel/head-xen.c
-@@ -106,6 +106,8 @@ void __init xen_start_kernel(void)
+@@ -107,6 +107,8 @@ void __init xen_start_kernel(void)
HYPERVISOR_shared_info = (shared_info_t *)fix_to_virt(FIX_SHARED_INFO);
clear_page(empty_zero_page);
@@ -462,7 +462,7 @@ prerequisite for removing the limitation on 32 vCPU-s per guest.
#define NR_MMU BITS_PER_LONG
--- a/arch/x86/mm/init_64-xen.c
+++ b/arch/x86/mm/init_64-xen.c
-@@ -121,6 +121,26 @@ void __init early_make_page_readonly(con
+@@ -131,6 +131,26 @@ void __init early_make_page_readonly(con
BUG();
}
@@ -472,7 +472,7 @@ prerequisite for removing the limitation on 32 vCPU-s per guest.
+
+ BUG_ON(va < __START_KERNEL_map);
+
-+ page = (void *)(xen_read_cr3() + __START_KERNEL_map);
++ page = (void *)(__xen_read_cr3() + __START_KERNEL_map);
+
+ addr = page[pgd_index(va)];
+ addr_to_page(addr, page);
@@ -486,12 +486,12 @@ prerequisite for removing the limitation on 32 vCPU-s per guest.
+ return (page[pte_index(va)] & PHYSICAL_PAGE_MASK) >> PAGE_SHIFT;
+}
+
- #include "ident_map.c"
+ #include "ident_map-xen.c"
/*
--- a/drivers/xen/Kconfig
+++ b/drivers/xen/Kconfig
-@@ -354,6 +354,18 @@ config XEN_COMPAT
+@@ -358,6 +358,18 @@ config XEN_COMPAT
default 0x030002 if XEN_COMPAT_030002_AND_LATER
default 0
@@ -512,7 +512,7 @@ prerequisite for removing the limitation on 32 vCPU-s per guest.
config HAVE_IRQ_IGNORE_UNHANDLED
--- a/drivers/xen/core/evtchn.c
+++ b/drivers/xen/core/evtchn.c
-@@ -375,6 +375,10 @@ static DEFINE_PER_CPU(unsigned int, upca
+@@ -401,6 +401,10 @@ static DEFINE_PER_CPU(unsigned int, upca
static DEFINE_PER_CPU(unsigned int, current_l1i);
static DEFINE_PER_CPU(unsigned int, current_l2i);
@@ -523,7 +523,7 @@ prerequisite for removing the limitation on 32 vCPU-s per guest.
/* NB. Interrupts are disabled on entry. */
asmlinkage __visible
#ifdef CONFIG_PREEMPT
-@@ -389,7 +393,6 @@ __irq_entry evtchn_do_upcall(struct pt_r
+@@ -415,7 +419,6 @@ __irq_entry evtchn_do_upcall(struct pt_r
unsigned long masked_l1, masked_l2;
unsigned int l1i, l2i, start_l1i, start_l2i, port, i;
int irq;
@@ -531,7 +531,7 @@ prerequisite for removing the limitation on 32 vCPU-s per guest.
struct pt_regs *old_regs;
/* Nested invocations bail immediately. */
-@@ -397,7 +400,7 @@ __irq_entry evtchn_do_upcall(struct pt_r
+@@ -423,7 +426,7 @@ __irq_entry evtchn_do_upcall(struct pt_r
UPC_ACTIVE) != UPC_INACTIVE)) {
__this_cpu_or(upcall_state, UPC_NESTED_LATCH);
/* Avoid a callback storm when we reenable delivery. */
@@ -540,7 +540,7 @@ prerequisite for removing the limitation on 32 vCPU-s per guest.
return(false);
}
-@@ -405,11 +408,13 @@ __irq_entry evtchn_do_upcall(struct pt_r
+@@ -431,11 +434,13 @@ __irq_entry evtchn_do_upcall(struct pt_r
irq_enter();
do {
@@ -555,7 +555,7 @@ prerequisite for removing the limitation on 32 vCPU-s per guest.
#endif
#ifndef CONFIG_NO_HZ
-@@ -440,7 +445,7 @@ __irq_entry evtchn_do_upcall(struct pt_r
+@@ -466,7 +471,7 @@ __irq_entry evtchn_do_upcall(struct pt_r
}
#endif /* CONFIG_NO_HZ */
@@ -564,7 +564,7 @@ prerequisite for removing the limitation on 32 vCPU-s per guest.
start_l1i = l1i = __this_cpu_read(current_l1i);
start_l2i = __this_cpu_read(current_l2i);
-@@ -1600,7 +1605,6 @@ void unmask_evtchn(int port)
+@@ -1626,7 +1631,6 @@ void unmask_evtchn(int port)
{
shared_info_t *s = HYPERVISOR_shared_info;
unsigned int cpu = smp_processor_id();
@@ -572,7 +572,7 @@ prerequisite for removing the limitation on 32 vCPU-s per guest.
BUG_ON(!irqs_disabled());
-@@ -1614,10 +1618,13 @@ void unmask_evtchn(int port)
+@@ -1640,10 +1644,13 @@ void unmask_evtchn(int port)
sync_clear_bit(port, s->evtchn_mask);
/* Did we miss an interrupt 'edge'? Re-fire if so. */
diff --git a/patches.xen/xen-x86-pmd-handling b/patches.xen/xen-x86-pmd-handling
index 23ce3fdb0c..faa24949d4 100644
--- a/patches.xen/xen-x86-pmd-handling
+++ b/patches.xen/xen-x86-pmd-handling
@@ -1,16 +1,18 @@
From: jbeulich@novell.com
-Subject: consolidate pmd/pud/pgd entry handling
+Subject: consolidate pmd/pud/p4d/pgd entry handling
Patch-mainline: Never, SUSE-Xen specific
References: none
--- a/arch/x86/include/mach-xen/asm/hypervisor.h
+++ b/arch/x86/include/mach-xen/asm/hypervisor.h
-@@ -100,10 +100,12 @@ void xen_invlpg(unsigned long ptr);
+@@ -100,11 +100,13 @@ void xen_invlpg(unsigned long ptr);
void xen_l1_entry_update(pte_t *ptr, pte_t val);
void xen_l2_entry_update(pmd_t *ptr, pmd_t val);
void xen_l3_entry_update(pud_t *ptr, pud_t val); /* x86_64/PAE */
--void xen_l4_entry_update(pgd_t *ptr, pgd_t val); /* x86_64 only */
-+void xen_l4_entry_update(pgd_t *ptr, int user, pgd_t val); /* x86_64 only */
+-void xen_l4_entry_update(p4d_t *ptr, p4d_t val); /* x86_64 only */
+-void xen_l5_entry_update(pgd_t *ptr, pgd_t val); /* 5-level paging only */
++void xen_l4_entry_update(p4d_t *ptr, bool user, p4d_t val); /* x86_64 only */
++void xen_l5_entry_update(pgd_t *ptr, bool user, pgd_t val); /* 5-level paging only */
void xen_pgd_pin(unsigned long ptr);
void xen_pgd_unpin(unsigned long ptr);
@@ -21,7 +23,7 @@ References: none
#ifdef CONFIG_SMP
--- a/arch/x86/include/mach-xen/asm/pgalloc.h
+++ b/arch/x86/include/mach-xen/asm/pgalloc.h
-@@ -75,20 +75,16 @@ static inline void pmd_populate(struct m
+@@ -77,20 +77,16 @@ static inline void pmd_populate(struct m
struct page *pte)
{
unsigned long pfn = page_to_pfn(pte);
@@ -48,7 +50,7 @@ References: none
}
#define pmd_pgtable(pmd) pmd_page(pmd)
-@@ -116,39 +112,28 @@ extern void pud_populate(struct mm_struc
+@@ -118,40 +114,29 @@ extern void pud_populate(struct mm_struc
#else /* !CONFIG_X86_PAE */
static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
{
@@ -71,15 +73,14 @@ References: none
#endif /* CONFIG_X86_PAE */
#if CONFIG_PGTABLE_LEVELS > 3
- #define __user_pgd(pgd) ((pgd) + PTRS_PER_PGD)
-/*
-- * We need to use the batch mode here, but pgd_pupulate() won't be
+- * We need to use the batch mode here, but p4d_populate() won't be
- * be called frequently.
- */
- static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pud_t *pud)
+ static inline void p4d_populate(struct mm_struct *mm, p4d_t *p4d, pud_t *pud)
{
-+ pgd_t ent = __pgd(_PAGE_TABLE | __pa(pud));
++ p4d_t ent = __p4d(_PAGE_TABLE | __pa(pud));
+
paravirt_alloc_pud(mm, __pa(pud) >> PAGE_SHIFT);
- if (unlikely(PagePinned(virt_to_page((mm)->pgd)))) {
@@ -87,22 +88,56 @@ References: none
- (unsigned long)pud,
- pfn_pte(virt_to_phys(pud)>>PAGE_SHIFT,
- PAGE_KERNEL_RO), 0));
-- set_pgd(pgd, __pgd(_PAGE_TABLE | __pa(pud)));
-- set_pgd(__user_pgd(pgd), __pgd(_PAGE_TABLE | __pa(pud)));
+- set_p4d(p4d, __p4d(_PAGE_TABLE | __pa(pud)));
++ if (unlikely(PagePinned(virt_to_page(p4d))))
++ xen_l4_entry_update(p4d, true, ent);
++ else {
++ *p4d = ent;
+ #if CONFIG_PGTABLE_LEVELS == 4
+- set_p4d(__user_p4d(p4d), __p4d(_PAGE_TABLE | __pa(pud)));
+-#endif
- } else {
-- *(pgd) = __pgd(_PAGE_TABLE | __pa(pud));
+- *(p4d) = __p4d(_PAGE_TABLE | __pa(pud));
+-#if CONFIG_PGTABLE_LEVELS == 4
+- *__user_p4d(p4d) = *(p4d);
++ *__user_p4d(p4d) = ent;
+ #endif
+ }
+ }
+@@ -177,24 +162,15 @@ static inline void __pud_free_tlb(struct
+
+ #if CONFIG_PGTABLE_LEVELS > 4
+
+-/*
+- * We need to use the batch mode here, but pgd_populate() won't be
+- * be called frequently.
+- */
+ static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, p4d_t *p4d)
+ {
++ pgd_t ent = __pgd(_PAGE_TABLE | __pa(p4d));
++
+ paravirt_alloc_p4d(mm, __pa(p4d) >> PAGE_SHIFT);
+- if (unlikely(PagePinned(virt_to_page((mm)->pgd)))) {
+- BUG_ON(HYPERVISOR_update_va_mapping(
+- (unsigned long)p4d,
+- pfn_pte(virt_to_phys(p4d)>>PAGE_SHIFT,
+- PAGE_KERNEL_RO), 0));
+- set_pgd(pgd, __pgd(_PAGE_TABLE | __pa(p4d)));
+- set_pgd(__user_pgd(pgd), __pgd(_PAGE_TABLE | __pa(p4d)));
+- } else {
+- *(pgd) = __pgd(_PAGE_TABLE | __pa(p4d));
- *__user_pgd(pgd) = *(pgd);
- }
+ if (unlikely(PagePinned(virt_to_page(pgd))))
-+ xen_l4_entry_update(pgd, 1, ent);
++ xen_l5_entry_update(pgd, true, ent);
+ else
+ *__user_pgd(pgd) = *pgd = ent;
}
- static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr)
+ static inline p4d_t *p4d_alloc_one(struct mm_struct *mm, unsigned long addr)
--- a/arch/x86/include/mach-xen/asm/pgtable.h
+++ b/arch/x86/include/mach-xen/asm/pgtable.h
-@@ -891,7 +891,7 @@ static inline pmd_t xen_local_pmdp_get_a
+@@ -962,7 +962,7 @@ static inline pmd_t xen_local_pmdp_get_a
{
pmd_t res = *pmdp;
@@ -152,7 +187,7 @@ References: none
{
--- a/arch/x86/include/mach-xen/asm/pgtable_64.h
+++ b/arch/x86/include/mach-xen/asm/pgtable_64.h
-@@ -66,10 +66,13 @@ static inline void xen_set_pmd(pmd_t *pm
+@@ -76,10 +76,13 @@ static inline void xen_set_pmd(pmd_t *pm
xen_l2_entry_update(pmdp, pmd);
}
@@ -170,7 +205,7 @@ References: none
#ifdef CONFIG_SMP
static inline pte_t xen_ptep_get_and_clear(pte_t *xp, pte_t ret)
-@@ -96,10 +99,13 @@ static inline void xen_set_pud(pud_t *pu
+@@ -106,10 +109,13 @@ static inline void xen_set_pud(pud_t *pu
xen_l3_entry_update(pudp, pud);
}
@@ -188,12 +223,45 @@ References: none
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
static inline pud_t xen_pudp_get_and_clear(pud_t *xp)
-@@ -122,14 +128,16 @@ static inline pud_t xen_pudp_get_and_cle
+@@ -134,31 +140,42 @@ static inline pud_t xen_pudp_get_and_cle
+
+ static inline void xen_set_p4d(p4d_t *p4dp, p4d_t p4d)
+ {
+- xen_l4_entry_update(p4dp, p4d);
++ xen_l4_entry_update(p4dp, false, p4d);
+ }
+
+-static inline void xen_p4d_clear(p4d_t *p4d)
+-{
+ #ifdef CONFIG_X86_5LEVEL
+- xen_set_p4d(p4d, xen_make_p4d(0));
++#define xen_p4d_clear(p4d) \
++({ \
++ p4d_t *p4dp_ = (p4d); \
++ PagePinned(virt_to_page(p4dp_)) \
++ ? xen_l4_entry_update(p4dp_, true, xen_make_p4d(0)) \
++ : (void)(*p4dp_ = xen_make_p4d(0)); \
++})
+ #else
+- xen_set_p4d(p4d, (p4d_t) { .pgd = xen_make_pgd(0) });
+- xen_set_p4d(__user_p4d(p4d), (p4d_t) { .pgd = xen_make_pgd(0) });
++#define xen_p4d_clear(p4d) \
++({ \
++ p4d_t *p4dp_ = (p4d); \
++ p4d_t p4de_ = (p4d_t){ .pgd = xen_make_pgd(0) }; \
++ PagePinned(virt_to_page(p4dp_)) \
++ ? xen_l4_entry_update(p4dp_, true, p4de_) \
++ : (void)(*__user_p4d(p4dp_) = *p4dp_ = p4de_); \
++})
+ #endif
+-}
+
+ #define __user_pgd(pgd) ((pgd) + PTRS_PER_PGD)
static inline void xen_set_pgd(pgd_t *pgdp, pgd_t pgd)
{
-- xen_l4_entry_update(pgdp, pgd);
-+ xen_l4_entry_update(pgdp, 0, pgd);
+- xen_l5_entry_update(pgdp, pgd);
++ xen_l5_entry_update(pgdp, false, pgd);
}
-static inline void xen_pgd_clear(pgd_t *pgd)
@@ -201,19 +269,19 @@ References: none
- xen_set_pgd(pgd, xen_make_pgd(0));
- xen_set_pgd(__user_pgd(pgd), xen_make_pgd(0));
-}
-+#define xen_pgd_clear(pgd) \
-+({ \
-+ pgd_t *__pgdp = (pgd); \
-+ PagePinned(virt_to_page(__pgdp)) \
-+ ? xen_l4_entry_update(__pgdp, 1, xen_make_pgd(0)) \
-+ : (void)(*__user_pgd(__pgdp) = *__pgdp = xen_make_pgd(0)); \
++#define xen_pgd_clear(pgd) \
++({ \
++ pgd_t *pgdp_ = (pgd); \
++ PagePinned(virt_to_page(pgdp_)) \
++ ? xen_l5_entry_update(pgdp_, true, xen_make_pgd(0)) \
++ : (void)(*__user_pgd(pgdp_) = *pgdp_ = xen_make_pgd(0)); \
+})
#define __pte_mfn(_pte) (((_pte).pte & PTE_PFN_MASK) >> PAGE_SHIFT)
--- a/arch/x86/mm/hypervisor.c
+++ b/arch/x86/mm/hypervisor.c
-@@ -356,31 +356,91 @@ void xen_l1_entry_update(pte_t *ptr, pte
+@@ -356,41 +356,116 @@ void xen_l1_entry_update(pte_t *ptr, pte
}
EXPORT_SYMBOL_GPL(xen_l1_entry_update);
@@ -285,8 +353,38 @@ References: none
#endif
#ifdef CONFIG_X86_64
--void xen_l4_entry_update(pgd_t *ptr, pgd_t val)
-+void xen_l4_entry_update(pgd_t *ptr, int user, pgd_t val)
+-void xen_l4_entry_update(p4d_t *ptr, p4d_t val)
++void xen_l4_entry_update(p4d_t *ptr, bool user, p4d_t val)
+ {
+- mmu_update_t u;
+- u.ptr = virt_to_machine(ptr);
+- u.val = __p4d_val(val);
+- BUG_ON(HYPERVISOR_mmu_update(&u, 1, NULL, DOMID_SELF) < 0);
++ mmu_update_t u[2];
++ struct page *page = NULL;
++
++ if (likely(p4d_present(val)) && likely(mem_map)
++ && likely(PagePinned(virt_to_page(ptr)))) {
++ page = p4d_page(val);
++ if (unlikely(PagePinned(page)))
++ page = NULL;
++ }
++ u[0].ptr = virt_to_machine(ptr);
++ u[0].val = __p4d_val(val);
++#ifndef CONFIG_X86_5LEVEL
++ if (user) {
++ u[1].ptr = virt_to_machine(__user_p4d(ptr));
++ u[1].val = __p4d_val(val);
++ do_lN_entry_update(u, 2, page);
++ } else
++#endif
++ do_lN_entry_update(u, 1, page);
+ }
+ #endif /* CONFIG_X86_64 */
+
+ #ifdef CONFIG_X86_5LEVEL
+-void xen_l5_entry_update(pgd_t *ptr, pgd_t val)
++void xen_l5_entry_update(pgd_t *ptr, bool user, pgd_t val)
{
- mmu_update_t u;
- u.ptr = virt_to_machine(ptr);
@@ -310,11 +408,11 @@ References: none
+ } else
+ do_lN_entry_update(u, 1, page);
}
- #endif /* CONFIG_X86_64 */
+ #endif /* CONFIG_X86_5LEVEL */
--- a/arch/x86/mm/init-xen.c
+++ b/arch/x86/mm/init-xen.c
-@@ -792,6 +792,8 @@ void __init zone_sizes_init(void)
+@@ -844,6 +844,8 @@ void __init zone_sizes_init(void)
#endif
free_area_init_nodes(max_zone_pfns);
@@ -325,10 +423,10 @@ References: none
DEFINE_PER_CPU_SHARED_ALIGNED(struct tlb_state, cpu_tlbstate) = {
--- a/arch/x86/mm/init_32-xen.c
+++ b/arch/x86/mm/init_32-xen.c
-@@ -819,8 +819,6 @@ void __init mem_init(void)
+@@ -826,8 +826,6 @@ void __init mem_init(void)
+ BUG_ON((unsigned long)high_memory > VMALLOC_START);
- if (boot_cpu_data.wp_works_ok < 0)
- test_wp_bit();
+ test_wp_bit();
-
- SetPagePinned(virt_to_page(init_mm.pgd));
}
@@ -336,21 +434,37 @@ References: none
#ifdef CONFIG_MEMORY_HOTPLUG
--- a/arch/x86/mm/init_64-xen.c
+++ b/arch/x86/mm/init_64-xen.c
-@@ -217,8 +217,11 @@ static pud_t *fill_pud(pgd_t *pgd, unsig
+@@ -276,8 +276,12 @@ static p4d_t *fill_p4d(pgd_t *pgd, unsig
{
if (pgd_none(*pgd)) {
+ p4d_t *p4d = (p4d_t *)spp_getpage();
+- make_page_readonly(p4d, XENFEAT_writable_page_tables);
+- pgd_populate(&init_mm, pgd, p4d);
++ if (!after_bootmem) {
++ make_page_readonly(p4d, XENFEAT_writable_page_tables);
++ xen_l5_entry_update(pgd, false,
++ __pgd(__pa(p4d) | _PAGE_TABLE));
++ } else
++ pgd_populate(&init_mm, pgd, p4d);
+ if (p4d != p4d_offset(pgd, 0))
+ printk(KERN_ERR "PAGETABLE BUG #00! %p <-> %p\n",
+ p4d, p4d_offset(pgd, 0));
+@@ -289,8 +293,12 @@ static pud_t *fill_pud(p4d_t *p4d, unsig
+ {
+ if (p4d_none(*p4d)) {
pud_t *pud = (pud_t *)spp_getpage();
- make_page_readonly(pud, XENFEAT_writable_page_tables);
-- pgd_populate(&init_mm, pgd, pud);
+- p4d_populate(&init_mm, p4d, pud);
+ if (!after_bootmem) {
+ make_page_readonly(pud, XENFEAT_writable_page_tables);
-+ xen_l4_entry_update(pgd, __pgd(__pa(pud) | _PAGE_TABLE));
++ xen_l4_entry_update(p4d, false,
++ __p4d(__pa(pud) | _PAGE_TABLE));
+ } else
-+ pgd_populate(&init_mm, pgd, pud);
- if (pud != pud_offset(pgd, 0))
- printk(KERN_ERR "PAGETABLE BUG #00! %p <-> %p\n",
- pud, pud_offset(pgd, 0));
-@@ -230,8 +233,11 @@ static pmd_t *fill_pmd(pud_t *pud, unsig
++ p4d_populate(&init_mm, p4d, pud);
+ if (pud != pud_offset(p4d, 0))
+ printk(KERN_ERR "PAGETABLE BUG #01! %p <-> %p\n",
+ pud, pud_offset(p4d, 0));
+@@ -302,8 +310,11 @@ static pmd_t *fill_pmd(pud_t *pud, unsig
{
if (pud_none(*pud)) {
pmd_t *pmd = (pmd_t *) spp_getpage();
@@ -362,9 +476,9 @@ References: none
+ } else
+ pud_populate(&init_mm, pud, pmd);
if (pmd != pmd_offset(pud, 0))
- printk(KERN_ERR "PAGETABLE BUG #01! %p <-> %p\n",
+ printk(KERN_ERR "PAGETABLE BUG #02! %p <-> %p\n",
pmd, pmd_offset(pud, 0));
-@@ -538,8 +544,8 @@ phys_pmd_init(pmd_t *pmd_page, unsigned
+@@ -630,8 +641,8 @@ phys_pmd_init(pmd_t *pmd_page, unsigned
pte = alloc_low_page();
paddr_last = phys_pte_init(pte, paddr, paddr_end, new_prot);
@@ -374,7 +488,7 @@ References: none
if (page_size_mask & (1 << PG_LEVEL_NUM)) {
mmu_update_t u;
-@@ -634,8 +640,8 @@ phys_pud_init(pud_t *pud_page, unsigned
+@@ -726,8 +737,8 @@ phys_pud_init(pud_t *pud_page, unsigned
page_size_mask & ~(1 << PG_LEVEL_NUM),
prot);
@@ -384,21 +498,24 @@ References: none
if (page_size_mask & (1 << PG_LEVEL_NUM)) {
mmu_update_t u;
-@@ -884,10 +890,10 @@ kernel_physical_mapping_init(unsigned lo
- paddr_last = phys_pud_init(pud, __pa(vaddr), __pa(vaddr_end),
+@@ -1042,12 +1053,13 @@ kernel_physical_mapping_init(unsigned lo
+ paddr_last = phys_p4d_init(p4d, __pa(vaddr), __pa(vaddr_end),
page_size_mask);
-- make_page_readonly(pud, XENFEAT_writable_page_tables);
-- if (!after_bootmem)
-+ if (!after_bootmem) {
-+ make_page_readonly(pud, XENFEAT_writable_page_tables);
- xen_l4_entry_update(pgd, __pgd(__pa(pud) | _PAGE_TABLE));
-- else {
-+ } else {
+- make_page_readonly(p4d, XENFEAT_writable_page_tables);
+ if (!after_bootmem) {
++ make_page_readonly(p4d, XENFEAT_writable_page_tables);
+ if (IS_ENABLED(CONFIG_X86_5LEVEL))
+- xen_l5_entry_update(pgd, __pgd(__pa(p4d) | _PAGE_TABLE));
++ xen_l5_entry_update(pgd, false,
++ __pgd(__pa(p4d) | _PAGE_TABLE));
+ else
+- xen_l4_entry_update(p4d_offset(pgd, vaddr),
++ xen_l4_entry_update(p4d_offset(pgd, vaddr), false,
+ __p4d(__pa(p4d) | _PAGE_TABLE));
+ } else {
spin_lock(&init_mm.page_table_lock);
- pgd_populate(&init_mm, pgd, pud);
- spin_unlock(&init_mm.page_table_lock);
-@@ -924,8 +930,6 @@ void __init paging_init(void)
+@@ -1089,8 +1101,6 @@ void __init paging_init(void)
node_clear_state(0, N_NORMAL_MEMORY);
zone_sizes_init();
@@ -460,7 +577,7 @@ References: none
ClearPageForeign(pmd);
init_page_count(pmd);
-@@ -235,21 +236,20 @@ static inline unsigned int pgd_walk_set_
+@@ -251,21 +252,20 @@ static inline unsigned int pgd_walk_set_
{
unsigned long pfn = page_to_pfn(page);
@@ -496,39 +613,46 @@ References: none
}
return seq;
-@@ -296,6 +296,16 @@ static void pgd_walk(pgd_t *pgd_base, pg
+@@ -328,6 +328,22 @@ static void pgd_walk(pgd_t *pgd_base, pg
}
}
+#ifdef CONFIG_X86_PAE
+ for (; g < PTRS_PER_PGD; g++, pgd++) {
++ p4d_t *p4d;
++ pud_t *pud;
++ pmd_t *pmd;
++
+ BUG_ON(pgd_none(*pgd));
-+ pud = pud_offset(pgd, 0);
++ p4d = p4d_offset(pgd, 0);
++ BUG_ON(p4d_none(*p4d));
++ pud = pud_offset(p4d, 0);
+ BUG_ON(pud_none(*pud));
+ pmd = pmd_offset(pud, 0);
-+ seq = pgd_walk_set_prot(virt_to_page(pmd),flags,cpu,seq);
++ seq = pgd_walk_set_prot(virt_to_page(pmd), flags, cpu, seq);
+ }
+#endif
+
mcl = per_cpu(pb_mcl, cpu);
#ifdef CONFIG_X86_64
if (unlikely(seq > PIN_BATCH - 2)) {
-@@ -331,6 +341,51 @@ static void pgd_walk(pgd_t *pgd_base, pg
+@@ -363,6 +379,65 @@ static void pgd_walk(pgd_t *pgd_base, pg
put_cpu();
}
+void __init xen_init_pgd_pin(void)
+{
-+ pgd_t *pgd = init_mm.pgd;
-+ pud_t *pud;
-+ pmd_t *pmd;
-+ unsigned int g, u, m;
++ pgd_t *pgd = init_mm.pgd;
++ unsigned int g;
+
+ if (xen_feature(XENFEAT_auto_translated_physmap))
+ return;
+
+ SetPagePinned(virt_to_page(pgd));
+ for (g = 0; g < PTRS_PER_PGD; g++, pgd++) {
++ p4d_t *p4d;
++ unsigned int l4;
++
+#ifndef CONFIG_X86_PAE
+ if (g >= pgd_index(HYPERVISOR_VIRT_START)
+ && g <= pgd_index(HYPERVISOR_VIRT_END - 1))
@@ -536,24 +660,37 @@ References: none
+#endif
+ if (!pgd_present(*pgd))
+ continue;
-+ pud = pud_offset(pgd, 0);
-+ if (PTRS_PER_PUD > 1) /* not folded */
-+ SetPagePinned(virt_to_page(pud));
-+ for (u = 0; u < PTRS_PER_PUD; u++, pud++) {
-+ if (!pud_present(*pud))
++ p4d = p4d_offset(pgd, 0);
++ if (PTRS_PER_P4D > 1) /* not folded */
++ SetPagePinned(virt_to_page(p4d));
++ for (l4 = 0; l4 < PTRS_PER_P4D; l4++, p4d++) {
++ pud_t *pud;
++ unsigned int u;
++
++ if (!p4d_present(*p4d))
+ continue;
-+ pmd = pmd_offset(pud, 0);
-+ if (PTRS_PER_PMD > 1) /* not folded */
-+ SetPagePinned(virt_to_page(pmd));
-+ for (m = 0; m < PTRS_PER_PMD; m++, pmd++) {
-+#ifdef CONFIG_X86_PAE
-+ if (g == pgd_index(HYPERVISOR_VIRT_START)
-+ && m >= pmd_index(HYPERVISOR_VIRT_START))
++ pud = pud_offset(p4d, 0);
++ if (PTRS_PER_PUD > 1) /* not folded */
++ SetPagePinned(virt_to_page(pud));
++ for (u = 0; u < PTRS_PER_PUD; u++, pud++) {
++ pmd_t *pmd;
++ unsigned int m;
++
++ if (!pud_present(*pud))
+ continue;
++ pmd = pmd_offset(pud, 0);
++ if (PTRS_PER_PMD > 1) /* not folded */
++ SetPagePinned(virt_to_page(pmd));
++ for (m = 0; m < PTRS_PER_PMD; m++, pmd++) {
++#ifdef CONFIG_X86_PAE
++ if (g == pgd_index(HYPERVISOR_VIRT_START)
++ && m >= pmd_index(HYPERVISOR_VIRT_START))
++ continue;
+#endif
-+ if (!pmd_present(*pmd))
-+ continue;
-+ SetPagePinned(pmd_page(*pmd));
++ if (!pmd_present(*pmd))
++ continue;
++ SetPagePinned(pmd_page(*pmd));
++ }
+ }
+ }
+ }
@@ -565,7 +702,7 @@ References: none
static void __pgd_pin(pgd_t *pgd)
{
pgd_walk(pgd, PAGE_KERNEL_RO);
-@@ -529,21 +584,18 @@ static void pgd_dtor(pgd_t *pgd)
+@@ -565,21 +640,18 @@ static void pgd_dtor(pgd_t *pgd)
void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd)
{
@@ -597,7 +734,7 @@ References: none
/*
* According to Intel App note "TLBs, Paging-Structure Caches,
-@@ -641,13 +693,10 @@ static void pgd_prepopulate_pmd(struct m
+@@ -679,13 +751,10 @@ static void pgd_prepopulate_pmd(struct m
for (i = 0; i < PREALLOCATED_PMDS; i++, pud++) {
pmd_t *pmd = pmds[i];
diff --git a/patches.xen/xen-x86_64-dump-user-pgt b/patches.xen/xen-x86_64-dump-user-pgt
index 91a3f5ed28..3122710307 100644
--- a/patches.xen/xen-x86_64-dump-user-pgt
+++ b/patches.xen/xen-x86_64-dump-user-pgt
@@ -4,34 +4,34 @@ Patch-mainline: Never, SUSE-Xen specific
--- a/arch/x86/mm/fault-xen.c
+++ b/arch/x86/mm/fault-xen.c
-@@ -417,6 +417,7 @@ static void dump_pagetable(unsigned long
+@@ -431,6 +431,7 @@ static void dump_pagetable(unsigned long
out:
- printk(KERN_CONT "\n");
+ pr_cont("\n");
}
+#define dump_pagetable(addr, krnl) dump_pagetable(addr)
#else /* CONFIG_X86_64: */
-@@ -530,7 +531,7 @@ static int bad_address(void *p)
+@@ -565,7 +566,7 @@ static int bad_address(void *p)
return probe_kernel_address((unsigned long *)p, dummy);
}
-static void dump_pagetable(unsigned long address)
+static void dump_pagetable(unsigned long address, bool kernel)
{
- pgd_t *base = __va(read_cr3() & PHYSICAL_PAGE_MASK);
+ pgd_t *base = __va(read_cr3_pa());
pgd_t *pgd = base + pgd_index(address);
-@@ -538,6 +539,9 @@ static void dump_pagetable(unsigned long
+@@ -574,6 +575,9 @@ static void dump_pagetable(unsigned long
pmd_t *pmd;
pte_t *pte;
+ if (!kernel)
-+ pgd = __user_pgd(base) + pgd_index(address);
++ pgd = __user_pgd(pgd);
+
if (bad_address(pgd))
goto bad;
-@@ -691,7 +695,7 @@ show_fault_oops(struct pt_regs *regs, un
+@@ -735,7 +739,7 @@ show_fault_oops(struct pt_regs *regs, un
printk(KERN_CONT " at %p\n", (void *) address);
printk(KERN_ALERT "IP: %pS\n", (void *)regs->ip);
@@ -40,7 +40,7 @@ Patch-mainline: Never, SUSE-Xen specific
}
static noinline void
-@@ -708,7 +712,7 @@ pgtable_bad(struct pt_regs *regs, unsign
+@@ -752,7 +756,7 @@ pgtable_bad(struct pt_regs *regs, unsign
printk(KERN_ALERT "%s: Corrupted page table at address %lx\n",
tsk->comm, address);
diff --git a/patches.xen/xen-x86_64-m2p-strict b/patches.xen/xen-x86_64-m2p-strict
index 75e2aaed20..9864e51978 100644
--- a/patches.xen/xen-x86_64-m2p-strict
+++ b/patches.xen/xen-x86_64-m2p-strict
@@ -5,7 +5,7 @@ References: none
--- a/arch/x86/kernel/head64-xen.c
+++ b/arch/x86/kernel/head64-xen.c
-@@ -149,6 +149,8 @@ static void __init copy_bootdata(char *r
+@@ -271,6 +271,8 @@ static void __init copy_bootdata(char *r
asmlinkage __visible void __init x86_64_start_kernel(char * real_mode_data)
{
@@ -14,7 +14,7 @@ References: none
/*
* Build-time sanity checks on the kernel image and module
* area mappings. (these are purely build-time and produce no code)
-@@ -166,6 +168,9 @@ asmlinkage __visible void __init x86_64_
+@@ -288,6 +290,9 @@ asmlinkage __visible void __init x86_64_
cr4_init_shadow();
xen_start_info = (struct start_info *)real_mode_data;
@@ -24,7 +24,7 @@ References: none
xen_start_kernel();
#ifndef CONFIG_XEN
-@@ -196,6 +201,9 @@ asmlinkage __visible void __init x86_64_
+@@ -318,6 +323,9 @@ asmlinkage __visible void __init x86_64_
#else
xen_switch_pt();
diff --git a/patches.xen/xen-x86_64-note-init-p2m b/patches.xen/xen-x86_64-note-init-p2m
index c5426393b1..12d49a9bc0 100644
--- a/patches.xen/xen-x86_64-note-init-p2m
+++ b/patches.xen/xen-x86_64-note-init-p2m
@@ -20,7 +20,7 @@ when the functions are used before the page fault handler gets set up.
--- a/arch/x86/kernel/head64-xen.c
+++ b/arch/x86/kernel/head64-xen.c
-@@ -205,7 +205,13 @@ void __init x86_64_start_reservations(ch
+@@ -327,7 +327,13 @@ void __init x86_64_start_reservations(ch
copy_bootdata(__va(real_mode_data));
x86_early_init_platform_quirks();
@@ -45,7 +45,7 @@ when the functions are used before the page fault handler gets set up.
#include <asm/msr.h>
#include <asm/cache.h>
#include <asm/percpu.h>
-@@ -160,6 +161,7 @@ EXPORT_SYMBOL(empty_zero_page)
+@@ -165,6 +166,7 @@ EXPORT_SYMBOL(empty_zero_page)
#endif
ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, .quad hypercall_page)
ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID, .quad _PAGE_PRESENT, _PAGE_PRESENT)
@@ -55,7 +55,7 @@ when the functions are used before the page fault handler gets set up.
.ascii "|auto_translated_physmap";
--- a/arch/x86/kernel/setup-xen.c
+++ b/arch/x86/kernel/setup-xen.c
-@@ -1483,7 +1483,7 @@ void __init setup_arch(char **cmdline_p)
+@@ -1492,7 +1492,7 @@ void __init setup_arch(char **cmdline_p)
long ret;
set_xen_guest_handle(reservation.extent_start,
@@ -64,7 +64,7 @@ when the functions are used before the page fault handler gets set up.
for (; ; difference = (difference + 1) >> 1) {
reservation.nr_extents = difference;
ret = HYPERVISOR_memory_op(
-@@ -1503,13 +1503,83 @@ void __init setup_arch(char **cmdline_p)
+@@ -1512,13 +1512,88 @@ void __init setup_arch(char **cmdline_p)
phys_to_machine_mapping = alloc_bootmem_pages(
max_pfn * sizeof(unsigned long));
memcpy(phys_to_machine_mapping,
@@ -78,17 +78,21 @@ when the functions are used before the page fault handler gets set up.
- sizeof(unsigned long))));
+#ifdef CONFIG_X86_64
+ if (xen_start_info->mfn_list == VMEMMAP_START) {
++# ifdef CONFIG_X86_5LEVEL
++# error 5-level support not implemented yet
++# else
+ /*
-+ * Since it is well isolated we can (and since it is
-+ * perhaps large we should) also free the page tables
-+ * mapping the initial P->M table.
++ * Since they are well isolated we can (and since they
++ * are perhaps large we should) also free the page
++ * tables mapping the initial P->M table.
+ */
+ unsigned long va = VMEMMAP_START, pa;
+ pgd_t *pgd = pgd_offset_k(va);
-+ pud_t *pud_page = pud_offset(pgd, 0);
++ p4d_t *p4d = p4d_offset(pgd, 0);
++ pud_t *pud_page = pud_offset(p4d, 0);
+
+ BUILD_BUG_ON(VMEMMAP_START & ~PGDIR_MASK);
-+ xen_l4_entry_update(pgd, __pgd(0));
++ xen_l4_entry_update(p4d, __p4d(0));
+ do {
+ pud_t *pud = pud_page + pud_index(va);
+
@@ -143,6 +147,7 @@ when the functions are used before the page fault handler gets set up.
+ XENFEAT_writable_page_tables);
+ free_bootmem(__pa((unsigned long)pud_page & PAGE_MASK),
+ PAGE_SIZE);
++# endif
+ } else if (!WARN_ON(xen_start_info->mfn_list
+ < __START_KERNEL_map))
+#endif
@@ -154,7 +159,7 @@ when the functions are used before the page fault handler gets set up.
setup_pfn_to_mfn_frame_list(__alloc_bootmem);
--- a/arch/x86/mm/init_64-xen.c
+++ b/arch/x86/mm/init_64-xen.c
-@@ -426,6 +426,13 @@ static inline int __meminit make_readonl
+@@ -521,6 +521,13 @@ static inline int __meminit make_readonl
PFN_PHYS(xen_start_info->nr_pt_frames) -
__START_KERNEL_map)))
readonly = 1;
@@ -168,20 +173,20 @@ when the functions are used before the page fault handler gets set up.
/*
* No need for writable mapping of kernel image. This also ensures that
-@@ -739,6 +746,12 @@ void __init xen_init_pt(void)
+@@ -892,6 +899,12 @@ void __init xen_init_pt(void)
(PTRS_PER_PUD - pud_index(__START_KERNEL_map))
* sizeof(*level3_kernel_pgt));
+ /* Copy the initial P->M table mappings if necessary. */
+ addr = pgd_index(xen_start_info->mfn_list);
+ if (addr < pgd_index(__START_KERNEL_map))
-+ init_level4_pgt[addr] =
++ init_top_pgt[addr] =
+ ((pgd_t *)xen_start_info->pt_base)[addr];
+
/* Do an early initialization of the fixmap area. */
addr = __fix_to_virt(FIX_EARLYCON_MEM_BASE);
if (pud_present(level3_kernel_pgt[pud_index(addr)])) {
-@@ -828,6 +841,7 @@ void __init xen_init_pt(void)
+@@ -985,6 +998,7 @@ void __init xen_init_pt(void)
void __init xen_finish_init_mapping(void)
{
unsigned long va;
@@ -189,7 +194,7 @@ when the functions are used before the page fault handler gets set up.
pud_t *pud;
/* Re-vector virtual addresses pointing into the initial
-@@ -835,16 +849,20 @@ void __init xen_finish_init_mapping(void
+@@ -992,16 +1006,20 @@ void __init xen_finish_init_mapping(void
xen_start_info = __va(__pa(xen_start_info));
xen_start_info->pt_base = (unsigned long)
__va(__pa(xen_start_info->pt_base));
@@ -217,7 +222,7 @@ when the functions are used before the page fault handler gets set up.
while (va < (unsigned long)&_text) {
--- a/arch/x86/mm/pageattr-xen.c
+++ b/arch/x86/mm/pageattr-xen.c
-@@ -2131,7 +2131,7 @@ static void __make_page_writable(unsigne
+@@ -2164,7 +2164,7 @@ static void __make_page_writable(unsigne
pte = lookup_address(va, &level);
BUG_ON(!pte || level != PG_LEVEL_4K);
@@ -228,27 +233,27 @@ when the functions are used before the page fault handler gets set up.
else {
--- a/arch/x86/mm/pgtable-xen.c
+++ b/arch/x86/mm/pgtable-xen.c
-@@ -367,7 +367,7 @@ void __init xen_init_pgd_pin(void)
- if (PTRS_PER_PUD > 1) /* not folded */
- SetPagePinned(virt_to_page(pud));
- for (u = 0; u < PTRS_PER_PUD; u++, pud++) {
-- if (!pud_present(*pud))
-+ if (!pud_present(*pud) || pud_large(*pud))
- continue;
- pmd = pmd_offset(pud, 0);
- if (PTRS_PER_PMD > 1) /* not folded */
-@@ -378,7 +378,7 @@ void __init xen_init_pgd_pin(void)
- && m >= pmd_index(HYPERVISOR_VIRT_START))
+@@ -418,7 +418,7 @@ void __init xen_init_pgd_pin(void)
+ pmd_t *pmd;
+ unsigned int m;
+
+- if (!pud_present(*pud))
++ if (!pud_present(*pud) || pud_large(*pud))
continue;
+ pmd = pmd_offset(pud, 0);
+ if (PTRS_PER_PMD > 1) /* not folded */
+@@ -429,7 +429,7 @@ void __init xen_init_pgd_pin(void)
+ && m >= pmd_index(HYPERVISOR_VIRT_START))
+ continue;
#endif
-- if (!pmd_present(*pmd))
-+ if (!pmd_present(*pmd) || pmd_large(*pmd))
- continue;
- SetPagePinned(pmd_page(*pmd));
- }
+- if (!pmd_present(*pmd))
++ if (!pmd_present(*pmd) || pmd_large(*pmd))
+ continue;
+ SetPagePinned(pmd_page(*pmd));
+ }
--- a/arch/x86/mm/pgtable_32-xen.c
+++ b/arch/x86/mm/pgtable_32-xen.c
-@@ -137,6 +137,6 @@ void make_lowmem_page_writable(const voi
+@@ -143,6 +143,6 @@ void make_lowmem_page_writable(const voi
pte = lookup_address((unsigned long)va, &level);
BUG_ON(!pte || level != PG_LEVEL_4K || !pte_present(*pte));
rc = HYPERVISOR_update_va_mapping(
diff --git a/patches.xen/xen-x86_64-pgd-alloc-order b/patches.xen/xen-x86_64-pgd-alloc-order
index 85256e5028..8363b349cf 100644
--- a/patches.xen/xen-x86_64-pgd-alloc-order
+++ b/patches.xen/xen-x86_64-pgd-alloc-order
@@ -3,7 +3,7 @@ Subject: don't require order-1 allocations for pgd-s
Patch-mainline: Never, SUSE-Xen specific
References: none
-At the same time remove the useless user mode pair of init_level4_pgt.
+At the same time remove the useless user mode pair of init_top_pgt.
--- a/arch/x86/include/mach-xen/asm/hypervisor.h
+++ b/arch/x86/include/mach-xen/asm/hypervisor.h
@@ -18,71 +18,98 @@ At the same time remove the useless user mode pair of init_level4_pgt.
void xen_load_gs(unsigned int selector); /* x86_64 only */
void xen_tlb_flush(void);
void xen_invlpg(unsigned long ptr);
-@@ -107,7 +107,7 @@ void xen_invlpg(unsigned long ptr);
+@@ -107,8 +107,8 @@ void xen_invlpg(unsigned long ptr);
void xen_l1_entry_update(pte_t *ptr, pte_t val);
void xen_l2_entry_update(pmd_t *ptr, pmd_t val);
void xen_l3_entry_update(pud_t *ptr, pud_t val); /* x86_64/PAE */
--void xen_l4_entry_update(pgd_t *ptr, int user, pgd_t val); /* x86_64 only */
-+void xen_l4_entry_update(pgd_t *ptr, pgd_t val); /* x86_64 only */
+-void xen_l4_entry_update(p4d_t *ptr, bool user, p4d_t val); /* x86_64 only */
+-void xen_l5_entry_update(pgd_t *ptr, bool user, pgd_t val); /* 5-level paging only */
++void xen_l4_entry_update(p4d_t *ptr, p4d_t val); /* x86_64 only */
++void xen_l5_entry_update(pgd_t *ptr, pgd_t val); /* 5-level paging only */
void xen_pgd_pin(pgd_t *);
void xen_pgd_unpin(pgd_t *);
--- a/arch/x86/include/mach-xen/asm/pgalloc.h
+++ b/arch/x86/include/mach-xen/asm/pgalloc.h
-@@ -123,15 +123,13 @@ static inline void pud_populate(struct m
- #endif /* CONFIG_X86_PAE */
-
- #if CONFIG_PGTABLE_LEVELS > 3
--#define __user_pgd(pgd) ((pgd) + PTRS_PER_PGD)
--
- static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pud_t *pud)
- {
- pgd_t ent = __pgd(_PAGE_TABLE | __pa(pud));
+@@ -132,7 +132,7 @@ static inline void p4d_populate(struct m
paravirt_alloc_pud(mm, __pa(pud) >> PAGE_SHIFT);
+ if (unlikely(PagePinned(virt_to_page(p4d))))
+- xen_l4_entry_update(p4d, true, ent);
++ xen_l4_entry_update(p4d, ent);
+ else {
+ *p4d = ent;
+ #if CONFIG_PGTABLE_LEVELS == 4
+@@ -168,7 +168,7 @@ static inline void pgd_populate(struct m
+
+ paravirt_alloc_p4d(mm, __pa(p4d) >> PAGE_SHIFT);
if (unlikely(PagePinned(virt_to_page(pgd))))
-- xen_l4_entry_update(pgd, 1, ent);
-+ xen_l4_entry_update(pgd, ent);
+- xen_l5_entry_update(pgd, true, ent);
++ xen_l5_entry_update(pgd, ent);
else
*__user_pgd(pgd) = *pgd = ent;
}
--- a/arch/x86/include/mach-xen/asm/pgtable_64.h
+++ b/arch/x86/include/mach-xen/asm/pgtable_64.h
-@@ -124,18 +124,22 @@ static inline pud_t xen_pudp_get_and_cle
+@@ -140,7 +140,7 @@ static inline pud_t xen_pudp_get_and_cle
+
+ static inline void xen_set_p4d(p4d_t *p4dp, p4d_t p4d)
+ {
+- xen_l4_entry_update(p4dp, false, p4d);
++ xen_l4_entry_update(p4dp, p4d);
}
+
+ #ifdef CONFIG_X86_5LEVEL
+@@ -148,7 +148,7 @@ static inline void xen_set_p4d(p4d_t *p4
+ ({ \
+ p4d_t *p4dp_ = (p4d); \
+ PagePinned(virt_to_page(p4dp_)) \
+- ? xen_l4_entry_update(p4dp_, true, xen_make_p4d(0)) \
++ ? xen_l4_entry_update(p4dp_, xen_make_p4d(0)) \
+ : (void)(*p4dp_ = xen_make_p4d(0)); \
+ })
+ #else
+@@ -157,23 +157,27 @@ static inline void xen_set_p4d(p4d_t *p4
+ p4d_t *p4dp_ = (p4d); \
+ p4d_t p4de_ = (p4d_t){ .pgd = xen_make_pgd(0) }; \
+ PagePinned(virt_to_page(p4dp_)) \
+- ? xen_l4_entry_update(p4dp_, true, p4de_) \
++ ? xen_l4_entry_update(p4dp_, p4de_) \
+ : (void)(*__user_p4d(p4dp_) = *p4dp_ = p4de_); \
+ })
#endif
-#define __user_pgd(pgd) ((pgd) + PTRS_PER_PGD)
+#define __user_pgd(pgd) \
-+ (((unsigned long)(pgd) & PAGE_MASK) != (unsigned long)init_level4_pgt \
-+ ? (pgd_t *)(virt_to_page(pgd)->private \
-+ + ((unsigned long)(pgd) & ~PAGE_MASK)) \
++ (((unsigned long)(pgd) & PAGE_MASK) != (unsigned long)init_top_pgt \
++ ? (typeof(pgd))(page_private(virt_to_page(pgd)) \
++ + ((unsigned long)(pgd) & ~PAGE_MASK)) \
+ : (typeof(pgd))NULL)
static inline void xen_set_pgd(pgd_t *pgdp, pgd_t pgd)
{
-- xen_l4_entry_update(pgdp, 0, pgd);
-+ xen_l4_entry_update(pgdp, pgd);
+- xen_l5_entry_update(pgdp, false, pgd);
++ xen_l5_entry_update(pgdp, pgd);
}
- #define xen_pgd_clear(pgd) \
- ({ \
- pgd_t *__pgdp = (pgd); \
- PagePinned(virt_to_page(__pgdp)) \
-- ? xen_l4_entry_update(__pgdp, 1, xen_make_pgd(0)) \
-+ ? xen_l4_entry_update(__pgdp, xen_make_pgd(0)) \
- : (void)(*__user_pgd(__pgdp) = *__pgdp = xen_make_pgd(0)); \
+ #define xen_pgd_clear(pgd) \
+ ({ \
+ pgd_t *pgdp_ = (pgd); \
+ PagePinned(virt_to_page(pgdp_)) \
+- ? xen_l5_entry_update(pgdp_, true, xen_make_pgd(0)) \
++ ? xen_l5_entry_update(pgdp_, xen_make_pgd(0)) \
+ : (void)(*__user_pgd(pgdp_) = *pgdp_ = xen_make_pgd(0)); \
})
--- a/arch/x86/kernel/cpu/common-xen.c
+++ b/arch/x86/kernel/cpu/common-xen.c
-@@ -1351,8 +1351,7 @@ DEFINE_PER_CPU_FIRST(union irq_stack_uni
+@@ -1392,8 +1392,7 @@ DEFINE_PER_CPU_FIRST(union irq_stack_uni
void xen_switch_pt(void)
{
#ifdef CONFIG_XEN
-- xen_pt_switch(__pa_symbol(init_level4_pgt));
-- xen_new_user_pt(__pa_symbol(__user_pgd(init_level4_pgt)));
-+ xen_pt_switch(init_level4_pgt);
+- xen_pt_switch(__pa_symbol(init_top_pgt));
+- xen_new_user_pt(__pa_symbol(__user_pgd(init_top_pgt)));
++ xen_pt_switch(init_top_pgt);
#endif
}
@@ -90,7 +117,7 @@ At the same time remove the useless user mode pair of init_level4_pgt.
+++ b/arch/x86/kernel/head_64-xen.S
@@ -63,14 +63,6 @@ GLOBAL(name)
__PAGE_ALIGNED_BSS
- NEXT_PAGE(init_level4_pgt)
+ NEXT_PAGE(init_top_pgt)
.fill 512,8,0
- /*
- * We update two pgd entries to make kernel and user pgd consistent
@@ -101,20 +128,43 @@ At the same time remove the useless user mode pair of init_level4_pgt.
- */
- .fill 512,8,0
- NEXT_PAGE(level3_kernel_pgt)
- .fill 512,8,0
+ #ifdef CONFIG_X86_5LEVEL
+ NEXT_PAGE(level4_kernel_pgt)
--- a/arch/x86/mm/hypervisor.c
+++ b/arch/x86/mm/hypervisor.c
@@ -519,7 +519,7 @@ void xen_l3_entry_update(pud_t *ptr, pud
#endif
#ifdef CONFIG_X86_64
--void xen_l4_entry_update(pgd_t *ptr, int user, pgd_t val)
-+void xen_l4_entry_update(pgd_t *ptr, pgd_t val)
+-void xen_l4_entry_update(p4d_t *ptr, bool user, p4d_t val)
++void xen_l4_entry_update(p4d_t *ptr, p4d_t val)
+ {
+ mmu_update_t u[2];
+ struct page *page = NULL;
+@@ -533,8 +533,11 @@ void xen_l4_entry_update(p4d_t *ptr, boo
+ u[0].ptr = virt_to_machine(ptr);
+ u[0].val = __p4d_val(val);
+ #ifndef CONFIG_X86_5LEVEL
+- if (user) {
+- u[1].ptr = virt_to_machine(__user_p4d(ptr));
++ if (((unsigned long)ptr & ~PAGE_MASK)
++ <= pgd_index(TASK_SIZE_MAX) * sizeof(*ptr)) {
++ ptr = __user_p4d(ptr);
++ BUG_ON(!ptr);
++ u[1].ptr = virt_to_machine(ptr);
+ u[1].val = __p4d_val(val);
+ do_lN_entry_update(u, 2, page);
+ } else
+@@ -544,7 +547,7 @@ void xen_l4_entry_update(p4d_t *ptr, boo
+ #endif /* CONFIG_X86_64 */
+
+ #ifdef CONFIG_X86_5LEVEL
+-void xen_l5_entry_update(pgd_t *ptr, bool user, pgd_t val)
++void xen_l5_entry_update(pgd_t *ptr, pgd_t val)
{
mmu_update_t u[2];
struct page *page = NULL;
-@@ -532,8 +532,11 @@ void xen_l4_entry_update(pgd_t *ptr, int
+@@ -557,8 +560,11 @@ void xen_l5_entry_update(pgd_t *ptr, boo
}
u[0].ptr = virt_to_machine(ptr);
u[0].val = __pgd_val(val);
@@ -128,9 +178,9 @@ At the same time remove the useless user mode pair of init_level4_pgt.
u[1].val = __pgd_val(val);
do_lN_entry_update(u, 2, page);
} else
-@@ -541,21 +544,25 @@ void xen_l4_entry_update(pgd_t *ptr, int
+@@ -566,21 +572,25 @@ void xen_l5_entry_update(pgd_t *ptr, boo
}
- #endif /* CONFIG_X86_64 */
+ #endif /* CONFIG_X86_5LEVEL */
-void xen_pt_switch(unsigned long ptr)
+#ifdef CONFIG_X86_64
@@ -158,7 +208,7 @@ At the same time remove the useless user mode pair of init_level4_pgt.
void xen_tlb_flush(void)
{
-@@ -627,14 +634,26 @@ EXPORT_SYMBOL_GPL(xen_invlpg_mask);
+@@ -652,6 +662,7 @@ EXPORT_SYMBOL_GPL(xen_invlpg_mask);
void xen_pgd_pin(pgd_t *pgd)
{
struct mmuext_op op[NR_PGD_PIN_OPS];
@@ -166,28 +216,36 @@ At the same time remove the useless user mode pair of init_level4_pgt.
op[0].cmd = MMUEXT_PIN_L3_TABLE;
op[0].arg1.mfn = virt_to_mfn(pgd);
- #ifdef CONFIG_X86_64
+@@ -661,9 +672,26 @@ void xen_pgd_pin(pgd_t *pgd)
+ # else
op[1].cmd = op[0].cmd = MMUEXT_PIN_L4_TABLE;
+ # endif
- op[1].arg1.mfn = virt_to_mfn(__user_pgd(pgd));
+ pgd = __user_pgd(pgd);
+ if (pgd)
+ op[1].arg1.mfn = virt_to_mfn(pgd);
+ else {
-+#ifdef CONFIG_X86_VSYSCALL_EMULATION
++# ifdef CONFIG_X86_VSYSCALL_EMULATION
++# ifdef CONFIG_X86_5LEVEL
++ op[1].cmd = MMUEXT_PIN_L4_TABLE;
++ op[1].arg1.mfn = pfn_to_mfn(__pa_symbol(level4_user_pgt)
++ >> PAGE_SHIFT);
++# else
+ op[1].cmd = MMUEXT_PIN_L3_TABLE;
+ op[1].arg1.mfn = pfn_to_mfn(__pa_symbol(level3_user_pgt)
+ >> PAGE_SHIFT);
-+#else
++# endif
++# else
+ nr = 1;
++# endif
++ }
#endif
- if (HYPERVISOR_mmuext_op(op, NR_PGD_PIN_OPS, NULL, DOMID_SELF) < 0)
-+ }
-+#endif
+ if (HYPERVISOR_mmuext_op(op, nr, NULL, DOMID_SELF) < 0)
BUG();
}
-@@ -645,8 +664,10 @@ void xen_pgd_unpin(pgd_t *pgd)
+@@ -674,8 +702,10 @@ void xen_pgd_unpin(pgd_t *pgd)
op[0].cmd = MMUEXT_UNPIN_TABLE;
op[0].arg1.mfn = virt_to_mfn(pgd);
#ifdef CONFIG_X86_64
@@ -201,30 +259,67 @@ At the same time remove the useless user mode pair of init_level4_pgt.
BUG();
--- a/arch/x86/mm/init_64-xen.c
+++ b/arch/x86/mm/init_64-xen.c
-@@ -739,11 +739,6 @@ void __init xen_init_pt(void)
+@@ -298,8 +298,7 @@ static p4d_t *fill_p4d(pgd_t *pgd, unsig
+ p4d_t *p4d = (p4d_t *)spp_getpage();
+ if (!after_bootmem) {
+ make_page_readonly(p4d, XENFEAT_writable_page_tables);
+- xen_l5_entry_update(pgd, false,
+- __pgd(__pa(p4d) | _PAGE_TABLE));
++ xen_l5_entry_update(pgd, __pgd(__pa(p4d) | _PAGE_TABLE));
+ } else
+ pgd_populate(&init_mm, pgd, p4d);
+ if (p4d != p4d_offset(pgd, 0))
+@@ -315,8 +314,7 @@ static pud_t *fill_pud(p4d_t *p4d, unsig
+ pud_t *pud = (pud_t *)spp_getpage();
+ if (!after_bootmem) {
+ make_page_readonly(pud, XENFEAT_writable_page_tables);
+- xen_l4_entry_update(p4d, false,
+- __p4d(__pa(pud) | _PAGE_TABLE));
++ xen_l4_entry_update(p4d, __p4d(__pa(pud) | _PAGE_TABLE));
+ } else
+ p4d_populate(&init_mm, p4d, pud);
+ if (pud != pud_offset(p4d, 0))
+@@ -894,15 +892,6 @@ void __init xen_init_pt(void)
(PTRS_PER_PUD - pud_index(__START_KERNEL_map))
* sizeof(*level3_kernel_pgt));
-#ifdef CONFIG_X86_VSYSCALL_EMULATION
-- __user_pgd(init_level4_pgt)[pgd_index(VSYSCALL_ADDR)] =
+- __user_pgd(init_top_pgt)[pgd_index(VSYSCALL_ADDR)] =
+-# ifdef CONFIG_X86_5LEVEL
+- __pgd(__pa_symbol(level4_user_pgt) | _PAGE_TABLE);
+-# else
- __pgd(__pa_symbol(level3_user_pgt) | _PAGE_TABLE);
+-# endif
-#endif
-
/* Do an early initialization of the fixmap area. */
addr = __fix_to_virt(FIX_EARLYCON_MEM_BASE);
if (pud_present(level3_kernel_pgt[pud_index(addr)])) {
-@@ -815,8 +810,6 @@ void __init xen_init_pt(void)
-
- early_make_page_readonly(init_level4_pgt,
+@@ -977,8 +966,6 @@ void __init xen_init_pt(void)
+ #else
+ early_make_page_readonly(init_top_pgt,
XENFEAT_writable_page_tables);
-- early_make_page_readonly(__user_pgd(init_level4_pgt),
+- early_make_page_readonly(__user_pgd(init_top_pgt),
- XENFEAT_writable_page_tables);
early_make_page_readonly(level3_kernel_pgt,
XENFEAT_writable_page_tables);
#ifdef CONFIG_X86_VSYSCALL_EMULATION
+@@ -1074,10 +1061,9 @@ kernel_physical_mapping_init(unsigned lo
+ if (!after_bootmem) {
+ make_page_readonly(p4d, XENFEAT_writable_page_tables);
+ if (IS_ENABLED(CONFIG_X86_5LEVEL))
+- xen_l5_entry_update(pgd, false,
+- __pgd(__pa(p4d) | _PAGE_TABLE));
++ xen_l5_entry_update(pgd, __pgd(__pa(p4d) | _PAGE_TABLE));
+ else
+- xen_l4_entry_update(p4d_offset(pgd, vaddr), false,
++ xen_l4_entry_update(p4d_offset(pgd, vaddr),
+ __p4d(__pa(p4d) | _PAGE_TABLE));
+ } else {
+ spin_lock(&init_mm.page_table_lock);
--- a/arch/x86/mm/pgtable-xen.c
+++ b/arch/x86/mm/pgtable-xen.c
-@@ -314,9 +314,11 @@ static void pgd_walk(pgd_t *pgd_base, pg
+@@ -352,9 +352,11 @@ static void pgd_walk(pgd_t *pgd_base, pg
BUG();
seq = 0;
}
@@ -238,7 +333,7 @@ At the same time remove the useless user mode pair of init_level4_pgt.
0);
MULTI_update_va_mapping(mcl + seq + 1,
(unsigned long)pgd_base,
-@@ -715,12 +717,6 @@ static void pgd_prepopulate_pmd(struct m
+@@ -773,12 +775,6 @@ static void pgd_prepopulate_pmd(struct m
}
}
@@ -251,7 +346,7 @@ At the same time remove the useless user mode pair of init_level4_pgt.
/*
* Xen paravirt assumes pgd table should be in one page. 64 bit kernel also
-@@ -788,12 +784,31 @@ static inline void _pgd_free(pgd_t *pgd)
+@@ -846,12 +842,31 @@ static inline void _pgd_free(pgd_t *pgd)
#else
static inline pgd_t *_pgd_alloc(void)
{
@@ -287,39 +382,29 @@ At the same time remove the useless user mode pair of init_level4_pgt.
--- a/arch/x86/mm/tlb-xen.c
+++ b/arch/x86/mm/tlb-xen.c
-@@ -26,6 +26,10 @@ void switch_mm_irqs_off(struct mm_struct
+@@ -28,6 +28,9 @@ void switch_mm_irqs_off(struct mm_struct
+ #else
struct mmuext_op _op[2 + (sizeof(long) > 4)], *op = _op;
-
- if (likely(prev != next)) {
+ #endif
+#ifdef CONFIG_X86_64_XEN
-+ pgd_t *upgd;
++ pgd_t *upgd;
+#endif
-+
- BUG_ON(!xen_feature(XENFEAT_writable_page_tables) &&
- !PagePinned(virt_to_page(next->pgd)));
-@@ -85,9 +89,10 @@ void switch_mm_irqs_off(struct mm_struct
- trace_tlb_flush(TLB_FLUSH_ON_TASK_SWITCH, TLB_FLUSH_ALL);
+ /*
+ * NB: The scheduler will call us with prev == next when
+@@ -109,9 +112,10 @@ void switch_mm_irqs_off(struct mm_struct
+ op++;
#ifdef CONFIG_X86_64_XEN
-- /* xen_new_user_pt(__pa(__user_pgd(next->pgd))) */
-+ /* xen_new_user_pt(next->pgd) */
- op->cmd = MMUEXT_NEW_USER_BASEPTR;
-- op->arg1.mfn = virt_to_mfn(__user_pgd(next->pgd));
-+ upgd = __user_pgd(next->pgd);
-+ op->arg1.mfn = likely(upgd) ? virt_to_mfn(upgd) : 0;
- op++;
+- /* xen_new_user_pt(__pa(__user_pgd(next->pgd))) */
++ /* xen_new_user_pt(next->pgd) */
+ op->cmd = MMUEXT_NEW_USER_BASEPTR;
+- op->arg1.mfn = virt_to_mfn(__user_pgd(next->pgd));
++ upgd = __user_pgd(next->pgd);
++ op->arg1.mfn = likely(upgd) ? virt_to_mfn(upgd) : 0;
+ op++;
#endif
-@@ -155,7 +160,7 @@ void switch_mm_irqs_off(struct mm_struct
- load_cr3(next->pgd);
- trace_tlb_flush(TLB_FLUSH_ON_TASK_SWITCH, TLB_FLUSH_ALL);
- load_mm_cr4(next);
-- xen_new_user_pt(__pa(__user_pgd(next->pgd)));
-+ xen_new_user_pt(next->pgd);
- load_mm_ldt(next);
- }
- }
--- a/drivers/xen/core/machine_reboot.c
+++ b/drivers/xen/core/machine_reboot.c
@@ -174,8 +174,7 @@ static int take_machine_down(void *_susp
diff --git a/patches.xen/xen-x86_64-pgd-pin b/patches.xen/xen-x86_64-pgd-pin
index 4a72b7b630..68273eca3e 100644
--- a/patches.xen/xen-x86_64-pgd-pin
+++ b/patches.xen/xen-x86_64-pgd-pin
@@ -4,10 +4,10 @@ Patch-mainline: Never, SUSE-Xen specific
--- a/arch/x86/include/mach-xen/asm/hypervisor.h
+++ b/arch/x86/include/mach-xen/asm/hypervisor.h
-@@ -108,8 +108,8 @@ void xen_l1_entry_update(pte_t *ptr, pte
- void xen_l2_entry_update(pmd_t *ptr, pmd_t val);
+@@ -109,8 +109,8 @@ void xen_l2_entry_update(pmd_t *ptr, pmd
void xen_l3_entry_update(pud_t *ptr, pud_t val); /* x86_64/PAE */
- void xen_l4_entry_update(pgd_t *ptr, int user, pgd_t val); /* x86_64 only */
+ void xen_l4_entry_update(p4d_t *ptr, bool user, p4d_t val); /* x86_64 only */
+ void xen_l5_entry_update(pgd_t *ptr, bool user, pgd_t val); /* 5-level paging only */
-void xen_pgd_pin(unsigned long ptr);
-void xen_pgd_unpin(unsigned long ptr);
+void xen_pgd_pin(pgd_t *);
@@ -17,17 +17,20 @@ Patch-mainline: Never, SUSE-Xen specific
#ifdef CONFIG_PM_SLEEP
--- a/arch/x86/mm/hypervisor.c
+++ b/arch/x86/mm/hypervisor.c
-@@ -618,26 +618,38 @@ EXPORT_SYMBOL_GPL(xen_invlpg_mask);
+@@ -643,28 +643,42 @@ EXPORT_SYMBOL_GPL(xen_invlpg_mask);
#endif /* CONFIG_SMP */
-void xen_pgd_pin(unsigned long ptr)
-{
- struct mmuext_op op;
- #ifdef CONFIG_X86_64
+-#if defined(CONFIG_X86_5LEVEL)
+- op.cmd = MMUEXT_PIN_L5_TABLE;
+-#elif defined(CONFIG_X86_64)
- op.cmd = MMUEXT_PIN_L4_TABLE;
-#elif defined(CONFIG_X86_PAE)
- op.cmd = MMUEXT_PIN_L3_TABLE;
++#ifdef CONFIG_X86_64
+#define NR_PGD_PIN_OPS 2
#else
- op.cmd = MMUEXT_PIN_L2_TABLE;
@@ -43,7 +46,11 @@ Patch-mainline: Never, SUSE-Xen specific
+ op[0].cmd = MMUEXT_PIN_L3_TABLE;
+ op[0].arg1.mfn = virt_to_mfn(pgd);
+#ifdef CONFIG_X86_64
++# ifdef CONFIG_X86_5LEVEL
++ op[1].cmd = op[0].cmd = MMUEXT_PIN_L5_TABLE;
++# else
+ op[1].cmd = op[0].cmd = MMUEXT_PIN_L4_TABLE;
++# endif
+ op[1].arg1.mfn = virt_to_mfn(__user_pgd(pgd));
+#endif
+ if (HYPERVISOR_mmuext_op(op, NR_PGD_PIN_OPS, NULL, DOMID_SELF) < 0)
@@ -72,22 +79,22 @@ Patch-mainline: Never, SUSE-Xen specific
void xen_set_ldt(const void *ptr, unsigned int ents)
--- a/arch/x86/mm/init_64-xen.c
+++ b/arch/x86/mm/init_64-xen.c
-@@ -828,10 +828,8 @@ void __init xen_init_pt(void)
+@@ -990,10 +990,8 @@ void __init xen_init_pt(void)
early_make_page_readonly(level1_fixmap_pgt,
XENFEAT_writable_page_tables);
- if (!xen_feature(XENFEAT_writable_page_tables)) {
-- xen_pgd_pin(__pa_symbol(init_level4_pgt));
-- xen_pgd_pin(__pa_symbol(__user_pgd(init_level4_pgt)));
+- xen_pgd_pin(__pa_symbol(init_top_pgt));
+- xen_pgd_pin(__pa_symbol(__user_pgd(init_top_pgt)));
- }
+ if (!xen_feature(XENFEAT_writable_page_tables))
-+ xen_pgd_pin(init_level4_pgt);
++ xen_pgd_pin(init_top_pgt);
+ #endif
}
- void __init xen_finish_init_mapping(void)
--- a/arch/x86/mm/pgtable-xen.c
+++ b/arch/x86/mm/pgtable-xen.c
-@@ -391,19 +391,13 @@ static void __pgd_pin(pgd_t *pgd)
+@@ -443,19 +443,13 @@ static void __pgd_pin(pgd_t *pgd)
{
pgd_walk(pgd, PAGE_KERNEL_RO);
kmap_flush_unused();
diff --git a/patches.xen/xen-x86_64-unmapped-initrd b/patches.xen/xen-x86_64-unmapped-initrd
index da58967748..125f955fbb 100644
--- a/patches.xen/xen-x86_64-unmapped-initrd
+++ b/patches.xen/xen-x86_64-unmapped-initrd
@@ -46,7 +46,7 @@ Xen to avoid the mapping and hence the restriction.
--- a/arch/x86/kernel/head64-xen.c
+++ b/arch/x86/kernel/head64-xen.c
-@@ -206,6 +206,14 @@ void __init x86_64_start_reservations(ch
+@@ -328,6 +328,14 @@ void __init x86_64_start_reservations(ch
x86_early_init_platform_quirks();
#ifdef CONFIG_XEN
@@ -63,7 +63,7 @@ Xen to avoid the mapping and hence the restriction.
else if (xen_start_info->mfn_list < __START_KERNEL_map)
--- a/arch/x86/kernel/head_64-xen.S
+++ b/arch/x86/kernel/head_64-xen.S
-@@ -161,6 +161,7 @@ EXPORT_SYMBOL(empty_zero_page)
+@@ -166,6 +166,7 @@ EXPORT_SYMBOL(empty_zero_page)
#endif
ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, .quad hypercall_page)
ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID, .quad _PAGE_PRESENT, _PAGE_PRESENT)
@@ -73,7 +73,7 @@ Xen to avoid the mapping and hence the restriction.
.ascii "|writable_descriptor_tables";
--- a/arch/x86/kernel/setup-xen.c
+++ b/arch/x86/kernel/setup-xen.c
-@@ -398,7 +398,7 @@ static u64 __init get_ramdisk_image(void
+@@ -397,7 +397,7 @@ static u64 __init get_ramdisk_image(void
return ramdisk_image;
#else
@@ -84,7 +84,7 @@ Xen to avoid the mapping and hence the restriction.
static u64 __init get_ramdisk_size(void)
--- a/arch/x86/mm/init_64-xen.c
+++ b/arch/x86/mm/init_64-xen.c
-@@ -853,9 +853,6 @@ void __init xen_finish_init_mapping(void
+@@ -1010,9 +1010,6 @@ void __init xen_finish_init_mapping(void
&& xen_start_info->mfn_list >= __START_KERNEL_map)
phys_to_machine_mapping =
__va(__pa_symbol(xen_start_info->mfn_list));
diff --git a/patches.xen/xen3-0001-x86-entry-64-Refactor-IRQ-stacks-and-make-them-NMI-s.patch b/patches.xen/xen3-0001-x86-entry-64-Refactor-IRQ-stacks-and-make-them-NMI-s.patch
new file mode 100644
index 0000000000..a4a0c9158f
--- /dev/null
+++ b/patches.xen/xen3-0001-x86-entry-64-Refactor-IRQ-stacks-and-make-them-NMI-s.patch
@@ -0,0 +1,138 @@
+From: Andy Lutomirski <luto@kernel.org>
+Date: Tue, 11 Jul 2017 10:33:38 -0500
+Subject: xen/x86/entry/64: Refactor IRQ stacks and make them NMI-safe
+Patch-mainline: Never, SUSE-Xen specific
+References: bnc#1018348
+
+This will allow IRQ stacks to nest inside NMIs or similar entries
+that can happen during IRQ stack setup or teardown.
+
+The new macros won't work correctly if they're invoked with IRQs on.
+Add a check under CONFIG_DEBUG_ENTRY to detect that.
+
+Signed-off-by: Andy Lutomirski <luto@kernel.org>
+[ Use %r10 instead of %r11 in xen_do_hypervisor_callback to make objtool
+ and ORC unwinder's lives a little easier. ]
+Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
+Cc: Borislav Petkov <bp@alien8.de>
+Cc: Brian Gerst <brgerst@gmail.com>
+Cc: Denys Vlasenko <dvlasenk@redhat.com>
+Cc: H. Peter Anvin <hpa@zytor.com>
+Cc: Jiri Slaby <jslaby@suse.cz>
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Mike Galbraith <efault@gmx.de>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: live-patching@vger.kernel.org
+Link: http://lkml.kernel.org/r/b0b2ff5fb97d2da2e1d7e1f380190c92545c8bb5.1499786555.git.jpoimboe@redhat.com
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+Automatically created from "patches.suse/0001-x86-entry-64-Refactor-IRQ-stacks-and-make-them-NMI-s.patch" by xen-port-patches.py
+
+--- a/arch/x86/entry/entry_64-xen.S
++++ b/arch/x86/entry/entry_64-xen.S
+@@ -363,6 +363,59 @@ ENTRY(ret_from_fork)
+ jmp 2b
+ END(ret_from_fork)
+
++.macro DEBUG_ENTRY_ASSERT_IRQS_OFF
++#ifdef CONFIG_DEBUG_ENTRY
++ pushfq
++ testl $X86_EFLAGS_IF, (%rsp)
++ jz .Lokay_\@
++ ud2
++.Lokay_\@:
++ addq $8, %rsp
++#endif
++.endm
++
++/*
++ * Enters the IRQ stack if we're not already using it. NMI-safe. Clobbers
++ * flags and puts old RSP into old_rsp, and leaves all other GPRs alone.
++ * Requires kernel GSBASE.
++ *
++ * The invariant is that, if irq_count != -1, then the IRQ stack is in use.
++ */
++.macro ENTER_IRQ_STACK old_rsp
++ DEBUG_ENTRY_ASSERT_IRQS_OFF
++ movq %rsp, \old_rsp
++ incl PER_CPU_VAR(irq_count)
++
++ /*
++ * Right now, if we just incremented irq_count to zero, we've
++ * claimed the IRQ stack but we haven't switched to it yet.
++ *
++ * If anything is added that can interrupt us here without using IST,
++ * it must be *extremely* careful to limit its stack usage. This
++ * could include kprobes and a hypothetical future IST-less #DB
++ * handler.
++ */
++
++ cmovzq PER_CPU_VAR(irq_stack_ptr), %rsp
++ pushq \old_rsp
++.endm
++
++/*
++ * Undoes ENTER_IRQ_STACK.
++ */
++.macro LEAVE_IRQ_STACK
++ DEBUG_ENTRY_ASSERT_IRQS_OFF
++ /* We need to be off the IRQ stack before decrementing irq_count. */
++ popq %rsp
++
++ /*
++ * As in ENTER_IRQ_STACK, irq_count == 0, we are still claiming
++ * the irq stack but we're not on it.
++ */
++
++ decl PER_CPU_VAR(irq_count)
++.endm
++
+ /*
+ * Interrupt exit.
+ */
+@@ -536,13 +589,11 @@ ENTRY(do_hypervisor_callback) # do_hyp
+ # Since we don't modify %rdi, evtchn_do_upall(struct *pt_regs) will
+ # see the correct pointer to the pt_regs
+ movq %rdi, %rsp # we don't return, adjust the stack frame
+-11: incl PER_CPU_VAR(irq_count)
+- movq %rsp, %rbp
+- cmovzq PER_CPU_VAR(irq_stack_ptr), %rsp
+- pushq %rbp # backlink for old unwinder
++11:
++ ENTER_IRQ_STACK old_rsp=%r10
+ call evtchn_do_upcall
+- popq %rsp
+- decl PER_CPU_VAR(irq_count)
++ LEAVE_IRQ_STACK
++
+ jmp error_exit
+ END(do_hypervisor_callback)
+
+@@ -626,12 +677,10 @@ idtentry simd_coprocessor_error do_simd
+ ENTRY(do_softirq_own_stack)
+ pushq %rbp
+ mov %rsp, %rbp
+- incl PER_CPU_VAR(irq_count)
+- cmove PER_CPU_VAR(irq_stack_ptr), %rsp
+- push %rbp /* frame pointer backlink */
++ ENTER_IRQ_STACK old_rsp=%r11
+ call __do_softirq
++ LEAVE_IRQ_STACK
+ leaveq
+- decl PER_CPU_VAR(irq_count)
+ ret
+ END(do_softirq_own_stack)
+
+--- a/arch/x86/kernel/process_64-xen.c
++++ b/arch/x86/kernel/process_64-xen.c
+@@ -300,6 +300,9 @@ __switch_to(struct task_struct *prev_p,
+ #endif
+ multicall_entry_t _mcl[6], *mcl = _mcl;
+
++ WARN_ON_ONCE(IS_ENABLED(CONFIG_DEBUG_ENTRY) &&
++ this_cpu_read(irq_count) != -1);
++
+ switch_fpu_prepare(prev_fpu, cpu);
+
+ /* Reload sp0. This is load_sp0(tss, next) with a multicall. */
diff --git a/patches.xen/xen3-0001-x86-unwind-Add-the-ORC-unwinder.patch b/patches.xen/xen3-0001-x86-unwind-Add-the-ORC-unwinder.patch
new file mode 100644
index 0000000000..182e35a43a
--- /dev/null
+++ b/patches.xen/xen3-0001-x86-unwind-Add-the-ORC-unwinder.patch
@@ -0,0 +1,60 @@
+From: Josh Poimboeuf <jpoimboe@redhat.com>
+Date: Mon, 24 Jul 2017 18:36:57 -0500
+Subject: xen/x86/unwind: Add the ORC unwinder
+Patch-mainline: Never, SUSE-Xen specific
+References: bnc#1018348
+
+Add the new ORC unwinder which is enabled by CONFIG_ORC_UNWINDER=y.
+It plugs into the existing x86 unwinder framework.
+
+It relies on objtool to generate the needed .orc_unwind and
+.orc_unwind_ip sections.
+
+For more details on why ORC is used instead of DWARF, see
+Documentation/x86/orc-unwinder.txt - but the short version is
+that it's a simplified, fundamentally more robust debugninfo
+data structure, which also allows up to two orders of magnitude
+faster lookups than the DWARF unwinder - which matters to
+profiling workloads like perf.
+
+Thanks to Andy Lutomirski for the performance improvement ideas:
+splitting the ORC unwind table into two parallel arrays and creating a
+fast lookup table to search a subset of the unwind table.
+
+Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
+Cc: Andy Lutomirski <luto@kernel.org>
+Cc: Borislav Petkov <bp@alien8.de>
+Cc: Brian Gerst <brgerst@gmail.com>
+Cc: Denys Vlasenko <dvlasenk@redhat.com>
+Cc: H. Peter Anvin <hpa@zytor.com>
+Cc: Jiri Slaby <jslaby@suse.cz>
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Mike Galbraith <efault@gmx.de>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: live-patching@vger.kernel.org
+Link: http://lkml.kernel.org/r/0a6cbfb40f8da99b7a45a1a8302dc6aef16ec812.1500938583.git.jpoimboe@redhat.com
+[ Extended the changelog. ]
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+Automatically created from "patches.suse/0001-x86-unwind-Add-the-ORC-unwinder.patch" by xen-port-patches.py
+
+--- a/arch/x86/kernel/setup-xen.c
++++ b/arch/x86/kernel/setup-xen.c
+@@ -112,6 +112,7 @@
+ #include <asm/alternative.h>
+ #include <asm/prom.h>
+ #include <asm/kaslr.h>
++#include <asm/unwind.h>
+
+ #ifdef CONFIG_XEN
+ #include <asm/hypervisor.h>
+@@ -1568,6 +1569,8 @@ void __init setup_arch(char **cmdline_p)
+ if (efi_enabled(EFI_BOOT))
+ efi_apply_memmap_quirks();
+ #endif
++
++ unwind_init();
+ }
+
+ #ifdef CONFIG_X86_32
diff --git a/patches.xen/xen3-0002-x86-entry-64-Initialize-the-top-of-the-IRQ-stack-bef.patch b/patches.xen/xen3-0002-x86-entry-64-Initialize-the-top-of-the-IRQ-stack-bef.patch
new file mode 100644
index 0000000000..ab4274385a
--- /dev/null
+++ b/patches.xen/xen3-0002-x86-entry-64-Initialize-the-top-of-the-IRQ-stack-bef.patch
@@ -0,0 +1,79 @@
+From: Andy Lutomirski <luto@kernel.org>
+Date: Tue, 11 Jul 2017 10:33:39 -0500
+Subject: xen/x86/entry/64: Initialize the top of the IRQ stack before switching
+ stacks
+Patch-mainline: Never, SUSE-Xen specific
+References: bnc#1018348
+
+The OOPS unwinder wants the word at the top of the IRQ stack to
+point back to the previous stack at all times when the IRQ stack
+is in use. There's currently a one-instruction window in ENTER_IRQ_STACK
+during which this isn't the case. Fix it by writing the old RSP to the
+top of the IRQ stack before jumping.
+
+This currently writes the pointer to the stack twice, which is a bit
+ugly. We could get rid of this by replacing irq_stack_ptr with
+irq_stack_ptr_minus_eight (better name welcome). OTOH, there may be
+all kinds of odd microarchitectural considerations in play that
+affect performance by a few cycles here.
+
+Reported-by: Mike Galbraith <efault@gmx.de>
+Reported-by: Josh Poimboeuf <jpoimboe@redhat.com>
+Signed-off-by: Andy Lutomirski <luto@kernel.org>
+Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
+Cc: Borislav Petkov <bp@alien8.de>
+Cc: Brian Gerst <brgerst@gmail.com>
+Cc: Denys Vlasenko <dvlasenk@redhat.com>
+Cc: H. Peter Anvin <hpa@zytor.com>
+Cc: Jiri Slaby <jslaby@suse.cz>
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: live-patching@vger.kernel.org
+Link: http://lkml.kernel.org/r/aae7e79e49914808440ad5310ace138ced2179ca.1499786555.git.jpoimboe@redhat.com
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+Automatically created from "patches.suse/0002-x86-entry-64-Initialize-the-top-of-the-IRQ-stack-bef.patch" by xen-port-patches.py
+
+--- a/arch/x86/entry/entry_64-xen.S
++++ b/arch/x86/entry/entry_64-xen.S
+@@ -385,6 +385,7 @@ END(ret_from_fork)
+ DEBUG_ENTRY_ASSERT_IRQS_OFF
+ movq %rsp, \old_rsp
+ incl PER_CPU_VAR(irq_count)
++ jnz .Lirq_stack_push_old_rsp_\@
+
+ /*
+ * Right now, if we just incremented irq_count to zero, we've
+@@ -394,9 +395,30 @@ END(ret_from_fork)
+ * it must be *extremely* careful to limit its stack usage. This
+ * could include kprobes and a hypothetical future IST-less #DB
+ * handler.
++ *
++ * The OOPS unwinder relies on the word at the top of the IRQ
++ * stack linking back to the previous RSP for the entire time we're
++ * on the IRQ stack. For this to work reliably, we need to write
++ * it before we actually move ourselves to the IRQ stack.
++ */
++
++ movq \old_rsp, PER_CPU_VAR(irq_stack_union + IRQ_STACK_SIZE - 8)
++ movq PER_CPU_VAR(irq_stack_ptr), %rsp
++
++#ifdef CONFIG_DEBUG_ENTRY
++ /*
++ * If the first movq above becomes wrong due to IRQ stack layout
++ * changes, the only way we'll notice is if we try to unwind right
++ * here. Assert that we set up the stack right to catch this type
++ * of bug quickly.
+ */
++ cmpq -8(%rsp), \old_rsp
++ je .Lirq_stack_okay\@
++ ud2
++ .Lirq_stack_okay\@:
++#endif
+
+- cmovzq PER_CPU_VAR(irq_stack_ptr), %rsp
++.Lirq_stack_push_old_rsp_\@:
+ pushq \old_rsp
+ .endm
+
diff --git a/patches.xen/xen3-0003-DWARF-EH-frame-based-stack-unwinding.patch b/patches.xen/xen3-0003-DWARF-EH-frame-based-stack-unwinding.patch
index aeacb03b32..5b8a729ff0 100644
--- a/patches.xen/xen3-0003-DWARF-EH-frame-based-stack-unwinding.patch
+++ b/patches.xen/xen3-0003-DWARF-EH-frame-based-stack-unwinding.patch
@@ -55,7 +55,7 @@ Automatically created from "patches.suse/DWARF-EH-frame-based-stack-unwinding.pa
--- a/arch/x86/entry/entry_32-xen.S
+++ b/arch/x86/entry/entry_32-xen.S
-@@ -298,6 +298,27 @@ ENTRY(ret_from_fork)
+@@ -303,6 +303,27 @@ ENTRY(ret_from_fork)
jmp 2b
END(ret_from_fork)
@@ -85,7 +85,7 @@ Automatically created from "patches.suse/DWARF-EH-frame-based-stack-unwinding.pa
* but we want the default path for a system call return to
--- a/arch/x86/entry/entry_64-xen.S
+++ b/arch/x86/entry/entry_64-xen.S
-@@ -638,6 +638,24 @@ ENTRY(do_softirq_own_stack)
+@@ -635,6 +635,24 @@ ENTRY(do_softirq_own_stack)
ret
END(do_softirq_own_stack)
diff --git a/patches.xen/xen3-0007-x86-entry-64-Add-unwind-hint-annotations.patch b/patches.xen/xen3-0007-x86-entry-64-Add-unwind-hint-annotations.patch
new file mode 100644
index 0000000000..900bf9af59
--- /dev/null
+++ b/patches.xen/xen3-0007-x86-entry-64-Add-unwind-hint-annotations.patch
@@ -0,0 +1,241 @@
+From: Josh Poimboeuf <jpoimboe@redhat.com>
+Date: Tue, 11 Jul 2017 10:33:44 -0500
+Subject: xen/x86/entry/64: Add unwind hint annotations
+Patch-mainline: Never, SUSE-Xen specific
+References: bnc#1018348
+
+Add unwind hint annotations to entry_64.S. This will enable the ORC
+unwinder to unwind through any location in the entry code including
+syscalls, interrupts, and exceptions.
+
+Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
+Cc: Andy Lutomirski <luto@kernel.org>
+Cc: Borislav Petkov <bp@alien8.de>
+Cc: Brian Gerst <brgerst@gmail.com>
+Cc: Denys Vlasenko <dvlasenk@redhat.com>
+Cc: H. Peter Anvin <hpa@zytor.com>
+Cc: Jiri Slaby <jslaby@suse.cz>
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Mike Galbraith <efault@gmx.de>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: live-patching@vger.kernel.org
+Link: http://lkml.kernel.org/r/b9f6d478aadf68ba57c739dcfac34ec0dc021c4c.1499786555.git.jpoimboe@redhat.com
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+Automatically created from "patches.suse/0007-x86-entry-64-Add-unwind-hint-annotations.patch" by xen-port-patches.py
+
+--- a/arch/x86/entry/entry_64-xen.S
++++ b/arch/x86/entry/entry_64-xen.S
+@@ -39,6 +39,7 @@
+ #include <asm/smap.h>
+ #include <asm/pgtable_types.h>
+ #include <asm/export.h>
++#include <asm/frame.h>
+ #include <linux/err.h>
+ #include <xen/interface/xen.h>
+ #include <xen/interface/features.h>
+@@ -163,6 +164,7 @@ NMI_MASK = 0x80000000
+ */
+
+ ENTRY(entry_SYSCALL_64)
++ UNWIND_HINT_EMPTY
+ /*
+ * Interrupts are enabled on entry.
+ */
+@@ -180,6 +182,7 @@ ENTRY(entry_SYSCALL_64)
+ pushq %r10 /* pt_regs->r10 */
+ pushq %r11 /* pt_regs->r11 */
+ sub $(6*8), %rsp /* pt_regs->bp, bx, r12-15 not saved */
++ UNWIND_HINT_REGS extra=0
+
+ /*
+ * If we need to do entry work or if we guess we'll need to do
+@@ -230,6 +233,7 @@ entry_SYSCALL_64_fastpath:
+ TRACE_IRQS_ON /* user mode is traced as IRQs on */
+ RESTORE_C_REGS_EXCEPT_RCX_R11
+ REMOVE_PT_GPREGS_FROM_STACK 8
++ UNWIND_HINT_EMPTY
+ xor %ecx, %ecx
+ xor %r11, %r11
+ HYPERVISOR_IRET VGCF_IN_SYSCALL
+@@ -274,6 +278,7 @@ ENTRY(stub_ptregs_64)
+ * Called from fast path -- pop return address and jump to slow path
+ */
+ popq %rax
++ UNWIND_HINT_REGS extra=0
+ jmp entry_SYSCALL64_slow_path
+
+ 1:
+@@ -282,6 +287,7 @@ END(stub_ptregs_64)
+
+ .macro ptregs_stub func
+ ENTRY(ptregs_\func)
++ UNWIND_HINT_FUNC
+ leaq \func(%rip), %rax
+ jmp stub_ptregs_64
+ END(ptregs_\func)
+@@ -298,6 +304,7 @@ END(ptregs_\func)
+ * %rsi: next task
+ */
+ ENTRY(__switch_to_asm)
++ UNWIND_HINT_FUNC
+ /*
+ * Save callee-saved registers
+ * This must match the order in inactive_task_frame
+@@ -337,6 +344,7 @@ END(__switch_to_asm)
+ * r12: kernel thread arg
+ */
+ ENTRY(ret_from_fork)
++ UNWIND_HINT_EMPTY
+ movq %rax, %rdi
+ call schedule_tail /* rdi: 'prev' task parameter */
+
+@@ -344,6 +352,7 @@ ENTRY(ret_from_fork)
+ jnz 1f /* kernel threads are uncommon */
+
+ 2:
++ UNWIND_HINT_REGS
+ movq %rsp, %rdi
+ call syscall_return_slowpath /* returns with IRQs disabled */
+ jmp restore_regs_and_iret
+@@ -381,9 +390,14 @@ END(ret_from_fork)
+ *
+ * The invariant is that, if irq_count != -1, then the IRQ stack is in use.
+ */
+-.macro ENTER_IRQ_STACK old_rsp
++.macro ENTER_IRQ_STACK regs=1 old_rsp
+ DEBUG_ENTRY_ASSERT_IRQS_OFF
+ movq %rsp, \old_rsp
++
++ .if \regs
++ UNWIND_HINT_REGS base=\old_rsp
++ .endif
++
+ incl PER_CPU_VAR(irq_count)
+ jnz .Lirq_stack_push_old_rsp_\@
+
+@@ -420,16 +434,24 @@ END(ret_from_fork)
+
+ .Lirq_stack_push_old_rsp_\@:
+ pushq \old_rsp
++
++ .if \regs
++ UNWIND_HINT_REGS indirect=1
++ .endif
+ .endm
+
+ /*
+ * Undoes ENTER_IRQ_STACK.
+ */
+-.macro LEAVE_IRQ_STACK
++.macro LEAVE_IRQ_STACK regs=1
+ DEBUG_ENTRY_ASSERT_IRQS_OFF
+ /* We need to be off the IRQ stack before decrementing irq_count. */
+ popq %rsp
+
++ .if \regs
++ UNWIND_HINT_REGS
++ .endif
++
+ /*
+ * As in ENTER_IRQ_STACK, irq_count == 0, we are still claiming
+ * the irq stack but we're not on it.
+@@ -491,6 +513,8 @@ END(retint_kernel)
+
+ .macro idtentry sym do_sym has_error_code:req paranoid=0 shift_ist=-1
+ ENTRY(\sym)
++ UNWIND_HINT_IRET_REGS offset=8
++
+ /* Sanity check */
+ .if \shift_ist != -1 && \paranoid == 0
+ .error "using shift_ist requires paranoid=1"
+@@ -516,6 +540,7 @@ ENTRY(\sym)
+ .else
+ call error_entry
+ .endif
++ UNWIND_HINT_REGS
+ /* returned flag: ebx=0: need swapgs on exit, ebx=1: don't need it */
+
+ .if \paranoid
+@@ -610,7 +635,9 @@ idtentry \sym \do_sym has_error_code=\ha
+ ENTRY(do_hypervisor_callback) # do_hypervisor_callback(struct *pt_regs)
+ # Since we don't modify %rdi, evtchn_do_upall(struct *pt_regs) will
+ # see the correct pointer to the pt_regs
++ UNWIND_HINT_FUNC
+ movq %rdi, %rsp # we don't return, adjust the stack frame
++ UNWIND_HINT_REGS
+ 11:
+ ENTER_IRQ_STACK old_rsp=%r10
+ call evtchn_do_upcall
+@@ -699,12 +726,12 @@ idtentry simd_coprocessor_error do_simd
+ ENTRY(do_softirq_own_stack)
+ pushq %rbp
+ mov %rsp, %rbp
+- ENTER_IRQ_STACK old_rsp=%r11
++ ENTER_IRQ_STACK regs=0 old_rsp=%r11
+ call __do_softirq
+- LEAVE_IRQ_STACK
++ LEAVE_IRQ_STACK regs=0
+ leaveq
+ ret
+-END(do_softirq_own_stack)
++ENDPROC(do_softirq_own_stack)
+
+ idtentry debug do_debug has_error_code=0
+ idtentry nmi do_nmi_callback has_error_code=0
+@@ -729,6 +756,7 @@ idtentry machine_check has_error_cod
+ * Return: ebx=0: need swapgs on exit, ebx=1: otherwise
+ */
+ ENTRY(paranoid_entry)
++ UNWIND_HINT_FUNC
+ cld
+ SAVE_C_REGS 8
+ SAVE_EXTRA_REGS 8
+@@ -756,6 +784,7 @@ END(paranoid_entry)
+ * On entry, ebx is "no swapgs" flag (1: don't need swapgs, 0: need it)
+ */
+ ENTRY(paranoid_exit)
++ UNWIND_HINT_REGS
+ DISABLE_INTERRUPTS(CLBR_ANY)
+ TRACE_IRQS_OFF_DEBUG
+ testl %ebx, %ebx /* swapgs needed? */
+@@ -778,6 +807,7 @@ END(paranoid_exit)
+ * Return: EBX=0: came from user mode; EBX=1: otherwise
+ */
+ ENTRY(error_entry)
++ UNWIND_HINT_FUNC
+ cld
+ SAVE_C_REGS 8
+ SAVE_EXTRA_REGS 8
+@@ -861,6 +891,7 @@ END(error_entry)
+
+
+ ENTRY(error_exit)
++ UNWIND_HINT_REGS
+ DISABLE_INTERRUPTS(CLBR_ANY)
+ TRACE_IRQS_OFF
+ testb $3, CS(%rsp)
+@@ -896,18 +927,20 @@ END(do_nmi_callback)
+ ENTRY(ignore_sysret)
+ popq %rcx
+ popq %r11
++ UNWIND_HINT_EMPTY
+ mov $-ENOSYS, %eax
+ HYPERVISOR_IRET VGCF_i387_valid
+ END(ignore_sysret)
+ #endif
+
+ ENTRY(rewind_stack_do_exit)
++ UNWIND_HINT_FUNC
+ /* Prevent any naive code from trying to unwind to our caller. */
+ xorl %ebp, %ebp
+
+ movq PER_CPU_VAR(cpu_current_top_of_stack), %rax
+- leaq -TOP_OF_KERNEL_STACK_PADDING-PTREGS_SIZE(%rax), %rsp
++ leaq -PTREGS_SIZE(%rax), %rsp
++ UNWIND_HINT_FUNC sp_offset=PTREGS_SIZE
+
+ call do_exit
+-1: jmp 1b
+ END(rewind_stack_do_exit)
diff --git a/patches.xen/xen3-0008-x86-asm-Add-unwind-hint-annotations-to-sync_core.patch b/patches.xen/xen3-0008-x86-asm-Add-unwind-hint-annotations-to-sync_core.patch
new file mode 100644
index 0000000000..eec2ed2341
--- /dev/null
+++ b/patches.xen/xen3-0008-x86-asm-Add-unwind-hint-annotations-to-sync_core.patch
@@ -0,0 +1,51 @@
+From: Josh Poimboeuf <jpoimboe@redhat.com>
+Date: Tue, 11 Jul 2017 10:33:45 -0500
+Subject: xen/x86/asm: Add unwind hint annotations to sync_core()
+Patch-mainline: Never, SUSE-Xen specific
+References: bnc#1018348
+
+This enables objtool to grok the iret in the middle of a C function.
+
+Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
+Cc: Andy Lutomirski <luto@kernel.org>
+Cc: Borislav Petkov <bp@alien8.de>
+Cc: Brian Gerst <brgerst@gmail.com>
+Cc: Denys Vlasenko <dvlasenk@redhat.com>
+Cc: H. Peter Anvin <hpa@zytor.com>
+Cc: Jiri Slaby <jslaby@suse.cz>
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Mike Galbraith <efault@gmx.de>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: live-patching@vger.kernel.org
+Link: http://lkml.kernel.org/r/b057be26193c11d2ed3337b2107bc7adcba42c99.1499786555.git.jpoimboe@redhat.com
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+Automatically created from "patches.suse/0008-x86-asm-Add-unwind-hint-annotations-to-sync_core.patch" by xen-port-patches.py
+
+--- a/arch/x86/include/mach-xen/asm/processor.h
++++ b/arch/x86/include/mach-xen/asm/processor.h
+@@ -22,6 +22,7 @@ struct vm86;
+ #include <asm/nops.h>
+ #include <asm/special_insns.h>
+ #include <asm/fpu/types.h>
++#include <asm/unwind_hints.h>
+
+ #include <linux/personality.h>
+ #include <linux/cache.h>
+@@ -687,6 +688,7 @@ static inline void sync_core(void)
+ unsigned int tmp;
+
+ asm volatile (
++ UNWIND_HINT_SAVE
+ "mov %%ss, %0\n\t"
+ "pushq %q0\n\t"
+ "pushq %%rsp\n\t"
+@@ -696,6 +698,7 @@ static inline void sync_core(void)
+ "pushq %q0\n\t"
+ "pushq $1f\n\t"
+ "iretq\n\t"
++ UNWIND_HINT_RESTORE
+ "1:"
+ : "=&r" (tmp), "+r" (__sp) : : "cc", "memory");
+ #endif
diff --git a/patches.xen/xen3-auto-arch-i386.diff b/patches.xen/xen3-auto-arch-i386.diff
index ac047a1c24..379e385805 100644
--- a/patches.xen/xen3-auto-arch-i386.diff
+++ b/patches.xen/xen3-auto-arch-i386.diff
@@ -1,4 +1,4 @@
-From http://xenbits.xen.org/linux-2.6.18-xen.hg (tip 1331:e08ba8d3bafe)
+From http://xenbits.xen.org/linux-2.6.18-xen.hg (tip 1337:615890cbff82)
Subject: xen3 arch-i386
From: xen-devel@lists.xen.org
Patch-mainline: Never, SUSE-Xen specific
@@ -30,7 +30,7 @@ Acked-by: jbeulich@suse.com
BLANK();
--- a/arch/x86/entry/entry_32.S
+++ b/arch/x86/entry/entry_32.S
-@@ -415,7 +415,7 @@ ENTRY(xen_sysenter_target)
+@@ -399,7 +399,7 @@ ENTRY(xen_sysenter_target)
* 0(%ebp) arg6
*/
ENTRY(entry_SYSENTER_32)
@@ -42,7 +42,7 @@ Acked-by: jbeulich@suse.com
--- a/arch/x86/kernel/machine_kexec_32.c
+++ b/arch/x86/kernel/machine_kexec_32.c
@@ -26,6 +26,10 @@
- #include <asm/cacheflush.h>
+ #include <asm/set_memory.h>
#include <asm/debugreg.h>
+#ifdef CONFIG_XEN
@@ -52,7 +52,7 @@ Acked-by: jbeulich@suse.com
static void machine_kexec_free_page_tables(struct kimage *image)
{
free_page((unsigned long)image->arch.pgd);
-@@ -96,6 +100,55 @@ static void machine_kexec_prepare_page_t
+@@ -98,6 +102,55 @@ static void machine_kexec_prepare_page_t
__pa(control_page), __pa(control_page));
}
@@ -108,7 +108,7 @@ Acked-by: jbeulich@suse.com
/*
* A architecture hook called to validate the
* proposed image and prepare the control pages
-@@ -133,6 +186,7 @@ void machine_kexec_cleanup(struct kimage
+@@ -135,6 +188,7 @@ void machine_kexec_cleanup(struct kimage
machine_kexec_free_page_tables(image);
}
@@ -116,7 +116,7 @@ Acked-by: jbeulich@suse.com
/*
* Do not allocate memory (or fail in any way) in machine_kexec().
* We are past the point of no return, committed to rebooting now.
-@@ -199,6 +253,7 @@ void machine_kexec(struct kimage *image)
+@@ -201,6 +255,7 @@ void machine_kexec(struct kimage *image)
__ftrace_enabled_restore(save_ftrace_enabled);
}
@@ -153,7 +153,7 @@ Acked-by: jbeulich@suse.com
memcpy(&regs->pt, &vm86->regs32, sizeof(struct pt_regs));
-@@ -232,7 +238,9 @@ SYSCALL_DEFINE2(vm86, unsigned long, cmd
+@@ -236,7 +242,9 @@ SYSCALL_DEFINE2(vm86, unsigned long, cmd
static long do_sys_vm86(struct vm86plus_struct __user *user_vm86, bool plus)
{
@@ -163,7 +163,7 @@ Acked-by: jbeulich@suse.com
struct task_struct *tsk = current;
struct vm86 *vm86 = tsk->thread.vm86;
struct kernel_vm86_regs vm86regs;
-@@ -360,7 +368,9 @@ static long do_sys_vm86(struct vm86plus_
+@@ -364,7 +372,9 @@ static long do_sys_vm86(struct vm86plus_
vm86->saved_sp0 = tsk->thread.sp0;
lazy_save_gs(vm86->regs32.gs);
@@ -173,7 +173,7 @@ Acked-by: jbeulich@suse.com
/* make room for real-mode segments */
tsk->thread.sp0 += 16;
-@@ -368,7 +378,9 @@ static long do_sys_vm86(struct vm86plus_
+@@ -372,7 +382,9 @@ static long do_sys_vm86(struct vm86plus_
tsk->thread.sysenter_cs = 0;
load_sp0(tss, &tsk->thread);
diff --git a/patches.xen/xen3-auto-arch-x86.diff b/patches.xen/xen3-auto-arch-x86.diff
index 730446d0a9..1f267a4dcb 100644
--- a/patches.xen/xen3-auto-arch-x86.diff
+++ b/patches.xen/xen3-auto-arch-x86.diff
@@ -1,4 +1,4 @@
-From http://xenbits.xen.org/linux-2.6.18-xen.hg (tip 1331:e08ba8d3bafe)
+From http://xenbits.xen.org/linux-2.6.18-xen.hg (tip 1337:615890cbff82)
Subject: xen3 arch-x86
From: xen-devel@lists.xen.org
Patch-mainline: Never, SUSE-Xen specific
@@ -17,7 +17,7 @@ take the forward porting patches:
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
-@@ -216,6 +216,10 @@ ifneq ($(CONFIG_UNWIND_INFO),y)
+@@ -234,6 +234,10 @@ ifneq ($(CONFIG_UNWIND_INFO),y)
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
endif
@@ -28,7 +28,7 @@ take the forward porting patches:
KBUILD_CFLAGS += $(mflags-y)
KBUILD_AFLAGS += $(mflags-y)
-@@ -267,9 +271,26 @@ boot := arch/x86/boot
+@@ -283,9 +287,26 @@ boot := arch/x86/boot
BOOT_TARGETS = bzlilo bzdisk fdimage fdimage144 fdimage288 isoimage
@@ -56,7 +56,7 @@ take the forward porting patches:
all: bzImage
# KBUILD_IMAGE specify target image being built
-@@ -285,6 +306,7 @@ endif
+@@ -301,6 +322,7 @@ endif
$(BOOT_TARGETS): vmlinux
$(Q)$(MAKE) $(build)=$(boot) $@
@@ -74,7 +74,7 @@ take the forward porting patches:
targets += fdimage fdimage144 fdimage288 image.iso mtools.conf
subdir- := compressed
-@@ -187,6 +188,14 @@ bzlilo: $(obj)/bzImage
+@@ -188,6 +189,14 @@ bzlilo: $(obj)/bzImage
cp System.map $(INSTALL_PATH)/
if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
@@ -91,9 +91,9 @@ take the forward porting patches:
System.map "$(INSTALL_PATH)"
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
-@@ -136,9 +136,12 @@ KASAN_SANITIZE_unwind_guess.o := n
- endif
- endif
+@@ -130,9 +130,12 @@ obj-$(CONFIG_ORC_UNWINDER) += unwind_or
+ obj-$(CONFIG_FRAME_POINTER_UNWINDER) += unwind_frame.o
+ obj-$(CONFIG_GUESS_UNWINDER) += unwind_guess.o
+obj-$(CONFIG_X86_XEN) += fixup.o
+
@@ -104,7 +104,7 @@ take the forward porting patches:
obj-$(CONFIG_AUDIT) += audit_64.o
obj-$(CONFIG_GART_IOMMU) += amd_gart_64.o aperture_64.o
-@@ -146,4 +149,10 @@ ifeq ($(CONFIG_X86_64),y)
+@@ -140,4 +143,10 @@ ifeq ($(CONFIG_X86_64),y)
obj-$(CONFIG_PCI_MMCONFIG) += mmconf-fam10h_64.o
obj-y += vsmp_64.o
@@ -117,7 +117,7 @@ take the forward porting patches:
+%/head_$(BITS).o %/head_$(BITS).s: $(if $(CONFIG_XEN),EXTRA_AFLAGS,dummy) :=
--- a/arch/x86/kernel/acpi/Makefile
+++ b/arch/x86/kernel/acpi/Makefile
-@@ -5,5 +5,9 @@ obj-$(CONFIG_ACPI_CPPC_LIB) += cppc_msr.
+@@ -7,5 +7,9 @@ obj-$(CONFIG_ACPI_CPPC_LIB) += cppc_msr.
ifneq ($(CONFIG_ACPI_PROCESSOR),)
obj-y += cstate.o
@@ -139,7 +139,7 @@ take the forward porting patches:
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
-@@ -1312,8 +1312,15 @@ int memory_failure(unsigned long pfn, in
+@@ -1298,8 +1298,15 @@ int memory_failure(unsigned long pfn, in
* Periodic polling timer for "silent" machine check errors. If the
* poller finds an MCE, poll 2x faster. When the poller finds no more
* errors, poll 2x slower (up to check_interval seconds).
@@ -155,7 +155,7 @@ take the forward porting patches:
static DEFINE_PER_CPU(unsigned long, mce_next_interval); /* in jiffies */
static DEFINE_PER_CPU(struct timer_list, mce_timer);
-@@ -1562,6 +1569,7 @@ static int __mcheck_cpu_apply_quirks(str
+@@ -1537,6 +1544,7 @@ static int __mcheck_cpu_apply_quirks(str
/* This should be disabled by the BIOS, but isn't always */
if (c->x86_vendor == X86_VENDOR_AMD) {
@@ -163,15 +163,15 @@ take the forward porting patches:
if (c->x86 == 15 && cfg->banks > 4) {
/*
* disable GART TBL walk error reporting, which
-@@ -1570,6 +1578,7 @@ static int __mcheck_cpu_apply_quirks(str
+@@ -1545,6 +1553,7 @@ static int __mcheck_cpu_apply_quirks(str
*/
clear_bit(10, (unsigned long *)&mce_banks[4].ctl);
}
+#endif
- if (c->x86 < 17 && cfg->bootlog < 0) {
+ if (c->x86 < 0x11 && cfg->bootlog < 0) {
/*
* Lots of broken BIOS around that don't clear them
-@@ -1685,6 +1694,7 @@ static int __mcheck_cpu_ancient_init(str
+@@ -1679,6 +1688,7 @@ static void __mcheck_cpu_init_early(stru
static void __mcheck_cpu_init_vendor(struct cpuinfo_x86 *c)
{
@@ -179,7 +179,7 @@ take the forward porting patches:
switch (c->x86_vendor) {
case X86_VENDOR_INTEL:
mce_intel_feature_init(c);
-@@ -1713,6 +1723,7 @@ static void __mcheck_cpu_init_vendor(str
+@@ -1693,6 +1703,7 @@ static void __mcheck_cpu_init_vendor(str
default:
break;
}
@@ -187,9 +187,9 @@ take the forward porting patches:
}
static void __mcheck_cpu_clear_vendor(struct cpuinfo_x86 *c)
-@@ -2593,6 +2604,16 @@ static __init int mcheck_init_device(voi
- if (err)
- goto err_register;
+@@ -2399,6 +2410,16 @@ static int __init mcheck_late_init(void)
+ */
+ mce_schedule_work();
+#ifdef CONFIG_X86_XEN_MCE
+ if (is_initial_xendomain()) {
@@ -202,8 +202,8 @@ take the forward porting patches:
+#endif
+
return 0;
-
- err_register:
+ }
+ late_initcall(mcheck_late_init);
--- a/arch/x86/kernel/cpu/mtrr/Makefile
+++ b/arch/x86/kernel/cpu/mtrr/Makefile
@@ -1,3 +1,4 @@
@@ -272,7 +272,7 @@ take the forward porting patches:
extern int acpi_lapic;
extern int acpi_ioapic;
extern int acpi_noirq;
-@@ -78,6 +83,26 @@ extern int (*acpi_suspend_lowlevel)(void
+@@ -80,6 +85,26 @@ extern int (*acpi_suspend_lowlevel)(void
/* Physical address to resume after wakeup */
#define acpi_wakeup_address ((unsigned long)(real_mode_header->wakeup_start))
@@ -299,7 +299,7 @@ take the forward porting patches:
/*
* Check if the CPU can handle C2 and deeper
*/
-@@ -142,7 +167,9 @@ static inline void disable_acpi(void) {
+@@ -144,7 +169,9 @@ static inline void disable_acpi(void) {
#endif /* !CONFIG_ACPI */
@@ -323,7 +323,7 @@ take the forward porting patches:
* Debugging macros
--- a/arch/x86/include/asm/kexec.h
+++ b/arch/x86/include/asm/kexec.h
-@@ -212,6 +212,19 @@ typedef void crash_vmclear_fn(void);
+@@ -213,6 +213,19 @@ typedef void crash_vmclear_fn(void);
extern crash_vmclear_fn __rcu *crash_vmclear_loaded_vmcss;
extern void kdump_nmi_shootdown_cpus(void);
diff --git a/patches.xen/xen3-auto-arch-x86_64.diff b/patches.xen/xen3-auto-arch-x86_64.diff
index 480de53691..99e6216be5 100644
--- a/patches.xen/xen3-auto-arch-x86_64.diff
+++ b/patches.xen/xen3-auto-arch-x86_64.diff
@@ -1,4 +1,4 @@
-From http://xenbits.xen.org/linux-2.6.18-xen.hg (tip 1331:e08ba8d3bafe)
+From http://xenbits.xen.org/linux-2.6.18-xen.hg (tip 1337:615890cbff82)
Subject: xen3 arch-x86_64
From: xen-devel@lists.xen.org
Patch-mainline: Never, SUSE-Xen specific
@@ -21,7 +21,7 @@ Acked-by: jbeulich@suse.com
DEFINE(stack_canary_offset, offsetof(union irq_stack_union, stack_canary));
--- a/arch/x86/kernel/machine_kexec_64.c
+++ b/arch/x86/kernel/machine_kexec_64.c
-@@ -34,6 +34,62 @@ static struct kexec_file_ops *kexec_file
+@@ -35,6 +35,62 @@ static struct kexec_file_ops *kexec_file
};
#endif
@@ -83,8 +83,8 @@ Acked-by: jbeulich@suse.com
+
static void free_transition_pgtable(struct kimage *image)
{
- free_page((unsigned long)image->arch.pud);
-@@ -210,6 +266,7 @@ void machine_kexec_cleanup(struct kimage
+ free_page((unsigned long)image->arch.p4d);
+@@ -225,6 +281,7 @@ void machine_kexec_cleanup(struct kimage
free_transition_pgtable(image);
}
@@ -92,7 +92,7 @@ Acked-by: jbeulich@suse.com
/*
* Do not allocate memory (or fail in any way) in machine_kexec().
* We are past the point of no return, committed to rebooting now.
-@@ -269,6 +326,7 @@ void machine_kexec(struct kimage *image)
+@@ -284,6 +341,7 @@ void machine_kexec(struct kimage *image)
__ftrace_enabled_restore(save_ftrace_enabled);
}
diff --git a/patches.xen/xen3-auto-common.diff b/patches.xen/xen3-auto-common.diff
index 0fdc47ff57..7ed6c72b50 100644
--- a/patches.xen/xen3-auto-common.diff
+++ b/patches.xen/xen3-auto-common.diff
@@ -1,4 +1,4 @@
-From http://xenbits.xen.org/linux-2.6.18-xen.hg (tip 1331:e08ba8d3bafe)
+From http://xenbits.xen.org/linux-2.6.18-xen.hg (tip 1337:615890cbff82)
Subject: xen3 common
From: xen-devel@lists.xen.org
Patch-mainline: Never, SUSE-Xen specific
@@ -26,7 +26,7 @@ take the forward porting patches:
--- a/drivers/Makefile
+++ b/drivers/Makefile
-@@ -75,6 +75,7 @@ obj-$(CONFIG_DEV_DAX) += dax/
+@@ -77,6 +77,7 @@ obj-$(CONFIG_DAX) += dax/
obj-$(CONFIG_DMA_SHARED_BUFFER) += dma-buf/
obj-$(CONFIG_NUBUS) += nubus/
obj-y += macintosh/
@@ -36,7 +36,7 @@ take the forward porting patches:
obj-y += nvme/
--- a/drivers/acpi/Makefile
+++ b/drivers/acpi/Makefile
-@@ -90,6 +90,9 @@ processor-$(CONFIG_ACPI_PROCESSOR_IDLE)
+@@ -91,6 +91,9 @@ processor-$(CONFIG_ACPI_PROCESSOR_IDLE)
processor-$(CONFIG_ACPI_CPU_FREQ_PSS) += processor_throttling.o \
processor_thermal.o
processor-$(CONFIG_CPU_FREQ) += processor_perflib.o
@@ -72,7 +72,7 @@ take the forward porting patches:
static int acpi_processor_add(struct acpi_device *device,
const struct acpi_device_id *id)
-@@ -384,8 +391,11 @@ static int acpi_processor_add(struct acp
+@@ -384,30 +391,59 @@ static int acpi_processor_add(struct acp
strcpy(acpi_device_class(device), ACPI_PROCESSOR_CLASS);
device->driver_data = pr;
@@ -84,11 +84,6 @@ take the forward porting patches:
+ ((pr->id == -1) && !processor_cntl_external()))
return 0;
- #ifdef CONFIG_SMP
-@@ -393,26 +403,52 @@ static int acpi_processor_add(struct acp
- return 0;
- #endif
-
- BUG_ON(pr->id >= nr_cpu_ids);
+ BUG_ON(!processor_cntl_external() && pr->id >= nr_cpu_ids);
@@ -139,7 +134,7 @@ take the forward porting patches:
per_cpu(processors, pr->id) = pr;
dev = get_cpu_device(pr->id);
-@@ -435,8 +471,19 @@ static int acpi_processor_add(struct acp
+@@ -430,8 +466,19 @@ static int acpi_processor_add(struct acp
acpi_unbind_one(dev);
err:
@@ -159,7 +154,7 @@ take the forward porting patches:
per_cpu(processors, pr->id) = NULL;
err_free_pr:
kfree(pr);
-@@ -456,7 +503,7 @@ static void acpi_processor_remove(struct
+@@ -451,7 +498,7 @@ static void acpi_processor_remove(struct
return;
pr = acpi_driver_data(device);
@@ -168,7 +163,7 @@ take the forward porting patches:
goto out;
/*
-@@ -470,9 +517,22 @@ static void acpi_processor_remove(struct
+@@ -465,9 +512,22 @@ static void acpi_processor_remove(struct
device_release_driver(pr->dev);
acpi_unbind_one(pr->dev);
@@ -617,7 +612,7 @@ take the forward porting patches:
--- a/drivers/char/agp/intel-gtt.c
+++ b/drivers/char/agp/intel-gtt.c
-@@ -148,8 +148,19 @@ static struct page *i8xx_alloc_pages(voi
+@@ -149,8 +149,19 @@ static struct page *i8xx_alloc_pages(voi
if (page == NULL)
return NULL;
@@ -637,7 +632,7 @@ take the forward porting patches:
__free_pages(page, 2);
return NULL;
}
-@@ -163,6 +174,9 @@ static void i8xx_destroy_pages(struct pa
+@@ -164,6 +175,9 @@ static void i8xx_destroy_pages(struct pa
return;
set_pages_wb(page, 4);
@@ -665,7 +660,7 @@ take the forward porting patches:
int __weak phys_mem_access_prot_allowed(struct file *file,
unsigned long pfn, unsigned long size, pgprot_t *vma_prot)
-@@ -374,6 +376,9 @@ static int mmap_mem(struct file *file, s
+@@ -379,6 +381,9 @@ static int mmap_mem(struct file *file, s
static int mmap_kmem(struct file *file, struct vm_area_struct *vma)
{
unsigned long pfn;
@@ -675,7 +670,7 @@ take the forward porting patches:
/* Turn a kernel-virtual address into a physical page frame */
pfn = __pa((u64)vma->vm_pgoff << PAGE_SHIFT) >> PAGE_SHIFT;
-@@ -388,6 +393,13 @@ static int mmap_kmem(struct file *file,
+@@ -393,6 +398,13 @@ static int mmap_kmem(struct file *file,
if (!pfn_valid(pfn))
return -EIO;
@@ -689,7 +684,7 @@ take the forward porting patches:
vma->vm_pgoff = pfn;
return mmap_mem(file, vma);
}
-@@ -767,6 +779,7 @@ static int open_port(struct inode *inode
+@@ -772,6 +784,7 @@ static int open_port(struct inode *inode
#define open_mem open_port
#define open_kmem open_mem
@@ -697,7 +692,7 @@ take the forward porting patches:
static const struct file_operations __maybe_unused mem_fops = {
.llseek = memory_lseek,
.read = read_mem,
-@@ -778,6 +791,9 @@ static const struct file_operations __ma
+@@ -783,6 +796,9 @@ static const struct file_operations __ma
.mmap_capabilities = memory_mmap_capabilities,
#endif
};
@@ -709,7 +704,7 @@ take the forward porting patches:
.llseek = memory_lseek,
--- a/drivers/char/tpm/Makefile
+++ b/drivers/char/tpm/Makefile
-@@ -18,5 +18,7 @@ obj-$(CONFIG_TCG_INFINEON) += tpm_infine
+@@ -19,5 +19,7 @@ obj-$(CONFIG_TCG_INFINEON) += tpm_infine
obj-$(CONFIG_TCG_IBMVTPM) += tpm_ibmvtpm.o
obj-$(CONFIG_TCG_TIS_ST33ZP24) += st33zp24/
obj-$(CONFIG_TCG_XEN) += xen-tpmfront.o
@@ -719,18 +714,18 @@ take the forward porting patches:
obj-$(CONFIG_TCG_VTPM_PROXY) += tpm_vtpm_proxy.o
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
-@@ -199,6 +199,9 @@ struct tpm_chip {
+@@ -229,6 +229,9 @@ struct tpm_chip {
acpi_handle acpi_dev_handle;
char ppi_version[TPM_PPI_VERSION_LEN + 1];
#endif /* CONFIG_ACPI */
+#ifdef CONFIG_XEN
+ void *priv;
+#endif
- };
- #define to_tpm_chip(d) container_of(d, struct tpm_chip, dev)
-@@ -493,6 +496,18 @@ enum tpm_transmit_flags {
- TPM_TRANSMIT_UNLOCKED = BIT(0),
+ struct tpm_space work_space;
+ u32 nr_commands;
+@@ -509,6 +512,18 @@ enum tpm_transmit_flags {
+ TPM_TRANSMIT_RAW = BIT(1),
};
+#ifdef CONFIG_XEN
@@ -745,9 +740,9 @@ take the forward porting patches:
+}
+#endif
+
- ssize_t tpm_transmit(struct tpm_chip *chip, const u8 *buf, size_t bufsiz,
- unsigned int flags);
- ssize_t tpm_transmit_cmd(struct tpm_chip *chip, const void *buf, size_t bufsiz,
+ ssize_t tpm_transmit(struct tpm_chip *chip, struct tpm_space *space,
+ u8 *buf, size_t bufsiz, unsigned int flags);
+ ssize_t tpm_transmit_cmd(struct tpm_chip *chip, struct tpm_space *space,
--- /dev/null
+++ b/drivers/char/tpm/tpm_vtpm.c
@@ -0,0 +1,542 @@
@@ -2085,7 +2080,7 @@ take the forward porting patches:
static ssize_t tty_read(struct file *, char __user *, size_t, loff_t *);
static ssize_t tty_write(struct file *, const char __user *, size_t, loff_t *);
ssize_t redirected_tty_write(struct file *, const char __user *,
-@@ -1992,6 +1996,10 @@ static struct tty_driver *tty_lookup_dri
+@@ -1759,6 +1763,10 @@ static struct tty_driver *tty_lookup_dri
#ifdef CONFIG_VT
case MKDEV(TTY_MAJOR, 0): {
extern struct tty_driver *console_driver;
@@ -2096,7 +2091,7 @@ take the forward porting patches:
driver = tty_driver_kref_get(console_driver);
*index = fg_console;
break;
-@@ -3703,7 +3711,8 @@ int __init tty_init(void)
+@@ -3217,7 +3225,8 @@ int __init tty_init(void)
consdev = NULL;
#ifdef CONFIG_VT
@@ -2108,7 +2103,7 @@ take the forward porting patches:
}
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
-@@ -791,6 +791,10 @@ static void edac_mc_scrub_block(unsigned
+@@ -837,6 +837,10 @@ static void edac_mc_scrub_block(unsigned
edac_dbg(3, "\n");
@@ -3042,7 +3037,7 @@ take the forward porting patches:
#define convert_in_user(srcptr, dstptr) \
({ \
typeof(*srcptr) val; \
-@@ -1437,6 +1444,19 @@ IGNORE_IOCTL(FBIOGETCMAP32)
+@@ -1430,6 +1437,19 @@ IGNORE_IOCTL(FBIOGETCMAP32)
IGNORE_IOCTL(FBIOSCURSOR32)
IGNORE_IOCTL(FBIOGCURSOR32)
#endif
@@ -3284,7 +3279,7 @@ take the forward porting patches:
#endif /* _LINUX_HIGHMEM_H */
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
-@@ -402,6 +402,12 @@ static inline int disable_irq_wake(unsig
+@@ -411,6 +411,12 @@ static inline int disable_irq_wake(unsig
return irq_set_irq_wake(irq, 0);
}
@@ -3299,7 +3294,7 @@ take the forward porting patches:
*/
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
-@@ -236,6 +236,12 @@ struct kimage {
+@@ -222,6 +222,12 @@ struct kimage {
extern void machine_kexec(struct kimage *image);
extern int machine_kexec_prepare(struct kimage *image);
extern void machine_kexec_cleanup(struct kimage *image);
@@ -3427,7 +3422,7 @@ take the forward porting patches:
__NR_PAGEFLAGS,
/* Filesystems */
-@@ -468,6 +473,27 @@ static __always_inline void SetPageUptod
+@@ -471,6 +476,27 @@ static __always_inline void SetPageUptod
CLEARPAGEFLAG(Uptodate, uptodate, PF_NO_TAIL)
@@ -3455,7 +3450,7 @@ take the forward porting patches:
int test_clear_page_writeback(struct page *page);
int __test_set_page_writeback(struct page *page, bool keep_write);
-@@ -713,6 +739,14 @@ static inline void ClearPageSlabPfmemall
+@@ -716,6 +742,14 @@ static inline void ClearPageSlabPfmemall
#define __PG_MLOCKED 0
#endif
@@ -3470,7 +3465,7 @@ take the forward porting patches:
/*
* Flags checked when a page is freed. Pages being freed should not have
* these flags set. It they are, there is a problem.
-@@ -722,7 +756,7 @@ static inline void ClearPageSlabPfmemall
+@@ -725,7 +759,7 @@ static inline void ClearPageSlabPfmemall
1UL << PG_private | 1UL << PG_private_2 | \
1UL << PG_writeback | 1UL << PG_reserved | \
1UL << PG_slab | 1UL << PG_active | \
@@ -3481,7 +3476,7 @@ take the forward porting patches:
* Flags checked when a page is prepped for return by the page allocator.
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
-@@ -1325,6 +1325,10 @@ int pci_irq_vector(struct pci_dev *dev,
+@@ -1342,6 +1342,10 @@ int pci_irq_vector(struct pci_dev *dev,
const struct cpumask *pci_irq_get_affinity(struct pci_dev *pdev, int vec);
int pci_irq_get_node(struct pci_dev *pdev, int vec);
@@ -3491,7 +3486,7 @@ take the forward porting patches:
+#endif
#else
static inline int pci_msi_vec_count(struct pci_dev *dev) { return -ENOSYS; }
- static inline void pci_msi_shutdown(struct pci_dev *dev) { }
+ static inline void pci_disable_msi(struct pci_dev *dev) { }
--- a/include/linux/vermagic.h
+++ b/include/linux/vermagic.h
@@ -21,6 +21,11 @@
@@ -3506,12 +3501,13 @@ take the forward porting patches:
#ifndef MODULE_ARCH_VERMAGIC
#define MODULE_ARCH_VERMAGIC ""
#endif
-@@ -29,5 +34,5 @@
+@@ -35,6 +40,7 @@
UTS_RELEASE " " \
MODULE_VERMAGIC_SMP MODULE_VERMAGIC_PREEMPT \
MODULE_VERMAGIC_MODULE_UNLOAD MODULE_VERMAGIC_MODVERSIONS \
-- MODULE_ARCH_VERMAGIC
-+ MODULE_VERMAGIC_XEN MODULE_ARCH_VERMAGIC
++ MODULE_VERMAGIC_XEN \
+ MODULE_ARCH_VERMAGIC \
+ MODULE_RANDSTRUCT_PLUGIN
--- a/kernel/irq/spurious.c
+++ b/kernel/irq/spurious.c
@@ -3526,7 +3522,7 @@ take the forward porting patches:
}
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
-@@ -152,6 +152,13 @@ static int do_kexec_load(unsigned long e
+@@ -160,6 +160,13 @@ static int do_kexec_load(unsigned long e
kimage_terminate(image);
@@ -3542,7 +3538,7 @@ take the forward porting patches:
--- a/kernel/kexec_core.c
+++ b/kernel/kexec_core.c
-@@ -302,14 +302,26 @@ int kimage_is_destination_range(struct k
+@@ -297,14 +297,26 @@ int kimage_is_destination_range(struct k
return 0;
}
@@ -3570,7 +3566,7 @@ take the forward porting patches:
pages->mapping = NULL;
set_page_private(pages, order);
count = 1 << order;
-@@ -370,7 +382,8 @@ static struct page *kimage_alloc_normal_
+@@ -365,7 +377,8 @@ static struct page *kimage_alloc_normal_
do {
unsigned long pfn, epfn, addr, eaddr;
@@ -3580,7 +3576,7 @@ take the forward porting patches:
if (!pages)
break;
pfn = page_to_boot_pfn(pages);
-@@ -407,6 +420,7 @@ static struct page *kimage_alloc_normal_
+@@ -402,6 +415,7 @@ static struct page *kimage_alloc_normal_
return pages;
}
@@ -3588,7 +3584,7 @@ take the forward porting patches:
static struct page *kimage_alloc_crash_control_pages(struct kimage *image,
unsigned int order)
{
-@@ -486,6 +500,13 @@ struct page *kimage_alloc_control_pages(
+@@ -481,6 +495,13 @@ struct page *kimage_alloc_control_pages(
return pages;
}
@@ -3600,9 +3596,9 @@ take the forward porting patches:
+}
+#endif
- static int kimage_add_entry(struct kimage *image, kimage_entry_t entry)
+ int kimage_crash_copy_vmcoreinfo(struct kimage *image)
{
-@@ -574,6 +595,10 @@ void kimage_free(struct kimage *image)
+@@ -603,6 +624,10 @@ void kimage_free(struct kimage *image)
if (!image)
return;
@@ -3610,10 +3606,10 @@ take the forward porting patches:
+ xen_machine_kexec_unload(image);
+#endif
+
- kimage_free_extra_pages(image);
- for_each_kimage_entry(image, ptr, entry) {
- if (entry & IND_INDIRECTION) {
-@@ -667,7 +692,7 @@ static struct page *kimage_alloc_page(st
+ if (image->vmcoreinfo_data_copy) {
+ crash_update_vmcoreinfo_safecopy(NULL);
+ vunmap(image->vmcoreinfo_data_copy);
+@@ -701,7 +726,7 @@ static struct page *kimage_alloc_page(st
kimage_entry_t *old;
/* Allocate a page, if we run out of memory give up */
@@ -3622,7 +3618,7 @@ take the forward porting patches:
if (!page)
return NULL;
/* If the page cannot be used file it away */
-@@ -790,6 +815,7 @@ out:
+@@ -824,6 +849,7 @@ out:
return result;
}
@@ -3630,7 +3626,7 @@ take the forward porting patches:
static int kimage_load_crash_segment(struct kimage *image,
struct kexec_segment *segment)
{
-@@ -870,6 +896,13 @@ int kimage_load_segment(struct kimage *i
+@@ -904,6 +930,13 @@ int kimage_load_segment(struct kimage *i
return result;
}
@@ -3646,7 +3642,7 @@ take the forward porting patches:
struct kimage *kexec_crash_image;
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
-@@ -1025,7 +1025,7 @@ static struct ctl_table kern_table[] = {
+@@ -1051,7 +1051,7 @@ static struct ctl_table kern_table[] = {
.proc_handler = proc_dointvec,
},
#endif
@@ -3657,7 +3653,7 @@ take the forward porting patches:
.data = &acpi_realmode_flags,
--- a/mm/gup.c
+++ b/mm/gup.c
-@@ -584,7 +584,32 @@ static long __get_user_pages(struct task
+@@ -651,7 +651,32 @@ static long __get_user_pages(struct task
goto next_page;
}
@@ -3693,7 +3689,7 @@ take the forward porting patches:
i = follow_hugetlb_page(mm, vma, pages, vmas,
--- a/mm/memory.c
+++ b/mm/memory.c
-@@ -793,6 +793,12 @@ struct page *vm_normal_page(struct vm_ar
+@@ -822,6 +822,12 @@ struct page *vm_normal_page(struct vm_ar
{
unsigned long pfn = pte_pfn(pte);
@@ -3706,7 +3702,7 @@ take the forward porting patches:
if (HAVE_PTE_SPECIAL) {
if (likely(!pte_special(pte)))
goto check_pfn;
-@@ -826,6 +832,9 @@ struct page *vm_normal_page(struct vm_ar
+@@ -855,6 +861,9 @@ struct page *vm_normal_page(struct vm_ar
return NULL;
check_pfn:
if (unlikely(pfn > highest_memmap_pfn)) {
@@ -3716,7 +3712,7 @@ take the forward porting patches:
print_bad_pte(vma, addr, pte, NULL);
return NULL;
}
-@@ -1217,8 +1226,14 @@ again:
+@@ -1247,8 +1256,14 @@ again:
details->check_mapping != page_rmapping(page))
continue;
}
@@ -3733,7 +3729,7 @@ take the forward porting patches:
tlb_remove_tlb_entry(tlb, pte, addr);
if (unlikely(!page))
continue;
-@@ -1488,6 +1503,7 @@ void zap_page_range(struct vm_area_struc
+@@ -1518,6 +1533,7 @@ void zap_page_range(struct vm_area_struc
mmu_notifier_invalidate_range_end(mm, start, end);
tlb_finish_mmu(&tlb, start, end);
}
@@ -3743,7 +3739,7 @@ take the forward porting patches:
* zap_page_range_single - remove user pages in a given range
--- a/mm/mmap.c
+++ b/mm/mmap.c
-@@ -2467,6 +2467,14 @@ static void unmap_region(struct mm_struc
+@@ -2498,6 +2498,14 @@ static void unmap_region(struct mm_struc
tlb_finish_mmu(&tlb, start, end);
}
@@ -3758,7 +3754,7 @@ take the forward porting patches:
/*
* Create a list of vma's touched by the unmap, removing them from the mm's
* vma list as we go..
-@@ -2482,6 +2490,7 @@ detach_vmas_to_be_unmapped(struct mm_str
+@@ -2513,6 +2521,7 @@ detach_vmas_to_be_unmapped(struct mm_str
vma->vm_prev = NULL;
do {
vma_rb_erase(vma, &mm->mm_rb);
@@ -3766,7 +3762,7 @@ take the forward porting patches:
mm->map_count--;
tail_vma = vma;
vma = vma->vm_next;
-@@ -2951,6 +2960,11 @@ void exit_mmap(struct mm_struct *mm)
+@@ -2982,6 +2991,11 @@ void exit_mmap(struct mm_struct *mm)
arch_exit_mmap(mm);
@@ -3780,7 +3776,7 @@ take the forward porting patches:
return;
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
-@@ -998,6 +998,13 @@ static __always_inline bool free_pages_p
+@@ -1009,6 +1009,13 @@ static __always_inline bool free_pages_p
{
int bad = 0;
diff --git a/patches.xen/xen3-auto-include-xen-interface.diff b/patches.xen/xen3-auto-include-xen-interface.diff
index d942eaaa7e..b04557735c 100644
--- a/patches.xen/xen3-auto-include-xen-interface.diff
+++ b/patches.xen/xen3-auto-include-xen-interface.diff
@@ -1,4 +1,4 @@
-From http://xenbits.xen.org/linux-2.6.18-xen.hg (tip 1331:e08ba8d3bafe)
+From http://xenbits.xen.org/linux-2.6.18-xen.hg (tip 1337:615890cbff82)
Subject: xen3 include-xen-interface
From: xen-devel@lists.xen.org
Patch-mainline: Never, SUSE-Xen specific
@@ -48,7 +48,7 @@ Acked-by: jbeulich@suse.com
+DEALINGS IN THE SOFTWARE.
--- /dev/null
+++ b/include/xen/interface/arch-x86/cpufeatureset.h
-@@ -0,0 +1,255 @@
+@@ -0,0 +1,262 @@
+/*
+ * arch-x86/cpufeatureset.h
+ *
@@ -165,6 +165,7 @@ Acked-by: jbeulich@suse.com
+XEN_CPUFEATURE(FXSR, 0*32+24) /*A FXSAVE and FXRSTOR instructions */
+XEN_CPUFEATURE(SSE, 0*32+25) /*A Streaming SIMD Extensions */
+XEN_CPUFEATURE(SSE2, 0*32+26) /*A Streaming SIMD Extensions-2 */
++XEN_CPUFEATURE(SS, 0*32+27) /*A CPU self snoop */
+XEN_CPUFEATURE(HTT, 0*32+28) /*!A Hyper-Threading Technology */
+XEN_CPUFEATURE(TM1, 0*32+29) /* Thermal Monitor 1 */
+XEN_CPUFEATURE(PBE, 0*32+31) /* Pending Break Enable */
@@ -222,7 +223,7 @@ Acked-by: jbeulich@suse.com
+XEN_CPUFEATURE(MISALIGNSSE, 3*32+ 7) /*A Misaligned SSE mode */
+XEN_CPUFEATURE(3DNOWPREFETCH, 3*32+ 8) /*A 3DNow prefetch instructions */
+XEN_CPUFEATURE(OSVW, 3*32+ 9) /* OS Visible Workaround */
-+XEN_CPUFEATURE(IBS, 3*32+10) /*S Instruction Based Sampling */
++XEN_CPUFEATURE(IBS, 3*32+10) /* Instruction Based Sampling */
+XEN_CPUFEATURE(XOP, 3*32+11) /*A extended AVX instructions */
+XEN_CPUFEATURE(SKINIT, 3*32+12) /* SKINIT/STGI instructions */
+XEN_CPUFEATURE(WDT, 3*32+13) /* Watchdog timer */
@@ -277,6 +278,8 @@ Acked-by: jbeulich@suse.com
+XEN_CPUFEATURE(AVX512VBMI, 6*32+ 1) /*A AVX-512 Vector Byte Manipulation Instrs */
+XEN_CPUFEATURE(PKU, 6*32+ 3) /*H Protection Keys for Userspace */
+XEN_CPUFEATURE(OSPKE, 6*32+ 4) /*! OS Protection Keys Enable */
++XEN_CPUFEATURE(AVX512_VPOPCNTDQ, 6*32+14) /*A POPCNT for vectors of DW/QW */
++XEN_CPUFEATURE(RDPID, 6*32+22) /*A RDPID instruction */
+
+/* AMD-defined CPU features, CPUID level 0x80000007.edx, word 7 */
+XEN_CPUFEATURE(ITSC, 7*32+ 8) /* Invariant TSC */
@@ -285,6 +288,10 @@ Acked-by: jbeulich@suse.com
+/* AMD-defined CPU features, CPUID level 0x80000008.ebx, word 8 */
+XEN_CPUFEATURE(CLZERO, 8*32+ 0) /*A CLZERO instruction */
+
++/* Intel-defined CPU features, CPUID level 0x00000007:0.edx, word 9 */
++XEN_CPUFEATURE(AVX512_4VNNIW, 9*32+ 2) /*A AVX512 Neural Network Instructions */
++XEN_CPUFEATURE(AVX512_4FMAPS, 9*32+ 3) /*A AVX512 Multiply Accumulation Single Precision */
++
+#endif /* XEN_CPUFEATURE */
+
+/* Clean up from a default include. Close the enum (for C). */
@@ -399,7 +406,7 @@ Acked-by: jbeulich@suse.com
+#endif /* __XEN_PUBLIC_ARCH_X86_CPUID_H__ */
--- /dev/null
+++ b/include/xen/interface/arch-x86/hvm/save.h
-@@ -0,0 +1,645 @@
+@@ -0,0 +1,656 @@
+/*
+ * Structure definitions for HVM state that is held by Xen and must
+ * be saved along with the domain's memory and device-model state.
@@ -537,7 +544,7 @@ Acked-by: jbeulich@suse.com
+ uint64_t shadow_gs;
+
+ /* msr content saved/restored. */
-+ uint64_t msr_flags;
++ uint64_t msr_flags; /* Obsolete, ignored. */
+ uint64_t msr_lstar;
+ uint64_t msr_star;
+ uint64_t msr_cstar;
@@ -651,7 +658,7 @@ Acked-by: jbeulich@suse.com
+ uint64_t shadow_gs;
+
+ /* msr content saved/restored. */
-+ uint64_t msr_flags;
++ uint64_t msr_flags; /* Obsolete, ignored. */
+ uint64_t msr_lstar;
+ uint64_t msr_star;
+ uint64_t msr_cstar;
@@ -763,30 +770,41 @@ Acked-by: jbeulich@suse.com
+ * IO-APIC
+ */
+
++union vioapic_redir_entry
++{
++ uint64_t bits;
++ struct {
++ uint8_t vector;
++ uint8_t delivery_mode:3;
++ uint8_t dest_mode:1;
++ uint8_t delivery_status:1;
++ uint8_t polarity:1;
++ uint8_t remote_irr:1;
++ uint8_t trig_mode:1;
++ uint8_t mask:1;
++ uint8_t reserve:7;
++ uint8_t reserved[4];
++ uint8_t dest_id;
++ } fields;
++};
++
+#define VIOAPIC_NUM_PINS 48 /* 16 ISA IRQs, 32 non-legacy PCI IRQS. */
+
-+struct hvm_hw_vioapic {
-+ uint64_t base_address;
-+ uint32_t ioregsel;
-+ uint32_t id;
-+ union vioapic_redir_entry
-+ {
-+ uint64_t bits;
-+ struct {
-+ uint8_t vector;
-+ uint8_t delivery_mode:3;
-+ uint8_t dest_mode:1;
-+ uint8_t delivery_status:1;
-+ uint8_t polarity:1;
-+ uint8_t remote_irr:1;
-+ uint8_t trig_mode:1;
-+ uint8_t mask:1;
-+ uint8_t reserve:7;
-+ uint8_t reserved[4];
-+ uint8_t dest_id;
-+ } fields;
-+ } redirtbl[VIOAPIC_NUM_PINS];
-+};
++#define XEN_HVM_VIOAPIC(name, cnt) \
++ struct name { \
++ uint64_t base_address; \
++ uint32_t ioregsel; \
++ uint32_t id; \
++ union vioapic_redir_entry redirtbl[cnt]; \
++ }
++
++XEN_HVM_VIOAPIC(hvm_hw_vioapic, VIOAPIC_NUM_PINS);
++
++#ifndef __XEN__
++#undef XEN_HVM_VIOAPIC
++#else
++#undef VIOAPIC_NUM_PINS
++#endif
+
+DECLARE_HVM_SAVE_TYPE(IOAPIC, 4, struct hvm_hw_vioapic);
+
@@ -990,8 +1008,8 @@ Acked-by: jbeulich@suse.com
+DECLARE_HVM_SAVE_TYPE(VIRIDIAN_DOMAIN, 15, struct hvm_viridian_domain_context);
+
+struct hvm_viridian_vcpu_context {
-+ uint64_t apic_assist_msr;
-+ uint8_t apic_assist_vector;
++ uint64_t vp_assist_msr;
++ uint8_t vp_assist_vector;
+ uint8_t _pad[7];
+};
+
@@ -1318,7 +1336,7 @@ Acked-by: jbeulich@suse.com
+
--- /dev/null
+++ b/include/xen/interface/arch-x86/xen-mca.h
-@@ -0,0 +1,443 @@
+@@ -0,0 +1,445 @@
+/******************************************************************************
+ * arch-x86/mca.h
+ *
@@ -1409,6 +1427,8 @@ Acked-by: jbeulich@suse.com
+#define XEN_MC_NOTDELIVERED 0x10
+/* Note, XEN_MC_CANNOTHANDLE and XEN_MC_NOTDELIVERED are mutually exclusive. */
+
++/* Applicable to all mc_vcpuid fields below. */
++#define XEN_MC_VCPUID_INVALID 0xffff
+
+#ifndef __ASSEMBLY__
+
@@ -1633,8 +1653,8 @@ Acked-by: jbeulich@suse.com
+ struct mcinfo_common *_mic; \
+ \
+ found = 0; \
-+ (_ret) = NULL; \
-+ if (_mi == NULL) break; \
++ (_ret) = NULL; \
++ if (_mi == NULL) break; \
+ _mic = x86_mcinfo_first(_mi); \
+ for (i = 0; i < x86_mcinfo_nentries(_mi); i++) { \
+ if (_mic->type == (_type)) { \
@@ -1666,8 +1686,8 @@ Acked-by: jbeulich@suse.com
+ /* IN/OUT variables. */
+ uint32_t flags; /* IN: XEN_MC_NONURGENT, XEN_MC_URGENT,
+ XEN_MC_ACK if ack'ing an earlier fetch */
-+ /* OUT: XEN_MC_OK, XEN_MC_FETCHFAILED,
-+ XEN_MC_NODATA, XEN_MC_NOMATCH */
++ /* OUT: XEN_MC_OK, XEN_MC_FETCHFAILED,
++ XEN_MC_NODATA, XEN_MC_NOMATCH */
+ uint32_t _pad0;
+ uint64_t fetch_id; /* OUT: id for ack, IN: id we are ack'ing */
+
@@ -1699,11 +1719,11 @@ Acked-by: jbeulich@suse.com
+
+#define XEN_MC_physcpuinfo 3
+struct xen_mc_physcpuinfo {
-+ /* IN/OUT */
-+ uint32_t ncpus;
-+ uint32_t _pad0;
-+ /* OUT */
-+ XEN_GUEST_HANDLE(xen_mc_logical_cpu_t) info;
++ /* IN/OUT */
++ uint32_t ncpus;
++ uint32_t _pad0;
++ /* OUT */
++ XEN_GUEST_HANDLE(xen_mc_logical_cpu_t) info;
+};
+
+#define XEN_MC_msrinject 4
@@ -1725,7 +1745,7 @@ Acked-by: jbeulich@suse.com
+
+#define XEN_MC_mceinject 5
+struct xen_mc_mceinject {
-+ unsigned int mceinj_cpunr; /* target processor id */
++ unsigned int mceinj_cpunr; /* target processor id */
+};
+
+#if defined(__XEN__) || defined(__XEN_TOOLS__)
@@ -1737,8 +1757,8 @@ Acked-by: jbeulich@suse.com
+#define XEN_MC_INJECT_CPU_BROADCAST 0x8
+
+struct xen_mc_inject_v2 {
-+ uint32_t flags;
-+ struct xenctl_bitmap cpumap;
++ uint32_t flags;
++ struct xenctl_bitmap cpumap;
+};
+#endif
+
@@ -1764,7 +1784,7 @@ Acked-by: jbeulich@suse.com
+#endif /* __XEN_PUBLIC_ARCH_X86_MCA_H__ */
--- /dev/null
+++ b/include/xen/interface/arch-x86/xen-x86_32.h
-@@ -0,0 +1,169 @@
+@@ -0,0 +1,194 @@
+/******************************************************************************
+ * xen-x86_32.h
+ *
@@ -1876,22 +1896,44 @@ Acked-by: jbeulich@suse.com
+
+#ifndef __ASSEMBLY__
+
++#if defined(XEN_GENERATING_COMPAT_HEADERS)
++/* nothing */
++#elif defined(__XEN__) || defined(__XEN_TOOLS__)
++/* Anonymous unions include all permissible names (e.g., al/ah/ax/eax). */
++#define __DECL_REG_LO8(which) union { \
++ uint32_t e ## which ## x; \
++ uint16_t which ## x; \
++ struct { \
++ uint8_t which ## l; \
++ uint8_t which ## h; \
++ }; \
++}
++#define __DECL_REG_LO16(name) union { \
++ uint32_t e ## name, _e ## name; \
++ uint16_t name; \
++}
++#else
++/* Other sources must always use the proper 32-bit name (e.g., eax). */
++#define __DECL_REG_LO8(which) uint32_t e ## which ## x
++#define __DECL_REG_LO16(name) uint32_t e ## name
++#endif
++
+struct cpu_user_regs {
-+ uint32_t ebx;
-+ uint32_t ecx;
-+ uint32_t edx;
-+ uint32_t esi;
-+ uint32_t edi;
-+ uint32_t ebp;
-+ uint32_t eax;
++ __DECL_REG_LO8(b);
++ __DECL_REG_LO8(c);
++ __DECL_REG_LO8(d);
++ __DECL_REG_LO16(si);
++ __DECL_REG_LO16(di);
++ __DECL_REG_LO16(bp);
++ __DECL_REG_LO8(a);
+ uint16_t error_code; /* private */
+ uint16_t entry_vector; /* private */
-+ uint32_t eip;
++ __DECL_REG_LO16(ip);
+ uint16_t cs;
+ uint8_t saved_upcall_mask;
+ uint8_t _pad0;
-+ uint32_t eflags; /* eflags.IF == !saved_upcall_mask */
-+ uint32_t esp;
++ __DECL_REG_LO16(flags); /* eflags.IF == !saved_upcall_mask */
++ __DECL_REG_LO16(sp);
+ uint16_t ss, _pad1;
+ uint16_t es, _pad2;
+ uint16_t ds, _pad3;
@@ -1901,6 +1943,9 @@ Acked-by: jbeulich@suse.com
+typedef struct cpu_user_regs cpu_user_regs_t;
+DEFINE_XEN_GUEST_HANDLE(cpu_user_regs_t);
+
++#undef __DECL_REG_LO8
++#undef __DECL_REG_LO16
++
+/*
+ * Page-directory addresses above 4GB do not fit into architectural %cr3.
+ * When accessing %cr3, or equivalent field in vcpu_guest_context, guests
@@ -1936,7 +1981,7 @@ Acked-by: jbeulich@suse.com
+ */
--- /dev/null
+++ b/include/xen/interface/arch-x86/xen-x86_64.h
-@@ -0,0 +1,202 @@
+@@ -0,0 +1,241 @@
+/******************************************************************************
+ * xen-x86_64.h
+ *
@@ -2069,7 +2114,35 @@ Acked-by: jbeulich@suse.com
+ /* Bottom of iret stack frame. */
+};
+
-+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
++#if defined(__XEN__) || defined(__XEN_TOOLS__)
++/* Anonymous unions include all permissible names (e.g., al/ah/ax/eax/rax). */
++#define __DECL_REG_LOHI(which) union { \
++ uint64_t r ## which ## x; \
++ uint32_t e ## which ## x; \
++ uint16_t which ## x; \
++ struct { \
++ uint8_t which ## l; \
++ uint8_t which ## h; \
++ }; \
++}
++#define __DECL_REG_LO8(name) union { \
++ uint64_t r ## name; \
++ uint32_t e ## name; \
++ uint16_t name; \
++ uint8_t name ## l; \
++}
++#define __DECL_REG_LO16(name) union { \
++ uint64_t r ## name; \
++ uint32_t e ## name; \
++ uint16_t name; \
++}
++#define __DECL_REG_HI(num) union { \
++ uint64_t r ## num; \
++ uint32_t r ## num ## d; \
++ uint16_t r ## num ## w; \
++ uint8_t r ## num ## b; \
++}
++#elif defined(__GNUC__) && !defined(__STRICT_ANSI__)
+/* Anonymous union includes both 32- and 64-bit names (e.g., eax/rax). */
+#define __DECL_REG(name) union { \
+ uint64_t r ## name, e ## name; \
@@ -2080,30 +2153,37 @@ Acked-by: jbeulich@suse.com
+#define __DECL_REG(name) uint64_t r ## name
+#endif
+
++#ifndef __DECL_REG_LOHI
++#define __DECL_REG_LOHI(name) __DECL_REG(name ## x)
++#define __DECL_REG_LO8 __DECL_REG
++#define __DECL_REG_LO16 __DECL_REG
++#define __DECL_REG_HI(num) uint64_t r ## num
++#endif
++
+struct cpu_user_regs {
-+ uint64_t r15;
-+ uint64_t r14;
-+ uint64_t r13;
-+ uint64_t r12;
-+ __DECL_REG(bp);
-+ __DECL_REG(bx);
-+ uint64_t r11;
-+ uint64_t r10;
-+ uint64_t r9;
-+ uint64_t r8;
-+ __DECL_REG(ax);
-+ __DECL_REG(cx);
-+ __DECL_REG(dx);
-+ __DECL_REG(si);
-+ __DECL_REG(di);
++ __DECL_REG_HI(15);
++ __DECL_REG_HI(14);
++ __DECL_REG_HI(13);
++ __DECL_REG_HI(12);
++ __DECL_REG_LO8(bp);
++ __DECL_REG_LOHI(b);
++ __DECL_REG_HI(11);
++ __DECL_REG_HI(10);
++ __DECL_REG_HI(9);
++ __DECL_REG_HI(8);
++ __DECL_REG_LOHI(a);
++ __DECL_REG_LOHI(c);
++ __DECL_REG_LOHI(d);
++ __DECL_REG_LO8(si);
++ __DECL_REG_LO8(di);
+ uint32_t error_code; /* private */
+ uint32_t entry_vector; /* private */
-+ __DECL_REG(ip);
++ __DECL_REG_LO16(ip);
+ uint16_t cs, _pad0[1];
+ uint8_t saved_upcall_mask;
+ uint8_t _pad1[3];
-+ __DECL_REG(flags); /* rflags.IF == !saved_upcall_mask */
-+ __DECL_REG(sp);
++ __DECL_REG_LO16(flags); /* rflags.IF == !saved_upcall_mask */
++ __DECL_REG_LO8(sp);
+ uint16_t ss, _pad2[3];
+ uint16_t es, _pad3[3];
+ uint16_t ds, _pad4[3];
@@ -2114,6 +2194,10 @@ Acked-by: jbeulich@suse.com
+DEFINE_XEN_GUEST_HANDLE(cpu_user_regs_t);
+
+#undef __DECL_REG
++#undef __DECL_REG_LOHI
++#undef __DECL_REG_LO8
++#undef __DECL_REG_LO16
++#undef __DECL_REG_HI
+
+#define xen_pfn_to_cr3(pfn) ((unsigned long)(pfn) << 12)
+#define xen_cr3_to_pfn(cr3) ((unsigned long)(cr3) >> 12)
@@ -2141,7 +2225,7 @@ Acked-by: jbeulich@suse.com
+ */
--- /dev/null
+++ b/include/xen/interface/arch-x86/xen.h
-@@ -0,0 +1,338 @@
+@@ -0,0 +1,357 @@
+/******************************************************************************
+ * arch-x86/xen.h
+ *
@@ -2201,7 +2285,17 @@ Acked-by: jbeulich@suse.com
+#define set_xen_guest_handle(hnd, val) set_xen_guest_handle_raw(hnd, val)
+
+#if defined(__i386__)
++# ifdef __XEN__
++__DeFiNe__ __DECL_REG_LO8(which) uint32_t e ## which ## x
++__DeFiNe__ __DECL_REG_LO16(name) union { uint32_t e ## name; }
++# endif
+#include "xen-x86_32.h"
++# ifdef __XEN__
++__UnDeF__ __DECL_REG_LO8
++__UnDeF__ __DECL_REG_LO16
++__DeFiNe__ __DECL_REG_LO8(which) e ## which ## x
++__DeFiNe__ __DECL_REG_LO16(name) e ## name
++# endif
+#elif defined(__x86_64__)
+#include "xen-x86_64.h"
+#endif
@@ -2296,7 +2390,7 @@ Acked-by: jbeulich@suse.com
+ * The following is all CPU context. Note that the fpu_ctxt block is filled
+ * in by FXSAVE if the CPU has feature FXSR; otherwise FSAVE is used.
+ *
-+ * Also note that when calling DOMCTL_setvcpucontext and VCPU_initialise
++ * Also note that when calling DOMCTL_setvcpucontext and VCPUOP_initialise
+ * for HVM and PVH guests, not all information in this structure is updated:
+ *
+ * - For HVM guests, the structures read include: fpu_ctxt (if
@@ -2427,14 +2521,23 @@ Acked-by: jbeulich@suse.com
+#define XEN_X86_EMU_IOMMU (1U<<_XEN_X86_EMU_IOMMU)
+#define _XEN_X86_EMU_PIT 8
+#define XEN_X86_EMU_PIT (1U<<_XEN_X86_EMU_PIT)
++#define _XEN_X86_EMU_USE_PIRQ 9
++#define XEN_X86_EMU_USE_PIRQ (1U<<_XEN_X86_EMU_USE_PIRQ)
+
+#define XEN_X86_EMU_ALL (XEN_X86_EMU_LAPIC | XEN_X86_EMU_HPET | \
+ XEN_X86_EMU_PM | XEN_X86_EMU_RTC | \
+ XEN_X86_EMU_IOAPIC | XEN_X86_EMU_PIC | \
+ XEN_X86_EMU_VGA | XEN_X86_EMU_IOMMU | \
-+ XEN_X86_EMU_PIT)
++ XEN_X86_EMU_PIT | XEN_X86_EMU_USE_PIRQ)
+ uint32_t emulation_flags;
+};
++
++/* Location of online VCPU bitmap. */
++#define XEN_ACPI_CPU_MAP 0xaf00
++#define XEN_ACPI_CPU_MAP_LEN ((HVM_MAX_VCPUS + 7) / 8)
++
++/* GPE0 bit set during CPU hotplug */
++#define XEN_ACPI_GPE0_CPUHP_BIT 2
+#endif
+
+#endif /* !__ASSEMBLY__ */
@@ -2681,7 +2784,7 @@ Acked-by: jbeulich@suse.com
+ */
--- /dev/null
+++ b/include/xen/interface/domctl.h
-@@ -0,0 +1,1348 @@
+@@ -0,0 +1,1345 @@
+/******************************************************************************
+ * domctl.h
+ *
@@ -2721,7 +2824,7 @@ Acked-by: jbeulich@suse.com
+#include "hvm/save.h"
+#include "memory.h"
+
-+#define XEN_DOMCTL_INTERFACE_VERSION 0x0000000c
++#define XEN_DOMCTL_INTERFACE_VERSION 0x0000000d
+
+/*
+ * NB. xen_domctl.domain is an IN/OUT parameter for this operation.
@@ -2744,11 +2847,8 @@ Acked-by: jbeulich@suse.com
+ /* Disable out-of-sync shadow page tables? */
+#define _XEN_DOMCTL_CDF_oos_off 3
+#define XEN_DOMCTL_CDF_oos_off (1U<<_XEN_DOMCTL_CDF_oos_off)
-+ /* Is this a PVH guest (as opposed to an HVM or PV guest)? */
-+#define _XEN_DOMCTL_CDF_pvh_guest 4
-+#define XEN_DOMCTL_CDF_pvh_guest (1U<<_XEN_DOMCTL_CDF_pvh_guest)
+ /* Is this a xenstore domain? */
-+#define _XEN_DOMCTL_CDF_xs_domain 5
++#define _XEN_DOMCTL_CDF_xs_domain 4
+#define XEN_DOMCTL_CDF_xs_domain (1U<<_XEN_DOMCTL_CDF_xs_domain)
+ uint32_t flags;
+ struct xen_arch_domainconfig config;
@@ -2781,14 +2881,11 @@ Acked-by: jbeulich@suse.com
+ /* Being debugged. */
+#define _XEN_DOMINF_debugged 6
+#define XEN_DOMINF_debugged (1U<<_XEN_DOMINF_debugged)
-+/* domain is PVH */
-+#define _XEN_DOMINF_pvh_guest 7
-+#define XEN_DOMINF_pvh_guest (1U<<_XEN_DOMINF_pvh_guest)
+/* domain is a xenstore domain */
-+#define _XEN_DOMINF_xs_domain 8
++#define _XEN_DOMINF_xs_domain 7
+#define XEN_DOMINF_xs_domain (1U<<_XEN_DOMINF_xs_domain)
+/* domain has hardware assisted paging */
-+#define _XEN_DOMINF_hap 9
++#define _XEN_DOMINF_hap 8
+#define XEN_DOMINF_hap (1U<<_XEN_DOMINF_hap)
+ /* XEN_DOMINF_shutdown guest-supplied code. */
+#define XEN_DOMINF_shutdownmask 255
@@ -3036,6 +3133,7 @@ Acked-by: jbeulich@suse.com
+#define XEN_SCHEDULER_CREDIT2 6
+#define XEN_SCHEDULER_ARINC653 7
+#define XEN_SCHEDULER_RTDS 8
++#define XEN_SCHEDULER_NULL 9
+
+typedef struct xen_domctl_sched_credit {
+ uint16_t weight;
@@ -3813,6 +3911,8 @@ Acked-by: jbeulich@suse.com
+#define XEN_DOMCTL_MONITOR_EVENT_DEBUG_EXCEPTION 5
+#define XEN_DOMCTL_MONITOR_EVENT_CPUID 6
+#define XEN_DOMCTL_MONITOR_EVENT_PRIVILEGED_CALL 7
++#define XEN_DOMCTL_MONITOR_EVENT_INTERRUPT 8
++#define XEN_DOMCTL_MONITOR_EVENT_DESC_ACCESS 9
+
+struct xen_domctl_monitor_op {
+ uint32_t op; /* XEN_DOMCTL_MONITOR_OP_* */
@@ -4158,124 +4258,6 @@ Acked-by: jbeulich@suse.com
+
+#endif /* XEN_ERRNO_DEFAULT_INCLUDE */
--- /dev/null
-+++ b/include/xen/interface/gcov.h
-@@ -0,0 +1,115 @@
-+/******************************************************************************
-+ * gcov.h
-+ *
-+ * Coverage structures exported by Xen.
-+ * Structure is different from Gcc one.
-+ *
-+ * Permission is hereby granted, free of charge, to any person obtaining a copy
-+ * of this software and associated documentation files (the "Software"), to
-+ * deal in the Software without restriction, including without limitation the
-+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-+ * sell copies of the Software, and to permit persons to whom the Software is
-+ * furnished to do so, subject to the following conditions:
-+ *
-+ * The above copyright notice and this permission notice shall be included in
-+ * all copies or substantial portions of the Software.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-+ * DEALINGS IN THE SOFTWARE.
-+ *
-+ * Copyright (c) 2013, Citrix Systems R&D Ltd.
-+ */
-+
-+#ifndef __XEN_PUBLIC_GCOV_H__
-+#define __XEN_PUBLIC_GCOV_H__ __XEN_PUBLIC_GCOV_H__
-+
-+#define XENCOV_COUNTERS 5
-+#define XENCOV_TAG_BASE 0x58544300u
-+#define XENCOV_TAG_FILE (XENCOV_TAG_BASE+0x46u)
-+#define XENCOV_TAG_FUNC (XENCOV_TAG_BASE+0x66u)
-+#define XENCOV_TAG_COUNTER(n) (XENCOV_TAG_BASE+0x30u+((n)&0xfu))
-+#define XENCOV_TAG_END (XENCOV_TAG_BASE+0x2eu)
-+#define XENCOV_IS_TAG_COUNTER(n) \
-+ ((n) >= XENCOV_TAG_COUNTER(0) && (n) < XENCOV_TAG_COUNTER(XENCOV_COUNTERS))
-+#define XENCOV_COUNTER_NUM(n) ((n)-XENCOV_TAG_COUNTER(0))
-+
-+/*
-+ * The main structure for the blob is
-+ * BLOB := FILE.. END
-+ * FILE := TAG_FILE VERSION STAMP FILENAME COUNTERS FUNCTIONS
-+ * FILENAME := LEN characters
-+ * characters are padded to 32 bit
-+ * LEN := 32 bit value
-+ * COUNTERS := TAG_COUNTER(n) NUM COUNTER..
-+ * NUM := 32 bit valie
-+ * COUNTER := 64 bit value
-+ * FUNCTIONS := TAG_FUNC NUM FUNCTION..
-+ * FUNCTION := IDENT CHECKSUM NUM_COUNTERS
-+ *
-+ * All tagged structures are aligned to 8 bytes
-+ */
-+
-+/**
-+ * File information
-+ * Prefixed with XENCOV_TAG_FILE and a string with filename
-+ * Aligned to 8 bytes
-+ */
-+struct xencov_file
-+{
-+ uint32_t tag; /* XENCOV_TAG_FILE */
-+ uint32_t version;
-+ uint32_t stamp;
-+ uint32_t fn_len;
-+ char filename[1];
-+};
-+
-+
-+/**
-+ * Counters information
-+ * Prefixed with XENCOV_TAG_COUNTER(n) where n is 0..(XENCOV_COUNTERS-1)
-+ * Aligned to 8 bytes
-+ */
-+struct xencov_counter
-+{
-+ uint32_t tag; /* XENCOV_TAG_COUNTER(n) */
-+ uint32_t num;
-+ uint64_t values[1];
-+};
-+
-+/**
-+ * Information for each function
-+ * Number of counter is equal to the number of counter structures got before
-+ */
-+struct xencov_function
-+{
-+ uint32_t ident;
-+ uint32_t checksum;
-+ uint32_t num_counters[1];
-+};
-+
-+/**
-+ * Information for all functions
-+ * Aligned to 8 bytes
-+ */
-+struct xencov_functions
-+{
-+ uint32_t tag; /* XENCOV_TAG_FUNC */
-+ uint32_t num;
-+ struct xencov_function xencov_function[1];
-+};
-+
-+/**
-+ * Terminator
-+ */
-+struct xencov_end
-+{
-+ uint32_t tag; /* XENCOV_TAG_END */
-+};
-+
-+#endif /* __XEN_PUBLIC_GCOV_H__ */
-+
---- /dev/null
+++ b/include/xen/interface/hvm/e820.h
@@ -0,0 +1,38 @@
+/*
@@ -5011,6 +4993,162 @@ Acked-by: jbeulich@suse.com
+
+#endif
--- /dev/null
++++ b/include/xen/interface/io/pvcalls.h
+@@ -0,0 +1,153 @@
++/*
++ * pvcalls.h -- Xen PV Calls Protocol
++ *
++ * Refer to docs/misc/pvcalls.markdown for the specification
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a copy
++ * of this software and associated documentation files (the "Software"), to
++ * deal in the Software without restriction, including without limitation the
++ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
++ * sell copies of the Software, and to permit persons to whom the Software is
++ * furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
++ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
++ * DEALINGS IN THE SOFTWARE.
++ *
++ * Copyright (C) 2017 Stefano Stabellini <stefano@aporeto.com>
++ */
++
++#ifndef __XEN_PUBLIC_IO_PVCALLS_H__
++#define __XEN_PUBLIC_IO_PVCALLS_H__
++
++#include "../grant_table.h"
++#include "ring.h"
++
++/*
++ * See docs/misc/pvcalls.markdown in xen.git for the full specification:
++ * https://xenbits.xen.org/docs/unstable/misc/pvcalls.html
++ */
++struct pvcalls_data_intf {
++ RING_IDX in_cons, in_prod, in_error;
++
++ uint8_t pad1[52];
++
++ RING_IDX out_cons, out_prod, out_error;
++
++ uint8_t pad2[52];
++
++ RING_IDX ring_order;
++ grant_ref_t ref[];
++};
++DEFINE_XEN_FLEX_RING(pvcalls);
++
++#define PVCALLS_SOCKET 0
++#define PVCALLS_CONNECT 1
++#define PVCALLS_RELEASE 2
++#define PVCALLS_BIND 3
++#define PVCALLS_LISTEN 4
++#define PVCALLS_ACCEPT 5
++#define PVCALLS_POLL 6
++
++struct xen_pvcalls_request {
++ uint32_t req_id; /* private to guest, echoed in response */
++ uint32_t cmd; /* command to execute */
++ union {
++ struct xen_pvcalls_socket {
++ uint64_t id;
++ uint32_t domain;
++ uint32_t type;
++ uint32_t protocol;
++ } socket;
++ struct xen_pvcalls_connect {
++ uint64_t id;
++ uint8_t addr[28];
++ uint32_t len;
++ uint32_t flags;
++ grant_ref_t ref;
++ uint32_t evtchn;
++ } connect;
++ struct xen_pvcalls_release {
++ uint64_t id;
++ uint8_t reuse;
++ } release;
++ struct xen_pvcalls_bind {
++ uint64_t id;
++ uint8_t addr[28];
++ uint32_t len;
++ } bind;
++ struct xen_pvcalls_listen {
++ uint64_t id;
++ uint32_t backlog;
++ } listen;
++ struct xen_pvcalls_accept {
++ uint64_t id;
++ uint64_t id_new;
++ grant_ref_t ref;
++ uint32_t evtchn;
++ } accept;
++ struct xen_pvcalls_poll {
++ uint64_t id;
++ } poll;
++ /* dummy member to force sizeof(struct xen_pvcalls_request)
++ * to match across archs */
++ struct xen_pvcalls_dummy {
++ uint8_t dummy[56];
++ } dummy;
++ } u;
++};
++
++struct xen_pvcalls_response {
++ uint32_t req_id;
++ uint32_t cmd;
++ int32_t ret;
++ uint32_t pad;
++ union {
++ struct _xen_pvcalls_socket {
++ uint64_t id;
++ } socket;
++ struct _xen_pvcalls_connect {
++ uint64_t id;
++ } connect;
++ struct _xen_pvcalls_release {
++ uint64_t id;
++ } release;
++ struct _xen_pvcalls_bind {
++ uint64_t id;
++ } bind;
++ struct _xen_pvcalls_listen {
++ uint64_t id;
++ } listen;
++ struct _xen_pvcalls_accept {
++ uint64_t id;
++ } accept;
++ struct _xen_pvcalls_poll {
++ uint64_t id;
++ } poll;
++ struct _xen_pvcalls_dummy {
++ uint8_t dummy[8];
++ } dummy;
++ } u;
++};
++
++DEFINE_RING_TYPES(xen_pvcalls, struct xen_pvcalls_request,
++ struct xen_pvcalls_response);
++
++#endif
++
++/*
++ * Local variables:
++ * mode: C
++ * c-file-style: "BSD"
++ * c-basic-offset: 4
++ * tab-width: 4
++ * indent-tabs-mode: nil
++ * End:
++ */
+--- /dev/null
+++ b/include/xen/interface/io/usbif.h
@@ -0,0 +1,254 @@
+/*
@@ -5269,7 +5407,7 @@ Acked-by: jbeulich@suse.com
+#endif /* __XEN_PUBLIC_IO_USBIF_H__ */
--- /dev/null
+++ b/include/xen/interface/kexec.h
-@@ -0,0 +1,252 @@
+@@ -0,0 +1,266 @@
+/******************************************************************************
+ * kexec.h - Public portion
+ *
@@ -5502,6 +5640,20 @@ Acked-by: jbeulich@suse.com
+} xen_kexec_unload_t;
+DEFINE_XEN_GUEST_HANDLE(xen_kexec_unload_t);
+
++/*
++ * Figure out whether we have an image loaded. A return value of
++ * zero indicates no image loaded. A return value of one
++ * indicates an image is loaded. A negative return value
++ * indicates an error.
++ *
++ * Type must be one of KEXEC_TYPE_DEFAULT or KEXEC_TYPE_CRASH.
++ */
++#define KEXEC_CMD_kexec_status 6
++typedef struct xen_kexec_status {
++ uint8_t type;
++} xen_kexec_status_t;
++DEFINE_XEN_GUEST_HANDLE(xen_kexec_status_t);
++
+#else /* __XEN_INTERFACE_VERSION__ < 0x00040400 */
+
+#define KEXEC_CMD_kexec_load KEXEC_CMD_kexec_load_v1
@@ -5670,7 +5822,7 @@ Acked-by: jbeulich@suse.com
+ */
--- /dev/null
+++ b/include/xen/interface/sysctl.h
-@@ -0,0 +1,1163 @@
+@@ -0,0 +1,1170 @@
+/******************************************************************************
+ * sysctl.h
+ *
@@ -5709,7 +5861,7 @@ Acked-by: jbeulich@suse.com
+#include "physdev.h"
+#include "tmem.h"
+
-+#define XEN_SYSCTL_INTERFACE_VERSION 0x0000000E
++#define XEN_SYSCTL_INTERFACE_VERSION 0x0000000F
+
+/*
+ * Read console content from Xen buffer ring.
@@ -6338,40 +6490,39 @@ Acked-by: jbeulich@suse.com
+typedef struct xen_sysctl_scheduler_op xen_sysctl_scheduler_op_t;
+DEFINE_XEN_GUEST_HANDLE(xen_sysctl_scheduler_op_t);
+
-+/* XEN_SYSCTL_coverage_op */
-+/*
-+ * Get total size of information, to help allocate
-+ * the buffer. The pointer points to a 32 bit value.
-+ */
-+#define XEN_SYSCTL_COVERAGE_get_total_size 0
-+
+/*
-+ * Read coverage information in a single run
-+ * You must use a tool to split them.
++ * Output format of gcov data:
++ *
++ * XEN_GCOV_FORMAT_MAGIC XEN_GCOV_RECORD ... XEN_GCOV_RECORD
++ *
++ * That is, one magic number followed by 0 or more record.
++ *
++ * The magic number is stored as an uint32_t field.
++ *
++ * The record is packed and variable in length. It has the form:
++ *
++ * filename: a NULL terminated path name extracted from gcov, used to
++ * create the name of gcda file.
++ * size: a uint32_t field indicating the size of the payload, the
++ * unit is byte.
++ * payload: the actual payload, length is `size' bytes.
++ *
++ * Userspace tool will split the record to different files.
+ */
-+#define XEN_SYSCTL_COVERAGE_read 1
+
-+/*
-+ * Reset all the coverage counters to 0
-+ * No parameters.
-+ */
-+#define XEN_SYSCTL_COVERAGE_reset 2
++#define XEN_GCOV_FORMAT_MAGIC 0x58434f56 /* XCOV */
+
-+/*
-+ * Like XEN_SYSCTL_COVERAGE_read but reset also
-+ * counters to 0 in a single call.
-+ */
-+#define XEN_SYSCTL_COVERAGE_read_and_reset 3
++#define XEN_SYSCTL_GCOV_get_size 0 /* Get total size of output data */
++#define XEN_SYSCTL_GCOV_read 1 /* Read output data */
++#define XEN_SYSCTL_GCOV_reset 2 /* Reset all counters */
+
-+struct xen_sysctl_coverage_op {
-+ uint32_t cmd; /* XEN_SYSCTL_COVERAGE_* */
-+ union {
-+ uint32_t total_size; /* OUT */
-+ XEN_GUEST_HANDLE_64(uint8) raw_info; /* OUT */
-+ } u;
++struct xen_sysctl_gcov_op {
++ uint32_t cmd;
++ uint32_t size; /* IN/OUT: size of the buffer */
++ XEN_GUEST_HANDLE_64(char) buffer; /* OUT */
+};
-+typedef struct xen_sysctl_coverage_op xen_sysctl_coverage_op_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_sysctl_coverage_op_t);
++typedef struct xen_sysctl_gcov_op xen_sysctl_gcov_op_t;
++DEFINE_XEN_GUEST_HANDLE(xen_sysctl_gcov_op_t);
+
+#define XEN_SYSCTL_PSR_CMT_get_total_rmid 0
+#define XEN_SYSCTL_PSR_CMT_get_l3_upscaling_factor 1
@@ -6444,7 +6595,9 @@ Acked-by: jbeulich@suse.com
+#define XEN_SYSCTL_TMEM_OP_SET_CLIENT_INFO 6
+#define XEN_SYSCTL_TMEM_OP_GET_POOLS 7
+#define XEN_SYSCTL_TMEM_OP_QUERY_FREEABLE_MB 8
++#define XEN_SYSCTL_TMEM_OP_SET_POOLS 9
+#define XEN_SYSCTL_TMEM_OP_SAVE_BEGIN 10
++#define XEN_SYSCTL_TMEM_OP_SET_AUTH 11
+#define XEN_SYSCTL_TMEM_OP_SAVE_GET_NEXT_PAGE 19
+#define XEN_SYSCTL_TMEM_OP_SAVE_GET_NEXT_INV 20
+#define XEN_SYSCTL_TMEM_OP_SAVE_END 21
@@ -6486,10 +6639,14 @@ Acked-by: jbeulich@suse.com
+DEFINE_XEN_GUEST_HANDLE(xen_tmem_client_t);
+
+/*
-+ * XEN_SYSCTL_TMEM_OP_GET_POOLS uses the 'pool' array in
-+ * xen_sysctl_tmem_op with this structure. The hypercall will
++ * XEN_SYSCTL_TMEM_OP_[GET|SET]_POOLS or XEN_SYSCTL_TMEM_OP_SET_AUTH
++ * uses the 'pool' array in * xen_sysctl_tmem_op with this structure.
++ * The XEN_SYSCTL_TMEM_OP_GET_POOLS hypercall will
+ * return the number of entries in 'pool' or a negative value
+ * if an error was encountered.
++ * The XEN_SYSCTL_TMEM_OP_SET_[AUTH|POOLS] will return the number of
++ * entries in 'pool' processed or a negative value if an error
++ * was encountered.
+ */
+struct xen_tmem_pool_info {
+ union {
@@ -6497,14 +6654,15 @@ Acked-by: jbeulich@suse.com
+ struct {
+ uint32_t persist:1, /* See TMEM_POOL_PERSIST. */
+ shared:1, /* See TMEM_POOL_SHARED. */
-+ rsv:2,
++ auth:1, /* See TMEM_POOL_AUTH. */
++ rsv1:1,
+ pagebits:8, /* TMEM_POOL_PAGESIZE_[SHIFT,MASK]. */
+ rsv2:12,
+ version:8; /* TMEM_POOL_VERSION_[SHIFT,MASK]. */
+ } u;
+ } flags;
+ uint32_t id; /* Less than tmem_client.maxpools. */
-+ uint64_t n_pages;
++ uint64_t n_pages; /* Zero on XEN_SYSCTL_TMEM_OP_SET_[AUTH|POOLS]. */
+ uint64_aligned_t uuid[2];
+};
+typedef struct xen_tmem_pool_info xen_tmem_pool_info_t;
@@ -6741,8 +6899,9 @@ Acked-by: jbeulich@suse.com
+#define LIVEPATCH_ACTION_APPLY 3
+#define LIVEPATCH_ACTION_REPLACE 4
+ uint32_t cmd; /* IN: LIVEPATCH_ACTION_*. */
-+ uint32_t timeout; /* IN: Zero if no timeout. */
-+ /* Or upper bound of time (ms) */
++ uint32_t timeout; /* IN: If zero then uses */
++ /* hypervisor default. */
++ /* Or upper bound of time (ns) */
+ /* for operation to take. */
+};
+typedef struct xen_sysctl_livepatch_action xen_sysctl_livepatch_action_t;
@@ -6781,7 +6940,7 @@ Acked-by: jbeulich@suse.com
+#define XEN_SYSCTL_numainfo 17
+#define XEN_SYSCTL_cpupool_op 18
+#define XEN_SYSCTL_scheduler_op 19
-+#define XEN_SYSCTL_coverage_op 20
++#define XEN_SYSCTL_gcov_op 20
+#define XEN_SYSCTL_psr_cmt_op 21
+#define XEN_SYSCTL_pcitopoinfo 22
+#define XEN_SYSCTL_psr_cat_op 23
@@ -6810,7 +6969,7 @@ Acked-by: jbeulich@suse.com
+ struct xen_sysctl_lockprof_op lockprof_op;
+ struct xen_sysctl_cpupool_op cpupool_op;
+ struct xen_sysctl_scheduler_op scheduler_op;
-+ struct xen_sysctl_coverage_op coverage_op;
++ struct xen_sysctl_gcov_op gcov_op;
+ struct xen_sysctl_psr_cmt_op psr_cmt_op;
+ struct xen_sysctl_psr_cat_op psr_cat_op;
+ struct xen_sysctl_tmem_op tmem_op;
@@ -6890,9 +7049,9 @@ Acked-by: jbeulich@suse.com
+#define TMEM_XCHG 10
+#endif
+
-+/* Privileged commands to HYPERVISOR_tmem_op() */
-+#define TMEM_AUTH 101
-+#define TMEM_RESTORE_NEW 102
++/* Privileged commands now called via XEN_SYSCTL_tmem_op. */
++#define TMEM_AUTH 101 /* as XEN_SYSCTL_TMEM_OP_SET_AUTH. */
++#define TMEM_RESTORE_NEW 102 /* as XEN_SYSCTL_TMEM_OP_SET_POOL. */
+
+/* Bits for HYPERVISOR_tmem_op(TMEM_NEW_POOL) */
+#define TMEM_POOL_PERSIST 1
@@ -6931,7 +7090,7 @@ Acked-by: jbeulich@suse.com
+ uint64_t uuid[2];
+ uint32_t flags;
+ uint32_t arg1;
-+ } creat; /* for cmd == TMEM_NEW_POOL, TMEM_AUTH, TMEM_RESTORE_NEW */
++ } creat; /* for cmd == TMEM_NEW_POOL. */
+ struct {
+#if __XEN_INTERFACE_VERSION__ < 0x00040600
+ uint64_t oid[3];
@@ -6963,7 +7122,7 @@ Acked-by: jbeulich@suse.com
+ */
--- /dev/null
+++ b/include/xen/interface/trace.h
-@@ -0,0 +1,337 @@
+@@ -0,0 +1,338 @@
+/******************************************************************************
+ * include/public/trace.h
+ *
@@ -7081,6 +7240,7 @@ Acked-by: jbeulich@suse.com
+#define TRC_SCHED_SWITCH_INFPREV (TRC_SCHED_VERBOSE + 14)
+#define TRC_SCHED_SWITCH_INFNEXT (TRC_SCHED_VERBOSE + 15)
+#define TRC_SCHED_SHUTDOWN_CODE (TRC_SCHED_VERBOSE + 16)
++#define TRC_SCHED_SWITCH_INFCONT (TRC_SCHED_VERBOSE + 17)
+
+#define TRC_DOM0_DOM_ADD (TRC_DOM0_DOMOPS + 1)
+#define TRC_DOM0_DOM_REM (TRC_DOM0_DOMOPS + 2)
@@ -7303,7 +7463,7 @@ Acked-by: jbeulich@suse.com
+ */
--- /dev/null
+++ b/include/xen/interface/vm_event.h
-@@ -0,0 +1,333 @@
+@@ -0,0 +1,376 @@
+/******************************************************************************
+ * vm_event.h
+ *
@@ -7411,6 +7571,11 @@ Acked-by: jbeulich@suse.com
+ * if any of those flags are set, only those will be honored).
+ */
+#define VM_EVENT_FLAG_SET_EMUL_INSN_DATA (1 << 9)
++/*
++ * Have a one-shot VM_EVENT_REASON_INTERRUPT event sent for the first
++ * interrupt pending after resuming the VCPU.
++ */
++#define VM_EVENT_FLAG_GET_NEXT_INTERRUPT (1 << 10)
+
+/*
+ * Reasons for the vm event request
@@ -7445,6 +7610,10 @@ Acked-by: jbeulich@suse.com
+ * These kinds of events will be filtered out in future versions.
+ */
+#define VM_EVENT_REASON_PRIVILEGED_CALL 11
++/* An interrupt has been delivered. */
++#define VM_EVENT_REASON_INTERRUPT 12
++/* A descriptor table register was accessed. */
++#define VM_EVENT_REASON_DESCRIPTOR_ACCESS 13
+
+/* Supported values for the vm_event_write_ctrlreg index. */
+#define VM_EVENT_X86_CR0 0
@@ -7558,6 +7727,28 @@ Acked-by: jbeulich@suse.com
+ uint64_t value;
+};
+
++#define VM_EVENT_DESC_IDTR 1
++#define VM_EVENT_DESC_GDTR 2
++#define VM_EVENT_DESC_LDTR 3
++#define VM_EVENT_DESC_TR 4
++
++struct vm_event_desc_access {
++ union {
++ struct {
++ uint32_t instr_info; /* VMX: VMCS Instruction-Information */
++ uint32_t _pad1;
++ uint64_t exit_qualification; /* VMX: VMCS Exit Qualification */
++ } vmx;
++ struct {
++ uint64_t exitinfo; /* SVM: VMCB EXITINFO */
++ uint64_t _pad2;
++ } svm;
++ } arch;
++ uint8_t descriptor; /* VM_EVENT_DESC_* */
++ uint8_t is_write;
++ uint8_t _pad[6];
++};
++
+struct vm_event_cpuid {
+ uint32_t insn_length;
+ uint32_t leaf;
@@ -7565,6 +7756,14 @@ Acked-by: jbeulich@suse.com
+ uint32_t _pad;
+};
+
++struct vm_event_interrupt_x86 {
++ uint32_t vector;
++ uint32_t type;
++ uint32_t error_code;
++ uint32_t _pad;
++ uint64_t cr2;
++};
++
+#define MEM_PAGING_DROP_PAGE (1 << 0)
+#define MEM_PAGING_EVICT_FAIL (1 << 1)
+
@@ -7604,10 +7803,14 @@ Acked-by: jbeulich@suse.com
+ struct vm_event_mem_access mem_access;
+ struct vm_event_write_ctrlreg write_ctrlreg;
+ struct vm_event_mov_to_msr mov_to_msr;
++ struct vm_event_desc_access desc_access;
+ struct vm_event_singlestep singlestep;
+ struct vm_event_debug software_breakpoint;
+ struct vm_event_debug debug_exception;
+ struct vm_event_cpuid cpuid;
++ union {
++ struct vm_event_interrupt_x86 x86;
++ } interrupt;
+ } u;
+
+ union {
@@ -7669,7 +7872,7 @@ Acked-by: jbeulich@suse.com
+#ifndef __XEN_PUBLIC_XEN_COMPAT_H__
+#define __XEN_PUBLIC_XEN_COMPAT_H__
+
-+#define __XEN_LATEST_INTERFACE_VERSION__ 0x00040800
++#define __XEN_LATEST_INTERFACE_VERSION__ 0x00040900
+
+#if defined(__XEN__) || defined(__XEN_TOOLS__)
+/* Xen is built with matching headers and implements the latest interface. */
diff --git a/patches.xen/xen3-auto-xen-arch.diff b/patches.xen/xen3-auto-xen-arch.diff
index 87e89d2871..bdb493c927 100644
--- a/patches.xen/xen3-auto-xen-arch.diff
+++ b/patches.xen/xen3-auto-xen-arch.diff
@@ -1,4 +1,4 @@
-From http://xenbits.xen.org/linux-2.6.18-xen.hg (tip 1331:e08ba8d3bafe)
+From http://xenbits.xen.org/linux-2.6.18-xen.hg (tip 1337:615890cbff82)
Subject: xen3 xen-arch
From: xen-devel@lists.xen.org
Patch-mainline: Never, SUSE-Xen specific
@@ -28652,7 +28652,7 @@ pick them up (for reference, prefixed with the version the removal occured):
+#endif /* _X8664_TLBFLUSH_H */
--- /dev/null
+++ b/include/xen/blkif.h
-@@ -0,0 +1,124 @@
+@@ -0,0 +1,112 @@
+/*
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
@@ -28687,9 +28687,6 @@ pick them up (for reference, prefixed with the version the removal occured):
+struct blkif_common_request {
+ char dummy;
+};
-+struct blkif_common_response {
-+ char dummy;
-+};
+
+/* i386 protocol version */
+#pragma pack(push, 4)
@@ -28701,13 +28698,7 @@ pick them up (for reference, prefixed with the version the removal occured):
+ blkif_sector_t sector_number;/* start sector idx on disk (r/w only) */
+ struct blkif_request_segment seg[BLKIF_MAX_SEGMENTS_PER_REQUEST];
+};
-+struct blkif_x86_32_response {
-+ uint64_t id; /* copied from request */
-+ uint8_t operation; /* copied from request */
-+ int16_t status; /* BLKIF_RSP_??? */
-+};
+typedef struct blkif_x86_32_request blkif_x86_32_request_t;
-+typedef struct blkif_x86_32_response blkif_x86_32_response_t;
+#pragma pack(pop)
+
+/* x86_64 protocol version */
@@ -28719,18 +28710,15 @@ pick them up (for reference, prefixed with the version the removal occured):
+ blkif_sector_t sector_number;/* start sector idx on disk (r/w only) */
+ struct blkif_request_segment seg[BLKIF_MAX_SEGMENTS_PER_REQUEST];
+};
-+struct blkif_x86_64_response {
-+ uint64_t __attribute__((__aligned__(8))) id;
-+ uint8_t operation; /* copied from request */
-+ int16_t status; /* BLKIF_RSP_??? */
-+};
+typedef struct blkif_x86_64_request blkif_x86_64_request_t;
-+typedef struct blkif_x86_64_response blkif_x86_64_response_t;
+
+#define blkif_native_sring blkif_sring
-+DEFINE_RING_TYPES(blkif_common, struct blkif_common_request, struct blkif_common_response);
-+DEFINE_RING_TYPES(blkif_x86_32, struct blkif_x86_32_request, struct blkif_x86_32_response);
-+DEFINE_RING_TYPES(blkif_x86_64, struct blkif_x86_64_request, struct blkif_x86_64_response);
++DEFINE_RING_TYPES(blkif_common, struct blkif_common_request,
++ struct blkif_response);
++DEFINE_RING_TYPES(blkif_x86_32, struct blkif_x86_32_request,
++ struct blkif_response __attribute__((__packed__)));
++DEFINE_RING_TYPES(blkif_x86_64, struct blkif_x86_64_request,
++ struct blkif_response);
+
+union blkif_back_rings {
+ blkif_back_ring_t native;
diff --git a/patches.xen/xen3-auto-xen-drivers.diff b/patches.xen/xen3-auto-xen-drivers.diff
index d066873575..a1c6c9b0dc 100644
--- a/patches.xen/xen3-auto-xen-drivers.diff
+++ b/patches.xen/xen3-auto-xen-drivers.diff
@@ -1,4 +1,4 @@
-From http://xenbits.xen.org/linux-2.6.18-xen.hg (tip 1331:e08ba8d3bafe)
+From http://xenbits.xen.org/linux-2.6.18-xen.hg (tip 1337:615890cbff82)
Subject: xen3 xen-drivers
From: xen-devel@lists.xen.org
Patch-mainline: Never, SUSE-Xen specific
@@ -1009,7 +1009,7 @@ and in case upstream wants to take the forward porting patches:
+blkbk-y := blkback.o xenbus.o interface.o vbd.o
--- /dev/null
+++ b/drivers/xen/blkback/blkback.c
-@@ -0,0 +1,689 @@
+@@ -0,0 +1,691 @@
+/******************************************************************************
+ * arch/xen/drivers/blkif/backend/main.c
+ *
@@ -1618,33 +1618,35 @@ and in case upstream wants to take the forward porting patches:
+static void make_response(blkif_t *blkif, u64 id,
+ unsigned short op, int st)
+{
-+ blkif_response_t resp;
++ blkif_response_t *resp;
+ unsigned long flags;
+ blkif_back_rings_t *blk_rings = &blkif->blk_rings;
+ int notify;
+
-+ resp.id = id;
-+ resp.operation = op;
-+ resp.status = st;
-+
+ spin_lock_irqsave(&blkif->blk_ring_lock, flags);
+ /* Place on the response ring for the relevant domain. */
+ switch (blkif->blk_protocol) {
+ case BLKIF_PROTOCOL_NATIVE:
-+ memcpy(RING_GET_RESPONSE(&blk_rings->native, blk_rings->native.rsp_prod_pvt),
-+ &resp, sizeof(resp));
++ resp = RING_GET_RESPONSE(&blk_rings->native,
++ blk_rings->native.rsp_prod_pvt);
+ break;
+ case BLKIF_PROTOCOL_X86_32:
-+ memcpy(RING_GET_RESPONSE(&blk_rings->x86_32, blk_rings->x86_32.rsp_prod_pvt),
-+ &resp, sizeof(resp));
++ resp = RING_GET_RESPONSE(&blk_rings->x86_32,
++ blk_rings->x86_32.rsp_prod_pvt);
+ break;
+ case BLKIF_PROTOCOL_X86_64:
-+ memcpy(RING_GET_RESPONSE(&blk_rings->x86_64, blk_rings->x86_64.rsp_prod_pvt),
-+ &resp, sizeof(resp));
++ resp = RING_GET_RESPONSE(&blk_rings->x86_64,
++ blk_rings->x86_64.rsp_prod_pvt);
+ break;
+ default:
+ BUG();
++ return;
+ }
++
++ resp->id = id;
++ resp->operation = op;
++ resp->status = st;
++
+ blk_rings->common.rsp_prod_pvt++;
+ RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&blk_rings->common, notify);
+ spin_unlock_irqrestore(&blkif->blk_ring_lock, flags);
@@ -4657,7 +4659,7 @@ and in case upstream wants to take the forward porting patches:
+xenblktap-y := xenbus.o interface.o blktap.o
--- /dev/null
+++ b/drivers/xen/blktap/blktap.c
-@@ -0,0 +1,1781 @@
+@@ -0,0 +1,1780 @@
+/******************************************************************************
+ * drivers/xen/blktap/blktap.c
+ *
@@ -6338,36 +6340,35 @@ and in case upstream wants to take the forward porting patches:
+static void make_response(blkif_t *blkif, u64 id,
+ unsigned short op, int st)
+{
-+ blkif_response_t resp;
++ blkif_response_t *resp;
+ unsigned long flags;
+ blkif_back_rings_t *blk_rings = &blkif->blk_rings;
+ int notify;
+
-+ resp.id = id;
-+ resp.operation = op;
-+ resp.status = st;
-+
+ spin_lock_irqsave(&blkif->blk_ring_lock, flags);
+ /* Place on the response ring for the relevant domain. */
+ switch (blkif->blk_protocol) {
+ case BLKIF_PROTOCOL_NATIVE:
-+ memcpy(RING_GET_RESPONSE(&blk_rings->native,
-+ blk_rings->native.rsp_prod_pvt),
-+ &resp, sizeof(resp));
++ resp = RING_GET_RESPONSE(&blk_rings->native,
++ blk_rings->native.rsp_prod_pvt);
+ break;
+ case BLKIF_PROTOCOL_X86_32:
-+ memcpy(RING_GET_RESPONSE(&blk_rings->x86_32,
-+ blk_rings->x86_32.rsp_prod_pvt),
-+ &resp, sizeof(resp));
++ resp = RING_GET_RESPONSE(&blk_rings->x86_32,
++ blk_rings->x86_32.rsp_prod_pvt);
+ break;
+ case BLKIF_PROTOCOL_X86_64:
-+ memcpy(RING_GET_RESPONSE(&blk_rings->x86_64,
-+ blk_rings->x86_64.rsp_prod_pvt),
-+ &resp, sizeof(resp));
++ resp = RING_GET_RESPONSE(&blk_rings->x86_64,
++ blk_rings->x86_64.rsp_prod_pvt);
+ break;
+ default:
+ BUG();
++ return;
+ }
++
++ resp->id = id;
++ resp->operation = op;
++ resp->status = st;
++
+ blk_rings->common.rsp_prod_pvt++;
+ RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&blk_rings->common, notify);
+
@@ -15119,7 +15120,7 @@ and in case upstream wants to take the forward porting patches:
+obj-$(CONFIG_XEN_KEYBOARD) += xenkbd.o
--- /dev/null
+++ b/drivers/xen/fbfront/xenfb.c
-@@ -0,0 +1,888 @@
+@@ -0,0 +1,887 @@
+/*
+ * linux/drivers/video/xenfb.c -- Xen para-virtual frame buffer device
+ *
@@ -15929,7 +15930,6 @@ and in case upstream wants to take the forward porting patches:
+ break;
+
+ case XenbusStateInitWait:
-+ InitWait:
+ xenbus_switch_state(dev, XenbusStateConnected);
+ break;
+
@@ -15940,8 +15940,8 @@ and in case upstream wants to take the forward porting patches:
+ * get Connected twice here.
+ */
+ if (dev->state != XenbusStateConnected)
-+ goto InitWait; /* no InitWait seen yet, fudge it */
-+
++ /* no InitWait seen yet, fudge it */
++ xenbus_switch_state(dev, XenbusStateConnected);
+
+ if (xenbus_scanf(XBT_NIL, dev->otherend,
+ "feature-resize", "%d", &val) < 0)
@@ -16010,7 +16010,7 @@ and in case upstream wants to take the forward porting patches:
+MODULE_LICENSE("GPL");
--- /dev/null
+++ b/drivers/xen/fbfront/xenkbd.c
-@@ -0,0 +1,368 @@
+@@ -0,0 +1,375 @@
+/*
+ * linux/drivers/input/keyboard/xenkbd.c -- Xen para-virtual input device
+ *
@@ -16286,11 +16286,28 @@ and in case upstream wants to take the forward porting patches:
+ info->irq = -1;
+}
+
++static void xenkbd_set_connected(struct xenbus_device *dev)
++{
++ struct xenkbd_info *info = dev_get_drvdata(&dev->dev);
++ int ret, val;
++
++ ret = xenbus_scanf(XBT_NIL, info->xbdev->otherend,
++ "feature-abs-pointer", "%d", &val);
++ if (ret > 0 && val) {
++ ret = xenbus_write(XBT_NIL, info->xbdev->nodename,
++ "request-abs-pointer", "1");
++ if (ret)
++ printk(KERN_WARNING "xenkbd: can't request abs-pointer");
++ }
++
++ xenbus_switch_state(dev, XenbusStateConnected);
++}
++
+static void xenkbd_backend_changed(struct xenbus_device *dev,
+ enum xenbus_state backend_state)
+{
+ struct xenkbd_info *info = dev->dev.driver_data;
-+ int ret, val;
++ int val;
+
+ switch (backend_state) {
+ case XenbusStateInitialising:
@@ -16301,18 +16318,7 @@ and in case upstream wants to take the forward porting patches:
+ break;
+
+ case XenbusStateInitWait:
-+ InitWait:
-+ ret = xenbus_scanf(XBT_NIL, info->xbdev->otherend,
-+ "feature-abs-pointer", "%d", &val);
-+ if (ret < 0)
-+ val = 0;
-+ if (val) {
-+ ret = xenbus_write(XBT_NIL, info->xbdev->nodename,
-+ "request-abs-pointer", "1");
-+ if (ret)
-+ ; /* FIXME */
-+ }
-+ xenbus_switch_state(dev, XenbusStateConnected);
++ xenkbd_set_connected(dev);
+ break;
+
+ case XenbusStateConnected:
@@ -16322,7 +16328,8 @@ and in case upstream wants to take the forward porting patches:
+ * get Connected twice here.
+ */
+ if (dev->state != XenbusStateConnected)
-+ goto InitWait; /* no InitWait seen yet, fudge it */
++ /* No InitWait seen yet, fudge it. */
++ xenkbd_set_connected(dev);
+
+ /* Set input abs params to match backend screen res */
+ if (xenbus_scanf(XBT_NIL, info->xbdev->otherend,
diff --git a/patches.xen/xen3-auto-xen-kconfig.diff b/patches.xen/xen3-auto-xen-kconfig.diff
index 3db1a7d69e..6355575407 100644
--- a/patches.xen/xen3-auto-xen-kconfig.diff
+++ b/patches.xen/xen3-auto-xen-kconfig.diff
@@ -1,4 +1,4 @@
-From http://xenbits.xen.org/linux-2.6.18-xen.hg (tip 1331:e08ba8d3bafe)
+From http://xenbits.xen.org/linux-2.6.18-xen.hg (tip 1337:615890cbff82)
Subject: xen3 xen-kconfig
From: xen-devel@lists.xen.org
Patch-mainline: Never, SUSE-Xen specific
@@ -7,7 +7,7 @@ Acked-by: jbeulich@suse.com
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -304,6 +304,16 @@ config X86_64_SMP
+@@ -315,6 +315,16 @@ config X86_64_SMP
def_bool y
depends on X86_64 && SMP
@@ -24,7 +24,7 @@ Acked-by: jbeulich@suse.com
config X86_32_LAZY_GS
def_bool y
depends on X86_32 && !CC_STACKPROTECTOR
-@@ -404,6 +414,15 @@ config X86_MPPARSE
+@@ -415,6 +425,15 @@ config X86_MPPARSE
For old smp systems that do not have proper acpi support. Newer systems
(esp with 64bit cpus) with acpi support, MADT and DSDT will override it
@@ -40,7 +40,7 @@ Acked-by: jbeulich@suse.com
config X86_BIGSMP
bool "Support for big SMP systems with more than 8 CPUs"
depends on X86_32 && SMP
-@@ -449,6 +468,13 @@ config X86_EXTENDED_PLATFORM
+@@ -460,6 +479,13 @@ config X86_EXTENDED_PLATFORM
generic distribution kernel, say Y here - otherwise say N.
endif
@@ -54,7 +54,7 @@ Acked-by: jbeulich@suse.com
if X86_64
config X86_EXTENDED_PLATFORM
bool "Support for extended (non-PC) x86 platforms"
-@@ -794,6 +820,7 @@ source "arch/x86/Kconfig.cpu"
+@@ -805,6 +831,7 @@ source "arch/x86/Kconfig.cpu"
config HPET_TIMER
def_bool X86_64
prompt "HPET Timer Support" if X86_32
@@ -62,7 +62,7 @@ Acked-by: jbeulich@suse.com
---help---
Use the IA-PC HPET (High Precision Event Timer) to manage
time in preference to the PIT and RTC, if a HPET is
-@@ -841,7 +868,7 @@ config DMI
+@@ -852,7 +879,7 @@ config DMI
config GART_IOMMU
bool "Old AMD GART IOMMU support"
select SWIOTLB
@@ -71,7 +71,7 @@ Acked-by: jbeulich@suse.com
---help---
Provides a driver for older AMD Athlon64/Opteron/Turion/Sempron
GART based hardware IOMMUs.
-@@ -862,7 +889,7 @@ config GART_IOMMU
+@@ -873,7 +900,7 @@ config GART_IOMMU
config CALGARY_IOMMU
bool "IBM Calgary IOMMU support"
select SWIOTLB
@@ -80,7 +80,7 @@ Acked-by: jbeulich@suse.com
---help---
Support for hardware IOMMUs in IBM's xSeries x366 and x460
systems. Needed to run systems with more than 3GB of memory
-@@ -918,6 +945,7 @@ config NR_CPUS
+@@ -929,6 +956,7 @@ config NR_CPUS
default "1" if !SMP
default "8192" if MAXSMP
default "32" if SMP && X86_BIGSMP
@@ -88,7 +88,7 @@ Acked-by: jbeulich@suse.com
default "8" if SMP && X86_32
default "64" if SMP
---help---
-@@ -977,7 +1005,7 @@ config UP_LATE_INIT
+@@ -988,7 +1016,7 @@ config UP_LATE_INIT
config X86_UP_APIC
bool "Local APIC support on uniprocessors" if !PCI_MSI
default PCI_MSI
@@ -97,7 +97,7 @@ Acked-by: jbeulich@suse.com
---help---
A local APIC (Advanced Programmable Interrupt Controller) is an
integrated interrupt controller in the CPU. If you have a single-CPU
-@@ -1003,12 +1031,19 @@ config X86_UP_IOAPIC
+@@ -1014,12 +1042,19 @@ config X86_UP_IOAPIC
config X86_LOCAL_APIC
def_bool y
depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_APIC || PCI_MSI
@@ -117,7 +117,7 @@ Acked-by: jbeulich@suse.com
config X86_REROUTE_FOR_BROKEN_BOOT_IRQS
bool "Reroute for broken boot IRQs"
-@@ -1037,6 +1072,7 @@ config X86_MCE
+@@ -1048,6 +1083,7 @@ config X86_MCE
bool "Machine Check / overheating reporting"
select GENERIC_ALLOCATOR
default y
@@ -125,7 +125,7 @@ Acked-by: jbeulich@suse.com
---help---
Machine Check support allows the processor to notify the
kernel if it detects a problem (e.g. overheating, data corruption).
-@@ -1046,7 +1082,7 @@ config X86_MCE
+@@ -1065,7 +1101,7 @@ config X86_MCELOG_LEGACY
config X86_MCE_INTEL
def_bool y
prompt "Intel MCE features"
@@ -134,7 +134,7 @@ Acked-by: jbeulich@suse.com
---help---
Additional support for intel specific MCE features such as
the thermal monitor.
-@@ -1054,7 +1090,7 @@ config X86_MCE_INTEL
+@@ -1073,7 +1109,7 @@ config X86_MCE_INTEL
config X86_MCE_AMD
def_bool y
prompt "AMD MCE features"
@@ -143,7 +143,7 @@ Acked-by: jbeulich@suse.com
---help---
Additional support for AMD specific MCE features such as
the DRAM Error Threshold.
-@@ -1079,6 +1115,10 @@ config X86_MCE_INJECT
+@@ -1098,6 +1134,10 @@ config X86_MCE_INJECT
If you don't know what a machine check is and you don't do kernel
QA it is safe to say n.
@@ -154,7 +154,7 @@ Acked-by: jbeulich@suse.com
config X86_THERMAL_VECTOR
def_bool y
depends on X86_MCE_INTEL
-@@ -1187,7 +1227,7 @@ config I8K
+@@ -1206,7 +1246,7 @@ config I8K
config X86_REBOOTFIXUPS
bool "Enable X86 board specific fixups for reboot"
@@ -163,7 +163,7 @@ Acked-by: jbeulich@suse.com
---help---
This enables chipset and/or board specific fixups to be done
in order to get reboot to work correctly. This is only needed on
-@@ -1206,6 +1246,7 @@ config MICROCODE
+@@ -1225,6 +1265,7 @@ config MICROCODE
bool "CPU microcode loading support"
default y
depends on CPU_SUP_AMD || CPU_SUP_INTEL
@@ -171,7 +171,7 @@ Acked-by: jbeulich@suse.com
select FW_LOADER
---help---
If you say Y here, you will be able to update the microcode on
-@@ -1400,7 +1441,7 @@ config X86_DIRECT_GBPAGES
+@@ -1419,7 +1460,7 @@ config X86_DIRECT_GBPAGES
# Common NUMA Features
config NUMA
bool "Numa Memory Allocation and Scheduler Support"
@@ -180,7 +180,7 @@ Acked-by: jbeulich@suse.com
depends on X86_64 || (X86_32 && HIGHMEM64G && X86_BIGSMP)
default y if X86_BIGSMP
---help---
-@@ -1488,6 +1529,7 @@ config ARCH_DISCONTIGMEM_DEFAULT
+@@ -1507,6 +1548,7 @@ config ARCH_DISCONTIGMEM_DEFAULT
config ARCH_SPARSEMEM_ENABLE
def_bool y
depends on X86_64 || NUMA || X86_32 || X86_32_NON_STANDARD
@@ -188,7 +188,7 @@ Acked-by: jbeulich@suse.com
select SPARSEMEM_STATIC if X86_32
select SPARSEMEM_VMEMMAP_ENABLE if X86_64
-@@ -1607,6 +1649,7 @@ config MATH_EMULATION
+@@ -1626,6 +1668,7 @@ config MATH_EMULATION
bool
depends on MODIFY_LDT_SYSCALL
prompt "Math emulation" if X86_32
@@ -196,7 +196,7 @@ Acked-by: jbeulich@suse.com
---help---
Linux can emulate a math coprocessor (used for floating point
operations) if you don't have one. 486DX and Pentium processors have
-@@ -1633,6 +1676,7 @@ config MATH_EMULATION
+@@ -1652,6 +1695,7 @@ config MATH_EMULATION
config MTRR
def_bool y
prompt "MTRR (Memory Type Range Register) support" if EXPERT
@@ -204,7 +204,7 @@ Acked-by: jbeulich@suse.com
---help---
On Intel P6 family processors (Pentium Pro, Pentium II and later)
the Memory Type Range Registers (MTRRs) may be used to control
-@@ -1779,7 +1823,7 @@ config X86_INTEL_MEMORY_PROTECTION_KEYS
+@@ -1798,7 +1842,7 @@ config X86_INTEL_MEMORY_PROTECTION_KEYS
config EFI
bool "EFI runtime service support"
@@ -213,7 +213,7 @@ Acked-by: jbeulich@suse.com
select UCS2_STRING
select EFI_RUNTIME_WRAPPERS
---help---
-@@ -1837,6 +1881,7 @@ source kernel/Kconfig.hz
+@@ -1856,6 +1900,7 @@ source kernel/Kconfig.hz
config KEXEC
bool "kexec system call"
@@ -221,7 +221,7 @@ Acked-by: jbeulich@suse.com
select KEXEC_CORE
---help---
kexec is a system call that implements the ability to shutdown your
-@@ -1887,6 +1932,7 @@ config KEXEC_BZIMAGE_VERIFY_SIG
+@@ -1906,6 +1951,7 @@ config KEXEC_BZIMAGE_VERIFY_SIG
config CRASH_DUMP
bool "kernel crash dumps"
depends on X86_64 || (X86_32 && HIGHMEM)
@@ -229,7 +229,7 @@ Acked-by: jbeulich@suse.com
---help---
Generate crash dump after being started by kexec.
This should be normally only set in special crash dump kernels
-@@ -2120,6 +2166,7 @@ config COMPAT_VDSO
+@@ -2139,6 +2185,7 @@ config COMPAT_VDSO
def_bool n
prompt "Disable the 32-bit vDSO (needed for glibc 2.3.3)"
depends on COMPAT_32
@@ -237,7 +237,7 @@ Acked-by: jbeulich@suse.com
---help---
Certain buggy versions of glibc will crash if they are
presented with a 32-bit vDSO that is not mapped at the address
-@@ -2274,6 +2321,7 @@ config ARCH_ENABLE_HUGEPAGE_MIGRATION
+@@ -2293,6 +2340,7 @@ config ARCH_ENABLE_HUGEPAGE_MIGRATION
depends on X86_64 && HUGETLB_PAGE && MIGRATION
menu "Power management and ACPI options"
@@ -245,7 +245,7 @@ Acked-by: jbeulich@suse.com
config ARCH_HIBERNATION_HEADER
def_bool y
-@@ -2291,7 +2339,7 @@ config X86_APM_BOOT
+@@ -2310,7 +2358,7 @@ config X86_APM_BOOT
menuconfig APM
tristate "APM (Advanced Power Management) BIOS support"
@@ -254,7 +254,7 @@ Acked-by: jbeulich@suse.com
---help---
APM is a BIOS specification for saving power using several different
techniques. This is mostly useful for battery powered laptops with
-@@ -2452,6 +2500,7 @@ choice
+@@ -2471,6 +2519,7 @@ choice
config PCI_GOBIOS
bool "BIOS"
@@ -262,7 +262,7 @@ Acked-by: jbeulich@suse.com
config PCI_GOMMCONFIG
bool "MMConfig"
-@@ -2463,6 +2512,13 @@ config PCI_GOOLPC
+@@ -2482,6 +2531,13 @@ config PCI_GOOLPC
bool "OLPC XO-1"
depends on OLPC
@@ -276,7 +276,7 @@ Acked-by: jbeulich@suse.com
config PCI_GOANY
bool "Any"
-@@ -2470,7 +2526,7 @@ endchoice
+@@ -2489,7 +2545,7 @@ endchoice
config PCI_BIOS
def_bool y
@@ -285,7 +285,7 @@ Acked-by: jbeulich@suse.com
# x86-64 doesn't support PCI BIOS access from long mode so always go direct.
config PCI_DIRECT
-@@ -2511,6 +2567,22 @@ config PCI_CNB20LE_QUIRK
+@@ -2530,6 +2586,22 @@ config PCI_CNB20LE_QUIRK
You should say N unless you know you need this.
@@ -308,7 +308,7 @@ Acked-by: jbeulich@suse.com
source "drivers/pci/Kconfig"
config ISA_BUS
-@@ -2534,6 +2606,7 @@ if X86_32
+@@ -2553,6 +2625,7 @@ if X86_32
config ISA
bool "ISA support"
@@ -316,7 +316,7 @@ Acked-by: jbeulich@suse.com
---help---
Find out whether you have ISA slots on your motherboard. ISA is the
name of a bus system, i.e. the way the CPU talks to the other stuff
-@@ -2791,7 +2864,9 @@ source "net/Kconfig"
+@@ -2809,7 +2882,9 @@ source "net/Kconfig"
source "drivers/Kconfig"
@@ -326,7 +326,7 @@ Acked-by: jbeulich@suse.com
source "fs/Kconfig"
-@@ -2803,4 +2878,6 @@ source "crypto/Kconfig"
+@@ -2821,4 +2896,6 @@ source "crypto/Kconfig"
source "arch/x86/kvm/Kconfig"
@@ -354,7 +354,7 @@ Acked-by: jbeulich@suse.com
def_bool y
--- a/arch/x86/Kconfig.debug
+++ b/arch/x86/Kconfig.debug
-@@ -104,6 +104,7 @@ config DEBUG_WX
+@@ -127,6 +127,7 @@ config DEBUG_WX
config DOUBLEFAULT
default y
bool "Enable doublefault exception handler" if EXPERT
@@ -372,7 +372,7 @@ Acked-by: jbeulich@suse.com
default y
help
The Power Management Timer is available on all ACPI-capable,
-@@ -526,6 +527,16 @@ config ACPI_CONFIGFS
+@@ -531,6 +532,16 @@ config ACPI_CONFIGFS
userspace. The configurable ACPI groups will be visible under
/config/acpi, assuming configfs is mounted under /config.
@@ -391,7 +391,7 @@ Acked-by: jbeulich@suse.com
endif
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
-@@ -506,7 +506,7 @@ config MAX_RAW_DEVS
+@@ -508,7 +508,7 @@ config MAX_RAW_DEVS
config HPET
bool "HPET - High Precision Event Timer" if (X86 || IA64)
default n
@@ -402,7 +402,7 @@ Acked-by: jbeulich@suse.com
open selects one of the timers supported by the HPET. The timers are
--- a/drivers/char/tpm/Kconfig
+++ b/drivers/char/tpm/Kconfig
-@@ -133,6 +133,15 @@ config TCG_XEN
+@@ -134,6 +134,15 @@ config TCG_XEN
To compile this driver as a module, choose M here; the module
will be called xen-tpmfront.
@@ -417,7 +417,7 @@ Acked-by: jbeulich@suse.com
+
config TCG_CRB
tristate "TPM 2.0 CRB Interface"
- depends on X86 && ACPI
+ depends on ACPI
--- a/drivers/cpufreq/Kconfig
+++ b/drivers/cpufreq/Kconfig
@@ -2,6 +2,7 @@ menu "CPU Frequency scaling"
@@ -440,7 +440,7 @@ Acked-by: jbeulich@suse.com
This selects whether you want to include the driver for the standard
--- a/drivers/xen/Kconfig
+++ b/drivers/xen/Kconfig
-@@ -1,8 +1,413 @@
+@@ -1,8 +1,417 @@
+#
+# This Kconfig describe xen options
+#
@@ -453,7 +453,7 @@ Acked-by: jbeulich@suse.com
+if XEN
+config XEN_INTERFACE_VERSION
+ hex
-+ default 0x00040800
++ default 0x00040900
+
+menu "XEN"
+
@@ -777,6 +777,9 @@ Acked-by: jbeulich@suse.com
+ config XEN_COMPAT_040800_AND_LATER
+ bool "4.8.0 and later"
+
++ config XEN_COMPAT_040900_AND_LATER
++ bool "4.9.0 and later"
++
+ config XEN_COMPAT_LATEST_ONLY
+ bool "no compatibility code"
+endchoice
@@ -808,6 +811,7 @@ Acked-by: jbeulich@suse.com
+config XEN_COMPAT
+ hex
+ default 0xffffff if XEN_COMPAT_LATEST_ONLY
++ default 0x040900 if XEN_COMPAT_040900_AND_LATER
+ default 0x040800 if XEN_COMPAT_040800_AND_LATER
+ default 0x040700 if XEN_COMPAT_040700_AND_LATER
+ default 0x040600 if XEN_COMPAT_040600_AND_LATER
@@ -856,7 +860,7 @@ Acked-by: jbeulich@suse.com
default y
help
The balloon driver allows the Xen domain to request more memory from
-@@ -80,14 +485,16 @@ config XEN_BALLOON_MEMORY_HOTPLUG_LIMIT
+@@ -80,14 +489,16 @@ config XEN_BALLOON_MEMORY_HOTPLUG_LIMIT
tables needed for physical memory administration.
config XEN_SCRUB_PAGES
diff --git a/patches.xen/xen3-fixup-arch-x86 b/patches.xen/xen3-fixup-arch-x86
index 1a15750dfd..055ca45ff7 100644
--- a/patches.xen/xen3-fixup-arch-x86
+++ b/patches.xen/xen3-fixup-arch-x86
@@ -1,10 +1,10 @@
Subject: xen3 x86 build fixes.
From: jbeulich@novell.com
-Patch-mainline: n/a
+Patch-mainline: Never, SUSE-Xen specific
--- a/arch/x86/power/Makefile
+++ b/arch/x86/power/Makefile
-@@ -5,3 +5,5 @@ CFLAGS_cpu.o := $(nostackp)
+@@ -7,3 +7,5 @@ CFLAGS_cpu.o := $(nostackp)
obj-$(CONFIG_PM_SLEEP) += cpu.o
obj-$(CONFIG_HIBERNATION) += hibernate_$(BITS).o hibernate_asm_$(BITS).o
diff --git a/patches.xen/xen3-fixup-common b/patches.xen/xen3-fixup-common
index 8667665476..1c64441bd0 100644
--- a/patches.xen/xen3-fixup-common
+++ b/patches.xen/xen3-fixup-common
@@ -4,7 +4,7 @@ Patch-mainline: Never, SUSE-Xen specific
--- a/drivers/acpi/acpica/hwxfsleep.c
+++ b/drivers/acpi/acpica/hwxfsleep.c
-@@ -181,6 +181,7 @@ ACPI_EXPORT_SYMBOL(acpi_set_firmware_wak
+@@ -185,6 +185,7 @@ ACPI_EXPORT_SYMBOL(acpi_set_firmware_wak
* THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
*
******************************************************************************/
@@ -12,7 +12,7 @@ Patch-mainline: Never, SUSE-Xen specific
acpi_status acpi_enter_sleep_state_s4bios(void)
{
u32 in_value;
-@@ -235,6 +236,7 @@ acpi_status acpi_enter_sleep_state_s4bio
+@@ -239,6 +240,7 @@ acpi_status acpi_enter_sleep_state_s4bio
}
ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_s4bios)
@@ -96,7 +96,7 @@ Patch-mainline: Never, SUSE-Xen specific
PG_blkback, /* Page is owned by blkback */
#endif
__NR_PAGEFLAGS,
-@@ -486,9 +486,11 @@ CLEARPAGEFLAG(Uptodate, uptodate, PF_NO_
+@@ -489,9 +489,11 @@ CLEARPAGEFLAG(Uptodate, uptodate, PF_NO_
#define PageForeignDestructor(_page, order) \
((void (*)(struct page *, unsigned int))(_page)->index)(_page, order)
@@ -110,7 +110,7 @@ Patch-mainline: Never, SUSE-Xen specific
#define SetPageBlkback(page) set_bit(PG_blkback, &(page)->flags)
--- a/kernel/kexec_core.c
+++ b/kernel/kexec_core.c
-@@ -48,8 +48,10 @@
+@@ -49,8 +49,10 @@
DEFINE_MUTEX(kexec_mutex);
@@ -119,17 +119,17 @@ Patch-mainline: Never, SUSE-Xen specific
note_buf_t __percpu *crash_notes;
+#endif
- /* vmcoreinfo stuff */
- static unsigned char vmcoreinfo_data[VMCOREINFO_BYTES];
-@@ -1057,6 +1059,7 @@ static void final_note(u32 *buf)
- memcpy(buf, &note, sizeof(note));
+ /* Flag to indicate we are going to kexec a new kernel */
+ bool kexec_in_progress = false;
+@@ -1064,6 +1066,7 @@ unlock:
+ return ret;
}
+#ifndef CONFIG_XEN
void crash_save_cpu(struct pt_regs *regs, int cpu)
{
struct elf_prstatus prstatus;
-@@ -1082,9 +1085,11 @@ void crash_save_cpu(struct pt_regs *regs
+@@ -1089,9 +1092,11 @@ void crash_save_cpu(struct pt_regs *regs
&prstatus, sizeof(prstatus));
final_note(buf);
}
@@ -141,7 +141,7 @@ Patch-mainline: Never, SUSE-Xen specific
/* Allocate memory for saving cpu registers. */
size_t size, align;
-@@ -1112,6 +1117,7 @@ static int __init crash_notes_memory_ini
+@@ -1119,6 +1124,7 @@ static int __init crash_notes_memory_ini
pr_warn("Memory allocation for saving cpu register states failed\n");
return -ENOMEM;
}
diff --git a/patches.xen/xen3-fixup-kconfig b/patches.xen/xen3-fixup-kconfig
index 6925e828bc..9ca680a8d4 100644
--- a/patches.xen/xen3-fixup-kconfig
+++ b/patches.xen/xen3-fixup-kconfig
@@ -5,7 +5,7 @@ References: none
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -265,6 +265,7 @@ config NEED_PER_CPU_PAGE_FIRST_CHUNK
+@@ -275,6 +275,7 @@ config NEED_PER_CPU_PAGE_FIRST_CHUNK
config ARCH_HIBERNATION_POSSIBLE
def_bool y
diff --git a/patches.xen/xen3-fixup-xen b/patches.xen/xen3-fixup-xen
index 89bbc9e9cd..953ceef768 100644
--- a/patches.xen/xen3-fixup-xen
+++ b/patches.xen/xen3-fixup-xen
@@ -1,4 +1,4 @@
-From http://xenbits.xen.org/linux-2.6.18-xen.hg (tip 1331:e08ba8d3bafe)
+From http://xenbits.xen.org/linux-2.6.18-xen.hg (tip 1337:615890cbff82)
Subject: Fix Xen build wrt. Xen files coming from mainline.
From: xen-devel@lists.xen.org
Patch-mainline: Never, SUSE-Xen specific
@@ -7,7 +7,7 @@ Acked-by: jbeulich@suse.com
--- a/drivers/xen/Makefile
+++ b/drivers/xen/Makefile
-@@ -1,44 +1,28 @@
+@@ -1,41 +1,28 @@
-obj-$(CONFIG_HOTPLUG_CPU) += cpu_hotplug.o
-obj-$(CONFIG_X86) += fallback.o
-obj-y += grant-table.o features.o balloon.o manage.o preempt.o time.o
@@ -21,9 +21,6 @@ Acked-by: jbeulich@suse.com
-nostackp := $(call cc-option, -fno-stack-protector)
-CFLAGS_features.o := $(nostackp)
-
--CFLAGS_efi.o += -fshort-wchar
--LDFLAGS += $(call ld-option, --no-wchar-size-warning)
--
-dom0-$(CONFIG_ARM64) += arm-device.o
-dom0-$(CONFIG_PCI) += pci.o
-dom0-$(CONFIG_USB_SUPPORT) += dbgp.o
@@ -1247,7 +1244,7 @@ Acked-by: jbeulich@suse.com
if (!check_indexes(cons, prod)) {
intf->rsp_cons = intf->rsp_prod = 0;
return -EIO;
-@@ -191,298 +201,56 @@ static int xb_read(void *data, unsigned
+@@ -191,297 +201,56 @@ static int xb_read(void *data, unsigned
avail = len;
/* Must read data /after/ reading the producer index. */
@@ -1362,17 +1359,7 @@ Acked-by: jbeulich@suse.com
- mutex_lock(&xb_write_mutex);
- list_for_each_entry(req, &xs_reply_list, list) {
- if (req->msg.req_id == state.msg.req_id) {
-- if (req->state == xb_req_state_wait_reply) {
-- req->msg.type = state.msg.type;
-- req->msg.len = state.msg.len;
-- req->body = state.body;
-- req->state = xb_req_state_got_reply;
-- list_del(&req->list);
-- req->cb(req);
-- } else {
-- list_del(&req->list);
-- kfree(req);
-- }
+- list_del(&req->list);
- err = 0;
- break;
- }
@@ -1380,6 +1367,15 @@ Acked-by: jbeulich@suse.com
- mutex_unlock(&xb_write_mutex);
- if (err)
- goto out;
+-
+- if (req->state == xb_req_state_wait_reply) {
+- req->msg.type = state.msg.type;
+- req->msg.len = state.msg.len;
+- req->body = state.body;
+- req->state = xb_req_state_got_reply;
+- req->cb(req);
+- } else
+- kfree(req);
- }
-
- mutex_unlock(&xs_response_mutex);
@@ -4064,10 +4060,10 @@ Acked-by: jbeulich@suse.com
+ struct xs_stored_msg *msg;
+ current->flags |= PF_NOFREEZE;
+ xenwatch_pid = current->pid;
+
for (;;) {
- wait_event_interruptible(watch_events_waitq,
- !list_empty(&watch_events));
-@@ -872,61 +791,165 @@ static int xenwatch_thread(void *unused)
+@@ -874,60 +793,164 @@ static int xenwatch_thread(void *unused)
list_del(ent);
spin_unlock(&watch_events_lock);
@@ -4257,7 +4253,6 @@ Acked-by: jbeulich@suse.com
task = kthread_run(xenwatch_thread, NULL, "xenwatch");
if (IS_ERR(task))
return PTR_ERR(task);
- xenwatch_pid = task->pid;
+ task = kthread_run(xenbus_thread, NULL, "xenbus");
+ if (IS_ERR(task))
@@ -4268,7 +4263,7 @@ Acked-by: jbeulich@suse.com
--- a/include/xen/balloon.h
+++ b/include/xen/balloon.h
-@@ -1,37 +1,57 @@
+@@ -1,45 +1,57 @@
/******************************************************************************
- * Xen balloon functionality
+ * balloon.h
@@ -4338,6 +4333,14 @@ Acked-by: jbeulich@suse.com
- return -ENOSYS;
-}
-#endif
+-
+-#ifdef CONFIG_XEN_BALLOON
+-void xen_balloon_init(void);
+-#else
+-static inline void xen_balloon_init(void)
+-{
+-}
+-#endif
+/*
+ * Inform the balloon driver that it should allow some slop for device-driver
+ * memory activities.
@@ -4502,7 +4505,18 @@ Acked-by: jbeulich@suse.com
*
* LEGACY: PAE (n.b. The legacy interface included a provision to
* indicate 'extended-cr3' support allowing L3 page tables to be
-@@ -207,12 +214,66 @@
+@@ -166,7 +173,9 @@
+ * The (non-default) location the initial phys-to-machine map should be
+ * placed at by the hypervisor (Dom0) or the tools (DomU).
+ * The kernel must be prepared for this mapping to be established using
+- * large pages, despite such otherwise not being available to guests.
++ * large pages, despite such otherwise not being available to guests. Note
++ * that these large pages may be misaligned in PFN space (they'll obviously
++ * be aligned in MFN and virtual address spaces).
+ * The kernel must also be able to handle the page table pages used for
+ * this mapping not being accessible through the initial mapping.
+ * (Only x86-64 supports this at present.)
+@@ -207,12 +216,66 @@
*/
#define XEN_ELFNOTE_MAX XEN_ELFNOTE_PHYS32_ENTRY
@@ -5467,6 +5481,396 @@ Acked-by: jbeulich@suse.com
#define GNTTABOP_error_msgs { \
"okay", \
+--- a/include/xen/interface/hvm/dm_op.h
++++ b/include/xen/interface/hvm/dm_op.h
+@@ -23,10 +23,384 @@
+ #ifndef __XEN_PUBLIC_HVM_DM_OP_H__
+ #define __XEN_PUBLIC_HVM_DM_OP_H__
+
++#include "../xen.h"
++
++#if defined(__XEN__) || defined(__XEN_TOOLS__)
++
++#include "../event_channel.h"
++
++#ifndef uint64_aligned_t
++#define uint64_aligned_t uint64_t
++#endif
++
++/*
++ * IOREQ Servers
++ *
++ * The interface between an I/O emulator an Xen is called an IOREQ Server.
++ * A domain supports a single 'legacy' IOREQ Server which is instantiated if
++ * parameter...
++ *
++ * HVM_PARAM_IOREQ_PFN is read (to get the gmfn containing the synchronous
++ * ioreq structures), or...
++ * HVM_PARAM_BUFIOREQ_PFN is read (to get the gmfn containing the buffered
++ * ioreq ring), or...
++ * HVM_PARAM_BUFIOREQ_EVTCHN is read (to get the event channel that Xen uses
++ * to request buffered I/O emulation).
++ *
++ * The following hypercalls facilitate the creation of IOREQ Servers for
++ * 'secondary' emulators which are invoked to implement port I/O, memory, or
++ * PCI config space ranges which they explicitly register.
++ */
++
++typedef uint16_t ioservid_t;
++
++/*
++ * XEN_DMOP_create_ioreq_server: Instantiate a new IOREQ Server for a
++ * secondary emulator.
++ *
++ * The <id> handed back is unique for target domain. The valur of
++ * <handle_bufioreq> should be one of HVM_IOREQSRV_BUFIOREQ_* defined in
++ * hvm_op.h. If the value is HVM_IOREQSRV_BUFIOREQ_OFF then the buffered
++ * ioreq ring will not be allocated and hence all emulation requests to
++ * this server will be synchronous.
++ */
++#define XEN_DMOP_create_ioreq_server 1
++
++struct xen_dm_op_create_ioreq_server {
++ /* IN - should server handle buffered ioreqs */
++ uint8_t handle_bufioreq;
++ uint8_t pad[3];
++ /* OUT - server id */
++ ioservid_t id;
++};
++
++/*
++ * XEN_DMOP_get_ioreq_server_info: Get all the information necessary to
++ * access IOREQ Server <id>.
++ *
++ * The emulator needs to map the synchronous ioreq structures and buffered
++ * ioreq ring (if it exists) that Xen uses to request emulation. These are
++ * hosted in the target domain's gmfns <ioreq_pfn> and <bufioreq_pfn>
++ * respectively. In addition, if the IOREQ Server is handling buffered
++ * emulation requests, the emulator needs to bind to event channel
++ * <bufioreq_port> to listen for them. (The event channels used for
++ * synchronous emulation requests are specified in the per-CPU ioreq
++ * structures in <ioreq_pfn>).
++ * If the IOREQ Server is not handling buffered emulation requests then the
++ * values handed back in <bufioreq_pfn> and <bufioreq_port> will both be 0.
++ */
++#define XEN_DMOP_get_ioreq_server_info 2
++
++struct xen_dm_op_get_ioreq_server_info {
++ /* IN - server id */
++ ioservid_t id;
++ uint16_t pad;
++ /* OUT - buffered ioreq port */
++ evtchn_port_t bufioreq_port;
++ /* OUT - sync ioreq pfn */
++ uint64_aligned_t ioreq_pfn;
++ /* OUT - buffered ioreq pfn */
++ uint64_aligned_t bufioreq_pfn;
++};
++
++/*
++ * XEN_DMOP_map_io_range_to_ioreq_server: Register an I/O range for
++ * emulation by the client of
++ * IOREQ Server <id>.
++ * XEN_DMOP_unmap_io_range_from_ioreq_server: Deregister an I/O range
++ * previously registered for
++ * emulation by the client of
++ * IOREQ Server <id>.
++ *
++ * There are three types of I/O that can be emulated: port I/O, memory
++ * accesses and PCI config space accesses. The <type> field denotes which
++ * type of range* the <start> and <end> (inclusive) fields are specifying.
++ * PCI config space ranges are specified by segment/bus/device/function
++ * values which should be encoded using the DMOP_PCI_SBDF helper macro
++ * below.
++ *
++ * NOTE: unless an emulation request falls entirely within a range mapped
++ * by a secondary emulator, it will not be passed to that emulator.
++ */
++#define XEN_DMOP_map_io_range_to_ioreq_server 3
++#define XEN_DMOP_unmap_io_range_from_ioreq_server 4
++
++struct xen_dm_op_ioreq_server_range {
++ /* IN - server id */
++ ioservid_t id;
++ uint16_t pad;
++ /* IN - type of range */
++ uint32_t type;
++# define XEN_DMOP_IO_RANGE_PORT 0 /* I/O port range */
++# define XEN_DMOP_IO_RANGE_MEMORY 1 /* MMIO range */
++# define XEN_DMOP_IO_RANGE_PCI 2 /* PCI segment/bus/dev/func range */
++ /* IN - inclusive start and end of range */
++ uint64_aligned_t start, end;
++};
++
++#define XEN_DMOP_PCI_SBDF(s,b,d,f) \
++ ((((s) & 0xffff) << 16) | \
++ (((b) & 0xff) << 8) | \
++ (((d) & 0x1f) << 3) | \
++ ((f) & 0x07))
++
++/*
++ * XEN_DMOP_set_ioreq_server_state: Enable or disable the IOREQ Server <id>
++ *
++ * The IOREQ Server will not be passed any emulation requests until it is
++ * in the enabled state.
++ * Note that the contents of the ioreq_pfn and bufioreq_fn (see
++ * XEN_DMOP_get_ioreq_server_info) are not meaningful until the IOREQ Server
++ * is in the enabled state.
++ */
++#define XEN_DMOP_set_ioreq_server_state 5
++
++struct xen_dm_op_set_ioreq_server_state {
++ /* IN - server id */
++ ioservid_t id;
++ /* IN - enabled? */
++ uint8_t enabled;
++ uint8_t pad;
++};
++
++/*
++ * XEN_DMOP_destroy_ioreq_server: Destroy the IOREQ Server <id>.
++ *
++ * Any registered I/O ranges will be automatically deregistered.
++ */
++#define XEN_DMOP_destroy_ioreq_server 6
++
++struct xen_dm_op_destroy_ioreq_server {
++ /* IN - server id */
++ ioservid_t id;
++ uint16_t pad;
++};
++
++/*
++ * XEN_DMOP_track_dirty_vram: Track modifications to the specified pfn
++ * range.
++ *
++ * NOTE: The bitmap passed back to the caller is passed in a
++ * secondary buffer.
++ */
++#define XEN_DMOP_track_dirty_vram 7
++
++struct xen_dm_op_track_dirty_vram {
++ /* IN - number of pages to be tracked */
++ uint32_t nr;
++ uint32_t pad;
++ /* IN - first pfn to track */
++ uint64_aligned_t first_pfn;
++};
++
++/*
++ * XEN_DMOP_set_pci_intx_level: Set the logical level of one of a domain's
++ * PCI INTx pins.
++ */
++#define XEN_DMOP_set_pci_intx_level 8
++
++struct xen_dm_op_set_pci_intx_level {
++ /* IN - PCI INTx identification (domain:bus:device:intx) */
++ uint16_t domain;
++ uint8_t bus, device, intx;
++ /* IN - Level: 0 -> deasserted, 1 -> asserted */
++ uint8_t level;
++};
++
++/*
++ * XEN_DMOP_set_isa_irq_level: Set the logical level of a one of a domain's
++ * ISA IRQ lines.
++ */
++#define XEN_DMOP_set_isa_irq_level 9
++
++struct xen_dm_op_set_isa_irq_level {
++ /* IN - ISA IRQ (0-15) */
++ uint8_t isa_irq;
++ /* IN - Level: 0 -> deasserted, 1 -> asserted */
++ uint8_t level;
++};
++
++/*
++ * XEN_DMOP_set_pci_link_route: Map a PCI INTx line to an IRQ line.
++ */
++#define XEN_DMOP_set_pci_link_route 10
++
++struct xen_dm_op_set_pci_link_route {
++ /* PCI INTx line (0-3) */
++ uint8_t link;
++ /* ISA IRQ (1-15) or 0 -> disable link */
++ uint8_t isa_irq;
++};
++
++/*
++ * XEN_DMOP_modified_memory: Notify that a set of pages were modified by
++ * an emulator.
++ *
++ * DMOP buf 1 contains an array of xen_dm_op_modified_memory_extent with
++ * @nr_extents entries.
++ *
++ * On error, @nr_extents will contain the index+1 of the extent that
++ * had the error. It is not defined if or which pages may have been
++ * marked as dirty, in this event.
++ */
++#define XEN_DMOP_modified_memory 11
++
++struct xen_dm_op_modified_memory {
++ /*
++ * IN - Number of extents to be processed
++ * OUT -returns n+1 for failing extent
++ */
++ uint32_t nr_extents;
++ /* IN/OUT - Must be set to 0 */
++ uint32_t opaque;
++};
++
++struct xen_dm_op_modified_memory_extent {
++ /* IN - number of contiguous pages modified */
++ uint32_t nr;
++ uint32_t pad;
++ /* IN - first pfn modified */
++ uint64_aligned_t first_pfn;
++};
++
++/*
++ * XEN_DMOP_set_mem_type: Notify that a region of memory is to be treated
++ * in a specific way. (See definition of
++ * hvmmem_type_t).
++ *
++ * NOTE: In the event of a continuation (return code -ERESTART), the
++ * @first_pfn is set to the value of the pfn of the remaining
++ * region and @nr reduced to the size of the remaining region.
++ */
++#define XEN_DMOP_set_mem_type 12
++
++struct xen_dm_op_set_mem_type {
++ /* IN - number of contiguous pages */
++ uint32_t nr;
++ /* IN - new hvmmem_type_t of region */
++ uint16_t mem_type;
++ uint16_t pad;
++ /* IN - first pfn in region */
++ uint64_aligned_t first_pfn;
++};
++
++/*
++ * XEN_DMOP_inject_event: Inject an event into a VCPU, which will
++ * get taken up when it is next scheduled.
++ *
++ * Note that the caller should know enough of the state of the CPU before
++ * injecting, to know what the effect of injecting the event will be.
++ */
++#define XEN_DMOP_inject_event 13
++
++struct xen_dm_op_inject_event {
++ /* IN - index of vCPU */
++ uint32_t vcpuid;
++ /* IN - interrupt vector */
++ uint8_t vector;
++ /* IN - event type (DMOP_EVENT_* ) */
++ uint8_t type;
++/* NB. This enumeration precisely matches hvm.h:X86_EVENTTYPE_* */
++# define XEN_DMOP_EVENT_ext_int 0 /* external interrupt */
++# define XEN_DMOP_EVENT_nmi 2 /* nmi */
++# define XEN_DMOP_EVENT_hw_exc 3 /* hardware exception */
++# define XEN_DMOP_EVENT_sw_int 4 /* software interrupt (CD nn) */
++# define XEN_DMOP_EVENT_pri_sw_exc 5 /* ICEBP (F1) */
++# define XEN_DMOP_EVENT_sw_exc 6 /* INT3 (CC), INTO (CE) */
++ /* IN - instruction length */
++ uint8_t insn_len;
++ uint8_t pad0;
++ /* IN - error code (or ~0 to skip) */
++ uint32_t error_code;
++ uint32_t pad1;
++ /* IN - CR2 for page faults */
++ uint64_aligned_t cr2;
++};
++
++/*
++ * XEN_DMOP_inject_msi: Inject an MSI for an emulated device.
++ */
++#define XEN_DMOP_inject_msi 14
++
++struct xen_dm_op_inject_msi {
++ /* IN - MSI data (lower 32 bits) */
++ uint32_t data;
++ uint32_t pad;
++ /* IN - MSI address (0xfeexxxxx) */
++ uint64_aligned_t addr;
++};
++
++/*
++ * XEN_DMOP_map_mem_type_to_ioreq_server : map or unmap the IOREQ Server <id>
++ * to specific memory type <type>
++ * for specific accesses <flags>
++ *
++ * For now, flags only accept the value of XEN_DMOP_IOREQ_MEM_ACCESS_WRITE,
++ * which means only write operations are to be forwarded to an ioreq server.
++ * Support for the emulation of read operations can be added when an ioreq
++ * server has such requirement in future.
++ */
++#define XEN_DMOP_map_mem_type_to_ioreq_server 15
++
++struct xen_dm_op_map_mem_type_to_ioreq_server {
++ ioservid_t id; /* IN - ioreq server id */
++ uint16_t type; /* IN - memory type */
++ uint32_t flags; /* IN - types of accesses to be forwarded to the
++ ioreq server. flags with 0 means to unmap the
++ ioreq server */
++
++#define XEN_DMOP_IOREQ_MEM_ACCESS_READ (1u << 0)
++#define XEN_DMOP_IOREQ_MEM_ACCESS_WRITE (1u << 1)
++
++ uint64_t opaque; /* IN/OUT - only used for hypercall continuation,
++ has to be set to zero by the caller */
++};
++
++struct xen_dm_op {
++ uint32_t op;
++ uint32_t pad;
++ union {
++ struct xen_dm_op_create_ioreq_server create_ioreq_server;
++ struct xen_dm_op_get_ioreq_server_info get_ioreq_server_info;
++ struct xen_dm_op_ioreq_server_range map_io_range_to_ioreq_server;
++ struct xen_dm_op_ioreq_server_range unmap_io_range_from_ioreq_server;
++ struct xen_dm_op_set_ioreq_server_state set_ioreq_server_state;
++ struct xen_dm_op_destroy_ioreq_server destroy_ioreq_server;
++ struct xen_dm_op_track_dirty_vram track_dirty_vram;
++ struct xen_dm_op_set_pci_intx_level set_pci_intx_level;
++ struct xen_dm_op_set_isa_irq_level set_isa_irq_level;
++ struct xen_dm_op_set_pci_link_route set_pci_link_route;
++ struct xen_dm_op_modified_memory modified_memory;
++ struct xen_dm_op_set_mem_type set_mem_type;
++ struct xen_dm_op_inject_event inject_event;
++ struct xen_dm_op_inject_msi inject_msi;
++ struct xen_dm_op_map_mem_type_to_ioreq_server
++ map_mem_type_to_ioreq_server;
++ } u;
++};
++
++#endif /* __XEN__ || __XEN_TOOLS__ */
++
+ struct xen_dm_op_buf {
+- GUEST_HANDLE(void) h;
+- xen_ulong_t size;
++ XEN_GUEST_HANDLE(void) h;
++ xen_ulong_t size;
+ };
+-DEFINE_GUEST_HANDLE_STRUCT(xen_dm_op_buf);
++typedef struct xen_dm_op_buf xen_dm_op_buf_t;
++DEFINE_XEN_GUEST_HANDLE(xen_dm_op_buf_t);
++
++/* ` enum neg_errnoval
++ * ` HYPERVISOR_dm_op(domid_t domid,
++ * ` unsigned int nr_bufs,
++ * ` xen_dm_op_buf_t bufs[])
++ * `
++ *
++ * @domid is the domain the hypercall operates on.
++ * @nr_bufs is the number of buffers in the @bufs array.
++ * @bufs points to an array of buffers where @bufs[0] contains a struct
++ * xen_dm_op, describing the specific device model operation and its
++ * parameters.
++ * @bufs[1..] may be referenced in the parameters for the purposes of
++ * passing extra information to or from the domain.
++ */
+
+ #endif /* __XEN_PUBLIC_HVM_DM_OP_H__ */
--- a/include/xen/interface/hvm/hvm_op.h
+++ b/include/xen/interface/hvm/hvm_op.h
@@ -16,11 +16,17 @@
@@ -5487,7 +5891,7 @@ Acked-by: jbeulich@suse.com
/* Get/set subcommands: the second argument of the hypercall is a
* pointer to a xen_hvm_param struct. */
#define HVMOP_set_param 0
-@@ -30,24 +36,182 @@ struct xen_hvm_param {
+@@ -30,24 +36,111 @@ struct xen_hvm_param {
uint32_t index; /* IN */
uint64_t value; /* IN/OUT */
};
@@ -5495,6 +5899,8 @@ Acked-by: jbeulich@suse.com
+typedef struct xen_hvm_param xen_hvm_param_t;
+DEFINE_XEN_GUEST_HANDLE(xen_hvm_param_t);
+
++#if __XEN_INTERFACE_VERSION__ < 0x00040900
++
+/* Set the logical level of one of a domain's PCI INTx wires. */
+#define HVMOP_set_pci_intx_level 2
+struct xen_hvm_set_pci_intx_level {
@@ -5533,6 +5939,8 @@ Acked-by: jbeulich@suse.com
+typedef struct xen_hvm_set_pci_link_route xen_hvm_set_pci_link_route_t;
+DEFINE_XEN_GUEST_HANDLE(xen_hvm_set_pci_link_route_t);
+
++#endif /* __XEN_INTERFACE_VERSION__ < 0x00040900 */
++
+/* Flushes all VCPU TLBs: @arg must be NULL. */
+#define HVMOP_flush_tlbs 5
+
@@ -5546,57 +5954,14 @@ Acked-by: jbeulich@suse.com
+ HVMMEM_unused, /* Placeholder; setting memory to this type
+ will fail for code after 4.7.0 */
+#endif
-+ HVMMEM_ioreq_server
++ HVMMEM_ioreq_server /* Memory type claimed by an ioreq server; type
++ changes to this value are only allowed after
++ an ioreq server has claimed its ownership.
++ Only pages with HVMMEM_ram_rw are allowed to
++ change to this type; conversely, pages with
++ this type are only allowed to be changed back
++ to HVMMEM_ram_rw. */
+} hvmmem_type_t;
-+
-+/* Following tools-only interfaces may change in future. */
-+#if defined(__XEN__) || defined(__XEN_TOOLS__)
-+
-+/* Track dirty VRAM. */
-+#define HVMOP_track_dirty_vram 6
-+struct xen_hvm_track_dirty_vram {
-+ /* Domain to be tracked. */
-+ domid_t domid;
-+ /* Number of pages to track. */
-+ uint32_t nr;
-+ /* First pfn to track. */
-+ uint64_aligned_t first_pfn;
-+ /* OUT variable. */
-+ /* Dirty bitmap buffer. */
-+ XEN_GUEST_HANDLE_64(uint8) dirty_bitmap;
-+};
-+typedef struct xen_hvm_track_dirty_vram xen_hvm_track_dirty_vram_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_hvm_track_dirty_vram_t);
-+
-+/* Notify that some pages got modified by the Device Model. */
-+#define HVMOP_modified_memory 7
-+struct xen_hvm_modified_memory {
-+ /* Domain to be updated. */
-+ domid_t domid;
-+ /* Number of pages. */
-+ uint32_t nr;
-+ /* First pfn. */
-+ uint64_aligned_t first_pfn;
-+};
-+typedef struct xen_hvm_modified_memory xen_hvm_modified_memory_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_hvm_modified_memory_t);
-+
-+#define HVMOP_set_mem_type 8
-+/* Notify that a region of memory is to be treated in a specific way. */
-+struct xen_hvm_set_mem_type {
-+ /* Domain to be updated. */
-+ domid_t domid;
-+ /* Memory type */
-+ uint16_t hvmmem_type;
-+ /* Number of pages. */
-+ uint32_t nr;
-+ /* First pfn. */
-+ uint64_aligned_t first_pfn;
-+};
-+typedef struct xen_hvm_set_mem_type xen_hvm_set_mem_type_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_hvm_set_mem_type_t);
-+
-+#endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
/* Hint from PV drivers for pagetable destruction. */
#define HVMOP_pagetable_dying 9
@@ -5621,7 +5986,7 @@ Acked-by: jbeulich@suse.com
+#define HVMOP_get_time 10
+struct xen_hvm_get_time {
+ uint64_t now; /* OUT */
-+};
+ };
+typedef struct xen_hvm_get_time xen_hvm_get_time_t;
+DEFINE_XEN_GUEST_HANDLE(xen_hvm_get_time_t);
+
@@ -5629,7 +5994,7 @@ Acked-by: jbeulich@suse.com
+struct xen_hvm_xentrace {
+ uint16_t event, extra_bytes;
+ uint8_t extra[TRACE_EXTRA_MAX * sizeof(uint32_t)];
- };
++};
+typedef struct xen_hvm_xentrace xen_hvm_xentrace_t;
+DEFINE_XEN_GUEST_HANDLE(xen_hvm_xentrace_t);
+
@@ -5642,43 +6007,11 @@ Acked-by: jbeulich@suse.com
+/* Deprecated by XENMEM_access_op_get_access */
+#define HVMOP_get_mem_access 13
+
-+#define HVMOP_inject_trap 14
-+/* Inject a trap into a VCPU, which will get taken up on the next
-+ * scheduling of it. Note that the caller should know enough of the
-+ * state of the CPU before injecting, to know what the effect of
-+ * injecting the trap will be.
-+ */
-+struct xen_hvm_inject_trap {
-+ /* Domain to be queried. */
-+ domid_t domid;
-+ /* VCPU */
-+ uint32_t vcpuid;
-+ /* Vector number */
-+ uint32_t vector;
-+ /* Trap type (HVMOP_TRAP_*) */
-+ uint32_t type;
-+/* NB. This enumeration precisely matches hvm.h:X86_EVENTTYPE_* */
-+# define HVMOP_TRAP_ext_int 0 /* external interrupt */
-+# define HVMOP_TRAP_nmi 2 /* nmi */
-+# define HVMOP_TRAP_hw_exc 3 /* hardware exception */
-+# define HVMOP_TRAP_sw_int 4 /* software interrupt (CD nn) */
-+# define HVMOP_TRAP_pri_sw_exc 5 /* ICEBP (F1) */
-+# define HVMOP_TRAP_sw_exc 6 /* INT3 (CC), INTO (CE) */
-+ /* Error code, or ~0u to skip */
-+ uint32_t error_code;
-+ /* Intruction length */
-+ uint32_t insn_len;
-+ /* CR2 for page faults */
-+ uint64_aligned_t cr2;
-+};
-+typedef struct xen_hvm_inject_trap xen_hvm_inject_trap_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_hvm_inject_trap_t);
-+
+#endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
#define HVMOP_get_mem_type 15
/* Return hvmmem_type_t for the specified pfn. */
-@@ -60,6 +224,276 @@ struct xen_hvm_get_mem_type {
+@@ -60,6 +153,135 @@ struct xen_hvm_get_mem_type {
/* IN variable. */
uint64_t pfn;
};
@@ -5689,51 +6022,11 @@ Acked-by: jbeulich@suse.com
+/* Following tools-only interfaces may change in future. */
+#if defined(__XEN__) || defined(__XEN_TOOLS__)
+
-+/* MSI injection for emulated devices */
-+#define HVMOP_inject_msi 16
-+struct xen_hvm_inject_msi {
-+ /* Domain to be injected */
-+ domid_t domid;
-+ /* Data -- lower 32 bits */
-+ uint32_t data;
-+ /* Address (0xfeexxxxx) */
-+ uint64_t addr;
-+};
-+typedef struct xen_hvm_inject_msi xen_hvm_inject_msi_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_hvm_inject_msi_t);
-+
+/*
-+ * IOREQ Servers
-+ *
-+ * The interface between an I/O emulator an Xen is called an IOREQ Server.
-+ * A domain supports a single 'legacy' IOREQ Server which is instantiated if
-+ * parameter...
-+ *
-+ * HVM_PARAM_IOREQ_PFN is read (to get the gmfn containing the synchronous
-+ * ioreq structures), or...
-+ * HVM_PARAM_BUFIOREQ_PFN is read (to get the gmfn containing the buffered
-+ * ioreq ring), or...
-+ * HVM_PARAM_BUFIOREQ_EVTCHN is read (to get the event channel that Xen uses
-+ * to request buffered I/O emulation).
-+ *
-+ * The following hypercalls facilitate the creation of IOREQ Servers for
-+ * 'secondary' emulators which are invoked to implement port I/O, memory, or
-+ * PCI config space ranges which they explicitly register.
++ * Definitions relating to DMOP_create_ioreq_server. (Defined here for
++ * backwards compatibility).
+ */
+
-+typedef uint16_t ioservid_t;
-+
-+/*
-+ * HVMOP_create_ioreq_server: Instantiate a new IOREQ Server for a secondary
-+ * emulator servicing domain <domid>.
-+ *
-+ * The <id> handed back is unique for <domid>. If <handle_bufioreq> is zero
-+ * the buffered ioreq ring will not be allocated and hence all emulation
-+ * requestes to this server will be synchronous.
-+ */
-+#define HVMOP_create_ioreq_server 17
-+struct xen_hvm_create_ioreq_server {
-+ domid_t domid; /* IN - domain to be serviced */
+#define HVM_IOREQSRV_BUFIOREQ_OFF 0
+#define HVM_IOREQSRV_BUFIOREQ_LEGACY 1
+/*
@@ -5741,107 +6034,6 @@ Acked-by: jbeulich@suse.com
+ * the pointer pair gets read atomically:
+ */
+#define HVM_IOREQSRV_BUFIOREQ_ATOMIC 2
-+ uint8_t handle_bufioreq; /* IN - should server handle buffered ioreqs */
-+ ioservid_t id; /* OUT - server id */
-+};
-+typedef struct xen_hvm_create_ioreq_server xen_hvm_create_ioreq_server_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_hvm_create_ioreq_server_t);
-+
-+/*
-+ * HVMOP_get_ioreq_server_info: Get all the information necessary to access
-+ * IOREQ Server <id>.
-+ *
-+ * The emulator needs to map the synchronous ioreq structures and buffered
-+ * ioreq ring (if it exists) that Xen uses to request emulation. These are
-+ * hosted in domain <domid>'s gmfns <ioreq_pfn> and <bufioreq_pfn>
-+ * respectively. In addition, if the IOREQ Server is handling buffered
-+ * emulation requests, the emulator needs to bind to event channel
-+ * <bufioreq_port> to listen for them. (The event channels used for
-+ * synchronous emulation requests are specified in the per-CPU ioreq
-+ * structures in <ioreq_pfn>).
-+ * If the IOREQ Server is not handling buffered emulation requests then the
-+ * values handed back in <bufioreq_pfn> and <bufioreq_port> will both be 0.
-+ */
-+#define HVMOP_get_ioreq_server_info 18
-+struct xen_hvm_get_ioreq_server_info {
-+ domid_t domid; /* IN - domain to be serviced */
-+ ioservid_t id; /* IN - server id */
-+ evtchn_port_t bufioreq_port; /* OUT - buffered ioreq port */
-+ uint64_aligned_t ioreq_pfn; /* OUT - sync ioreq pfn */
-+ uint64_aligned_t bufioreq_pfn; /* OUT - buffered ioreq pfn */
-+};
-+typedef struct xen_hvm_get_ioreq_server_info xen_hvm_get_ioreq_server_info_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_hvm_get_ioreq_server_info_t);
-+
-+/*
-+ * HVM_map_io_range_to_ioreq_server: Register an I/O range of domain <domid>
-+ * for emulation by the client of IOREQ
-+ * Server <id>
-+ * HVM_unmap_io_range_from_ioreq_server: Deregister an I/O range of <domid>
-+ * for emulation by the client of IOREQ
-+ * Server <id>
-+ *
-+ * There are three types of I/O that can be emulated: port I/O, memory accesses
-+ * and PCI config space accesses. The <type> field denotes which type of range
-+ * the <start> and <end> (inclusive) fields are specifying.
-+ * PCI config space ranges are specified by segment/bus/device/function values
-+ * which should be encoded using the HVMOP_PCI_SBDF helper macro below.
-+ *
-+ * NOTE: unless an emulation request falls entirely within a range mapped
-+ * by a secondary emulator, it will not be passed to that emulator.
-+ */
-+#define HVMOP_map_io_range_to_ioreq_server 19
-+#define HVMOP_unmap_io_range_from_ioreq_server 20
-+struct xen_hvm_io_range {
-+ domid_t domid; /* IN - domain to be serviced */
-+ ioservid_t id; /* IN - server id */
-+ uint32_t type; /* IN - type of range */
-+# define HVMOP_IO_RANGE_PORT 0 /* I/O port range */
-+# define HVMOP_IO_RANGE_MEMORY 1 /* MMIO range */
-+# define HVMOP_IO_RANGE_PCI 2 /* PCI segment/bus/dev/func range */
-+ uint64_aligned_t start, end; /* IN - inclusive start and end of range */
-+};
-+typedef struct xen_hvm_io_range xen_hvm_io_range_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_hvm_io_range_t);
-+
-+#define HVMOP_PCI_SBDF(s,b,d,f) \
-+ ((((s) & 0xffff) << 16) | \
-+ (((b) & 0xff) << 8) | \
-+ (((d) & 0x1f) << 3) | \
-+ ((f) & 0x07))
-+
-+/*
-+ * HVMOP_destroy_ioreq_server: Destroy the IOREQ Server <id> servicing domain
-+ * <domid>.
-+ *
-+ * Any registered I/O ranges will be automatically deregistered.
-+ */
-+#define HVMOP_destroy_ioreq_server 21
-+struct xen_hvm_destroy_ioreq_server {
-+ domid_t domid; /* IN - domain to be serviced */
-+ ioservid_t id; /* IN - server id */
-+};
-+typedef struct xen_hvm_destroy_ioreq_server xen_hvm_destroy_ioreq_server_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_hvm_destroy_ioreq_server_t);
-+
-+/*
-+ * HVMOP_set_ioreq_server_state: Enable or disable the IOREQ Server <id> servicing
-+ * domain <domid>.
-+ *
-+ * The IOREQ Server will not be passed any emulation requests until it is in the
-+ * enabled state.
-+ * Note that the contents of the ioreq_pfn and bufioreq_fn (see
-+ * HVMOP_get_ioreq_server_info) are not meaningful until the IOREQ Server is in
-+ * the enabled state.
-+ */
-+#define HVMOP_set_ioreq_server_state 22
-+struct xen_hvm_set_ioreq_server_state {
-+ domid_t domid; /* IN - domain to be serviced */
-+ ioservid_t id; /* IN - server id */
-+ uint8_t enabled; /* IN - enabled? */
-+};
-+typedef struct xen_hvm_set_ioreq_server_state xen_hvm_set_ioreq_server_state_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_hvm_set_ioreq_server_state_t);
+
+#endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
+
@@ -6006,7 +6198,7 @@ Acked-by: jbeulich@suse.com
#define HVM_PARAM_STORE_PFN 1
#define HVM_PARAM_STORE_EVTCHN 2
-@@ -74,6 +83,72 @@
+@@ -74,6 +83,77 @@
#define HVM_PARAM_IOREQ_PFN 5
#define HVM_PARAM_BUFIOREQ_PFN 6
@@ -6067,19 +6259,24 @@ Acked-by: jbeulich@suse.com
+#define _HVMPV_apic_assist 5
+#define HVMPV_apic_assist (1 << _HVMPV_apic_assist)
+
++/* Enable crash MSRs */
++#define _HVMPV_crash_ctl 6
++#define HVMPV_crash_ctl (1 << _HVMPV_crash_ctl)
++
+#define HVMPV_feature_mask \
+ (HVMPV_base_freq | \
+ HVMPV_no_freq | \
+ HVMPV_time_ref_count | \
+ HVMPV_reference_tsc | \
+ HVMPV_hcall_remote_tlb_flush | \
-+ HVMPV_apic_assist)
++ HVMPV_apic_assist | \
++ HVMPV_crash_ctl)
+
+#endif
/*
* Set mode for virtual timers (currently x86 only):
-@@ -122,6 +197,67 @@
+@@ -122,6 +202,83 @@
#define HVM_PARAM_CONSOLE_PFN 17
#define HVM_PARAM_CONSOLE_EVTCHN 18
@@ -6120,8 +6317,18 @@ Acked-by: jbeulich@suse.com
+/* Location of the VM Generation ID in guest physical address space. */
+#define HVM_PARAM_VM_GENERATION_ID_ADDR 34
+
-+/* Boolean: Enable altp2m */
++/*
++ * Set mode for altp2m:
++ * disabled: don't activate altp2m (default)
++ * mixed: allow access to all altp2m ops for both in-guest and external tools
++ * external: allow access to external privileged tools only
++ * limited: guest only has limited access (ie. control VMFUNC and #VE)
++ */
+#define HVM_PARAM_ALTP2M 35
++#define XEN_ALTP2M_disabled 0
++#define XEN_ALTP2M_mixed 1
++#define XEN_ALTP2M_external 2
++#define XEN_ALTP2M_limited 3
+
+/*
+ * Size of the x87 FPU FIP/FDP registers that the hypervisor needs to
@@ -6145,9 +6352,27 @@ Acked-by: jbeulich@suse.com
+ */
+#define HVM_PARAM_X87_FIP_WIDTH 36
+
-+#define HVM_NR_PARAMS 37
++/*
++ * TSS (and its size) used on Intel when CR0.PE=0. The address occupies
++ * the low 32 bits, while the size is in the high 32 ones.
++ */
++#define HVM_PARAM_VM86_TSS_SIZED 37
++
++#define HVM_NR_PARAMS 38
#endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */
+--- a/include/xen/interface/io/9pfs.h
++++ b/include/xen/interface/io/9pfs.h
+@@ -25,7 +25,8 @@
+ #ifndef __XEN_PUBLIC_IO_9PFS_H__
+ #define __XEN_PUBLIC_IO_9PFS_H__
+
+-#include "xen/interface/io/ring.h"
++#include "../grant_table.h"
++#include "ring.h"
+
+ /*
+ * See docs/misc/9pfs.markdown in xen.git for the full specification:
--- a/include/xen/interface/io/blkif.h
+++ b/include/xen/interface/io/blkif.h
@@ -3,14 +3,33 @@
@@ -7451,7 +7676,7 @@ Acked-by: jbeulich@suse.com
#elif defined(__arm__) || defined(__aarch64__)
--- a/include/xen/interface/io/ring.h
+++ b/include/xen/interface/io/ring.h
-@@ -3,12 +3,38 @@
+@@ -3,12 +3,53 @@
*
* Shared producer-consumer ring macros.
*
@@ -7479,6 +7704,21 @@ Acked-by: jbeulich@suse.com
#ifndef __XEN_PUBLIC_IO_RING_H__
#define __XEN_PUBLIC_IO_RING_H__
++/*
++ * When #include'ing this header, you need to provide the following
++ * declaration upfront:
++ * - standard integers types (uint8_t, uint16_t, etc)
++ * They are provided by stdint.h of the standard headers.
++ *
++ * In addition, if you intend to use the FLEX macros, you also need to
++ * provide the following, before invoking the FLEX macros:
++ * - size_t
++ * - memcpy
++ * - grant_ref_t
++ * These declarations are provided by string.h of the standard headers,
++ * and grant_table.h from the Xen public headers.
++ */
++
+#include "../xen-compat.h"
+
+#if __XEN_INTERFACE_VERSION__ < 0x00030208
@@ -7490,7 +7730,7 @@ Acked-by: jbeulich@suse.com
typedef unsigned int RING_IDX;
/* Round a 32-bit unsigned constant down to the nearest power of two. */
-@@ -38,34 +64,32 @@ typedef unsigned int RING_IDX;
+@@ -38,34 +79,32 @@ typedef unsigned int RING_IDX;
* Macros to make the correct C datatypes for a new kind of ring.
*
* To make a new ring datatype, you need to have two message structures,
@@ -7535,7 +7775,7 @@ Acked-by: jbeulich@suse.com
*/
#define DEFINE_RING_TYPES(__name, __req_t, __rsp_t) \
-@@ -80,7 +104,16 @@ union __name##_sring_entry { \
+@@ -80,7 +119,16 @@ union __name##_sring_entry { \
struct __name##_sring { \
RING_IDX req_prod, req_event; \
RING_IDX rsp_prod, rsp_event; \
@@ -7553,7 +7793,7 @@ Acked-by: jbeulich@suse.com
union __name##_sring_entry ring[1]; /* variable-length */ \
}; \
\
-@@ -98,7 +131,12 @@ struct __name##_back_ring { \
+@@ -98,7 +146,12 @@ struct __name##_back_ring { \
RING_IDX req_cons; \
unsigned int nr_ents; \
struct __name##_sring *sring; \
@@ -7567,7 +7807,7 @@ Acked-by: jbeulich@suse.com
/*
* Macros for manipulating rings.
-@@ -119,7 +157,8 @@ struct __name##_back_ring { \
+@@ -119,7 +172,8 @@ struct __name##_back_ring { \
#define SHARED_RING_INIT(_s) do { \
(_s)->req_prod = (_s)->rsp_prod = 0; \
(_s)->req_event = (_s)->rsp_event = 1; \
@@ -7577,7 +7817,7 @@ Acked-by: jbeulich@suse.com
} while(0)
#define FRONT_RING_INIT(_r, _s, __size) do { \
-@@ -136,21 +175,6 @@ struct __name##_back_ring { \
+@@ -136,21 +190,6 @@ struct __name##_back_ring { \
(_r)->sring = (_s); \
} while (0)
@@ -7599,7 +7839,7 @@ Acked-by: jbeulich@suse.com
/* How big is this ring? */
#define RING_SIZE(_r) \
((_r)->nr_ents)
-@@ -169,6 +193,7 @@ struct __name##_back_ring { \
+@@ -169,6 +208,7 @@ struct __name##_back_ring { \
#define RING_HAS_UNCONSUMED_RESPONSES(_r) \
((_r)->sring->rsp_prod - (_r)->rsp_cons)
@@ -7607,7 +7847,7 @@ Acked-by: jbeulich@suse.com
#define RING_HAS_UNCONSUMED_REQUESTS(_r) \
({ \
unsigned int req = (_r)->sring->req_prod - (_r)->req_cons; \
-@@ -176,6 +201,14 @@ struct __name##_back_ring { \
+@@ -176,6 +216,14 @@ struct __name##_back_ring { \
((_r)->req_cons - (_r)->rsp_prod_pvt); \
req < rsp ? req : rsp; \
})
@@ -7622,7 +7862,7 @@ Acked-by: jbeulich@suse.com
/* Direct access to individual ring elements, by index. */
#define RING_GET_REQUEST(_r, _idx) \
-@@ -203,17 +236,16 @@ struct __name##_back_ring { \
+@@ -203,17 +251,16 @@ struct __name##_back_ring { \
(((_cons) - (_r)->rsp_prod_pvt) >= RING_SIZE(_r))
/* Ill-behaved frontend determination: Can there be this many requests? */
@@ -7643,7 +7883,7 @@ Acked-by: jbeulich@suse.com
(_r)->sring->rsp_prod = (_r)->rsp_prod_pvt; \
} while (0)
-@@ -250,9 +282,9 @@ struct __name##_back_ring { \
+@@ -250,9 +297,9 @@ struct __name##_back_ring { \
#define RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(_r, _notify) do { \
RING_IDX __old = (_r)->sring->req_prod; \
RING_IDX __new = (_r)->req_prod_pvt; \
@@ -7655,7 +7895,7 @@ Acked-by: jbeulich@suse.com
(_notify) = ((RING_IDX)(__new - (_r)->sring->req_event) < \
(RING_IDX)(__new - __old)); \
} while (0)
-@@ -260,9 +292,9 @@ struct __name##_back_ring { \
+@@ -260,9 +307,9 @@ struct __name##_back_ring { \
#define RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(_r, _notify) do { \
RING_IDX __old = (_r)->sring->rsp_prod; \
RING_IDX __new = (_r)->rsp_prod_pvt; \
@@ -7667,7 +7907,7 @@ Acked-by: jbeulich@suse.com
(_notify) = ((RING_IDX)(__new - (_r)->sring->rsp_event) < \
(RING_IDX)(__new - __old)); \
} while (0)
-@@ -271,7 +303,7 @@ struct __name##_back_ring { \
+@@ -271,7 +318,7 @@ struct __name##_back_ring { \
(_work_to_do) = RING_HAS_UNCONSUMED_REQUESTS(_r); \
if (_work_to_do) break; \
(_r)->sring->req_event = (_r)->req_cons + 1; \
@@ -7676,7 +7916,7 @@ Acked-by: jbeulich@suse.com
(_work_to_do) = RING_HAS_UNCONSUMED_REQUESTS(_r); \
} while (0)
-@@ -279,7 +311,7 @@ struct __name##_back_ring { \
+@@ -279,7 +326,7 @@ struct __name##_back_ring { \
(_work_to_do) = RING_HAS_UNCONSUMED_RESPONSES(_r); \
if (_work_to_do) break; \
(_r)->sring->rsp_event = (_r)->rsp_cons + 1; \
@@ -8039,16 +8279,33 @@ Acked-by: jbeulich@suse.com
* Copyright (C) 2005 Rusty Russell IBM Corporation
*/
-@@ -31,6 +50,8 @@ enum xsd_sockmsg_type
+@@ -9,7 +28,8 @@
+
+ enum xsd_sockmsg_type
+ {
+- XS_DEBUG,
++ XS_CONTROL,
++#define XS_DEBUG XS_CONTROL
+ XS_DIRECTORY,
+ XS_READ,
+ XS_GET_PERMS,
+@@ -29,8 +49,13 @@ enum xsd_sockmsg_type
+ XS_IS_DOMAIN_INTRODUCED,
+ XS_RESUME,
XS_SET_TARGET,
- XS_RESTRICT,
- XS_RESET_WATCHES,
+- XS_RESTRICT,
+- XS_RESET_WATCHES,
++ /* XS_RESTRICT has been removed */
++ XS_RESET_WATCHES = XS_SET_TARGET + 2,
++ XS_DIRECTORY_PART,
++
++ XS_TYPE_COUNT, /* Number of valid types. */
+
+ XS_INVALID = 0xffff /* Guaranteed to remain an invalid type */
};
#define XS_WRITE_NONE "NONE"
-@@ -43,8 +64,14 @@ struct xsd_errors
+@@ -43,8 +68,14 @@ struct xsd_errors
int errnum;
const char *errstring;
};
@@ -8064,7 +8321,7 @@ Acked-by: jbeulich@suse.com
XSD_ERROR(EINVAL),
XSD_ERROR(EACCES),
XSD_ERROR(EEXIST),
-@@ -58,8 +85,10 @@ static struct xsd_errors xsd_errors[] __
+@@ -58,8 +89,10 @@ static struct xsd_errors xsd_errors[] __
XSD_ERROR(EROFS),
XSD_ERROR(EBUSY),
XSD_ERROR(EAGAIN),
@@ -8076,7 +8333,7 @@ Acked-by: jbeulich@suse.com
struct xsd_sockmsg
{
-@@ -77,7 +106,10 @@ enum xs_watch_type
+@@ -77,7 +110,10 @@ enum xs_watch_type
XS_WATCH_TOKEN
};
@@ -8088,7 +8345,7 @@ Acked-by: jbeulich@suse.com
#define XENSTORE_RING_SIZE 1024
typedef uint32_t XENSTORE_RING_IDX;
#define MASK_XENSTORE_IDX(idx) ((idx) & (XENSTORE_RING_SIZE-1))
-@@ -86,9 +118,22 @@ struct xenstore_domain_interface {
+@@ -86,9 +122,22 @@ struct xenstore_domain_interface {
char rsp[XENSTORE_RING_SIZE]; /* Replies and async watch events. */
XENSTORE_RING_IDX req_cons, req_prod;
XENSTORE_RING_IDX rsp_cons, rsp_prod;
@@ -8289,9 +8546,9 @@ Acked-by: jbeulich@suse.com
+ * XENMEM_add_to_physmap_batch only. */
+#define XENMAPSPACE_dev_mmio 5 /* device mmio region
+ ARM only; the region is mapped in
-+ Stage-2 using the memory attribute
-+ "Device-nGnRE" (previously named
-+ "Device" on ARMv7) */
++ Stage-2 using the Normal Memory
++ Inner/Outer Write-Back Cacheable
++ memory attribute. */
+/* ` } */
/*
@@ -8391,7 +8648,7 @@ Acked-by: jbeulich@suse.com
/*
* Returns the pseudo-physical memory map as it was when the domain
-@@ -231,9 +337,10 @@ struct xen_memory_map {
+@@ -231,37 +337,323 @@ struct xen_memory_map {
* Entries in the buffer are in the same format as returned by the
* BIOS INT 0x15 EAX=0xE820 call.
*/
@@ -8404,7 +8661,10 @@ Acked-by: jbeulich@suse.com
/*
* Returns the real physical memory map. Passes the same structure as
-@@ -242,26 +349,309 @@ DEFINE_GUEST_HANDLE_STRUCT(xen_memory_ma
+ * XENMEM_memory_map.
++ * Specifying buffer as NULL will return the number of entries required
++ * to store the complete memory map.
+ * arg == addr of struct xen_memory_map.
*/
#define XENMEM_machine_memory_map 10
@@ -9215,7 +9475,7 @@ Acked-by: jbeulich@suse.com
struct {
uint32_t attr;
uint64_t max_store_size;
-@@ -196,32 +213,33 @@ struct xenpf_efi_runtime_call {
+@@ -196,32 +213,34 @@ struct xenpf_efi_runtime_call {
} query_variable_info;
struct {
@@ -9255,10 +9515,11 @@ Acked-by: jbeulich@suse.com
+#define XEN_FW_EFI_MEM_INFO 3
+#define XEN_FW_EFI_RT_VERSION 4
+#define XEN_FW_EFI_PCI_ROM 5
++#define XEN_FW_EFI_APPLE_PROPERTIES 6
#define XEN_FW_KBD_SHIFT_FLAGS 5 /* Int16, Fn02: Get keyboard shift flags. */
struct xenpf_firmware_info {
-@@ -241,7 +259,7 @@ struct xenpf_firmware_info {
+@@ -241,7 +260,7 @@ struct xenpf_firmware_info {
uint8_t legacy_sectors_per_track; /* %cl[5:0]: max sector # */
/* Int13, Fn41: Get Device Parameters (as filled into %ds:%esi). */
/* NB. First uint16_t of buffer must be set to buffer size. */
@@ -9267,7 +9528,7 @@ Acked-by: jbeulich@suse.com
} disk_info; /* XEN_FW_DISK_INFO */
struct {
uint8_t device; /* bios device number */
-@@ -252,7 +270,7 @@ struct xenpf_firmware_info {
+@@ -252,7 +271,7 @@ struct xenpf_firmware_info {
uint8_t capabilities;
uint8_t edid_transfer_time;
/* must refer to 128-byte buffer */
@@ -9276,7 +9537,7 @@ Acked-by: jbeulich@suse.com
} vbeddc_info; /* XEN_FW_VBEDDC_INFO */
union xenpf_efi_info {
-@@ -264,8 +282,7 @@ struct xenpf_firmware_info {
+@@ -264,8 +283,7 @@ struct xenpf_firmware_info {
struct {
uint32_t revision;
uint32_t bufsz; /* input, in bytes */
@@ -9286,7 +9547,7 @@ Acked-by: jbeulich@suse.com
} vendor;
struct {
uint64_t addr;
-@@ -273,23 +290,42 @@ struct xenpf_firmware_info {
+@@ -273,23 +291,47 @@ struct xenpf_firmware_info {
uint64_t attr;
uint32_t type;
} mem;
@@ -9301,6 +9562,11 @@ Acked-by: jbeulich@suse.com
+ uint64_t address;
+ xen_ulong_t size;
+ } pci_rom;
++ struct {
++ /* OUT variables */
++ uint64_t address;
++ xen_ulong_t size;
++ } apple_properties;
} efi_info; /* XEN_FW_EFI_INFO */
+ /* Int16, Fn02: Get keyboard shift flags. */
@@ -9331,7 +9597,7 @@ Acked-by: jbeulich@suse.com
#define XENPF_change_freq 52
struct xenpf_change_freq {
-@@ -298,7 +334,8 @@ struct xenpf_change_freq {
+@@ -298,7 +340,8 @@ struct xenpf_change_freq {
uint32_t cpu; /* Physical cpu. */
uint64_t freq; /* New frequency (Hz). */
};
@@ -9341,7 +9607,7 @@ Acked-by: jbeulich@suse.com
/*
* Get idle times (nanoseconds since boot) for physical CPUs specified in the
-@@ -312,17 +349,18 @@ DEFINE_GUEST_HANDLE_STRUCT(xenpf_change_
+@@ -312,17 +355,18 @@ DEFINE_GUEST_HANDLE_STRUCT(xenpf_change_
struct xenpf_getidletime {
/* IN/OUT variables */
/* IN: CPUs to interrogate; OUT: subset of IN which are present */
@@ -9363,7 +9629,7 @@ Acked-by: jbeulich@suse.com
#define XENPF_set_processor_pminfo 54
-@@ -336,6 +374,7 @@ DEFINE_GUEST_HANDLE_STRUCT(xenpf_getidle
+@@ -336,6 +380,7 @@ DEFINE_GUEST_HANDLE_STRUCT(xenpf_getidle
#define XEN_PM_PX 1
#define XEN_PM_TX 2
#define XEN_PM_PDC 3
@@ -9371,7 +9637,7 @@ Acked-by: jbeulich@suse.com
/* Px sub info type */
#define XEN_PX_PCT 1
#define XEN_PX_PSS 2
-@@ -355,7 +394,8 @@ struct xen_processor_csd {
+@@ -355,7 +400,8 @@ struct xen_processor_csd {
uint32_t coord_type; /* coordination type */
uint32_t num; /* number of processors in same domain */
};
@@ -9381,7 +9647,7 @@ Acked-by: jbeulich@suse.com
struct xen_processor_cx {
struct xen_power_register reg; /* GAS for Cx trigger register */
-@@ -363,9 +403,10 @@ struct xen_processor_cx {
+@@ -363,9 +409,10 @@ struct xen_processor_cx {
uint32_t latency; /* worst latency (ms) to enter/exit this cstate */
uint32_t power; /* average power consumption(mW) */
uint32_t dpcnt; /* number of dependency entries */
@@ -9394,7 +9660,7 @@ Acked-by: jbeulich@suse.com
struct xen_processor_flags {
uint32_t bm_control:1;
-@@ -378,7 +419,7 @@ struct xen_processor_flags {
+@@ -378,7 +425,7 @@ struct xen_processor_flags {
struct xen_processor_power {
uint32_t count; /* number of C state entries in array below */
struct xen_processor_flags flags; /* global flags of this processor */
@@ -9403,7 +9669,7 @@ Acked-by: jbeulich@suse.com
};
struct xen_pct_register {
-@@ -396,10 +437,11 @@ struct xen_processor_px {
+@@ -396,10 +443,11 @@ struct xen_processor_px {
uint64_t power; /* milliWatts */
uint64_t transition_latency; /* microseconds */
uint64_t bus_master_latency; /* microseconds */
@@ -9418,7 +9684,7 @@ Acked-by: jbeulich@suse.com
struct xen_psd_package {
uint64_t num_entries;
-@@ -415,11 +457,12 @@ struct xen_processor_performance {
+@@ -415,11 +463,12 @@ struct xen_processor_performance {
struct xen_pct_register control_register;
struct xen_pct_register status_register;
uint32_t state_count; /* total available performance states */
@@ -9433,7 +9699,7 @@ Acked-by: jbeulich@suse.com
struct xenpf_set_processor_pminfo {
/* IN variables */
-@@ -428,10 +471,11 @@ struct xenpf_set_processor_pminfo {
+@@ -428,10 +477,11 @@ struct xenpf_set_processor_pminfo {
union {
struct xen_processor_power power;/* Cx: _CST/_CSD */
struct xen_processor_performance perf; /* Px: _PPC/_PCT/_PSS/_PSD */
@@ -9448,7 +9714,7 @@ Acked-by: jbeulich@suse.com
#define XENPF_get_cpuinfo 55
struct xenpf_pcpuinfo {
-@@ -447,14 +491,31 @@ struct xenpf_pcpuinfo {
+@@ -447,14 +497,31 @@ struct xenpf_pcpuinfo {
uint32_t apic_id;
uint32_t acpi_id;
};
@@ -9482,7 +9748,7 @@ Acked-by: jbeulich@suse.com
#define XENPF_cpu_hotadd 58
struct xenpf_cpu_hotadd {
-@@ -481,29 +542,81 @@ struct xenpf_core_parking {
+@@ -481,29 +548,81 @@ struct xenpf_core_parking {
/* OUT variables: get cpu nums actually be idled */
uint32_t idle_nums;
};
@@ -9569,7 +9835,7 @@ Acked-by: jbeulich@suse.com
struct xenpf_settime32 settime32;
struct xenpf_settime64 settime64;
struct xenpf_add_memtype add_memtype;
-@@ -518,14 +631,17 @@ struct xen_platform_op {
+@@ -518,14 +637,17 @@ struct xen_platform_op {
struct xenpf_getidletime getidletime;
struct xenpf_set_processor_pminfo set_pminfo;
struct xenpf_pcpuinfo pcpu_info;
@@ -9884,7 +10150,7 @@ Acked-by: jbeulich@suse.com
/* arg == xen_compile_info_t. */
#define XENVER_compile_info 2
-@@ -30,37 +49,58 @@ struct xen_compile_info {
+@@ -30,43 +49,44 @@ struct xen_compile_info {
char compile_domain[32];
char compile_date[32];
};
@@ -9934,24 +10200,29 @@ Acked-by: jbeulich@suse.com
+ */
#define XENVER_guest_handle 8
-+#define XENVER_commandline 9
+ #define XENVER_commandline 9
+-struct xen_commandline {
+- char buf[1024];
+-};
+typedef char xen_commandline_t[1024];
-+
-+/*
-+ * Return value is the number of bytes written, or XEN_Exx on error.
-+ * Calling with empty parameter returns the size of build_id.
-+ */
-+#define XENVER_build_id 10
-+struct xen_build_id {
+
+ /*
+ * Return value is the number of bytes written, or XEN_Exx on error.
+@@ -74,8 +94,13 @@ struct xen_commandline {
+ */
+ #define XENVER_build_id 10
+ struct xen_build_id {
+- uint32_t len; /* IN: size of buf[]. */
+- unsigned char buf[];
+ uint32_t len; /* IN: size of buf[]. */
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ unsigned char buf[];
+#elif defined(__GNUC__)
+ unsigned char buf[1]; /* OUT: Variable length buffer with build_id. */
+#endif
-+};
+ };
+typedef struct xen_build_id xen_build_id_t;
-+
+
#endif /* __XEN_PUBLIC_VERSION_H__ */
--- a/include/xen/interface/xen.h
+++ b/include/xen/interface/xen.h
@@ -10059,15 +10330,7 @@ Acked-by: jbeulich@suse.com
#define __HYPERVISOR_callback_op 30
#define __HYPERVISOR_xenoprof_op 31
#define __HYPERVISOR_event_channel_op 32
-@@ -81,7 +125,6 @@
- #define __HYPERVISOR_tmem_op 38
- #define __HYPERVISOR_xc_reserved_op 39 /* reserved for XenClient */
- #define __HYPERVISOR_xenpmu_op 40
--#define __HYPERVISOR_dm_op 41
-
- /* Architecture-specific hypercall definitions. */
- #define __HYPERVISOR_arch_0 48
-@@ -93,15 +136,43 @@
+@@ -93,15 +137,43 @@
#define __HYPERVISOR_arch_6 54
#define __HYPERVISOR_arch_7 55
@@ -10111,7 +10374,7 @@ Acked-by: jbeulich@suse.com
#define VIRQ_TIMER 0 /* V. Timebase update, and/or requested timeout. */
#define VIRQ_DEBUG 1 /* V. Request guest to dump debug info. */
#define VIRQ_CONSOLE 2 /* G. (DOM0) Bytes received on emergency console. */
-@@ -114,7 +185,7 @@
+@@ -114,7 +186,7 @@
#define VIRQ_MEM_EVENT 10 /* G. (DOM0) A memory event has occured */
#define VIRQ_XC_RESERVED 11 /* G. Reserved for XenClient */
#define VIRQ_ENOMEM 12 /* G. (DOM0) Low on heap memory */
@@ -10120,7 +10383,7 @@ Acked-by: jbeulich@suse.com
/* Architecture-specific VIRQ definitions. */
#define VIRQ_ARCH_0 16
-@@ -125,13 +196,16 @@
+@@ -125,13 +197,16 @@
#define VIRQ_ARCH_5 21
#define VIRQ_ARCH_6 22
#define VIRQ_ARCH_7 23
@@ -10140,7 +10403,7 @@ Acked-by: jbeulich@suse.com
* @reqs is an array of mmu_update_t structures ((ptr, val) pairs).
* @count is the length of the above array.
* @pdone is an output parameter indicating number of completed operations
-@@ -272,10 +346,11 @@
+@@ -272,10 +347,11 @@
/*
* MMU EXTENDED OPERATIONS
*
@@ -10156,7 +10419,7 @@ Acked-by: jbeulich@suse.com
*/
/* HYPERVISOR_mmuext_op() accepts a list of mmuext_op structures.
* A foreigndom (FD) can be specified (or DOMID_SELF for none).
-@@ -332,6 +407,7 @@
+@@ -332,6 +408,7 @@
* cmd: MMUEXT_[UN]MARK_SUPER
* mfn: Machine frame number of head of superpage to be [un]marked.
*/
@@ -10164,7 +10427,7 @@ Acked-by: jbeulich@suse.com
#define MMUEXT_PIN_L1_TABLE 0
#define MMUEXT_PIN_L2_TABLE 1
#define MMUEXT_PIN_L3_TABLE 2
-@@ -352,10 +428,11 @@
+@@ -352,10 +429,11 @@
#define MMUEXT_FLUSH_CACHE_GLOBAL 18
#define MMUEXT_MARK_SUPER 19
#define MMUEXT_UNMARK_SUPER 20
@@ -10177,7 +10440,7 @@ Acked-by: jbeulich@suse.com
union {
/* [UN]PIN_TABLE, NEW_BASEPTR, NEW_USER_BASEPTR
* CLEAR_PAGE, COPY_PAGE, [UN]MARK_SUPER */
-@@ -367,24 +444,45 @@ struct mmuext_op {
+@@ -367,24 +445,45 @@ struct mmuext_op {
/* SET_LDT */
unsigned int nr_ents;
/* TLB_FLUSH_MULTI, INVLPG_MULTI */
@@ -10232,7 +10495,7 @@ Acked-by: jbeulich@suse.com
/*
* Commands to HYPERVISOR_console_io().
-@@ -429,17 +527,27 @@ DEFINE_GUEST_HANDLE_STRUCT(mmuext_op);
+@@ -429,17 +528,27 @@ DEFINE_GUEST_HANDLE_STRUCT(mmuext_op);
*/
#define VMASST_TYPE_runstate_update_flag 5
@@ -10266,18 +10529,30 @@ Acked-by: jbeulich@suse.com
/*
* DOMID_IO is used to restrict page-table updates to mapping I/O memory.
-@@ -450,7 +558,7 @@ typedef uint16_t domid_t;
- * This only makes sense in MMUEXT_SET_FOREIGNDOM, but in that context can
- * be specified by any calling domain.
+@@ -447,27 +556,36 @@ typedef uint16_t domid_t;
+ * is useful to ensure that no mappings to the OS's own heap are accidentally
+ * installed. (e.g., in Linux this could cause havoc as reference counts
+ * aren't adjusted on the I/O-mapping code path).
+- * This only makes sense in MMUEXT_SET_FOREIGNDOM, but in that context can
+- * be specified by any calling domain.
++ * This only makes sense as HYPERVISOR_mmu_update()'s and
++ * HYPERVISOR_update_va_mapping_otherdomain()'s "foreigndom" argument. For
++ * HYPERVISOR_mmu_update() context it can be specified by any calling domain,
++ * otherwise it's only permitted if the caller is privileged.
*/
-#define DOMID_IO (0x7FF1U)
+#define DOMID_IO xen_mk_uint(0x7FF1)
/*
* DOMID_XEN is used to allow privileged domains to map restricted parts of
-@@ -458,16 +566,20 @@ typedef uint16_t domid_t;
- * This only makes sense in MMUEXT_SET_FOREIGNDOM, and is only permitted if
- * the caller is privileged.
+ * Xen's heap space (e.g., the machine_to_phys table).
+- * This only makes sense in MMUEXT_SET_FOREIGNDOM, and is only permitted if
+- * the caller is privileged.
++ * This only makes sense as
++ * - HYPERVISOR_mmu_update()'s, HYPERVISOR_mmuext_op()'s, or
++ * HYPERVISOR_update_va_mapping_otherdomain()'s "foreigndom" argument,
++ * - with XENMAPSPACE_gmfn_foreign,
++ * and is only permitted if the caller is privileged.
*/
-#define DOMID_XEN (0x7FF2U)
+#define DOMID_XEN xen_mk_uint(0x7FF2)
@@ -10300,7 +10575,7 @@ Acked-by: jbeulich@suse.com
/*
* Send an array of these to HYPERVISOR_mmu_update().
-@@ -477,20 +589,32 @@ struct mmu_update {
+@@ -477,20 +595,32 @@ struct mmu_update {
uint64_t ptr; /* Machine address of PTE. */
uint64_t val; /* New contents of PTE. */
};
@@ -10338,7 +10613,7 @@ Acked-by: jbeulich@suse.com
struct vcpu_time_info {
/*
-@@ -515,8 +639,17 @@ struct vcpu_time_info {
+@@ -515,8 +645,17 @@ struct vcpu_time_info {
*/
uint32_t tsc_to_system_mul;
int8_t tsc_shift;
@@ -10356,7 +10631,7 @@ Acked-by: jbeulich@suse.com
struct vcpu_info {
/*
-@@ -545,18 +678,34 @@ struct vcpu_info {
+@@ -545,18 +684,34 @@ struct vcpu_info {
* to block: this avoids wakeup-waiting races.
*/
uint8_t evtchn_upcall_pending;
@@ -10393,7 +10668,7 @@ Acked-by: jbeulich@suse.com
/*
* A domain can create "event channels" on which it can send and receive
-@@ -596,17 +745,32 @@ struct shared_info {
+@@ -596,28 +751,43 @@ struct shared_info {
* Wallclock time: updated only by control software. Guests should base
* their gettimeofday() syscall on this wallclock-base value.
*/
@@ -10428,7 +10703,11 @@ Acked-by: jbeulich@suse.com
* 3. This the order of bootstrap elements in the initial virtual region:
* a. relocated kernel image
* b. initial ram disk [mod_start, mod_len]
-@@ -617,7 +781,7 @@ struct shared_info {
+ * (may be omitted)
+ * c. list of allocated page frames [mfn_list, nr_pages]
+ * (unless relocated due to XEN_ELFNOTE_INIT_P2M)
+- * d. start_info_t structure [register ESI (x86)]
++ * d. start_info_t structure [register rSI (x86)]
* in case of dom0 this page contains the console info, too
* e. unless dom0: xenstore ring page
* f. unless dom0: console ring page
@@ -10437,7 +10716,7 @@ Acked-by: jbeulich@suse.com
* h. bootstrap stack [register ESP (x86)]
* 4. Bootstrap elements are packed together, but each is 4kB-aligned.
* 5. The list of page frames forms a contiguous 'pseudo-physical' memory
-@@ -628,9 +792,18 @@ struct shared_info {
+@@ -628,9 +798,18 @@ struct shared_info {
* 7. There is guaranteed to be at least 512kB padding after the final
* bootstrap element. If necessary, the bootstrap virtual region is
* extended by an extra 4MB to ensure this.
@@ -10458,7 +10737,7 @@ Acked-by: jbeulich@suse.com
struct start_info {
/* THE FOLLOWING ARE FILLED IN BOTH ON INITIAL BOOT AND ON RESUME. */
char magic[32]; /* "xen-<version>-<platform>". */
-@@ -654,12 +827,23 @@ struct start_info {
+@@ -654,12 +833,23 @@ struct start_info {
unsigned long nr_pt_frames; /* Number of bootstrap p.t. frames. */
unsigned long mfn_list; /* VIRTUAL address of page-frame list. */
unsigned long mod_start; /* VIRTUAL address of pre-loaded module. */
@@ -10482,7 +10761,7 @@ Acked-by: jbeulich@suse.com
/* These flags are passed in the 'flags' field of start_info_t. */
#define SIF_PRIVILEGED (1<<0) /* Is the domain privileged? */
-@@ -695,13 +879,15 @@ struct xen_multiboot_mod_list {
+@@ -695,13 +885,15 @@ struct xen_multiboot_mod_list {
uint32_t pad;
};
/*
@@ -10500,7 +10779,7 @@ Acked-by: jbeulich@suse.com
#define XEN_VGATYPE_TEXT_MODE_3 0x03
#define XEN_VGATYPE_VESA_LFB 0x23
#define XEN_VGATYPE_EFI_LFB 0x70
-@@ -731,51 +917,47 @@ struct dom0_vga_console_info {
+@@ -731,51 +923,47 @@ struct dom0_vga_console_info {
uint8_t green_pos, green_size;
uint8_t blue_pos, blue_size;
uint8_t rsvd_pos, rsvd_size;
diff --git a/patches.xen/xen3-patch-2.6.18 b/patches.xen/xen3-patch-2.6.18
index 9984da89b7..5fdf0d1c1f 100644
--- a/patches.xen/xen3-patch-2.6.18
+++ b/patches.xen/xen3-patch-2.6.18
@@ -10,7 +10,7 @@ Acked-by: jbeulich@novell.com
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -1953,7 +1953,7 @@ config KEXEC_JUMP
+@@ -1972,7 +1972,7 @@ config KEXEC_JUMP
code in physical address mode via KEXEC
config PHYSICAL_START
@@ -293,13 +293,13 @@ Acked-by: jbeulich@novell.com
+#include_next <asm/time.h>
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
-@@ -137,11 +137,15 @@ struct thread_info {
- _TIF_NOHZ)
+@@ -140,11 +140,15 @@ struct thread_info {
+ _TIF_PATCH_PENDING | _TIF_NOHZ | _TIF_SYSCALL_TRACEPOINT)
/* flags to check in __switch_to() */
+#ifndef CONFIG_XEN
#define _TIF_WORK_CTXSW \
- (_TIF_IO_BITMAP|_TIF_NOTSC|_TIF_BLOCKSTEP)
+ (_TIF_IO_BITMAP|_TIF_NOCPUID|_TIF_NOTSC|_TIF_BLOCKSTEP)
#define _TIF_WORK_CTXSW_PREV (_TIF_WORK_CTXSW|_TIF_USER_RETURN_NOTIFY)
#define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW)
@@ -321,7 +321,7 @@ Acked-by: jbeulich@novell.com
#include "tick-internal.h"
#include "ntp_internal.h"
-@@ -1220,6 +1223,10 @@ int do_settimeofday64(const struct times
+@@ -1248,6 +1251,10 @@ int do_settimeofday64(const struct times
out:
timekeeping_update(tk, TK_CLEAR_NTP | TK_MIRROR | TK_CLOCK_WAS_SET);
diff --git a/patches.xen/xen3-patch-2.6.19 b/patches.xen/xen3-patch-2.6.19
index 2f020e8d9d..b26ab80e01 100644
--- a/patches.xen/xen3-patch-2.6.19
+++ b/patches.xen/xen3-patch-2.6.19
@@ -11,7 +11,7 @@ Acked-by: jbeulich@novell.com
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -725,6 +725,7 @@ config SCHED_OMIT_FRAME_POINTER
+@@ -736,6 +736,7 @@ config SCHED_OMIT_FRAME_POINTER
menuconfig HYPERVISOR_GUEST
bool "Linux guest support"
@@ -21,7 +21,7 @@ Acked-by: jbeulich@novell.com
visors. This option enables basic hypervisor detection and platform
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
-@@ -69,8 +69,12 @@ int acpi_disable_cmcff;
+@@ -70,8 +70,12 @@ int acpi_disable_cmcff;
u8 acpi_sci_flags __initdata;
int acpi_sci_override_gsi __initdata;
@@ -34,7 +34,7 @@ Acked-by: jbeulich@novell.com
int acpi_fix_pin2_polarity __initdata;
#ifdef CONFIG_X86_LOCAL_APIC
-@@ -715,6 +719,7 @@ static void __init acpi_set_irq_model_io
+@@ -724,6 +728,7 @@ static void __init acpi_set_irq_model_io
#ifdef CONFIG_ACPI_HOTPLUG_CPU
#include <acpi/processor.h>
@@ -42,7 +42,7 @@ Acked-by: jbeulich@novell.com
static int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid)
{
#ifdef CONFIG_ACPI_NUMA
-@@ -728,6 +733,9 @@ static int acpi_map_cpu2node(acpi_handle
+@@ -737,6 +742,9 @@ static int acpi_map_cpu2node(acpi_handle
#endif
return 0;
}
@@ -52,7 +52,7 @@ Acked-by: jbeulich@novell.com
int acpi_map_cpu(acpi_handle handle, phys_cpuid_t physid, u32 acpi_id,
int *pcpu)
-@@ -750,6 +758,7 @@ EXPORT_SYMBOL(acpi_map_cpu);
+@@ -759,6 +767,7 @@ EXPORT_SYMBOL(acpi_map_cpu);
int acpi_unmap_cpu(int cpu)
{
@@ -60,7 +60,7 @@ Acked-by: jbeulich@novell.com
#ifdef CONFIG_ACPI_NUMA
set_apicid_to_node(per_cpu(x86_cpu_to_apicid, cpu), NUMA_NO_NODE);
#endif
-@@ -757,6 +766,7 @@ int acpi_unmap_cpu(int cpu)
+@@ -766,6 +775,7 @@ int acpi_unmap_cpu(int cpu)
per_cpu(x86_cpu_to_apicid, cpu) = -1;
set_cpu_present(cpu, false);
num_processors--;
@@ -68,7 +68,7 @@ Acked-by: jbeulich@novell.com
return (0);
}
-@@ -1720,7 +1730,7 @@ int __init acpi_mps_check(void)
+@@ -1723,7 +1733,7 @@ int __init acpi_mps_check(void)
return 0;
}
@@ -2441,7 +2441,7 @@ Acked-by: jbeulich@novell.com
ia32_syscall_end:
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
-@@ -141,7 +141,7 @@ obj-$(CONFIG_X86_XEN) += fixup.o
+@@ -135,7 +135,7 @@ obj-$(CONFIG_X86_XEN) += fixup.o
###
# 64 bit specific files
ifeq ($(CONFIG_X86_64),y)
@@ -2450,7 +2450,7 @@ Acked-by: jbeulich@novell.com
obj-$(CONFIG_AUDIT) += audit_64.o
obj-$(CONFIG_GART_IOMMU) += amd_gart_64.o aperture_64.o
-@@ -154,5 +154,7 @@ ifeq ($(CONFIG_X86_64),y)
+@@ -148,5 +148,7 @@ ifeq ($(CONFIG_X86_64),y)
pci-dma_64-$(CONFIG_XEN) += pci-dma_32.o
endif
@@ -6093,7 +6093,7 @@ Acked-by: jbeulich@novell.com
**/
--- a/drivers/xen/Kconfig
+++ b/drivers/xen/Kconfig
-@@ -400,6 +400,10 @@ endmenu
+@@ -404,6 +404,10 @@ endmenu
config HAVE_IRQ_IGNORE_UNHANDLED
def_bool y
@@ -9031,7 +9031,7 @@ Acked-by: jbeulich@novell.com
+#endif /* __XEN_NETUTIL_H__ */
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
-@@ -6886,6 +6886,23 @@ static void __setup_per_zone_wmarks(void
+@@ -7032,6 +7032,23 @@ static void __setup_per_zone_wmarks(void
spin_unlock_irqrestore(&zone->lock, flags);
}
diff --git a/patches.xen/xen3-patch-2.6.20 b/patches.xen/xen3-patch-2.6.20
index 564f3682ff..db6fa0418c 100644
--- a/patches.xen/xen3-patch-2.6.20
+++ b/patches.xen/xen3-patch-2.6.20
@@ -10,7 +10,7 @@ Acked-by: jbeulich@novell.com
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -1996,6 +1996,7 @@ config PHYSICAL_START
+@@ -2015,6 +2015,7 @@ config PHYSICAL_START
config RELOCATABLE
bool "Build a relocatable kernel"
@@ -18,7 +18,7 @@ Acked-by: jbeulich@novell.com
default y
---help---
This builds a kernel image that retains relocation information
-@@ -2052,7 +2053,8 @@ config X86_NEED_RELOCS
+@@ -2071,7 +2072,8 @@ config X86_NEED_RELOCS
depends on RANDOMIZE_BASE || (X86_32 && RELOCATABLE)
config PHYSICAL_ALIGN
@@ -1986,7 +1986,7 @@ Acked-by: jbeulich@novell.com
-#endif
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
-@@ -82,6 +82,10 @@ SECTIONS
+@@ -83,6 +83,10 @@ SECTIONS
{
#ifdef CONFIG_X86_32
. = LOAD_OFFSET + LOAD_PHYSICAL_ADDR;
@@ -4316,7 +4316,7 @@ Acked-by: jbeulich@novell.com
if (csum) {
--- a/kernel/kexec_core.c
+++ b/kernel/kexec_core.c
-@@ -317,7 +317,7 @@ static struct page *kimage_alloc_pages(g
+@@ -312,7 +312,7 @@ static struct page *kimage_alloc_pages(g
if (limit == ~0UL)
address_bits = BITS_PER_LONG;
else
diff --git a/patches.xen/xen3-patch-2.6.21 b/patches.xen/xen3-patch-2.6.21
index d837afdb31..57be9b06e8 100644
--- a/patches.xen/xen3-patch-2.6.21
+++ b/patches.xen/xen3-patch-2.6.21
@@ -8,7 +8,7 @@ Acked-by: jbeulich@novell.com
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -75,12 +75,12 @@ config X86
+@@ -78,12 +78,12 @@ config X86
select BUILDTIME_EXTABLE_SORT
select CLKEVT_I8253
select CLOCKSOURCE_VALIDATE_LAST_CYCLE
@@ -26,7 +26,7 @@ Acked-by: jbeulich@novell.com
select GENERIC_CPU_AUTOPROBE
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
-@@ -154,7 +154,7 @@ ifeq ($(CONFIG_X86_64),y)
+@@ -148,7 +148,7 @@ ifeq ($(CONFIG_X86_64),y)
pci-dma_64-$(CONFIG_XEN) += pci-dma_32.o
endif
diff --git a/patches.xen/xen3-patch-2.6.22 b/patches.xen/xen3-patch-2.6.22
index 7065a5279f..754bac6bce 100644
--- a/patches.xen/xen3-patch-2.6.22
+++ b/patches.xen/xen3-patch-2.6.22
@@ -10,7 +10,7 @@ Acked-by: jbeulich@novell.com
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -2170,7 +2170,6 @@ config COMPAT_VDSO
+@@ -2189,7 +2189,6 @@ config COMPAT_VDSO
def_bool n
prompt "Disable the 32-bit vDSO (needed for glibc 2.3.3)"
depends on COMPAT_32
@@ -20,7 +20,7 @@ Acked-by: jbeulich@novell.com
presented with a 32-bit vDSO that is not mapped at the address
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
-@@ -157,4 +157,4 @@ endif
+@@ -151,4 +151,4 @@ endif
disabled-obj-$(CONFIG_XEN) := early-quirks.o hpet.o i8237.o i8253.o i8259_$(BITS).o \
reboot.o smpboot_$(BITS).o tsc_$(BITS).o tsc_sync.o
disabled-obj-$(CONFIG_XEN_UNPRIVILEGED_GUEST) += mpparse_64.o
@@ -2879,7 +2879,7 @@ Acked-by: jbeulich@novell.com
"(err=%d)\n", err);
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
-@@ -619,7 +619,7 @@ config SENSORS_I5500
+@@ -629,7 +629,7 @@ config SENSORS_I5500
config SENSORS_CORETEMP
tristate "Intel Core/Core2/Atom temperature sensor"
@@ -6457,10 +6457,10 @@ Acked-by: jbeulich@novell.com
EXPORT_SYMBOL(swiotlb_map_sg);
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
-@@ -1659,6 +1659,13 @@ static void *__vmalloc_area_node(struct
- unsigned int nr_pages, array_size, i;
- const gfp_t nested_gfp = (gfp_mask & GFP_RECLAIM_MASK) | __GFP_ZERO;
- const gfp_t alloc_mask = gfp_mask | __GFP_NOWARN;
+@@ -1675,6 +1675,13 @@ static void *__vmalloc_area_node(struct
+ const gfp_t highmem_mask = (gfp_mask & (GFP_DMA | GFP_DMA32)) ?
+ 0 :
+ __GFP_HIGHMEM;
+#ifdef CONFIG_XEN
+ gfp_t dma_mask = gfp_mask & (__GFP_DMA | __GFP_DMA32);
+
@@ -6471,7 +6471,7 @@ Acked-by: jbeulich@novell.com
nr_pages = get_vm_area_size(area) >> PAGE_SHIFT;
array_size = (nr_pages * sizeof(struct page *));
-@@ -1697,6 +1704,16 @@ static void *__vmalloc_area_node(struct
+@@ -1713,6 +1720,16 @@ static void *__vmalloc_area_node(struct
goto fail;
}
area->pages[i] = page;
@@ -6485,10 +6485,10 @@ Acked-by: jbeulich@novell.com
+ clear_highpage(page);
+ }
+#endif
- if (gfpflags_allow_blocking(gfp_mask))
+ if (gfpflags_allow_blocking(gfp_mask|highmem_mask))
cond_resched();
}
-@@ -1929,6 +1946,8 @@ void *vmalloc_exec(unsigned long size)
+@@ -1954,6 +1971,8 @@ void *vmalloc_exec(unsigned long size)
#define GFP_VMALLOC32 GFP_DMA32 | GFP_KERNEL
#elif defined(CONFIG_64BIT) && defined(CONFIG_ZONE_DMA)
#define GFP_VMALLOC32 GFP_DMA | GFP_KERNEL
diff --git a/patches.xen/xen3-patch-2.6.23 b/patches.xen/xen3-patch-2.6.23
index 8197267e94..aa429f7572 100644
--- a/patches.xen/xen3-patch-2.6.23
+++ b/patches.xen/xen3-patch-2.6.23
@@ -66,7 +66,7 @@ Acked-by: jbeulich@novell.com
early_cpu_detect();
--- a/arch/x86/entry/entry_32.S
+++ b/arch/x86/entry/entry_32.S
-@@ -372,7 +372,7 @@ GLOBAL(__begin_SYSENTER_singlestep_regio
+@@ -356,7 +356,7 @@ GLOBAL(__begin_SYSENTER_singlestep_regio
* will ignore all of the single-step traps generated in this range.
*/
@@ -75,7 +75,7 @@ Acked-by: jbeulich@novell.com
/*
* Xen doesn't set %esp to be precisely what the normal SYSENTER
* entry point expects, so fix it up before using the normal path.
-@@ -898,7 +898,7 @@ ENDPROC(xen_failsafe_callback)
+@@ -882,7 +882,7 @@ ENDPROC(xen_failsafe_callback)
BUILD_INTERRUPT3(xen_hvm_callback_vector, HYPERVISOR_CALLBACK_VECTOR,
xen_evtchn_do_upcall)
@@ -805,7 +805,7 @@ Acked-by: jbeulich@novell.com
#include <linux/elfnote.h>
#include <linux/init.h>
-@@ -73,4 +73,4 @@ ENTRY(hypercall_page)
+@@ -77,4 +77,4 @@ ENTRY(hypercall_page)
ELFNOTE(Xen, XEN_ELFNOTE_HV_START_LOW, _ASM_PTR __HYPERVISOR_VIRT_START)
ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET, _ASM_PTR 0)
@@ -1781,7 +1781,7 @@ Acked-by: jbeulich@novell.com
#endif
--- a/drivers/Makefile
+++ b/drivers/Makefile
-@@ -42,7 +42,7 @@ obj-$(CONFIG_DMADEVICES) += dma/
+@@ -44,7 +44,7 @@ obj-$(CONFIG_DMADEVICES) += dma/
obj-y += soc/
obj-$(CONFIG_VIRTIO) += virtio/
@@ -1792,7 +1792,7 @@ Acked-by: jbeulich@novell.com
obj-$(CONFIG_REGULATOR) += regulator/
--- a/drivers/block/Kconfig
+++ b/drivers/block/Kconfig
-@@ -466,9 +466,9 @@ config XILINX_SYSACE
+@@ -434,9 +434,9 @@ config XILINX_SYSACE
help
Include support for the Xilinx SystemACE CompactFlash interface
@@ -1806,9 +1806,9 @@ Acked-by: jbeulich@novell.com
help
--- a/drivers/block/Makefile
+++ b/drivers/block/Makefile
-@@ -32,7 +32,7 @@ obj-$(CONFIG_VIRTIO_BLK) += virtio_blk.o
+@@ -29,7 +29,7 @@ obj-$(CONFIG_VIRTIO_BLK) += virtio_blk.o
+
obj-$(CONFIG_BLK_DEV_SX8) += sx8.o
- obj-$(CONFIG_BLK_DEV_HD) += hd.o
-obj-$(CONFIG_XEN_BLKDEV_FRONTEND) += xen-blkfront.o
+obj-$(CONFIG_PARAVIRT_XEN_BLKDEV_FRONTEND) += xen-blkfront.o
@@ -1828,7 +1828,7 @@ Acked-by: jbeulich@novell.com
default y
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
-@@ -418,9 +418,9 @@ source "drivers/net/wan/Kconfig"
+@@ -426,9 +426,9 @@ source "drivers/net/wan/Kconfig"
source "drivers/net/ieee802154/Kconfig"
@@ -1842,7 +1842,7 @@ Acked-by: jbeulich@novell.com
help
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
-@@ -65,7 +65,7 @@ obj-$(CONFIG_WIMAX) += wimax/
+@@ -66,7 +66,7 @@ obj-$(CONFIG_WIMAX) += wimax/
obj-$(CONFIG_IEEE802154) += ieee802154/
obj-$(CONFIG_VMXNET3) += vmxnet3/
@@ -3367,7 +3367,7 @@ Acked-by: jbeulich@novell.com
static int xenwatch_thread(void *unused)
{
-@@ -795,6 +801,7 @@ static int xenwatch_thread(void *unused)
+@@ -797,6 +803,7 @@ static int xenwatch_thread(void *unused)
msg = list_entry(ent, struct xs_stored_msg, list);
@@ -3375,7 +3375,7 @@ Acked-by: jbeulich@novell.com
/*
* Unlock the mutex before running an XBWF_new_thread
* handler. kthread_run can block which can deadlock
-@@ -811,6 +818,15 @@ static int xenwatch_thread(void *unused)
+@@ -813,6 +820,15 @@ static int xenwatch_thread(void *unused)
xenwatch_handle_callback(msg);
mutex_unlock(&xenwatch_mutex);
}
@@ -3391,7 +3391,7 @@ Acked-by: jbeulich@novell.com
}
return 0;
-@@ -925,6 +941,7 @@ static int xenbus_thread(void *unused)
+@@ -927,6 +943,7 @@ static int xenbus_thread(void *unused)
int xs_init(void)
{
@@ -3399,7 +3399,7 @@ Acked-by: jbeulich@novell.com
struct task_struct *task;
INIT_LIST_HEAD(&xs_state.reply_list);
-@@ -938,6 +955,13 @@ int xs_init(void)
+@@ -940,6 +957,13 @@ int xs_init(void)
atomic_set(&xs_state.transaction_count, 0);
init_waitqueue_head(&xs_state.transaction_wq);
@@ -3413,7 +3413,7 @@ Acked-by: jbeulich@novell.com
task = kthread_run(xenwatch_thread, NULL, "xenwatch");
if (IS_ERR(task))
return PTR_ERR(task);
-@@ -950,5 +974,5 @@ int xs_init(void)
+@@ -951,5 +975,5 @@ int xs_init(void)
/* shutdown watches for kexec boot */
xs_reset_watches();
@@ -3988,7 +3988,7 @@ Acked-by: jbeulich@novell.com
unsigned long start, unsigned long end)
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
-@@ -144,7 +144,8 @@ struct thread_info {
+@@ -147,7 +147,8 @@ struct thread_info {
#define _TIF_WORK_CTXSW_PREV (_TIF_WORK_CTXSW|_TIF_USER_RETURN_NOTIFY)
#define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW)
#else
@@ -4094,7 +4094,7 @@ Acked-by: jbeulich@novell.com
/* SLOB */
PG_slob_free = PG_private,
-@@ -741,10 +748,8 @@ static inline void ClearPageSlabPfmemall
+@@ -744,10 +751,8 @@ static inline void ClearPageSlabPfmemall
#define __PG_MLOCKED 0
#endif
@@ -4152,8 +4152,8 @@ Acked-by: jbeulich@novell.com
+#define DEFINE_GUEST_HANDLE_STRUCT(name) struct name
+
#if defined(__i386__)
- #include "xen-x86_32.h"
- #elif defined(__x86_64__)
+ # ifdef __XEN__
+ __DeFiNe__ __DECL_REG_LO8(which) uint32_t e ## which ## x
--- a/include/xen/interface/event_channel.h
+++ b/include/xen/interface/event_channel.h
@@ -333,6 +333,7 @@ struct evtchn_op {
@@ -4275,7 +4275,7 @@ Acked-by: jbeulich@novell.com
#include "arch-x86/xen.h"
#elif defined(__ia64__)
#include "arch-ia64.h"
-@@ -143,14 +145,14 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t);
+@@ -144,14 +146,14 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t);
*/
/* New sched_op hypercall introduced in 0x00030101. */
@@ -4292,7 +4292,7 @@ Acked-by: jbeulich@novell.com
#undef __HYPERVISOR_event_channel_op
#define __HYPERVISOR_event_channel_op __HYPERVISOR_event_channel_op_compat
#undef __HYPERVISOR_physdev_op
-@@ -158,7 +160,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t);
+@@ -159,7 +161,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t);
#endif
/* New platform_op hypercall introduced in 0x00030204. */
@@ -4301,7 +4301,7 @@ Acked-by: jbeulich@novell.com
#define __HYPERVISOR_dom0_op __HYPERVISOR_platform_op
#endif
-@@ -453,6 +455,7 @@ struct mmuext_op {
+@@ -454,6 +456,7 @@ struct mmuext_op {
xen_pfn_t src_mfn;
} arg2;
};
@@ -4309,7 +4309,7 @@ Acked-by: jbeulich@novell.com
typedef struct mmuext_op mmuext_op_t;
DEFINE_XEN_GUEST_HANDLE(mmuext_op_t);
#endif
-@@ -589,6 +592,7 @@ struct mmu_update {
+@@ -595,6 +598,7 @@ struct mmu_update {
uint64_t ptr; /* Machine address of PTE. */
uint64_t val; /* New contents of PTE. */
};
@@ -4317,7 +4317,7 @@ Acked-by: jbeulich@novell.com
typedef struct mmu_update mmu_update_t;
DEFINE_XEN_GUEST_HANDLE(mmu_update_t);
-@@ -602,13 +606,19 @@ DEFINE_XEN_GUEST_HANDLE(mmu_update_t);
+@@ -608,13 +612,19 @@ DEFINE_XEN_GUEST_HANDLE(mmu_update_t);
* any unused bits in the upper portion must be zero.
*/
struct multicall_entry {
diff --git a/patches.xen/xen3-patch-2.6.24 b/patches.xen/xen3-patch-2.6.24
index 7f396de5bc..379653bdd2 100644
--- a/patches.xen/xen3-patch-2.6.24
+++ b/patches.xen/xen3-patch-2.6.24
@@ -10,7 +10,7 @@ Acked-by: jbeulich@novell.com
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -75,12 +75,12 @@ config X86
+@@ -78,12 +78,12 @@ config X86
select BUILDTIME_EXTABLE_SORT
select CLKEVT_I8253
select CLOCKSOURCE_VALIDATE_LAST_CYCLE
@@ -26,7 +26,7 @@ Acked-by: jbeulich@novell.com
select GENERIC_CLOCKEVENTS_MIN_ADJUST
select GENERIC_CMOS_UPDATE
select GENERIC_CPU_AUTOPROBE
-@@ -307,12 +307,12 @@ config X86_64_SMP
+@@ -318,12 +318,12 @@ config X86_64_SMP
config X86_NO_TSS
bool
@@ -41,7 +41,7 @@ Acked-by: jbeulich@novell.com
default y
config X86_32_LAZY_GS
-@@ -417,6 +417,7 @@ config X86_MPPARSE
+@@ -428,6 +428,7 @@ config X86_MPPARSE
config X86_XEN
bool "Xen-compatible"
@@ -49,7 +49,7 @@ Acked-by: jbeulich@novell.com
select XEN
select X86_PAE
select SWIOTLB
-@@ -471,6 +472,7 @@ endif
+@@ -482,6 +483,7 @@ endif
config X86_64_XEN
bool "Enable Xen compatible kernel"
@@ -57,7 +57,7 @@ Acked-by: jbeulich@novell.com
select XEN
select SWIOTLB
help
-@@ -822,7 +824,7 @@ source "arch/x86/Kconfig.cpu"
+@@ -833,7 +835,7 @@ source "arch/x86/Kconfig.cpu"
config HPET_TIMER
def_bool X86_64
prompt "HPET Timer Support" if X86_32
@@ -66,7 +66,7 @@ Acked-by: jbeulich@novell.com
---help---
Use the IA-PC HPET (High Precision Event Timer) to manage
time in preference to the PIT and RTC, if a HPET is
-@@ -1229,7 +1231,7 @@ config I8K
+@@ -1248,7 +1250,7 @@ config I8K
config X86_REBOOTFIXUPS
bool "Enable X86 board specific fixups for reboot"
@@ -75,7 +75,7 @@ Acked-by: jbeulich@novell.com
---help---
This enables chipset and/or board specific fixups to be done
in order to get reboot to work correctly. This is only needed on
-@@ -1651,7 +1653,7 @@ config MATH_EMULATION
+@@ -1670,7 +1672,7 @@ config MATH_EMULATION
bool
depends on MODIFY_LDT_SYSCALL
prompt "Math emulation" if X86_32
@@ -84,7 +84,7 @@ Acked-by: jbeulich@novell.com
---help---
Linux can emulate a math coprocessor (used for floating point
operations) if you don't have one. 486DX and Pentium processors have
-@@ -2306,6 +2308,7 @@ endmenu
+@@ -2325,6 +2327,7 @@ endmenu
config ARCH_ENABLE_MEMORY_HOTPLUG
def_bool y
depends on X86_64 || (X86_32 && HIGHMEM)
@@ -92,7 +92,7 @@ Acked-by: jbeulich@novell.com
config ARCH_ENABLE_MEMORY_HOTREMOVE
def_bool y
-@@ -2503,7 +2506,7 @@ choice
+@@ -2522,7 +2525,7 @@ choice
config PCI_GOBIOS
bool "BIOS"
@@ -101,7 +101,7 @@ Acked-by: jbeulich@novell.com
config PCI_GOMMCONFIG
bool "MMConfig"
-@@ -2572,7 +2575,7 @@ config PCI_CNB20LE_QUIRK
+@@ -2591,7 +2594,7 @@ config PCI_CNB20LE_QUIRK
config XEN_PCIDEV_FRONTEND
bool "Xen PCI Frontend" if X86_64
@@ -112,7 +112,7 @@ Acked-by: jbeulich@novell.com
help
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
-@@ -274,11 +274,13 @@ BOOT_TARGETS = bzlilo bzdisk fdimage fdi
+@@ -290,11 +290,13 @@ BOOT_TARGETS = bzlilo bzdisk fdimage fdi
PHONY += bzImage vmlinuz $(BOOT_TARGETS)
ifdef CONFIG_XEN
@@ -129,7 +129,7 @@ Acked-by: jbeulich@novell.com
endif
# Default kernel to build
-@@ -289,6 +291,8 @@ KBUILD_IMAGE := $(boot)/vmlinuz
+@@ -305,6 +307,8 @@ KBUILD_IMAGE := $(boot)/vmlinuz
vmlinuz: vmlinux
$(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE)
@@ -190,7 +190,7 @@ Acked-by: jbeulich@novell.com
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
-@@ -157,4 +157,4 @@ endif
+@@ -151,4 +151,4 @@ endif
disabled-obj-$(CONFIG_XEN) := early-quirks.o hpet.o i8237.o i8253.o i8259_$(BITS).o \
reboot.o smpboot_$(BITS).o tsc_$(BITS).o tsc_sync.o
disabled-obj-$(CONFIG_XEN_UNPRIVILEGED_GUEST) += mpparse_64.o
@@ -218,7 +218,7 @@ Acked-by: jbeulich@novell.com
}
--- a/arch/x86/kernel/cpu/Makefile
+++ b/arch/x86/kernel/cpu/Makefile
-@@ -42,6 +42,8 @@ obj-$(CONFIG_X86_LOCAL_APIC) += perfctr
+@@ -43,6 +43,8 @@ obj-$(CONFIG_X86_LOCAL_APIC) += perfctr
obj-$(CONFIG_HYPERVISOR_GUEST) += vmware.o hypervisor.o mshyperv.o
@@ -250,7 +250,7 @@ Acked-by: jbeulich@novell.com
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
-@@ -402,6 +402,7 @@ static void srat_detect_node(struct cpui
+@@ -398,6 +398,7 @@ static void srat_detect_node(struct cpui
#endif
}
@@ -258,7 +258,7 @@ Acked-by: jbeulich@novell.com
/*
* find out the number of processor cores on the die
*/
-@@ -419,6 +420,7 @@ static int intel_num_cpu_cores(struct cp
+@@ -415,6 +416,7 @@ static int intel_num_cpu_cores(struct cp
else
return 1;
}
@@ -266,7 +266,7 @@ Acked-by: jbeulich@novell.com
static void detect_vmx_virtcap(struct cpuinfo_x86 *c)
{
-@@ -503,6 +505,7 @@ static void init_intel(struct cpuinfo_x8
+@@ -527,6 +529,7 @@ static void init_intel(struct cpuinfo_x8
*/
detect_extended_topology(c);
@@ -274,7 +274,7 @@ Acked-by: jbeulich@novell.com
if (!cpu_has(c, X86_FEATURE_XTOPOLOGY)) {
/*
* let's use the legacy cpuid vector 0x1 and 0x4 for topology
-@@ -513,6 +516,7 @@ static void init_intel(struct cpuinfo_x8
+@@ -537,6 +540,7 @@ static void init_intel(struct cpuinfo_x8
detect_ht(c);
#endif
}
@@ -2671,7 +2671,7 @@ Acked-by: jbeulich@novell.com
select CPU_IDLE_GOV_MENU if (NO_HZ || NO_HZ_IDLE)
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
-@@ -241,7 +241,7 @@ config INTEL_IOATDMA
+@@ -258,7 +258,7 @@ config INTEL_IOATDMA
depends on PCI && X86_64
select DMA_ENGINE
select DMA_ENGINE_RAID
@@ -2740,7 +2740,7 @@ Acked-by: jbeulich@novell.com
#include <linux/aer.h>
#include <linux/sizes.h>
#include "dma.h"
-@@ -1390,11 +1389,7 @@ static void ioat_remove(struct pci_dev *
+@@ -1378,11 +1377,7 @@ static void ioat_remove(struct pci_dev *
return;
dev_err(&pdev->dev, "Removing dma and dca services\n");
@@ -2989,7 +2989,7 @@ Acked-by: jbeulich@novell.com
return -EACCES;
}
-@@ -681,7 +678,7 @@ static int __init blkif_init(void)
+@@ -683,7 +680,7 @@ static int __init blkif_init(void)
kfree(pending_reqs);
kfree(pending_grant_handles);
free_empty_pages_and_pagevec(pending_pages, mmap_pages);
@@ -5964,7 +5964,7 @@ Acked-by: jbeulich@novell.com
up_read(&xs_state.watch_mutex);
-@@ -930,8 +928,8 @@ static int xenbus_thread(void *unused)
+@@ -932,8 +930,8 @@ static int xenbus_thread(void *unused)
for (;;) {
err = process_msg();
if (err)
@@ -6017,7 +6017,7 @@ Acked-by: jbeulich@novell.com
#include <xen/interface/platform.h>
#endif
-@@ -83,7 +83,7 @@ extern int (*acpi_suspend_lowlevel)(void
+@@ -85,7 +85,7 @@ extern int (*acpi_suspend_lowlevel)(void
/* Physical address to resume after wakeup */
#define acpi_wakeup_address ((unsigned long)(real_mode_header->wakeup_start))
@@ -6026,7 +6026,7 @@ Acked-by: jbeulich@novell.com
static inline int acpi_notify_hypervisor_state(u8 sleep_state,
u32 val_a, u32 val_b)
{
-@@ -101,13 +101,14 @@ static inline int acpi_notify_hypervisor
+@@ -103,13 +103,14 @@ static inline int acpi_notify_hypervisor
return HYPERVISOR_platform_op(&op);
}
@@ -6042,7 +6042,7 @@ Acked-by: jbeulich@novell.com
/*
* Early models (<=5) of AMD Opterons are not supposed to go into
* C2 state.
-@@ -122,6 +123,7 @@ static inline unsigned int acpi_processo
+@@ -124,6 +125,7 @@ static inline unsigned int acpi_processo
else if (boot_cpu_has(X86_BUG_AMD_APIC_C1E))
return 1;
else
@@ -8304,24 +8304,25 @@ Acked-by: jbeulich@novell.com
struct mutex lock;
void __user *vdso; /* vdso base address */
---- a/include/linux/kexec.h
-+++ b/include/linux/kexec.h
-@@ -312,8 +312,15 @@ extern int kexec_load_disabled;
- #define VMCOREINFO_BYTES (4096)
- #define VMCOREINFO_NOTE_NAME "VMCOREINFO"
+--- a/include/linux/crash_core.h
++++ b/include/linux/crash_core.h
+@@ -22,9 +22,16 @@
+ #define VMCOREINFO_BYTES PAGE_SIZE
+ #define VMCOREINFO_NOTE_NAME "VMCOREINFO"
#define VMCOREINFO_NOTE_NAME_BYTES ALIGN(sizeof(VMCOREINFO_NOTE_NAME), 4)
+#if !defined(CONFIG_XEN) || !defined(CONFIG_X86)
- #define VMCOREINFO_NOTE_SIZE (KEXEC_NOTE_HEAD_BYTES*2 + VMCOREINFO_BYTES \
- + VMCOREINFO_NOTE_NAME_BYTES)
+ #define VMCOREINFO_NOTE_SIZE ((CRASH_CORE_NOTE_HEAD_BYTES * 2) + \
+ VMCOREINFO_NOTE_NAME_BYTES + \
+ VMCOREINFO_BYTES)
+#else
-+#define VMCOREINFO_NOTE_SIZE ALIGN(KEXEC_NOTE_HEAD_BYTES*2 \
++#define VMCOREINFO_NOTE_SIZE ALIGN(CRASH_CORE_NOTE_HEAD_BYTES * 2 \
+ + VMCOREINFO_BYTES \
+ + VMCOREINFO_NOTE_NAME_BYTES, \
+ PAGE_SIZE)
+#endif
- /* Location of a reserved region to hold the crash kernel.
- */
+ typedef u32 note_buf_t[CRASH_CORE_NOTE_BYTES/4];
+
--- a/include/linux/oprofile.h
+++ b/include/linux/oprofile.h
@@ -129,6 +129,8 @@ void oprofile_add_ext_hw_sample(unsigned
@@ -8464,38 +8465,25 @@ Acked-by: jbeulich@novell.com
struct device_driver driver;
int (*read_otherend_details)(struct xenbus_device *dev);
int (*is_ready)(struct xenbus_device *dev);
---- a/kernel/kexec_core.c
-+++ b/kernel/kexec_core.c
-@@ -55,7 +55,11 @@ note_buf_t __percpu *crash_notes;
-
- /* vmcoreinfo stuff */
- static unsigned char vmcoreinfo_data[VMCOREINFO_BYTES];
--u32 vmcoreinfo_note[VMCOREINFO_NOTE_SIZE/4];
-+u32
-+#if defined(CONFIG_XEN) && defined(CONFIG_X86)
-+__attribute__((__section__(".bss.page_aligned"), __aligned__(PAGE_SIZE)))
-+#endif
-+vmcoreinfo_note[VMCOREINFO_NOTE_SIZE/4];
- size_t vmcoreinfo_size;
- size_t vmcoreinfo_max_size = sizeof(vmcoreinfo_data);
-
-@@ -1123,6 +1127,7 @@ static int __init crash_notes_memory_ini
- subsys_initcall(crash_notes_memory_init);
-
+--- a/kernel/crash_core.c
++++ b/kernel/crash_core.c
+@@ -21,6 +21,7 @@ u32 *vmcoreinfo_note;
+ /* trusted vmcoreinfo, e.g. we can make a copy in the crash memory */
+ static unsigned char *vmcoreinfo_data_safecopy;
+#ifndef CONFIG_XEN
/*
* parsing the "crashkernel" commandline
*
-@@ -1394,6 +1399,7 @@ int __init parse_crashkernel_low(char *c
+@@ -292,6 +293,7 @@ int __init parse_crashkernel_low(char *c
return __parse_crashkernel(cmdline, system_ram, crash_size, crash_base,
"crashkernel=", suffix_tbl[SUFFIX_LOW]);
}
+#endif
- static void update_vmcoreinfo_note(void)
- {
-@@ -1449,7 +1455,18 @@ static int __init crash_save_vmcoreinfo_
+ Elf_Word *append_elf_note(Elf_Word *buf, char *name, unsigned int type,
+ void *data, size_t data_len)
+@@ -399,7 +401,18 @@ static int __init crash_save_vmcoreinfo_
VMCOREINFO_SYMBOL(init_uts_ns);
VMCOREINFO_SYMBOL(node_online_map);
#ifdef CONFIG_MMU
diff --git a/patches.xen/xen3-patch-2.6.25 b/patches.xen/xen3-patch-2.6.25
index 599331ea2c..77956210e2 100644
--- a/patches.xen/xen3-patch-2.6.25
+++ b/patches.xen/xen3-patch-2.6.25
@@ -17,7 +17,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -146,7 +146,7 @@ config X86
+@@ -152,7 +152,7 @@ config X86
select HAVE_KPROBES
select HAVE_KPROBES_ON_FTRACE
select HAVE_KRETPROBES
@@ -26,7 +26,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches
select HAVE_LIVEPATCH if X86_64
select HAVE_MEMBLOCK
select HAVE_MEMBLOCK_NODE_MAP
-@@ -306,14 +306,12 @@ config X86_64_SMP
+@@ -317,14 +317,12 @@ config X86_64_SMP
depends on X86_64 && SMP
config X86_NO_TSS
@@ -43,7 +43,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches
config X86_32_LAZY_GS
def_bool y
-@@ -1045,9 +1043,8 @@ config X86_IO_APIC
+@@ -1056,9 +1054,8 @@ config X86_IO_APIC
depends on !XEN_UNPRIVILEGED_GUEST
config X86_XEN_GENAPIC
@@ -54,7 +54,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches
config X86_REROUTE_FOR_BROKEN_BOOT_IRQS
bool "Reroute for broken boot IRQs"
-@@ -1539,7 +1536,7 @@ config ARCH_SPARSEMEM_ENABLE
+@@ -1558,7 +1555,7 @@ config ARCH_SPARSEMEM_ENABLE
config ARCH_SPARSEMEM_DEFAULT
def_bool y
@@ -63,7 +63,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches
config ARCH_SELECT_MEMORY_MODEL
def_bool y
-@@ -2574,10 +2571,10 @@ config PCI_CNB20LE_QUIRK
+@@ -2593,10 +2590,10 @@ config PCI_CNB20LE_QUIRK
You should say N unless you know you need this.
config XEN_PCIDEV_FRONTEND
@@ -76,7 +76,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches
help
The PCI device frontend driver allows the kernel to import arbitrary
PCI devices from a PCI backend to support PCI driver domains.
-@@ -2585,7 +2582,6 @@ config XEN_PCIDEV_FRONTEND
+@@ -2604,7 +2601,6 @@ config XEN_PCIDEV_FRONTEND
config XEN_PCIDEV_FE_DEBUG
bool "Xen PCI Frontend Debugging"
depends on XEN_PCIDEV_FRONTEND
@@ -86,7 +86,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches
--- a/arch/x86/Kconfig.debug
+++ b/arch/x86/Kconfig.debug
-@@ -252,6 +252,7 @@ config DEBUG_BOOT_PARAMS
+@@ -275,6 +275,7 @@ config DEBUG_BOOT_PARAMS
bool "Debug boot parameters"
depends on DEBUG_KERNEL
depends on DEBUG_FS
@@ -141,7 +141,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches
ia32_syscall_end:
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
-@@ -150,11 +150,10 @@ ifeq ($(CONFIG_X86_64),y)
+@@ -144,11 +144,10 @@ ifeq ($(CONFIG_X86_64),y)
obj-$(CONFIG_PCI_MMCONFIG) += mmconf-fam10h_64.o
obj-y += vsmp_64.o
@@ -157,7 +157,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches
-%/head_64.o %/head_64.s: asflags-$(CONFIG_XEN) :=
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
-@@ -127,6 +127,11 @@ char *__init __acpi_map_table(unsigned l
+@@ -128,6 +128,11 @@ char *__init __acpi_map_table(unsigned l
if (!phys || !size)
return NULL;
@@ -2580,14 +2580,14 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches
+}
--- a/arch/x86/kernel/machine_kexec_64.c
+++ b/arch/x86/kernel/machine_kexec_64.c
-@@ -330,7 +330,9 @@ void machine_kexec(struct kimage *image)
+@@ -345,7 +345,9 @@ void machine_kexec(struct kimage *image)
void arch_crash_save_vmcoreinfo(void)
{
+#ifndef CONFIG_XEN /* could really be CONFIG_RELOCATABLE */
VMCOREINFO_NUMBER(phys_base);
+#endif
- VMCOREINFO_SYMBOL(init_level4_pgt);
+ VMCOREINFO_SYMBOL(init_top_pgt);
#ifdef CONFIG_NUMA
--- a/arch/x86/kernel/cpu/microcode/core-xen.c
@@ -12294,7 +12294,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches
-}
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
-@@ -560,7 +560,13 @@ int pci_wait_for_pending(struct pci_dev
+@@ -562,7 +562,13 @@ int pci_wait_for_pending(struct pci_dev
* Restore the BAR values for a given device, so as to make it
* accessible by its driver.
*/
@@ -12311,7 +12311,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches
--- a/drivers/xen/Kconfig
+++ b/drivers/xen/Kconfig
-@@ -414,6 +414,17 @@ config XEN_SMPBOOT
+@@ -418,6 +418,17 @@ config XEN_SMPBOOT
def_bool y
depends on SMP && !PPC_XEN
@@ -12976,18 +12976,18 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches
#define BIOS_BEGIN 0x000a0000
--- a/arch/x86/include/asm/hardirq.h
+++ b/arch/x86/include/asm/hardirq.h
-@@ -22,7 +22,11 @@ typedef struct {
- #ifdef CONFIG_SMP
+@@ -24,7 +24,11 @@ typedef struct {
unsigned int irq_resched_count;
unsigned int irq_call_count;
-+#ifndef CONFIG_XEN
+ #endif
++#if !defined(CONFIG_XEN)
unsigned int irq_tlb_count;
-+#else
++#elif defined(CONFIG_SMP)
+ unsigned int irq_lock_count;
+#endif
- #endif
#ifdef CONFIG_X86_THERMAL_VECTOR
unsigned int irq_thermal_count;
+ #endif
--- a/arch/x86/include/mach-xen/asm/agp.h
+++ b/arch/x86/include/mach-xen/asm/agp.h
@@ -13,18 +13,13 @@
@@ -20028,15 +20028,15 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches
-#endif /* _X8664_TLBFLUSH_H */
--- a/arch/x86/include/asm/mmu.h
+++ b/arch/x86/include/asm/mmu.h
-@@ -40,7 +40,7 @@ typedef struct {
+@@ -40,6 +40,8 @@ typedef struct {
#endif
} mm_context_t;
--#ifdef CONFIG_SMP
-+#if defined(CONFIG_SMP) && !defined(CONFIG_XEN)
++#ifndef CONFIG_XEN
void leave_mm(int cpu);
- #else
- static inline void leave_mm(int cpu)
++#endif
+
+ #endif /* _ASM_X86_MMU_H */
--- a/arch/x86/include/asm/ptrace.h
+++ b/arch/x86/include/asm/ptrace.h
@@ -216,7 +216,9 @@ static inline unsigned long regs_get_ker
@@ -20052,7 +20052,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches
#define arch_has_block_step() (boot_cpu_data.x86 >= 6)
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
-@@ -99,6 +99,9 @@ struct thread_info {
+@@ -98,6 +98,9 @@ struct thread_info {
#define TIF_SYSCALL_TRACEPOINT 28 /* syscall tracepoint instrumentation */
#define TIF_ADDR32 29 /* 32-bit address space on 64 bits */
#define TIF_X32 30 /* 32-bit native x86-64 binary */
@@ -20062,7 +20062,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches
#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
-@@ -121,6 +124,7 @@ struct thread_info {
+@@ -122,6 +125,7 @@ struct thread_info {
#define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT)
#define _TIF_ADDR32 (1 << TIF_ADDR32)
#define _TIF_X32 (1 << TIF_X32)
@@ -20070,9 +20070,9 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches
/*
* work to do in syscall_trace_enter(). Also includes TIF_NOHZ for
-@@ -141,12 +145,12 @@ struct thread_info {
+@@ -144,12 +148,12 @@ struct thread_info {
#define _TIF_WORK_CTXSW \
- (_TIF_IO_BITMAP|_TIF_NOTSC|_TIF_BLOCKSTEP)
+ (_TIF_IO_BITMAP|_TIF_NOCPUID|_TIF_NOTSC|_TIF_BLOCKSTEP)
-#define _TIF_WORK_CTXSW_PREV (_TIF_WORK_CTXSW|_TIF_USER_RETURN_NOTIFY)
-#define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW)
@@ -20102,7 +20102,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches
PG_pinned = PG_owner_priv_1,
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
-@@ -1069,6 +1069,9 @@ void pci_update_resource(struct pci_dev
+@@ -1084,6 +1084,9 @@ void pci_update_resource(struct pci_dev
int __must_check pci_assign_resource(struct pci_dev *dev, int i);
int __must_check pci_reassign_resource(struct pci_dev *dev, int i, resource_size_t add_size, resource_size_t align);
int pci_select_bars(struct pci_dev *dev, unsigned long flags);
@@ -20235,7 +20235,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches
}
--- a/mm/memory.c
+++ b/mm/memory.c
-@@ -2106,6 +2106,10 @@ int apply_to_page_range(struct mm_struct
+@@ -2136,6 +2136,10 @@ int apply_to_page_range(struct mm_struct
if (WARN_ON(addr >= end))
return -EINVAL;
diff --git a/patches.xen/xen3-patch-2.6.26 b/patches.xen/xen3-patch-2.6.26
index 6f7805d1c7..2898d18e3b 100644
--- a/patches.xen/xen3-patch-2.6.26
+++ b/patches.xen/xen3-patch-2.6.26
@@ -11,7 +11,7 @@ Automatically created from "patches.kernel.org/patch-2.6.26" by xen-port-patches
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -102,7 +102,7 @@ config X86
+@@ -107,7 +107,7 @@ config X86
select HAVE_ARCH_HUGE_VMAP if X86_64 || X86_PAE
select HAVE_ARCH_JUMP_LABEL
select HAVE_ARCH_KASAN if X86_64 && SPARSEMEM_VMEMMAP
@@ -20,7 +20,7 @@ Automatically created from "patches.kernel.org/patch-2.6.26" by xen-port-patches
select HAVE_ARCH_KMEMCHECK
select HAVE_ARCH_MMAP_RND_BITS if MMU
select HAVE_ARCH_MMAP_RND_COMPAT_BITS if MMU && COMPAT
-@@ -1432,7 +1432,7 @@ config ARCH_DMA_ADDR_T_64BIT
+@@ -1451,7 +1451,7 @@ config ARCH_DMA_ADDR_T_64BIT
config X86_DIRECT_GBPAGES
def_bool y
@@ -29,7 +29,7 @@ Automatically created from "patches.kernel.org/patch-2.6.26" by xen-port-patches
---help---
Certain kernel features effectively disable kernel
linear 1 GB mappings (even if the CPU otherwise
-@@ -2880,6 +2880,4 @@ source "crypto/Kconfig"
+@@ -2898,6 +2898,4 @@ source "crypto/Kconfig"
source "arch/x86/kvm/Kconfig"
@@ -100,7 +100,7 @@ Automatically created from "patches.kernel.org/patch-2.6.26" by xen-port-patches
.quad sys_pause
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
-@@ -152,8 +152,7 @@ ifeq ($(CONFIG_X86_64),y)
+@@ -146,8 +146,7 @@ ifeq ($(CONFIG_X86_64),y)
obj-$(CONFIG_XEN) += nmi_64.o
time_64-$(CONFIG_XEN) += time_32.o
@@ -113,7 +113,7 @@ Automatically created from "patches.kernel.org/patch-2.6.26" by xen-port-patches
+ pci-swiotlb_64.o reboot.o smpboot.o tlb_$(BITS).o tsc_$(BITS).o tsc_sync.o vsmp_64.o
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
-@@ -180,6 +180,7 @@ static int __init acpi_parse_madt(struct
+@@ -181,6 +181,7 @@ static int __init acpi_parse_madt(struct
*/
static int acpi_register_lapic(int id, u32 acpiid, u8 enabled)
{
@@ -121,7 +121,7 @@ Automatically created from "patches.kernel.org/patch-2.6.26" by xen-port-patches
unsigned int ver = 0;
int cpu;
-@@ -201,6 +202,7 @@ static int acpi_register_lapic(int id, u
+@@ -202,6 +203,7 @@ static int acpi_register_lapic(int id, u
early_per_cpu(x86_cpu_to_acpiid, cpu) = acpiid;
return cpu;
@@ -711,7 +711,7 @@ Automatically created from "patches.kernel.org/patch-2.6.26" by xen-port-patches
}
--- a/arch/x86/kernel/cpu/proc.c
+++ b/arch/x86/kernel/cpu/proc.c
-@@ -10,7 +10,7 @@
+@@ -9,7 +9,7 @@
static void show_cpuinfo_core(struct seq_file *m, struct cpuinfo_x86 *c,
unsigned int cpu)
{
@@ -720,7 +720,7 @@ Automatically created from "patches.kernel.org/patch-2.6.26" by xen-port-patches
seq_printf(m, "physical id\t: %d\n", c->phys_proc_id);
seq_printf(m, "siblings\t: %d\n",
cpumask_weight(topology_core_cpumask(cpu)));
-@@ -25,16 +25,20 @@ static void show_cpuinfo_core(struct seq
+@@ -24,16 +24,20 @@ static void show_cpuinfo_core(struct seq
static void show_cpuinfo_misc(struct seq_file *m, struct cpuinfo_x86 *c)
{
seq_printf(m,
@@ -732,7 +732,7 @@ Automatically created from "patches.kernel.org/patch-2.6.26" by xen-port-patches
"fpu\t\t: %s\n"
"fpu_exception\t: %s\n"
"cpuid level\t: %d\n"
- "wp\t\t: %s\n",
+ "wp\t\t: yes\n",
+#ifndef CONFIG_XEN
static_cpu_has_bug(X86_BUG_FDIV) ? "yes" : "no",
static_cpu_has_bug(X86_BUG_F00F) ? "yes" : "no",
@@ -740,7 +740,7 @@ Automatically created from "patches.kernel.org/patch-2.6.26" by xen-port-patches
+#endif
static_cpu_has(X86_FEATURE_FPU) ? "yes" : "no",
static_cpu_has(X86_FEATURE_FPU) ? "yes" : "no",
- c->cpuid_level,
+ c->cpuid_level);
--- a/arch/x86/kernel/e820-xen.c
+++ b/arch/x86/kernel/e820-xen.c
@@ -41,11 +41,11 @@ unsigned long end_pfn;
@@ -1766,7 +1766,7 @@ Automatically created from "patches.kernel.org/patch-2.6.26" by xen-port-patches
+#endif
--- a/arch/x86/kernel/machine_kexec_64.c
+++ b/arch/x86/kernel/machine_kexec_64.c
-@@ -79,15 +79,19 @@ int __init machine_kexec_setup_resources
+@@ -80,15 +80,19 @@ int __init machine_kexec_setup_resources
{
int k;
@@ -10801,7 +10801,7 @@ Automatically created from "patches.kernel.org/patch-2.6.26" by xen-port-patches
/**
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
-@@ -2251,7 +2251,7 @@ config FB_VIRTUAL
+@@ -2249,7 +2249,7 @@ config FB_VIRTUAL
config XEN_FBDEV_FRONTEND
tristate "Xen virtual frame buffer support"
@@ -11227,7 +11227,7 @@ Automatically created from "patches.kernel.org/patch-2.6.26" by xen-port-patches
}
return 0;
}
-@@ -1764,9 +1764,7 @@ static int __init blkif_init(void)
+@@ -1763,9 +1763,7 @@ static int __init blkif_init(void)
* We only create the device when a request of a new device is
* made.
*/
@@ -15579,7 +15579,7 @@ Automatically created from "patches.kernel.org/patch-2.6.26" by xen-port-patches
#endif
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
-@@ -480,29 +480,28 @@ static __always_inline void SetPageUptod
+@@ -483,29 +483,28 @@ static __always_inline void SetPageUptod
CLEARPAGEFLAG(Uptodate, uptodate, PF_NO_TAIL)
@@ -15812,7 +15812,7 @@ Automatically created from "patches.kernel.org/patch-2.6.26" by xen-port-patches
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
-@@ -1995,7 +1995,7 @@ config TEST_UDELAY
+@@ -1868,7 +1868,7 @@ config TEST_UDELAY
config MEMTEST
bool "Memtest"
diff --git a/patches.xen/xen3-patch-2.6.27 b/patches.xen/xen3-patch-2.6.27
index b9a848c444..d0bf16a9d7 100644
--- a/patches.xen/xen3-patch-2.6.27
+++ b/patches.xen/xen3-patch-2.6.27
@@ -15,10 +15,13 @@ have been needed - see SLE11 SPn).
2.6.28/arch/x86/kernel/cpu/common_64-xen.c
3.16/arch/x86/vdso/vdso32.S
4.4/arch/x86/entry/vdso/Makefile
+4.12/include/uapi/Kbuild
+4.12/include/uapi/xen/public/Kbuild
+4.13/kernel/crash_core.c
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -1713,7 +1713,7 @@ config MTRR
+@@ -1732,7 +1732,7 @@ config MTRR
config MTRR_SANITIZER
def_bool y
prompt "MTRR cleanup support"
@@ -29,7 +32,7 @@ have been needed - see SLE11 SPn).
add writeback entries.
--- a/arch/x86/Kconfig.debug
+++ b/arch/x86/Kconfig.debug
-@@ -8,6 +8,7 @@ source "lib/Kconfig.debug"
+@@ -11,6 +11,7 @@ config EARLY_PRINTK_USB
config X86_VERBOSE_BOOTUP
bool "Enable verbose x86 bootup info messages"
default y
@@ -37,7 +40,7 @@ have been needed - see SLE11 SPn).
---help---
Enables the informational output from the decompression stage
(e.g. bzImage) of the boot. If you disable this you will still
-@@ -163,6 +164,7 @@ config IOMMU_LEAK
+@@ -186,6 +187,7 @@ config IOMMU_LEAK
config HAVE_MMIOTRACE_SUPPORT
def_bool y
@@ -47,7 +50,7 @@ have been needed - see SLE11 SPn).
bool "x86 instruction decoder selftest"
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
-@@ -217,8 +217,8 @@ KBUILD_CFLAGS += -fno-asynchronous-unwin
+@@ -235,8 +235,8 @@ KBUILD_CFLAGS += -fno-asynchronous-unwin
endif
# Xen subarch support
@@ -303,7 +306,7 @@ have been needed - see SLE11 SPn).
ia32_syscall_end:
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
-@@ -150,9 +150,11 @@ ifeq ($(CONFIG_X86_64),y)
+@@ -144,9 +144,11 @@ ifeq ($(CONFIG_X86_64),y)
obj-$(CONFIG_PCI_MMCONFIG) += mmconf-fam10h_64.o
obj-y += vsmp_64.o
@@ -320,7 +323,7 @@ have been needed - see SLE11 SPn).
+disabled-obj-$(CONFIG_XEN_UNPRIVILEGED_GUEST) += probe_roms_32.o
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
-@@ -1341,6 +1341,7 @@ static int __init dmi_disable_acpi(const
+@@ -1350,6 +1350,7 @@ static int __init dmi_disable_acpi(const
return 0;
}
@@ -328,7 +331,7 @@ have been needed - see SLE11 SPn).
/*
* Force ignoring BIOS IRQ0 override
*/
-@@ -1353,6 +1354,7 @@ static int __init dmi_ignore_irq0_timer_
+@@ -1362,6 +1363,7 @@ static int __init dmi_ignore_irq0_timer_
}
return 0;
}
@@ -336,7 +339,7 @@ have been needed - see SLE11 SPn).
static int __init force_acpi_rsdt(const struct dmi_system_id *d)
{
-@@ -1493,6 +1495,7 @@ static struct dmi_system_id __initdata a
+@@ -1502,6 +1504,7 @@ static struct dmi_system_id __initdata a
{}
};
@@ -344,7 +347,7 @@ have been needed - see SLE11 SPn).
/* second table for DMI checks that should run after early-quirks */
static struct dmi_system_id __initdata acpi_dmi_table_late[] = {
/*
-@@ -1547,6 +1550,7 @@ static struct dmi_system_id __initdata a
+@@ -1556,6 +1559,7 @@ static struct dmi_system_id __initdata a
},
{}
};
@@ -352,7 +355,7 @@ have been needed - see SLE11 SPn).
/*
* acpi_boot_table_init() and acpi_boot_init()
-@@ -1630,8 +1634,10 @@ static int __init acpi_parse_bgrt(struct
+@@ -1633,8 +1637,10 @@ int __init early_acpi_boot_init(void)
int __init acpi_boot_init(void)
{
@@ -392,7 +395,7 @@ have been needed - see SLE11 SPn).
static int modern_apic(void)
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
-@@ -483,7 +483,7 @@ static void early_init_amd_mc(struct cpu
+@@ -484,7 +484,7 @@ static void early_init_amd_mc(struct cpu
static void bsp_init_amd(struct cpuinfo_x86 *c)
{
@@ -2874,16 +2877,16 @@ have been needed - see SLE11 SPn).
jmp syscall_exit
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
-@@ -923,7 +923,7 @@ SYM_FUNC_START(arch_dwarf_init_running)
- SYM_FUNC_END(arch_dwarf_init_running)
- #endif
+@@ -995,7 +995,7 @@ ENTRY(do_softirq_own_stack)
+ ret
+ ENDPROC(do_softirq_own_stack)
-#ifdef CONFIG_XEN
+#ifdef CONFIG_PARAVIRT_XEN
idtentry xen_hypervisor_callback xen_do_hypervisor_callback has_error_code=0
/*
-@@ -1008,7 +1008,7 @@ END(xen_failsafe_callback)
+@@ -1083,7 +1083,7 @@ END(xen_failsafe_callback)
apicinterrupt3 HYPERVISOR_CALLBACK_VECTOR \
xen_hvm_callback_vector xen_evtchn_do_upcall
@@ -4455,7 +4458,7 @@ have been needed - see SLE11 SPn).
alloc_bootmem_pages(PAGE_SIZE);
--- a/arch/x86/kernel/machine_kexec_32.c
+++ b/arch/x86/kernel/machine_kexec_32.c
-@@ -130,22 +130,11 @@ void machine_kexec_setup_load_arg(xen_ke
+@@ -132,22 +132,11 @@ void machine_kexec_setup_load_arg(xen_ke
xki->page_list[PA_PTE_0] = __ma(kexec_pte0);
xki->page_list[PA_PTE_1] = __ma(kexec_pte1);
@@ -4483,7 +4486,7 @@ have been needed - see SLE11 SPn).
--- a/arch/x86/kernel/machine_kexec_64.c
+++ b/arch/x86/kernel/machine_kexec_64.c
-@@ -73,24 +73,7 @@ void machine_kexec_setup_load_arg(xen_ke
+@@ -74,24 +74,7 @@ void machine_kexec_setup_load_arg(xen_ke
xki->page_list[PA_PTE_1] = __ma(kexec_pte1);
}
@@ -13101,12 +13104,12 @@ have been needed - see SLE11 SPn).
#define PREFIX "PCI: "
/* Indicate if the mmcfg resources have been placed into the resource table. */
-@@ -440,6 +444,36 @@ static int is_acpi_reserved(u64 start, u
+@@ -440,6 +444,36 @@ static bool is_acpi_reserved(u64 start,
return mcfg_res.flags;
}
-+static int xen_report_mmconf_reserved(const struct pci_mmcfg_region *cfg,
-+ int valid, int with_e820)
++static bool xen_report_mmconf_reserved(const struct pci_mmcfg_region *cfg,
++ bool valid, int with_e820)
+{
+#ifdef CONFIG_XEN
+ if (!with_e820) {
@@ -13135,27 +13138,27 @@ have been needed - see SLE11 SPn).
+ return valid;
+}
+
- typedef int (*check_reserved_t)(u64 start, u64 end, unsigned type);
+ typedef bool (*check_reserved_t)(u64 start, u64 end, unsigned type);
- static int __ref is_mmconf_reserved(check_reserved_t is_reserved,
-@@ -459,7 +493,7 @@ static int __ref is_mmconf_reserved(chec
+ static bool __ref is_mmconf_reserved(check_reserved_t is_reserved,
+@@ -459,7 +493,7 @@ static bool __ref is_mmconf_reserved(che
}
if (size < (16UL<<20) && size != old_size)
- return 0;
-+ return xen_report_mmconf_reserved(cfg, 0, with_e820);
++ return xen_report_mmconf_reserved(cfg, false, with_e820);
if (dev)
dev_info(dev, "MMCONFIG at %pR reserved in %s\n",
-@@ -491,7 +525,7 @@ static int __ref is_mmconf_reserved(chec
+@@ -491,7 +525,7 @@ static bool __ref is_mmconf_reserved(che
&cfg->res, (unsigned long) cfg->address);
}
- return 1;
-+ return xen_report_mmconf_reserved(cfg, 1, with_e820);
++ return xen_report_mmconf_reserved(cfg, true, with_e820);
}
- static int __ref pci_mmcfg_check_reserved(struct device *dev,
+ static bool __ref
--- a/arch/x86/entry/vdso/vdso32-setup-xen.c
+++ b/arch/x86/entry/vdso/vdso32-setup-xen.c
@@ -195,50 +195,28 @@ static __init void relocate_vdso(Elf32_E
@@ -13293,16 +13296,7 @@ have been needed - see SLE11 SPn).
memcpy(syscall_page, vsyscall, vsyscall_len);
--- a/arch/x86/xen/Kconfig
+++ b/arch/x86/xen/Kconfig
-@@ -26,7 +26,7 @@ config XEN_PVHVM
-
- config XEN_512GB
- bool "Limit Xen pv-domain memory to 512GB"
-- depends on XEN && X86_64
-+ depends on PARAVIRT_XEN && X86_64
- default y
- help
- Limit paravirtualized user domains to 512GB of RAM.
-@@ -39,7 +39,7 @@ config XEN_512GB
+@@ -60,7 +60,7 @@ config XEN_512GB
config XEN_SAVE_RESTORE
bool
@@ -13348,7 +13342,7 @@ have been needed - see SLE11 SPn).
--- a/drivers/acpi/acpi_processor.c
+++ b/drivers/acpi/acpi_processor.c
-@@ -447,7 +447,7 @@ static int acpi_processor_add(struct acp
+@@ -442,7 +442,7 @@ static int acpi_processor_add(struct acp
#ifndef CONFIG_XEN
per_cpu(processor_device_array, pr->id) = device;
#else
@@ -13357,7 +13351,7 @@ have been needed - see SLE11 SPn).
#endif
per_cpu(processors, pr->id) = pr;
-@@ -469,6 +469,9 @@ static int acpi_processor_add(struct acp
+@@ -464,6 +464,9 @@ static int acpi_processor_add(struct acp
dev_err(dev, "Processor driver could not be attached\n");
acpi_unbind_one(dev);
@@ -13367,7 +13361,7 @@ have been needed - see SLE11 SPn).
err:
#ifdef CONFIG_XEN
-@@ -514,8 +517,10 @@ static void acpi_processor_remove(struct
+@@ -509,8 +512,10 @@ static void acpi_processor_remove(struct
* Unbind the driver from the processor device and detach it from the
* ACPI companion object.
*/
@@ -13547,7 +13541,7 @@ have been needed - see SLE11 SPn).
--- a/drivers/xen/Kconfig
+++ b/drivers/xen/Kconfig
-@@ -415,6 +415,10 @@ config XEN_SMPBOOT
+@@ -419,6 +419,10 @@ config XEN_SMPBOOT
config XEN_SPINLOCK_ACQUIRE_NESTING
int "maximum nesting level for acquiring spin locks"
depends on SMP
@@ -13634,7 +13628,7 @@ have been needed - see SLE11 SPn).
DPRINTK("pid received %p:%d\n",
info->pid_ns, info->pid);
}
-@@ -1764,7 +1765,8 @@ static int __init blkif_init(void)
+@@ -1763,7 +1764,8 @@ static int __init blkif_init(void)
* We only create the device when a request of a new device is
* made.
*/
@@ -14304,7 +14298,7 @@ have been needed - see SLE11 SPn).
return 0;
error_nomem:
-@@ -883,4 +907,5 @@ static void __exit xenfb_cleanup(void)
+@@ -882,4 +906,5 @@ static void __exit xenfb_cleanup(void)
module_init(xenfb_init);
module_exit(xenfb_cleanup);
@@ -14312,7 +14306,7 @@ have been needed - see SLE11 SPn).
MODULE_LICENSE("GPL");
--- a/drivers/xen/fbfront/xenkbd.c
+++ b/drivers/xen/fbfront/xenkbd.c
-@@ -364,4 +364,5 @@ static void __exit xenkbd_cleanup(void)
+@@ -371,4 +371,5 @@ static void __exit xenkbd_cleanup(void)
module_init(xenkbd_init);
module_exit(xenkbd_cleanup);
@@ -14530,16 +14524,6 @@ have been needed - see SLE11 SPn).
if (fd < 0)
return fd;
---- a/include/uapi/Kbuild
-+++ b/include/uapi/Kbuild
-@@ -10,6 +10,7 @@ header-y += mtd/
- header-y += rdma/
- header-y += video/
- header-y += drm/
-+header-y += xen/public/
- header-y += xen/
- header-y += scsi/
- header-y += misc/
--- a/arch/x86/include/asm/kexec.h
+++ b/arch/x86/include/asm/kexec.h
@@ -5,8 +5,21 @@
@@ -16424,14 +16408,6 @@ have been needed - see SLE11 SPn).
typedef struct xen_add_to_physmap xen_add_to_physmap_t;
DEFINE_XEN_GUEST_HANDLE(xen_add_to_physmap_t);
---- a/include/uapi/xen/public/Kbuild
-+++ b/include/uapi/xen/public/Kbuild
-@@ -1 +1,5 @@
-+header-y += evtchn.h
-+header-y += gntdev.h
- header-y += iomulti.h
-+header-y += privcmd.h
-+header-y += xenbus.h
--- a/include/uapi/xen/public/privcmd.h
+++ b/include/uapi/xen/public/privcmd.h
@@ -35,10 +35,6 @@
@@ -16458,17 +16434,6 @@ have been needed - see SLE11 SPn).
typedef struct xenbus_alloc {
domid_t dom;
__u32 port;
---- a/kernel/kexec_core.c
-+++ b/kernel/kexec_core.c
-@@ -57,7 +57,7 @@ note_buf_t __percpu *crash_notes;
- static unsigned char vmcoreinfo_data[VMCOREINFO_BYTES];
- u32
- #if defined(CONFIG_XEN) && defined(CONFIG_X86)
--__attribute__((__section__(".bss.page_aligned"), __aligned__(PAGE_SIZE)))
-+__page_aligned_bss
- #endif
- vmcoreinfo_note[VMCOREINFO_NOTE_SIZE/4];
- size_t vmcoreinfo_size;
--- a/lib/swiotlb-xen.c
+++ b/lib/swiotlb-xen.c
@@ -787,7 +787,7 @@ swiotlb_sync_sg_for_device(struct device
diff --git a/patches.xen/xen3-patch-2.6.28 b/patches.xen/xen3-patch-2.6.28
index 84c5229d5e..06d69c05a9 100644
--- a/patches.xen/xen3-patch-2.6.28
+++ b/patches.xen/xen3-patch-2.6.28
@@ -24,7 +24,7 @@ Automatically created from "patches.kernel.org/patch-2.6.28" by xen-port-patches
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -1268,7 +1268,7 @@ config MICROCODE
+@@ -1287,7 +1287,7 @@ config MICROCODE
config MICROCODE_INTEL
bool "Intel microcode loading support"
@@ -33,7 +33,7 @@ Automatically created from "patches.kernel.org/patch-2.6.28" by xen-port-patches
default MICROCODE
select FW_LOADER
---help---
-@@ -1281,7 +1281,7 @@ config MICROCODE_INTEL
+@@ -1300,7 +1300,7 @@ config MICROCODE_INTEL
config MICROCODE_AMD
bool "AMD microcode loading support"
@@ -42,7 +42,7 @@ Automatically created from "patches.kernel.org/patch-2.6.28" by xen-port-patches
select FW_LOADER
---help---
If you select this option, microcode patch loading support for AMD
-@@ -1589,6 +1589,7 @@ config HIGHPTE
+@@ -1608,6 +1608,7 @@ config HIGHPTE
config X86_CHECK_BIOS_CORRUPTION
bool "Check for low memory corruption"
@@ -50,7 +50,7 @@ Automatically created from "patches.kernel.org/patch-2.6.28" by xen-port-patches
---help---
Periodically check for memory corruption in low memory, which
is suspected to be caused by BIOS. Even when enabled in the
-@@ -1619,6 +1620,7 @@ config X86_BOOTPARAM_MEMORY_CORRUPTION_C
+@@ -1638,6 +1639,7 @@ config X86_BOOTPARAM_MEMORY_CORRUPTION_C
config X86_RESERVE_LOW
int "Amount of low memory, in kilobytes, to reserve for the BIOS"
@@ -58,7 +58,7 @@ Automatically created from "patches.kernel.org/patch-2.6.28" by xen-port-patches
default 64
range 4 640
---help---
-@@ -1743,8 +1745,8 @@ config MTRR_SANITIZER_SPARE_REG_NR_DEFAU
+@@ -1762,8 +1764,8 @@ config MTRR_SANITIZER_SPARE_REG_NR_DEFAU
config X86_PAT
def_bool y
@@ -71,7 +71,7 @@ Automatically created from "patches.kernel.org/patch-2.6.28" by xen-port-patches
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
-@@ -217,7 +217,7 @@ KBUILD_CFLAGS += -fno-asynchronous-unwin
+@@ -235,7 +235,7 @@ KBUILD_CFLAGS += -fno-asynchronous-unwin
endif
# Xen subarch support
@@ -80,7 +80,7 @@ Automatically created from "patches.kernel.org/patch-2.6.28" by xen-port-patches
mcore-$(CONFIG_XEN) := arch/x86/mach-xen/
KBUILD_CFLAGS += $(mflags-y)
-@@ -275,7 +275,7 @@ PHONY += bzImage vmlinuz $(BOOT_TARGETS)
+@@ -291,7 +291,7 @@ PHONY += bzImage vmlinuz $(BOOT_TARGETS)
ifdef CONFIG_XEN
KBUILD_CPPFLAGS := -D__XEN_INTERFACE_VERSION__=$(CONFIG_XEN_INTERFACE_VERSION) \
@@ -213,7 +213,7 @@ Automatically created from "patches.kernel.org/patch-2.6.28" by xen-port-patches
* need to be called for each cacheline of the whole page so it may
--- a/arch/x86/include/asm/hw_irq.h
+++ b/arch/x86/include/asm/hw_irq.h
-@@ -45,6 +45,13 @@ extern asmlinkage void deferred_error_in
+@@ -46,6 +46,13 @@ extern asmlinkage void deferred_error_in
extern asmlinkage void call_function_interrupt(void);
extern asmlinkage void call_function_single_interrupt(void);
@@ -253,7 +253,7 @@ Automatically created from "patches.kernel.org/patch-2.6.28" by xen-port-patches
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
-@@ -99,7 +99,7 @@ struct thread_info {
+@@ -98,7 +98,7 @@ struct thread_info {
#define TIF_SYSCALL_TRACEPOINT 28 /* syscall tracepoint instrumentation */
#define TIF_ADDR32 29 /* 32-bit address space on 64 bits */
#define TIF_X32 30 /* 32-bit native x86-64 binary */
@@ -1483,7 +1483,7 @@ Automatically created from "patches.kernel.org/patch-2.6.28" by xen-port-patches
+#endif /* _ASM_X86_XEN_XOR_H */
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
-@@ -154,7 +154,7 @@ ifeq ($(CONFIG_X86_64),y)
+@@ -148,7 +148,7 @@ ifeq ($(CONFIG_X86_64),y)
time_64-$(CONFIG_XEN) += time_32.o
endif
@@ -12916,7 +12916,7 @@ Automatically created from "patches.kernel.org/patch-2.6.28" by xen-port-patches
}
--- a/arch/x86/xen/Kconfig
+++ b/arch/x86/xen/Kconfig
-@@ -45,7 +45,7 @@ config XEN_SAVE_RESTORE
+@@ -66,7 +66,7 @@ config XEN_SAVE_RESTORE
config XEN_DEBUG_FS
bool "Enable Xen debug and tuning parameters in debugfs"
@@ -12950,7 +12950,7 @@ Automatically created from "patches.kernel.org/patch-2.6.28" by xen-port-patches
ACPI_MODULE_NAME("processor_extcntl")
--- a/drivers/char/agp/generic.c
+++ b/drivers/char/agp/generic.c
-@@ -1214,7 +1214,7 @@ int agp_generic_alloc_pages(struct agp_b
+@@ -1210,7 +1210,7 @@ int agp_generic_alloc_pages(struct agp_b
}
#ifdef CONFIG_X86
@@ -12959,7 +12959,7 @@ Automatically created from "patches.kernel.org/patch-2.6.28" by xen-port-patches
#endif
ret = 0;
out:
-@@ -1247,7 +1247,7 @@ void agp_generic_destroy_pages(struct ag
+@@ -1243,7 +1243,7 @@ void agp_generic_destroy_pages(struct ag
return;
#ifdef CONFIG_X86
@@ -12970,7 +12970,7 @@ Automatically created from "patches.kernel.org/patch-2.6.28" by xen-port-patches
for (i = 0; i < mem->page_count; i++) {
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
-@@ -759,6 +759,11 @@ static bool dmi_matches(const struct dmi
+@@ -784,6 +784,11 @@ static bool dmi_matches(const struct dmi
{
int i;
@@ -13030,7 +13030,7 @@ Automatically created from "patches.kernel.org/patch-2.6.28" by xen-port-patches
+}
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
-@@ -1830,6 +1830,11 @@ static void pci_init_capabilities(struct
+@@ -1955,6 +1955,11 @@ static void pci_init_capabilities(struct
/* Vital Product Data */
pci_vpd_init(dev);
@@ -13044,7 +13044,7 @@ Automatically created from "patches.kernel.org/patch-2.6.28" by xen-port-patches
--- a/drivers/xen/Kconfig
+++ b/drivers/xen/Kconfig
-@@ -427,9 +427,6 @@ config XEN_SPINLOCK_ACQUIRE_NESTING
+@@ -431,9 +431,6 @@ config XEN_SPINLOCK_ACQUIRE_NESTING
This option specifies how many times this can be done for each
individual spin lock (0 disables this behavior).
@@ -13054,7 +13054,7 @@ Automatically created from "patches.kernel.org/patch-2.6.28" by xen-port-patches
config XEN_DEVMEM
def_bool y
-@@ -605,6 +602,9 @@ config SWIOTLB_XEN
+@@ -609,6 +606,9 @@ config SWIOTLB_XEN
def_bool y
select SWIOTLB
diff --git a/patches.xen/xen3-patch-2.6.29 b/patches.xen/xen3-patch-2.6.29
index 31eb9837bd..08da59acff 100644
--- a/patches.xen/xen3-patch-2.6.29
+++ b/patches.xen/xen3-patch-2.6.29
@@ -12,7 +12,7 @@ Automatically created from "patches.kernel.org/patch-2.6.29" by xen-port-patches
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -418,7 +418,6 @@ config X86_XEN
+@@ -429,7 +429,6 @@ config X86_XEN
depends on X86_32
select XEN
select X86_PAE
@@ -20,7 +20,7 @@ Automatically created from "patches.kernel.org/patch-2.6.29" by xen-port-patches
help
Choose this option if you plan to run this kernel on top of the
Xen Hypervisor.
-@@ -472,7 +471,6 @@ config X86_64_XEN
+@@ -483,7 +482,6 @@ config X86_64_XEN
bool "Enable Xen compatible kernel"
depends on X86_64
select XEN
@@ -28,7 +28,7 @@ Automatically created from "patches.kernel.org/patch-2.6.29" by xen-port-patches
help
This option will compile a kernel compatible with Xen hypervisor
-@@ -919,7 +917,7 @@ config CALGARY_IOMMU_ENABLED_BY_DEFAULT
+@@ -930,7 +928,7 @@ config CALGARY_IOMMU_ENABLED_BY_DEFAULT
# need this always selected by IOMMU for the VIA workaround
config SWIOTLB
@@ -37,7 +37,7 @@ Automatically created from "patches.kernel.org/patch-2.6.29" by xen-port-patches
---help---
Support for software bounce buffers used on x86-64 systems
which don't have a hardware IOMMU. Using this PCI devices
-@@ -1048,7 +1046,7 @@ config X86_XEN_GENAPIC
+@@ -1059,7 +1057,7 @@ config X86_XEN_GENAPIC
config X86_REROUTE_FOR_BROKEN_BOOT_IRQS
bool "Reroute for broken boot IRQs"
@@ -48,7 +48,7 @@ Automatically created from "patches.kernel.org/patch-2.6.29" by xen-port-patches
spurious interrupts. This is recommended when threaded
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
-@@ -274,8 +274,8 @@ BOOT_TARGETS = bzlilo bzdisk fdimage fdi
+@@ -290,8 +290,8 @@ BOOT_TARGETS = bzlilo bzdisk fdimage fdi
PHONY += bzImage vmlinuz $(BOOT_TARGETS)
ifdef CONFIG_XEN
@@ -86,7 +86,7 @@ Automatically created from "patches.kernel.org/patch-2.6.29" by xen-port-patches
ia32_badsys:
--- a/arch/x86/include/asm/hw_irq.h
+++ b/arch/x86/include/asm/hw_irq.h
-@@ -176,6 +176,8 @@ extern atomic_t irq_mis_count;
+@@ -178,6 +178,8 @@ extern atomic_t irq_mis_count;
extern void elcr_set_level_irq(unsigned int irq);
@@ -95,7 +95,7 @@ Automatically created from "patches.kernel.org/patch-2.6.29" by xen-port-patches
extern char irq_entries_start[];
#ifdef CONFIG_TRACING
#define trace_irq_entries_start irq_entries_start
-@@ -187,6 +189,8 @@ extern char irq_entries_start[];
+@@ -189,6 +191,8 @@ extern char irq_entries_start[];
typedef struct irq_desc* vector_irq_t[NR_VECTORS];
DECLARE_PER_CPU(vector_irq_t, vector_irq);
@@ -106,8 +106,8 @@ Automatically created from "patches.kernel.org/patch-2.6.29" by xen-port-patches
#endif /* _ASM_X86_HW_IRQ_H */
--- a/arch/x86/include/asm/hypervisor.h
+++ b/arch/x86/include/asm/hypervisor.h
-@@ -66,3 +66,7 @@ static inline void init_hypervisor_platf
- static inline bool hypervisor_x2apic_available(void) { return false; }
+@@ -72,3 +72,7 @@ static inline bool hypervisor_x2apic_ava
+ static inline void hypervisor_init_mem_mapping(void) { }
#endif /* CONFIG_HYPERVISOR_GUEST */
#endif /* _ASM_X86_HYPERVISOR_H */
+
@@ -135,7 +135,7 @@ Automatically created from "patches.kernel.org/patch-2.6.29" by xen-port-patches
# define PA_CONTROL_PAGE 0
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
-@@ -147,7 +147,7 @@ struct thread_info {
+@@ -150,7 +150,7 @@ struct thread_info {
#else
#define _TIF_WORK_CTXSW (_TIF_NOTSC \
@@ -759,7 +759,7 @@ Automatically created from "patches.kernel.org/patch-2.6.29" by xen-port-patches
}
--- a/arch/x86/kernel/cpu/Makefile
+++ b/arch/x86/kernel/cpu/Makefile
-@@ -42,7 +42,7 @@ obj-$(CONFIG_X86_LOCAL_APIC) += perfctr
+@@ -43,7 +43,7 @@ obj-$(CONFIG_X86_LOCAL_APIC) += perfctr
obj-$(CONFIG_HYPERVISOR_GUEST) += vmware.o hypervisor.o mshyperv.o
@@ -5503,7 +5503,7 @@ Automatically created from "patches.kernel.org/patch-2.6.29" by xen-port-patches
image->arch.pmd0 = (pmd_t *)get_zeroed_page(GFP_KERNEL);
image->arch.pmd1 = (pmd_t *)get_zeroed_page(GFP_KERNEL);
#endif
-@@ -122,13 +133,7 @@ void machine_kexec_setup_load_arg(xen_ke
+@@ -124,13 +135,7 @@ void machine_kexec_setup_load_arg(xen_ke
memcpy(control_page, relocate_kernel, PAGE_SIZE);
xki->page_list[PA_CONTROL_PAGE] = __ma(control_page);
@@ -8755,7 +8755,7 @@ Automatically created from "patches.kernel.org/patch-2.6.29" by xen-port-patches
int cpu;
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
-@@ -2501,7 +2501,7 @@ static const struct file_operations i915
+@@ -2589,7 +2589,7 @@ static const struct file_operations i915
.open = drm_open,
.release = drm_release,
.unlocked_ioctl = drm_ioctl,
@@ -8766,8 +8766,8 @@ Automatically created from "patches.kernel.org/patch-2.6.29" by xen-port-patches
.compat_ioctl = i915_compat_ioctl,
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
-@@ -3352,6 +3352,11 @@ int __must_check i915_gem_wait_for_idle(
- unsigned int flags);
+@@ -3476,6 +3476,11 @@ int i915_gem_wait_for_idle(struct drm_i9
+ unsigned int flags);
int __must_check i915_gem_suspend(struct drm_i915_private *dev_priv);
void i915_gem_resume(struct drm_i915_private *dev_priv);
+#ifdef CONFIG_XEN
@@ -8780,7 +8780,7 @@ Automatically created from "patches.kernel.org/patch-2.6.29" by xen-port-patches
unsigned int flags,
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
-@@ -1776,6 +1776,17 @@ compute_partial_view(struct drm_i915_gem
+@@ -1861,6 +1861,17 @@ compute_partial_view(struct drm_i915_gem
return view;
}
@@ -8948,7 +8948,7 @@ Automatically created from "patches.kernel.org/patch-2.6.29" by xen-port-patches
}
--- a/drivers/xen/Kconfig
+++ b/drivers/xen/Kconfig
-@@ -546,6 +546,7 @@ config XEN_BACKEND
+@@ -550,6 +550,7 @@ config XEN_BACKEND
config XENFS
tristate "Xen filesystem"
diff --git a/patches.xen/xen3-patch-2.6.30 b/patches.xen/xen3-patch-2.6.30
index 6854e3731e..46c558b602 100644
--- a/patches.xen/xen3-patch-2.6.30
+++ b/patches.xen/xen3-patch-2.6.30
@@ -16,7 +16,7 @@ Automatically created from "patches.kernel.org/patch-2.6.30" by xen-port-patches
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -137,10 +137,10 @@ config X86
+@@ -143,10 +143,10 @@ config X86
select HAVE_IOREMAP_PROT
select HAVE_IRQ_EXIT_ON_IRQ_STACK if X86_64
select HAVE_IRQ_TIME_ACCOUNTING
@@ -29,7 +29,7 @@ Automatically created from "patches.kernel.org/patch-2.6.30" by xen-port-patches
select HAVE_KERNEL_LZO
select HAVE_KERNEL_XZ
select HAVE_KPROBES
-@@ -424,7 +424,7 @@ config X86_XEN
+@@ -435,7 +435,7 @@ config X86_XEN
config X86_BIGSMP
bool "Support for big SMP systems with more than 8 CPUs"
@@ -38,7 +38,7 @@ Automatically created from "patches.kernel.org/patch-2.6.30" by xen-port-patches
---help---
This option is needed for the systems that have more than 8 CPUs
-@@ -445,7 +445,7 @@ config INTEL_RDT_A
+@@ -456,7 +456,7 @@ config INTEL_RDT_A
Say N if unsure.
@@ -47,7 +47,7 @@ Automatically created from "patches.kernel.org/patch-2.6.30" by xen-port-patches
config X86_EXTENDED_PLATFORM
bool "Support for extended (non-PC) x86 platforms"
default y
-@@ -474,7 +474,7 @@ config X86_64_XEN
+@@ -485,7 +485,7 @@ config X86_64_XEN
help
This option will compile a kernel compatible with Xen hypervisor
@@ -56,7 +56,7 @@ Automatically created from "patches.kernel.org/patch-2.6.30" by xen-port-patches
config X86_EXTENDED_PLATFORM
bool "Support for extended (non-PC) x86 platforms"
default y
-@@ -939,7 +939,7 @@ config MAXSMP
+@@ -950,7 +950,7 @@ config MAXSMP
config NR_CPUS
int "Maximum number of CPUs" if SMP && !MAXSMP
@@ -65,7 +65,7 @@ Automatically created from "patches.kernel.org/patch-2.6.30" by xen-port-patches
range 2 512 if SMP && !MAXSMP && !CPUMASK_OFFSTACK
range 2 8192 if SMP && !MAXSMP && CPUMASK_OFFSTACK && X86_64
default "1" if !SMP
-@@ -1040,10 +1040,6 @@ config X86_IO_APIC
+@@ -1051,10 +1051,6 @@ config X86_IO_APIC
depends on X86_LOCAL_APIC || X86_UP_IOAPIC
depends on !XEN_UNPRIVILEGED_GUEST
@@ -78,7 +78,7 @@ Automatically created from "patches.kernel.org/patch-2.6.30" by xen-port-patches
depends on X86_IO_APIC && !XEN
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
-@@ -216,10 +216,6 @@ ifneq ($(CONFIG_UNWIND_INFO),y)
+@@ -234,10 +234,6 @@ ifneq ($(CONFIG_UNWIND_INFO),y)
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
endif
@@ -89,7 +89,7 @@ Automatically created from "patches.kernel.org/patch-2.6.30" by xen-port-patches
KBUILD_CFLAGS += $(mflags-y)
KBUILD_AFLAGS += $(mflags-y)
-@@ -307,10 +303,10 @@ endif
+@@ -323,10 +319,10 @@ endif
$(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE)
$(Q)mkdir -p $(objtree)/arch/$(UTS_MACHINE)/boot
$(Q)ln -fsn ../../x86/boot/bzImage $(objtree)/arch/$(UTS_MACHINE)/boot/$@
@@ -103,7 +103,7 @@ Automatically created from "patches.kernel.org/patch-2.6.30" by xen-port-patches
install:
--- a/arch/x86/boot/Makefile
+++ b/arch/x86/boot/Makefile
-@@ -196,6 +196,12 @@ $(obj)/vmlinux-stripped: OBJCOPYFLAGS :=
+@@ -197,6 +197,12 @@ $(obj)/vmlinux-stripped: OBJCOPYFLAGS :=
$(obj)/vmlinux-stripped: vmlinux FORCE
$(call if_changed,objcopy)
@@ -154,7 +154,7 @@ Automatically created from "patches.kernel.org/patch-2.6.30" by xen-port-patches
# define KEXEC_CONTROL_CODE_MAX_SIZE 2048
--- a/arch/x86/include/asm/page_64.h
+++ b/arch/x86/include/asm/page_64.h
-@@ -31,7 +31,15 @@ extern unsigned long __phys_addr_symbol(
+@@ -32,7 +32,15 @@ extern unsigned long __phys_addr_symbol(
#define __phys_reloc_hide(x) (x)
#ifdef CONFIG_FLATMEM
@@ -169,7 +169,7 @@ Automatically created from "patches.kernel.org/patch-2.6.30" by xen-port-patches
+#endif
#endif
- void clear_page(void *page);
+ void clear_page_orig(void *page);
--- a/arch/x86/include/mach-xen/asm/desc.h
+++ b/arch/x86/include/mach-xen/asm/desc.h
@@ -39,7 +39,7 @@ extern gate_desc idt_table[];
@@ -2569,7 +2569,7 @@ Automatically created from "patches.kernel.org/patch-2.6.30" by xen-port-patches
+#endif /* _ASM_X86_PGTABLE_64_DEFS_H */
--- /dev/null
+++ b/arch/x86/include/mach-xen/asm/pgtable_types.h
-@@ -0,0 +1,388 @@
+@@ -0,0 +1,392 @@
+#ifndef _ASM_X86_PGTABLE_DEFS_H
+#define _ASM_X86_PGTABLE_DEFS_H
+
@@ -2760,7 +2760,11 @@ Automatically created from "patches.kernel.org/patch-2.6.30" by xen-port-patches
+#include <linux/types.h>
+
+/* PTE_PFN_MASK extracts the PFN from a (pte|pmd|pud|pgd)val_t */
++#ifdef CONFIG_X86_64
++#define PTE_PFN_MASK ((signed long)PAGE_MASK & (((pteval_t)1 << 52) - 1))
++#else
+#define PTE_PFN_MASK ((pteval_t)PHYSICAL_PAGE_MASK)
++#endif
+
+/* PTE_FLAGS_MASK extracts the flags from a (pte|pmd|pud|pgd)val_t */
+#define PTE_FLAGS_MASK (~PTE_PFN_MASK)
@@ -3346,7 +3350,7 @@ Automatically created from "patches.kernel.org/patch-2.6.30" by xen-port-patches
#endif /* _ASM_X86_TLBFLUSH_H */
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
-@@ -141,7 +141,6 @@ obj-$(CONFIG_X86_XEN) += fixup.o
+@@ -135,7 +135,6 @@ obj-$(CONFIG_X86_XEN) += fixup.o
###
# 64 bit specific files
ifeq ($(CONFIG_X86_64),y)
@@ -3354,7 +3358,7 @@ Automatically created from "patches.kernel.org/patch-2.6.30" by xen-port-patches
obj-$(CONFIG_AUDIT) += audit_64.o
obj-$(CONFIG_GART_IOMMU) += amd_gart_64.o aperture_64.o
-@@ -150,11 +149,10 @@ ifeq ($(CONFIG_X86_64),y)
+@@ -144,11 +143,10 @@ ifeq ($(CONFIG_X86_64),y)
obj-$(CONFIG_PCI_MMCONFIG) += mmconf-fam10h_64.o
obj-y += vsmp_64.o
@@ -3371,7 +3375,7 @@ Automatically created from "patches.kernel.org/patch-2.6.30" by xen-port-patches
disabled-obj-$(CONFIG_XEN_UNPRIVILEGED_GUEST) += probe_roms_32.o
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
-@@ -127,11 +127,6 @@ char *__init __acpi_map_table(unsigned l
+@@ -128,11 +128,6 @@ char *__init __acpi_map_table(unsigned l
if (!phys || !size)
return NULL;
@@ -3383,7 +3387,7 @@ Automatically created from "patches.kernel.org/patch-2.6.30" by xen-port-patches
return early_ioremap(phys, size);
}
-@@ -164,8 +159,10 @@ static int __init acpi_parse_madt(struct
+@@ -165,8 +160,10 @@ static int __init acpi_parse_madt(struct
madt->address);
}
@@ -3394,7 +3398,7 @@ Automatically created from "patches.kernel.org/patch-2.6.30" by xen-port-patches
return 0;
}
-@@ -233,7 +230,7 @@ acpi_parse_x2apic(struct acpi_subtable_h
+@@ -234,7 +231,7 @@ acpi_parse_x2apic(struct acpi_subtable_h
printk(KERN_WARNING PREFIX "x2apic entry ignored\n");
else
acpi_register_lapic(apic_id, processor->uid, enabled);
@@ -8570,7 +8574,7 @@ Automatically created from "patches.kernel.org/patch-2.6.30" by xen-port-patches
#endif
--- a/arch/x86/kernel/machine_kexec_64.c
+++ b/arch/x86/kernel/machine_kexec_64.c
-@@ -64,13 +64,8 @@ void machine_kexec_setup_load_arg(xen_ke
+@@ -65,13 +65,8 @@ void machine_kexec_setup_load_arg(xen_ke
xki->page_list[PA_CONTROL_PAGE] = __ma(control_page);
xki->page_list[PA_TABLE_PAGE] = __ma(table_page);
@@ -11630,7 +11634,7 @@ Automatically created from "patches.kernel.org/patch-2.6.30" by xen-port-patches
- pud_t *pud;
- pmd_t *pmd;
- pte_t *pte;
--
+
- pgd = (pgd_t *)read_cr3();
-
- pgd = __va((unsigned long)pgd & PHYSICAL_PAGE_MASK);
@@ -11644,7 +11648,7 @@ Automatically created from "patches.kernel.org/patch-2.6.30" by xen-port-patches
- printk(KERN_CONT "PUD %lx ", pud_val(*pud));
- if (!pud_present(*pud) || pud_large(*pud))
- goto ret;
-
+-
- pmd = pmd_offset(pud, address);
- if (bad_address(pmd)) goto bad;
- printk(KERN_CONT "PMD %lx ", pmd_val(*pmd));
@@ -11837,16 +11841,29 @@ Automatically created from "patches.kernel.org/patch-2.6.30" by xen-port-patches
{
-#ifdef CONFIG_X86_32
- if (!oops_may_print())
+- return;
+-#endif
+ unsigned long bit;
-+
+
+-#ifdef CONFIG_X86_PAE
+- if (error_code & PF_INSTR) {
+- unsigned int level;
+- pte_t *pte = lookup_address(address, &level);
+ if (!v8086_mode(regs))
+ return;
-+
+
+- if (pte && pte_present(*pte) && !pte_exec(*pte))
+- printk(KERN_CRIT "kernel tried to execute "
+- "NX-protected page - exploit attempt? "
+- "(uid: %d)\n", current_uid());
+- }
+-#endif
+ bit = (address - 0xA0000) >> PAGE_SHIFT;
+ if (bit < 32)
+ tsk->thread.screen_bitmap |= 1 << bit;
+}
-+
+
+- printk(KERN_ALERT "BUG: unable to handle kernel ");
+static void dump_pagetable(unsigned long address)
+{
+ __typeof__(pte_val(__pte(0))) page;
@@ -11855,18 +11872,18 @@ Automatically created from "patches.kernel.org/patch-2.6.30" by xen-port-patches
+ page = ((__typeof__(page) *) __va(page))[address >> PGDIR_SHIFT];
+
+#ifdef CONFIG_X86_PAE
-+ printk("*pdpt = %016Lx ", page);
++ pr_info("*pdpt = %016Lx ", page);
+ if ((page & _PAGE_PRESENT)
+ && mfn_to_local_pfn(page >> PAGE_SHIFT) < max_low_pfn) {
+ page = mfn_to_pfn(page >> PAGE_SHIFT);
+ page <<= PAGE_SHIFT;
+ page = ((__typeof__(page) *) __va(page))[(address >> PMD_SHIFT)
+ & (PTRS_PER_PMD - 1)];
-+ printk(KERN_CONT "*pde = %016Lx ", page);
++ pr_cont("*pde = %016Lx ", page);
+ page &= ~_PAGE_NX;
+ }
+#else
-+ printk("*pde = %08lx ", page);
++ pr_info("*pde = %08lx ", page);
+#endif
+
+ /*
@@ -11883,10 +11900,10 @@ Automatically created from "patches.kernel.org/patch-2.6.30" by xen-port-patches
+ page <<= PAGE_SHIFT;
+ page = ((__typeof__(page) *) __va(page))[(address >> PAGE_SHIFT)
+ & (PTRS_PER_PTE - 1)];
-+ printk(KERN_CONT "*pte = %0*Lx ", sizeof(page)*2, (u64)page);
++ pr_cont("*pte = %0*Lx ", sizeof(page)*2, (u64)page);
+ }
+
-+ printk(KERN_CONT "\n");
++ pr_cont("\n");
+}
+
+#else /* CONFIG_X86_64: */
@@ -12028,7 +12045,7 @@ Automatically created from "patches.kernel.org/patch-2.6.30" by xen-port-patches
+ if (bad_address(pgd))
+ goto bad;
+
-+ printk("PGD %lx ", pgd_val(*pgd));
++ pr_info("PGD %lx ", pgd_val(*pgd));
+
+ if (!pgd_present(*pgd))
+ goto out;
@@ -12037,7 +12054,7 @@ Automatically created from "patches.kernel.org/patch-2.6.30" by xen-port-patches
+ if (bad_address(pud))
+ goto bad;
+
-+ printk(KERN_CONT "PUD %lx ", pud_val(*pud));
++ pr_cont("PUD %lx ", pud_val(*pud));
+ if (!pud_present(*pud) || pud_large(*pud))
+ goto out;
+
@@ -12045,7 +12062,7 @@ Automatically created from "patches.kernel.org/patch-2.6.30" by xen-port-patches
+ if (bad_address(pmd))
+ goto bad;
+
-+ printk(KERN_CONT "PMD %lx ", pmd_val(*pmd));
++ pr_cont("PMD %lx ", pmd_val(*pmd));
+ if (!pmd_present(*pmd) || pmd_large(*pmd))
+ goto out;
+
@@ -12053,12 +12070,12 @@ Automatically created from "patches.kernel.org/patch-2.6.30" by xen-port-patches
+ if (bad_address(pte))
+ goto bad;
+
-+ printk(KERN_CONT "PTE %lx", pte_val(*pte));
++ pr_cont("PTE %lx", pte_val(*pte));
+out:
-+ printk(KERN_CONT "\n");
++ pr_cont("\n");
+ return;
+bad:
-+ printk("BAD\n");
++ pr_info("BAD\n");
+}
+
+#endif /* CONFIG_X86_64 */
@@ -12148,24 +12165,18 @@ Automatically created from "patches.kernel.org/patch-2.6.30" by xen-port-patches
+ unsigned long address)
+{
+ if (!oops_may_print())
- return;
--#endif
-
--#ifdef CONFIG_X86_PAE
- if (error_code & PF_INSTR) {
- unsigned int level;
++ return;
+
- pte_t *pte = lookup_address(address, &level);
-
- if (pte && pte_present(*pte) && !pte_exec(*pte))
-- printk(KERN_CRIT "kernel tried to execute "
-- "NX-protected page - exploit attempt? "
-- "(uid: %d)\n", current_uid());
++ if (error_code & PF_INSTR) {
++ unsigned int level;
++
++ pte_t *pte = lookup_address(address, &level);
++
++ if (pte && pte_present(*pte) && !pte_exec(*pte))
+ printk(nx_warning, current_uid());
- }
--#endif
-
- printk(KERN_ALERT "BUG: unable to handle kernel ");
++ }
++
++ printk(KERN_ALERT "BUG: unable to handle kernel ");
if (address < PAGE_SIZE)
printk(KERN_CONT "NULL pointer dereference");
else
@@ -16480,7 +16491,7 @@ Automatically created from "patches.kernel.org/patch-2.6.30" by xen-port-patches
* bytes. This can be used to increase (or decrease) the
--- a/drivers/acpi/Makefile
+++ b/drivers/acpi/Makefile
-@@ -90,9 +90,7 @@ processor-$(CONFIG_ACPI_PROCESSOR_IDLE)
+@@ -91,9 +91,7 @@ processor-$(CONFIG_ACPI_PROCESSOR_IDLE)
processor-$(CONFIG_ACPI_CPU_FREQ_PSS) += processor_throttling.o \
processor_thermal.o
processor-$(CONFIG_CPU_FREQ) += processor_perflib.o
@@ -16676,7 +16687,7 @@ Automatically created from "patches.kernel.org/patch-2.6.30" by xen-port-patches
help
Support for privileged operation (domain 0)
-@@ -401,10 +400,6 @@ endmenu
+@@ -405,10 +404,6 @@ endmenu
config HAVE_IRQ_IGNORE_UNHANDLED
def_bool y
@@ -17715,7 +17726,7 @@ Automatically created from "patches.kernel.org/patch-2.6.30" by xen-port-patches
}
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
-@@ -6887,11 +6887,9 @@ static void __setup_per_zone_wmarks(void
+@@ -7033,11 +7033,9 @@ static void __setup_per_zone_wmarks(void
}
#ifdef CONFIG_XEN
diff --git a/patches.xen/xen3-patch-2.6.31 b/patches.xen/xen3-patch-2.6.31
index 6debf23b17..418f4b6c96 100644
--- a/patches.xen/xen3-patch-2.6.31
+++ b/patches.xen/xen3-patch-2.6.31
@@ -10,19 +10,21 @@ Automatically created from "patches.kernel.org/patch-2.6.31" by xen-port-patches
2.6.34/drivers/staging/vt6655/ttype.h (VOID no longer used)
2.6.35/mm/page_alloc.c
+4.12/include/uapi/Kbuild
+4.12/include/uapi/xen/Kbuild
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -155,7 +155,7 @@ config X86
+@@ -162,7 +162,7 @@ config X86
select HAVE_OPROFILE
select HAVE_OPTPROBES
select HAVE_PCSPKR_PLATFORM
- select HAVE_PERF_EVENTS
+ select HAVE_PERF_EVENTS if !XEN
select HAVE_PERF_EVENTS_NMI
+ select HAVE_HARDLOCKUP_DETECTOR_PERF if PERF_EVENTS && HAVE_PERF_EVENTS_NMI
select HAVE_PERF_REGS
- select HAVE_PERF_USER_STACK_DUMP
-@@ -1067,7 +1067,7 @@ config X86_MCE
+@@ -1078,7 +1078,7 @@ config X86_MCE
bool "Machine Check / overheating reporting"
select GENERIC_ALLOCATOR
default y
@@ -31,7 +33,7 @@ Automatically created from "patches.kernel.org/patch-2.6.31" by xen-port-patches
---help---
Machine Check support allows the processor to notify the
kernel if it detects a problem (e.g. overheating, data corruption).
-@@ -1092,7 +1092,7 @@ config X86_MCE_AMD
+@@ -1111,7 +1111,7 @@ config X86_MCE_AMD
config X86_ANCIENT_MCE
bool "Support for old Pentium 5 / WinChip machine checks"
@@ -40,7 +42,7 @@ Automatically created from "patches.kernel.org/patch-2.6.31" by xen-port-patches
---help---
Include support for machine check handling on old Pentium 5 or WinChip
systems. These typically need to be enabled explicitly on the command
-@@ -1950,6 +1950,7 @@ config KEXEC_JUMP
+@@ -1969,6 +1969,7 @@ config KEXEC_JUMP
config PHYSICAL_START
hex "Physical address where the kernel is loaded" if (EXPERT || CRASH_DUMP || XEN)
@@ -50,7 +52,7 @@ Automatically created from "patches.kernel.org/patch-2.6.31" by xen-port-patches
This gives the physical address where the kernel is loaded.
--- a/arch/x86/Kconfig.debug
+++ b/arch/x86/Kconfig.debug
-@@ -149,6 +149,7 @@ config IOMMU_DEBUG
+@@ -172,6 +172,7 @@ config IOMMU_DEBUG
config IOMMU_STRESS
bool "Enable IOMMU stress-test mode"
@@ -75,7 +77,7 @@ Automatically created from "patches.kernel.org/patch-2.6.31" by xen-port-patches
ia32_syscall_end:
--- a/arch/x86/include/asm/hw_irq.h
+++ b/arch/x86/include/asm/hw_irq.h
-@@ -50,6 +50,7 @@ extern asmlinkage void call_function_sin
+@@ -51,6 +51,7 @@ extern asmlinkage void call_function_sin
extern irqreturn_t smp_reschedule_interrupt(int, void *);
extern irqreturn_t smp_call_function_interrupt(int, void *);
extern irqreturn_t smp_call_function_single_interrupt(int, void *);
@@ -85,7 +87,7 @@ Automatically created from "patches.kernel.org/patch-2.6.31" by xen-port-patches
#ifdef CONFIG_TRACING
--- a/arch/x86/include/asm/required-features.h
+++ b/arch/x86/include/asm/required-features.h
-@@ -54,7 +54,7 @@
+@@ -60,7 +60,7 @@
#endif
#ifdef CONFIG_X86_64
@@ -494,7 +496,7 @@ Automatically created from "patches.kernel.org/patch-2.6.31" by xen-port-patches
#if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE)
#define _PAGE_NX (_AT(pteval_t, 1) << _PAGE_BIT_NX)
#else
-@@ -330,7 +335,6 @@ typedef struct page *pgtable_t;
+@@ -334,7 +339,6 @@ typedef struct page *pgtable_t;
extern pteval_t __supported_pte_mask;
extern int nx_enabled;
@@ -633,7 +635,7 @@ Automatically created from "patches.kernel.org/patch-2.6.31" by xen-port-patches
#endif /* _ASM_X86_TLBFLUSH_H */
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
-@@ -153,6 +153,6 @@ ifeq ($(CONFIG_X86_64),y)
+@@ -147,6 +147,6 @@ ifeq ($(CONFIG_X86_64),y)
endif
disabled-obj-$(CONFIG_XEN) := %_uv.o crash.o early-quirks.o i8237.o i8253.o \
@@ -2320,7 +2322,7 @@ Automatically created from "patches.kernel.org/patch-2.6.31" by xen-port-patches
{
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
-@@ -571,7 +571,7 @@ static void early_init_amd(struct cpuinf
+@@ -572,7 +572,7 @@ static void early_init_amd(struct cpuinf
(c->x86_model == 8 && c->x86_mask >= 8))
set_cpu_cap(c, X86_FEATURE_K6_MTRR);
#endif
@@ -2496,7 +2498,7 @@ Automatically created from "patches.kernel.org/patch-2.6.31" by xen-port-patches
void __cpuinit identify_secondary_cpu(struct cpuinfo_x86 *c)
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
-@@ -134,8 +134,10 @@ void mce_setup(struct mce *m)
+@@ -120,8 +120,10 @@ void mce_setup(struct mce *m)
m->time = get_seconds();
m->cpuvendor = boot_cpu_data.x86_vendor;
m->cpuid = cpuid_eax(1);
@@ -2507,7 +2509,7 @@ Automatically created from "patches.kernel.org/patch-2.6.31" by xen-port-patches
rdmsrl(MSR_IA32_MCG_CAP, m->mcgcap);
if (this_cpu_has(X86_FEATURE_INTEL_PPIN))
-@@ -1694,7 +1696,7 @@ static int __mcheck_cpu_ancient_init(str
+@@ -1688,7 +1690,7 @@ static void __mcheck_cpu_init_early(stru
static void __mcheck_cpu_init_vendor(struct cpuinfo_x86 *c)
{
@@ -2516,7 +2518,7 @@ Automatically created from "patches.kernel.org/patch-2.6.31" by xen-port-patches
switch (c->x86_vendor) {
case X86_VENDOR_INTEL:
mce_intel_feature_init(c);
-@@ -2607,7 +2609,7 @@ static __init int mcheck_init_device(voi
+@@ -2413,7 +2415,7 @@ static int __init mcheck_late_init(void)
#ifdef CONFIG_X86_XEN_MCE
if (is_initial_xendomain()) {
/* Register vIRQ handler for MCE LOG processing */
@@ -2878,7 +2880,7 @@ Automatically created from "patches.kernel.org/patch-2.6.31" by xen-port-patches
nmi_stack_fixup:
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
-@@ -1019,7 +1019,7 @@ idtentry debug do_debug has_error_cod
+@@ -1094,7 +1094,7 @@ idtentry debug do_debug has_error_cod
idtentry int3 do_int3 has_error_code=0 paranoid=1 shift_ist=DEBUG_STACK
idtentry stack_segment do_stack_segment has_error_code=1
@@ -4863,10 +4865,10 @@ Automatically created from "patches.kernel.org/patch-2.6.31" by xen-port-patches
goto out;
--- a/arch/x86/pci/i386.c
+++ b/arch/x86/pci/i386.c
-@@ -399,12 +399,14 @@ void __init pcibios_resource_survey(void
+@@ -399,10 +399,12 @@ void __init pcibios_resource_survey(void
pcibios_allocate_resources(bus, 1);
- e820_reserve_resources_late();
+ e820__reserve_resources_late();
+#ifndef CONFIG_XEN
/*
* Insert the IO APIC resources after PCI initialization has
@@ -4876,8 +4878,6 @@ Automatically created from "patches.kernel.org/patch-2.6.31" by xen-port-patches
ioapic_insert_resources();
+#endif
}
-
- static const struct vm_operations_struct pci_mmap_ops = {
--- a/arch/x86/pci/pcifront.c
+++ b/arch/x86/pci/pcifront.c
@@ -6,6 +6,7 @@
@@ -4943,7 +4943,7 @@ Automatically created from "patches.kernel.org/patch-2.6.31" by xen-port-patches
--- a/drivers/char/agp/intel-gtt.c
+++ b/drivers/char/agp/intel-gtt.c
-@@ -282,7 +282,11 @@ static struct agp_memory *alloc_agpphysm
+@@ -283,7 +283,11 @@ static struct agp_memory *alloc_agpphysm
new->page_count = pg_count;
new->num_scratch_pages = pg_count;
new->type = AGP_PHYS_MEMORY;
@@ -4957,17 +4957,17 @@ Automatically created from "patches.kernel.org/patch-2.6.31" by xen-port-patches
--- a/drivers/edac/Kconfig
+++ b/drivers/edac/Kconfig
-@@ -99,6 +99,7 @@ config EDAC_GHES
+@@ -77,6 +77,7 @@ config EDAC_GHES
config EDAC_AMD64
tristate "AMD64 (Opteron, Athlon64)"
- depends on EDAC_MM_EDAC && AMD_NB && EDAC_DECODE_MCE
+ depends on AMD_NB && EDAC_DECODE_MCE
+ depends on !XEN
help
Support for error detection and correction of DRAM ECC errors on
the AMD64 families (>= K8) of memory controllers.
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
-@@ -1428,6 +1428,14 @@ int ttm_bo_global_init(struct drm_global
+@@ -1467,6 +1467,14 @@ int ttm_bo_global_init(struct drm_global
ret = -ENOMEM;
goto out_no_drp;
}
@@ -5194,7 +5194,7 @@ Automatically created from "patches.kernel.org/patch-2.6.31" by xen-port-patches
choice
prompt "Xen version compatibility"
default XEN_COMPAT_040000_AND_LATER
-@@ -524,7 +516,8 @@ config XEN_SCRUB_PAGES
+@@ -528,7 +520,8 @@ config XEN_SCRUB_PAGES
config XEN_DEV_EVTCHN
tristate "Xen /dev/xen/evtchn device"
@@ -5614,7 +5614,7 @@ Automatically created from "patches.kernel.org/patch-2.6.31" by xen-port-patches
if (ptask)
info->status = CLEANSHUTDOWN;
}
-@@ -1721,7 +1730,6 @@ static void make_response(blkif_t *blkif
+@@ -1720,7 +1729,6 @@ static void make_response(blkif_t *blkif
static int __init blkif_init(void)
{
int i, ret;
@@ -5622,7 +5622,7 @@ Automatically created from "patches.kernel.org/patch-2.6.31" by xen-port-patches
if (!is_running_on_xen())
return -ENODEV;
-@@ -1757,7 +1765,7 @@ static int __init blkif_init(void)
+@@ -1756,7 +1764,7 @@ static int __init blkif_init(void)
DPRINTK("Created misc_dev %d:0 [/dev/xen/blktap0]\n", ret);
/* Make sure the xen class exists */
@@ -5631,7 +5631,7 @@ Automatically created from "patches.kernel.org/patch-2.6.31" by xen-port-patches
/*
* This will allow udev to create the blktap ctrl device.
* We only want to create blktap0 first. We don't want
-@@ -1765,8 +1773,9 @@ static int __init blkif_init(void)
+@@ -1764,8 +1772,9 @@ static int __init blkif_init(void)
* We only create the device when a request of a new device is
* made.
*/
@@ -6269,7 +6269,7 @@ Automatically created from "patches.kernel.org/patch-2.6.31" by xen-port-patches
struct per_user_data {
struct mutex bind_mutex; /* serialize bind/unbind operations */
-@@ -429,6 +436,9 @@ static void evtchn_unbind_from_user(stru
+@@ -417,6 +424,9 @@ static void evtchn_unbind_from_user(stru
BUG_ON(irq < 0);
unbind_from_irqhandler(irq, evtchn);
@@ -6279,7 +6279,7 @@ Automatically created from "patches.kernel.org/patch-2.6.31" by xen-port-patches
del_evtchn(u, evtchn);
}
-@@ -628,7 +638,8 @@ static int evtchn_open(struct inode *ino
+@@ -648,7 +658,8 @@ static int evtchn_open(struct inode *ino
if (u == NULL)
return -ENOMEM;
@@ -6289,7 +6289,7 @@ Automatically created from "patches.kernel.org/patch-2.6.31" by xen-port-patches
if (u->name == NULL) {
kfree(u);
return -ENOMEM;
-@@ -682,6 +693,7 @@ static const struct file_operations evtc
+@@ -702,6 +713,7 @@ static const struct file_operations evtc
static struct miscdevice evtchn_miscdev = {
.minor = MISC_DYNAMIC_MINOR,
.name = "xen/evtchn",
@@ -6364,13 +6364,13 @@ Automatically created from "patches.kernel.org/patch-2.6.31" by xen-port-patches
xenkbd_disconnect_backend(info);
input_unregister_device(info->kbd);
-@@ -275,7 +275,7 @@ static void xenkbd_disconnect_backend(st
+@@ -292,7 +292,7 @@ static void xenkbd_set_connected(struct
static void xenkbd_backend_changed(struct xenbus_device *dev,
enum xenbus_state backend_state)
{
- struct xenkbd_info *info = dev->dev.driver_data;
+ struct xenkbd_info *info = dev_get_drvdata(&dev->dev);
- int ret, val;
+ int val;
switch (backend_state) {
--- a/drivers/xen/gntdev/gntdev.c
@@ -6965,7 +6965,7 @@ Automatically created from "patches.kernel.org/patch-2.6.31" by xen-port-patches
#define HYPERVISOR_ATTR_RO(_name) \
static struct hyp_sysfs_attr _name##_attr = __ATTR_RO(_name)
-@@ -112,9 +118,8 @@ static ssize_t uuid_show_fallback(struct
+@@ -141,9 +147,8 @@ static ssize_t uuid_show_fallback(struct
{
char *vm, *val;
int ret;
@@ -6976,7 +6976,7 @@ Automatically created from "patches.kernel.org/patch-2.6.31" by xen-port-patches
return -EBUSY;
vm = xenbus_read(XBT_NIL, "vm", "", NULL);
-@@ -346,6 +351,28 @@ static int __init xen_sysfs_properties_i
+@@ -403,6 +408,28 @@ static int __init xen_sysfs_properties_i
return sysfs_create_group(hypervisor_kobj, &xen_properties_group);
}
@@ -7005,7 +7005,7 @@ Automatically created from "patches.kernel.org/patch-2.6.31" by xen-port-patches
#ifdef CONFIG_XEN_HAVE_VPMU
struct pmu_mode {
const char *name;
-@@ -493,8 +520,11 @@ static int __init hyper_sysfs_init(void)
+@@ -553,8 +580,11 @@ static int __init hyper_sysfs_init(void)
}
}
#endif
@@ -7424,24 +7424,6 @@ Automatically created from "patches.kernel.org/patch-2.6.31" by xen-port-patches
mutex_unlock(&xs_state.response_mutex);
mutex_unlock(&xs_state.request_mutex);
transaction_resume();
---- a/include/uapi/Kbuild
-+++ b/include/uapi/Kbuild
-@@ -10,7 +10,6 @@ header-y += mtd/
- header-y += rdma/
- header-y += video/
- header-y += drm/
--header-y += xen/public/
- header-y += xen/
- header-y += scsi/
- header-y += misc/
---- a/include/uapi/xen/Kbuild
-+++ b/include/uapi/xen/Kbuild
-@@ -1,5 +1,4 @@
- # UAPI Header export list
--header-y += evtchn.h
- header-y += gntalloc.h
- header-y += gntdev.h
- header-y += privcmd.h
--- a/include/xen/driver_util.h
+++ b/include/xen/driver_util.h
@@ -1,8 +1,14 @@
diff --git a/patches.xen/xen3-patch-2.6.32 b/patches.xen/xen3-patch-2.6.32
index a2a612828e..4ec25b2e90 100644
--- a/patches.xen/xen3-patch-2.6.32
+++ b/patches.xen/xen3-patch-2.6.32
@@ -14,6 +14,8 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
3.7/drivers/usb/host/ehci-hub.c
3.10/drivers/hv/Kconfig
4.3/drivers/dma/ioat/dma_v2.h
+4.13/arch/x86/kernel/cpu/mcheck/mce-inject.c
+4.13/include/linux/nmi.h
--- a/arch/x86/entry/entry_64_compat-xen.S
+++ b/arch/x86/entry/entry_64_compat-xen.S
@@ -215,7 +217,7 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
ia32_syscall_end:
--- a/arch/x86/include/asm/irq.h
+++ b/arch/x86/include/asm/irq.h
-@@ -49,7 +49,8 @@ extern int vector_used_by_percpu_irq(uns
+@@ -48,7 +48,8 @@ extern int vector_used_by_percpu_irq(uns
extern void init_ISA_irqs(void);
@@ -490,7 +492,7 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
flush_tlb_page(vma, addr); \
--- a/arch/x86/include/mach-xen/asm/pgtable_types.h
+++ b/arch/x86/include/mach-xen/asm/pgtable_types.h
-@@ -334,6 +334,7 @@ static inline pteval_t pte_flags(pte_t p
+@@ -338,6 +338,7 @@ static inline pteval_t pte_flags(pte_t p
typedef struct page *pgtable_t;
extern pteval_t __supported_pte_mask;
@@ -498,7 +500,7 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
extern int nx_enabled;
#define pgprot_writecombine pgprot_writecombine
-@@ -354,14 +355,6 @@ int phys_mem_access_prot_allowed(struct
+@@ -358,14 +359,6 @@ int phys_mem_access_prot_allowed(struct
/* Install a pte for a particular vaddr in kernel space. */
void set_pte_vaddr(unsigned long vaddr, pte_t pte);
@@ -733,7 +735,7 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
-@@ -148,8 +148,6 @@ ifeq ($(CONFIG_X86_64),y)
+@@ -142,8 +142,6 @@ ifeq ($(CONFIG_X86_64),y)
obj-$(CONFIG_PCI_MMCONFIG) += mmconf-fam10h_64.o
obj-y += vsmp_64.o
@@ -1573,7 +1575,7 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
}
--- a/arch/x86/kernel/cpu/Makefile
+++ b/arch/x86/kernel/cpu/Makefile
-@@ -42,7 +42,7 @@ obj-$(CONFIG_X86_LOCAL_APIC) += perfctr
+@@ -43,7 +43,7 @@ obj-$(CONFIG_X86_LOCAL_APIC) += perfctr
obj-$(CONFIG_HYPERVISOR_GUEST) += vmware.o hypervisor.o mshyperv.o
@@ -1584,7 +1586,7 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
quiet_cmd_mkcapflags = MKCAP $@
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
-@@ -390,7 +390,7 @@ static void amd_detect_cmp(struct cpuinf
+@@ -391,7 +391,7 @@ static void amd_detect_cmp(struct cpuinf
u16 amd_get_nb_id(int cpu)
{
u16 id = 0;
@@ -1593,7 +1595,7 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
id = per_cpu(cpu_llc_id, cpu);
#endif
return id;
-@@ -630,10 +630,16 @@ static void init_amd_k8(struct cpuinfo_x
+@@ -631,10 +631,16 @@ static void init_amd_k8(struct cpuinfo_x
*/
if (c->x86_model < 0x14 && cpu_has(c, X86_FEATURE_LAHF_LM)) {
clear_cpu_cap(c, X86_FEATURE_LAHF_LM);
@@ -1610,7 +1612,7 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
}
if (!c->x86_model_id[0])
-@@ -742,8 +748,10 @@ static void init_amd(struct cpuinfo_x86
+@@ -743,8 +749,10 @@ static void init_amd(struct cpuinfo_x86
if (c->x86 >= 0x10)
set_cpu_cap(c, X86_FEATURE_REP_GOOD);
@@ -1788,27 +1790,6 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
#endif
/* Make sure %fs and %gs are initialized properly in idle threads */
---- a/arch/x86/kernel/cpu/mcheck/mce-inject.c
-+++ b/arch/x86/kernel/cpu/mcheck/mce-inject.c
-@@ -152,6 +152,7 @@ static void raise_mce(struct mce *m)
- if (context == MCJ_CTX_RANDOM)
- return;
-
-+#ifndef CONFIG_XEN
- if (m->inject_flags & (MCJ_IRQ_BROADCAST | MCJ_NMI_BROADCAST)) {
- unsigned long start;
- int cpu;
-@@ -191,7 +192,9 @@ static void raise_mce(struct mce *m)
- raise_local();
- put_cpu();
- put_online_cpus();
-- } else {
-+ } else
-+#endif
-+ {
- preempt_disable();
- raise_local();
- preempt_enable();
--- a/arch/x86/kernel/cpu/mtrr/main-xen.c
+++ b/arch/x86/kernel/cpu/mtrr/main-xen.c
@@ -1,10 +1,9 @@
@@ -4518,7 +4499,7 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
force_sig_info(si_signo, &info, tsk);
}
-@@ -303,27 +304,25 @@ check_v8086_mode(struct pt_regs *regs, u
+@@ -303,27 +304,29 @@ check_v8086_mode(struct pt_regs *regs, u
tsk->thread.screen_bitmap |= 1 << bit;
}
@@ -4539,28 +4520,31 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
+ pte_t *pte;
#ifdef CONFIG_X86_PAE
-- printk("*pdpt = %016Lx ", page);
+- pr_info("*pdpt = %016Lx ", page);
- if ((page & _PAGE_PRESENT)
- && mfn_to_local_pfn(page >> PAGE_SHIFT) < max_low_pfn) {
- page = mfn_to_pfn(page >> PAGE_SHIFT);
- page <<= PAGE_SHIFT;
- page = ((__typeof__(page) *) __va(page))[(address >> PMD_SHIFT)
- & (PTRS_PER_PMD - 1)];
-- printk(KERN_CONT "*pde = %016Lx ", page);
+- pr_cont("*pde = %016Lx ", page);
- page &= ~_PAGE_NX;
- }
--#else
-- printk("*pde = %08lx ", page);
-+ printk("*pdpt = %016Lx ", __pgd_val(*pgd));
++ pr_info("*pdpt = %016Lx ", __pgd_val(*pgd));
+ if (!low_pfn(pgd_val(*pgd) >> PAGE_SHIFT) || !pgd_present(*pgd))
+ goto out;
++#define pr_pde pr_cont
+ #else
+- pr_info("*pde = %08lx ", page);
++#define pr_pde pr_info
#endif
+ pmd = pmd_offset(pud_offset(pgd, address), address);
-+ printk(KERN_CONT "*pde = %0*Lx ", sizeof(*pmd) * 2, (u64)__pmd_val(*pmd));
++ pr_pde("*pde = %0*Lx ", sizeof(*pmd) * 2, (u64)__pmd_val(*pmd));
++#undef pr_pde
/*
* We must not directly access the pte in the highpte
-@@ -331,17 +330,12 @@ static void dump_pagetable(unsigned long
+@@ -331,17 +334,12 @@ static void dump_pagetable(unsigned long
* And let's rather not kmap-atomic the pte, just in case
* it's allocated already:
*/
@@ -4572,18 +4556,18 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
- page <<= PAGE_SHIFT;
- page = ((__typeof__(page) *) __va(page))[(address >> PAGE_SHIFT)
- & (PTRS_PER_PTE - 1)];
-- printk(KERN_CONT "*pte = %0*Lx ", sizeof(page)*2, (u64)page);
+- pr_cont("*pte = %0*Lx ", sizeof(page)*2, (u64)page);
- }
+ if (!low_pfn(pmd_pfn(*pmd)) || !pmd_present(*pmd) || pmd_large(*pmd))
+ goto out;
+ pte = pte_offset_kernel(pmd, address);
-+ printk(KERN_CONT "*pte = %0*Lx ", sizeof(*pte) * 2, (u64)__pte_val(*pte));
++ pr_cont("*pte = %0*Lx ", sizeof(*pte) * 2, (u64)__pte_val(*pte));
+out:
- printk(KERN_CONT "\n");
+ pr_cont("\n");
}
-@@ -472,16 +466,12 @@ static int bad_address(void *p)
+@@ -472,16 +470,12 @@ static int bad_address(void *p)
static void dump_pagetable(unsigned long address)
{
@@ -4602,7 +4586,7 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
if (bad_address(pgd))
goto bad;
-@@ -822,10 +812,12 @@ out_of_memory(struct pt_regs *regs, unsi
+@@ -822,10 +816,12 @@ out_of_memory(struct pt_regs *regs, unsi
}
static void
@@ -4616,7 +4600,7 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
up_read(&mm->mmap_sem);
-@@ -841,7 +833,15 @@ do_sigbus(struct pt_regs *regs, unsigned
+@@ -841,7 +837,15 @@ do_sigbus(struct pt_regs *regs, unsigned
tsk->thread.error_code = error_code;
tsk->thread.trap_no = 14;
@@ -4633,7 +4617,7 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
}
static noinline void
-@@ -851,8 +851,8 @@ mm_fault_error(struct pt_regs *regs, uns
+@@ -851,8 +855,8 @@ mm_fault_error(struct pt_regs *regs, uns
if (fault & VM_FAULT_OOM) {
out_of_memory(regs, error_code, address);
} else {
@@ -4644,7 +4628,7 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
else
BUG();
}
-@@ -1066,7 +1066,7 @@ do_page_fault(struct pt_regs *regs, unsi
+@@ -1066,7 +1070,7 @@ do_page_fault(struct pt_regs *regs, unsi
if (unlikely(error_code & PF_RSVD))
pgtable_bad(regs, error_code, address);
@@ -4653,7 +4637,7 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
/*
* If we're in an interrupt, have no user context or are running
-@@ -1163,11 +1163,11 @@ good_area:
+@@ -1163,11 +1167,11 @@ good_area:
if (fault & VM_FAULT_MAJOR) {
tsk->maj_flt++;
@@ -6045,7 +6029,7 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
//#define AGP_DEBUG 1
--- a/drivers/char/agp/amd-k7-agp.c
+++ b/drivers/char/agp/amd-k7-agp.c
-@@ -141,7 +141,7 @@ static int amd_create_gatt_table(struct
+@@ -142,7 +142,7 @@ static int amd_create_gatt_table(struct
agp_bridge->gatt_table_real = (u32 *)page_dir.real;
agp_bridge->gatt_table = (u32 __iomem *)page_dir.remapped;
@@ -6054,7 +6038,7 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
/* Get the address for the gart region.
* This is a bus address even on the alpha, b/c its
-@@ -153,7 +153,7 @@ static int amd_create_gatt_table(struct
+@@ -154,7 +154,7 @@ static int amd_create_gatt_table(struct
/* Calculate the agp offset */
for (i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) {
@@ -6085,7 +6069,7 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
agp_put_bridge(bridge);
--- a/drivers/char/agp/ati-agp.c
+++ b/drivers/char/agp/ati-agp.c
-@@ -361,7 +361,7 @@ static int ati_create_gatt_table(struct
+@@ -362,7 +362,7 @@ static int ati_create_gatt_table(struct
agp_bridge->gatt_table_real = (u32 *)page_dir.real;
agp_bridge->gatt_table = (u32 __iomem *) page_dir.remapped;
@@ -6094,7 +6078,7 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
/* Write out the size register */
current_size = A_SIZE_LVL2(agp_bridge->current_size);
-@@ -390,7 +390,7 @@ static int ati_create_gatt_table(struct
+@@ -391,7 +391,7 @@ static int ati_create_gatt_table(struct
/* Calculate the agp offset */
for (i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) {
@@ -6116,7 +6100,7 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
EFFICEON_ATTPAGE, value);
--- a/drivers/char/agp/generic.c
+++ b/drivers/char/agp/generic.c
-@@ -948,7 +948,7 @@ int agp_generic_create_gatt_table(struct
+@@ -944,7 +944,7 @@ int agp_generic_create_gatt_table(struct
bridge->gatt_table = (u32 __iomem *)table;
#else
@@ -6125,7 +6109,7 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
(PAGE_SIZE * (1 << page_order)));
bridge->driver->cache_flush();
#endif
-@@ -961,7 +961,7 @@ int agp_generic_create_gatt_table(struct
+@@ -957,7 +957,7 @@ int agp_generic_create_gatt_table(struct
return -ENOMEM;
}
@@ -6136,7 +6120,7 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
for (i = 0; i < num_entries; i++) {
--- a/drivers/char/agp/intel-gtt.c
+++ b/drivers/char/agp/intel-gtt.c
-@@ -32,7 +32,7 @@
+@@ -33,7 +33,7 @@
* on the Intel IOMMU support (CONFIG_INTEL_IOMMU).
* Only newer chipsets need to bother with this, of course.
*/
@@ -6147,7 +6131,7 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
#define USE_PCI_DMA_API 0
--- a/drivers/char/agp/sworks-agp.c
+++ b/drivers/char/agp/sworks-agp.c
-@@ -155,7 +155,7 @@ static int serverworks_create_gatt_table
+@@ -156,7 +156,7 @@ static int serverworks_create_gatt_table
/* Create a fake scratch directory */
for (i = 0; i < 1024; i++) {
writel(agp_bridge->scratch_page, serverworks_private.scratch_dir.remapped+i);
@@ -6156,7 +6140,7 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
}
retval = serverworks_create_gatt_pages(value->num_entries / 1024);
-@@ -167,7 +167,7 @@ static int serverworks_create_gatt_table
+@@ -168,7 +168,7 @@ static int serverworks_create_gatt_table
agp_bridge->gatt_table_real = (u32 *)page_dir.real;
agp_bridge->gatt_table = (u32 __iomem *)page_dir.remapped;
@@ -6165,7 +6149,7 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
/* Get the address for the gart region.
* This is a bus address even on the alpha, b/c its
-@@ -179,7 +179,7 @@ static int serverworks_create_gatt_table
+@@ -180,7 +180,7 @@ static int serverworks_create_gatt_table
/* Calculate the agp offset */
for (i = 0; i < value->num_entries / 1024; i++)
@@ -6201,7 +6185,7 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
-@@ -802,6 +802,18 @@ int radeon_dummy_page_init(struct radeon
+@@ -803,6 +803,18 @@ int radeon_dummy_page_init(struct radeon
rdev->dummy_page.page = alloc_page(GFP_DMA32 | GFP_KERNEL | __GFP_ZERO);
if (rdev->dummy_page.page == NULL)
return -ENOMEM;
@@ -6332,7 +6316,7 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
family 6 CPU */
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
-@@ -459,7 +459,7 @@ config XEN_NETDEV_BACKEND
+@@ -467,7 +467,7 @@ config XEN_NETDEV_BACKEND
config VMXNET3
tristate "VMware VMXNET3 ethernet driver"
@@ -6468,7 +6452,7 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
-@@ -2019,6 +2019,10 @@ static unsigned next_fn(struct pci_bus *
+@@ -2116,6 +2116,10 @@ static unsigned next_fn(struct pci_bus *
/* dev may be NULL for non-contiguous multifunction devices */
if (!dev || dev->multifunction)
return (fn + 1) % 8;
@@ -6479,7 +6463,7 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
return 0;
}
-@@ -2064,9 +2068,12 @@ int pci_scan_slot(struct pci_bus *bus, i
+@@ -2161,9 +2165,12 @@ int pci_scan_slot(struct pci_bus *bus, i
return 0; /* Already scanned the entire slot */
dev = pci_scan_single_device(bus, devfn);
@@ -6518,7 +6502,7 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
select SUSPEND
config XEN_PRIVCMD
-@@ -395,6 +396,10 @@ config HAVE_IRQ_IGNORE_UNHANDLED
+@@ -399,6 +400,10 @@ config HAVE_IRQ_IGNORE_UNHANDLED
config NO_IDLE_HZ
def_bool y
@@ -6657,7 +6641,7 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
fault: blktap_fault,
zap_pte: blktap_clear_pte,
open: blktap_vma_open,
-@@ -1750,7 +1750,7 @@ static int __init blkif_init(void)
+@@ -1749,7 +1749,7 @@ static int __init blkif_init(void)
tap_blkif_xenbus_init();
/* Dynamically allocate a major for this device */
@@ -6854,7 +6838,7 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
--- a/drivers/xen/evtchn.c
+++ b/drivers/xen/evtchn.c
-@@ -693,7 +693,7 @@ static const struct file_operations evtc
+@@ -713,7 +713,7 @@ static const struct file_operations evtc
static struct miscdevice evtchn_miscdev = {
.minor = MISC_DYNAMIC_MINOR,
.name = "xen/evtchn",
@@ -7152,18 +7136,6 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
ent->type = KCORE_RAM;
list_add(&ent->list, &head);
__kcore_update_ram(&head);
---- a/include/linux/nmi.h
-+++ b/include/linux/nmi.h
-@@ -72,6 +72,9 @@ static inline void reset_hung_task_detec
- #include <asm/nmi.h>
- extern void touch_nmi_watchdog(void);
- #else
-+#ifdef CONFIG_XEN
-+#include <asm/nmi.h>
-+#endif
- static inline void touch_nmi_watchdog(void)
- {
- touch_softlockup_watchdog();
--- a/include/linux/usb/ehci-dbgp.h
+++ b/include/linux/usb/ehci-dbgp.h
@@ -49,7 +49,7 @@ extern struct console early_dbgp_console
diff --git a/patches.xen/xen3-patch-2.6.33 b/patches.xen/xen3-patch-2.6.33
index 6fc63ecb33..da14c2eb02 100644
--- a/patches.xen/xen3-patch-2.6.33
+++ b/patches.xen/xen3-patch-2.6.33
@@ -14,7 +14,7 @@ Automatically created from "patches.kernel.org/patch-2.6.33" by xen-port-patches
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -141,7 +141,7 @@ config X86
+@@ -147,7 +147,7 @@ config X86
select HAVE_KERNEL_GZIP
select HAVE_KERNEL_LZ4
select HAVE_KERNEL_LZMA if !XEN
@@ -23,15 +23,15 @@ Automatically created from "patches.kernel.org/patch-2.6.33" by xen-port-patches
select HAVE_KERNEL_XZ
select HAVE_KPROBES
select HAVE_KPROBES_ON_FTRACE
-@@ -155,7 +155,7 @@ config X86
+@@ -162,7 +162,7 @@ config X86
select HAVE_OPROFILE
select HAVE_OPTPROBES
select HAVE_PCSPKR_PLATFORM
- select HAVE_PERF_EVENTS if !XEN
+ select HAVE_PERF_EVENTS
select HAVE_PERF_EVENTS_NMI
+ select HAVE_HARDLOCKUP_DETECTOR_PERF if PERF_EVENTS && HAVE_PERF_EVENTS_NMI
select HAVE_PERF_REGS
- select HAVE_PERF_USER_STACK_DUMP
--- a/arch/x86/entry/entry_64_compat-xen.S
+++ b/arch/x86/entry/entry_64_compat-xen.S
@@ -534,7 +534,7 @@ ia32_sys_call_table:
@@ -60,7 +60,7 @@ Automatically created from "patches.kernel.org/patch-2.6.33" by xen-port-patches
ia32_syscall_end:
--- a/arch/x86/include/asm/hw_irq.h
+++ b/arch/x86/include/asm/hw_irq.h
-@@ -146,11 +146,15 @@ struct irq_alloc_info {
+@@ -148,11 +148,15 @@ struct irq_alloc_info {
};
};
@@ -1069,7 +1069,7 @@ Automatically created from "patches.kernel.org/patch-2.6.33" by xen-port-patches
}
--- a/arch/x86/kernel/cpu/Makefile
+++ b/arch/x86/kernel/cpu/Makefile
-@@ -42,7 +42,8 @@ obj-$(CONFIG_X86_LOCAL_APIC) += perfctr
+@@ -43,7 +43,8 @@ obj-$(CONFIG_X86_LOCAL_APIC) += perfctr
obj-$(CONFIG_HYPERVISOR_GUEST) += vmware.o hypervisor.o mshyperv.o
@@ -3223,7 +3223,7 @@ Automatically created from "patches.kernel.org/patch-2.6.33" by xen-port-patches
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
-@@ -43,7 +43,7 @@ ENTRY(phys_startup_64)
+@@ -44,7 +44,7 @@ ENTRY(phys_startup_64)
jiffies_64 = jiffies;
#endif
@@ -3293,7 +3293,7 @@ Automatically created from "patches.kernel.org/patch-2.6.33" by xen-port-patches
{
unsigned long pgd_paddr;
pmd_t *pmd_k;
-@@ -377,7 +378,7 @@ void vmalloc_sync_all(void)
+@@ -381,7 +382,7 @@ void vmalloc_sync_all(void)
*
* This assumes no large pages in there.
*/
@@ -3302,7 +3302,7 @@ Automatically created from "patches.kernel.org/patch-2.6.33" by xen-port-patches
{
pgd_t *pgd, *pgd_ref;
pud_t *pud, *pud_ref;
-@@ -679,7 +680,7 @@ no_context(struct pt_regs *regs, unsigne
+@@ -683,7 +684,7 @@ no_context(struct pt_regs *regs, unsigne
show_fault_oops(regs, error_code, address);
stackend = end_of_stack(tsk);
@@ -3311,7 +3311,7 @@ Automatically created from "patches.kernel.org/patch-2.6.33" by xen-port-patches
printk(KERN_ALERT "Thread overran stack, or stack corrupted\n");
tsk->thread.cr2 = address;
-@@ -881,7 +882,7 @@ static int spurious_fault_check(unsigned
+@@ -885,7 +886,7 @@ static int spurious_fault_check(unsigned
* There are no security implications to leaving a stale TLB when
* increasing the permissions on a page.
*/
@@ -4456,7 +4456,7 @@ Automatically created from "patches.kernel.org/patch-2.6.33" by xen-port-patches
}
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
-@@ -1446,9 +1446,6 @@ IGNORE_IOCTL(FBIOGCURSOR32)
+@@ -1439,9 +1439,6 @@ IGNORE_IOCTL(FBIOGCURSOR32)
#endif
#ifdef CONFIG_XEN
@@ -4466,7 +4466,7 @@ Automatically created from "patches.kernel.org/patch-2.6.33" by xen-port-patches
COMPATIBLE_IOCTL(IOCTL_PRIVCMD_HYPERCALL)
COMPATIBLE_IOCTL(IOCTL_EVTCHN_BIND_VIRQ)
COMPATIBLE_IOCTL(IOCTL_EVTCHN_BIND_INTERDOMAIN)
-@@ -1513,6 +1510,12 @@ static long do_ioctl_trans(unsigned int
+@@ -1506,6 +1503,12 @@ static long do_ioctl_trans(unsigned int
return do_video_stillpicture(file, cmd, argp);
case VIDEO_SET_SPU_PALETTE:
return do_video_set_spu_palette(file, cmd, argp);
@@ -4570,7 +4570,7 @@ Automatically created from "patches.kernel.org/patch-2.6.33" by xen-port-patches
#endif /* CONFIG_XEN_DOM0 */
--- a/kernel/kexec_core.c
+++ b/kernel/kexec_core.c
-@@ -977,6 +977,7 @@ size_t crash_get_memory_size(void)
+@@ -1008,6 +1008,7 @@ size_t crash_get_memory_size(void)
return size;
}
@@ -4578,14 +4578,23 @@ Automatically created from "patches.kernel.org/patch-2.6.33" by xen-port-patches
void __weak crash_free_reserved_phys_range(unsigned long begin,
unsigned long end)
{
-@@ -1034,6 +1035,7 @@ unlock:
- mutex_unlock(&kexec_mutex);
+@@ -1066,7 +1067,6 @@ unlock:
return ret;
}
+
+-#ifndef CONFIG_XEN
+ void crash_save_cpu(struct pt_regs *regs, int cpu)
+ {
+ struct elf_prstatus prstatus;
+@@ -1092,7 +1092,7 @@ void crash_save_cpu(struct pt_regs *regs
+ &prstatus, sizeof(prstatus));
+ final_note(buf);
+ }
+-#endif
+#endif /* !CONFIG_XEN */
- static u32 *append_elf_note(u32 *buf, char *name, unsigned type, void *data,
- size_t data_len)
+ static int __init crash_notes_memory_init(void)
+ {
--- a/kernel/ksysfs.c
+++ b/kernel/ksysfs.c
@@ -110,6 +110,7 @@ static ssize_t kexec_crash_size_show(str
@@ -4604,8 +4613,8 @@ Automatically created from "patches.kernel.org/patch-2.6.33" by xen-port-patches
+KERNEL_ATTR_RO(kexec_crash_size);
+#endif
- static ssize_t vmcoreinfo_show(struct kobject *kobj,
- struct kobj_attribute *attr, char *buf)
+ #endif /* CONFIG_KEXEC_CORE */
+
--- a/kernel/sysctl_binary.c
+++ b/kernel/sysctl_binary.c
@@ -875,9 +875,10 @@ static const struct bin_table bin_bus_ta
diff --git a/patches.xen/xen3-patch-2.6.34 b/patches.xen/xen3-patch-2.6.34
index c62c80ae0d..6e453e157f 100644
--- a/patches.xen/xen3-patch-2.6.34
+++ b/patches.xen/xen3-patch-2.6.34
@@ -1403,7 +1403,7 @@ Automatically created from "patches.kernel.org/patch-2.6.34" by xen-port-patches
+#endif
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
-@@ -133,6 +133,9 @@ static void early_init_intel(struct cpui
+@@ -129,6 +129,9 @@ static void early_init_intel(struct cpui
* need the microcode to have already been loaded... so if it is
* not, recommend a BIOS update and disable large pages.
*/
@@ -3119,7 +3119,7 @@ Automatically created from "patches.kernel.org/patch-2.6.34" by xen-port-patches
select SUSPEND
config XEN_PRIVCMD
-@@ -521,7 +522,6 @@ config XEN_SCRUB_PAGES
+@@ -525,7 +526,6 @@ config XEN_SCRUB_PAGES
config XEN_DEV_EVTCHN
tristate "Xen /dev/xen/evtchn device"
@@ -3980,7 +3980,7 @@ Automatically created from "patches.kernel.org/patch-2.6.34" by xen-port-patches
#include <asm/dma.h>
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
-@@ -6896,7 +6896,8 @@ static void __setup_per_zone_wmarks(void
+@@ -7042,7 +7042,8 @@ static void __setup_per_zone_wmarks(void
high = percpu_pagelist_fraction
? zone->present_pages / percpu_pagelist_fraction
: 5 * zone_batchsize(zone);
diff --git a/patches.xen/xen3-patch-2.6.35 b/patches.xen/xen3-patch-2.6.35
index e88bcca158..7d3e17a0df 100644
--- a/patches.xen/xen3-patch-2.6.35
+++ b/patches.xen/xen3-patch-2.6.35
@@ -12,8 +12,8 @@ Automatically created from "patches.kernel.org/patch-2.6.35" by xen-port-patches
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
-@@ -146,8 +146,7 @@ struct thread_info {
- (_TIF_IO_BITMAP|_TIF_NOTSC|_TIF_BLOCKSTEP)
+@@ -149,8 +149,7 @@ struct thread_info {
+ (_TIF_IO_BITMAP|_TIF_NOCPUID|_TIF_NOTSC|_TIF_BLOCKSTEP)
#else
-#define _TIF_WORK_CTXSW (_TIF_NOTSC \
@@ -418,7 +418,7 @@ Automatically created from "patches.kernel.org/patch-2.6.35" by xen-port-patches
"GSI %d-%d\n", idx, mp_ioapics[idx].apicid,
--- a/arch/x86/kernel/cpu/Makefile
+++ b/arch/x86/kernel/cpu/Makefile
-@@ -42,8 +42,8 @@ obj-$(CONFIG_X86_LOCAL_APIC) += perfctr
+@@ -43,8 +43,8 @@ obj-$(CONFIG_X86_LOCAL_APIC) += perfctr
obj-$(CONFIG_HYPERVISOR_GUEST) += vmware.o hypervisor.o mshyperv.o
@@ -1882,20 +1882,6 @@ Automatically created from "patches.kernel.org/patch-2.6.35" by xen-port-patches
/*
* On some boxes several processors use the same processor bus id.
-@@ -408,8 +412,11 @@ static int acpi_processor_add(struct acp
- return 0;
-
- #ifdef CONFIG_SMP
-- if (pr->id >= setup_max_cpus && pr->id != 0)
-- return 0;
-+ if (pr->id >= setup_max_cpus && pr->id != 0) {
-+ if (!processor_cntl_external())
-+ return 0;
-+ WARN_ON(pr->id != -1);
-+ }
- #endif
-
- BUG_ON(!processor_cntl_external() && pr->id >= nr_cpu_ids);
--- a/drivers/acpi/processor_driver.c
+++ b/drivers/acpi/processor_driver.c
@@ -247,7 +247,11 @@ static int __acpi_processor_start(struct
@@ -1943,7 +1929,7 @@ Automatically created from "patches.kernel.org/patch-2.6.35" by xen-port-patches
processor_notify_external(pr,
--- a/drivers/gpu/drm/ttm/ttm_page_alloc.c
+++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c
-@@ -511,6 +511,19 @@ static int ttm_alloc_new_pages(struct li
+@@ -514,6 +514,19 @@ static int ttm_alloc_new_pages(struct li
for (i = 0, cpages = 0; i < count; ++i) {
p = alloc_page(gfp_flags);
@@ -1963,7 +1949,7 @@ Automatically created from "patches.kernel.org/patch-2.6.35" by xen-port-patches
if (!p) {
pr_err("Unable to get page %u\n", i);
-@@ -750,6 +763,22 @@ static int ttm_get_pages(struct page **p
+@@ -753,6 +766,22 @@ static int ttm_get_pages(struct page **p
return -ENOMEM;
}
@@ -2244,7 +2230,7 @@ Automatically created from "patches.kernel.org/patch-2.6.35" by xen-port-patches
#endif
--- a/drivers/xen/blktap/blktap.c
+++ b/drivers/xen/blktap/blktap.c
-@@ -1789,3 +1789,4 @@ static int __init blkif_init(void)
+@@ -1788,3 +1788,4 @@ static int __init blkif_init(void)
module_init(blkif_init);
MODULE_LICENSE("Dual BSD/GPL");
@@ -2358,7 +2344,7 @@ Automatically created from "patches.kernel.org/patch-2.6.35" by xen-port-patches
}
--- a/drivers/xen/evtchn.c
+++ b/drivers/xen/evtchn.c
-@@ -723,3 +723,4 @@ module_init(evtchn_init);
+@@ -743,3 +743,4 @@ module_init(evtchn_init);
module_exit(evtchn_cleanup);
MODULE_LICENSE("GPL");
@@ -2533,7 +2519,7 @@ Automatically created from "patches.kernel.org/patch-2.6.35" by xen-port-patches
* interface. Here the scatter gather list elements are each tagged with the
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
-@@ -1001,7 +1001,7 @@ static __always_inline bool free_pages_p
+@@ -1012,7 +1012,7 @@ static __always_inline bool free_pages_p
#ifdef CONFIG_XEN
if (PageForeign(page)) {
PageForeignDestructor(page, order);
diff --git a/patches.xen/xen3-patch-2.6.36 b/patches.xen/xen3-patch-2.6.36
index 7508758740..dc53dfc17a 100644
--- a/patches.xen/xen3-patch-2.6.36
+++ b/patches.xen/xen3-patch-2.6.36
@@ -12,16 +12,16 @@ Automatically created from "patches.kernel.org/patch-2.6.36" by xen-port-patches
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -156,7 +156,7 @@ config X86
+@@ -163,7 +163,7 @@ config X86
select HAVE_OPTPROBES
select HAVE_PCSPKR_PLATFORM
select HAVE_PERF_EVENTS
- select HAVE_PERF_EVENTS_NMI
+ select HAVE_PERF_EVENTS_NMI if !XEN
+ select HAVE_HARDLOCKUP_DETECTOR_PERF if PERF_EVENTS && HAVE_PERF_EVENTS_NMI
select HAVE_PERF_REGS
select HAVE_PERF_USER_STACK_DUMP
- select HAVE_REGS_AND_STACK_ACCESS_API
-@@ -1304,6 +1304,7 @@ config X86_CPUID
+@@ -1323,6 +1323,7 @@ config X86_CPUID
choice
prompt "High Memory Support"
@@ -29,7 +29,7 @@ Automatically created from "patches.kernel.org/patch-2.6.36" by xen-port-patches
default HIGHMEM4G
depends on X86_32
-@@ -1345,6 +1346,7 @@ config NOHIGHMEM
+@@ -1364,6 +1365,7 @@ config NOHIGHMEM
config HIGHMEM4G
bool "4GB"
@@ -373,7 +373,7 @@ Automatically created from "patches.kernel.org/patch-2.6.36" by xen-port-patches
#endif
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
-@@ -388,6 +388,7 @@ static void intel_workarounds(struct cpu
+@@ -384,6 +384,7 @@ static void intel_workarounds(struct cpu
}
#endif
@@ -381,7 +381,7 @@ Automatically created from "patches.kernel.org/patch-2.6.36" by xen-port-patches
static void srat_detect_node(struct cpuinfo_x86 *c)
{
#ifdef CONFIG_NUMA
-@@ -405,7 +406,6 @@ static void srat_detect_node(struct cpui
+@@ -401,7 +402,6 @@ static void srat_detect_node(struct cpui
#endif
}
@@ -389,7 +389,7 @@ Automatically created from "patches.kernel.org/patch-2.6.36" by xen-port-patches
/*
* find out the number of processor cores on the die
*/
-@@ -423,7 +423,6 @@ static int intel_num_cpu_cores(struct cp
+@@ -419,7 +419,6 @@ static int intel_num_cpu_cores(struct cp
else
return 1;
}
@@ -397,7 +397,7 @@ Automatically created from "patches.kernel.org/patch-2.6.36" by xen-port-patches
static void detect_vmx_virtcap(struct cpuinfo_x86 *c)
{
-@@ -462,6 +461,7 @@ static void detect_vmx_virtcap(struct cp
+@@ -458,6 +457,7 @@ static void detect_vmx_virtcap(struct cp
set_cpu_cap(c, X86_FEATURE_VPID);
}
}
@@ -405,7 +405,7 @@ Automatically created from "patches.kernel.org/patch-2.6.36" by xen-port-patches
static void init_intel_energy_perf(struct cpuinfo_x86 *c)
{
-@@ -601,11 +601,13 @@ static void init_intel(struct cpuinfo_x8
+@@ -625,11 +625,13 @@ static void init_intel(struct cpuinfo_x8
set_cpu_cap(c, X86_FEATURE_P3);
#endif
@@ -847,7 +847,7 @@ Automatically created from "patches.kernel.org/patch-2.6.36" by xen-port-patches
pe = debugfs_create_file("kernel_page_tables", 0600, NULL, NULL,
--- a/arch/x86/mm/fault-xen.c
+++ b/arch/x86/mm/fault-xen.c
-@@ -823,8 +823,10 @@ do_sigbus(struct pt_regs *regs, unsigned
+@@ -827,8 +827,10 @@ do_sigbus(struct pt_regs *regs, unsigned
up_read(&mm->mmap_sem);
/* Kernel mode? Handle exceptions or die: */
@@ -972,43 +972,37 @@ Automatically created from "patches.kernel.org/patch-2.6.36" by xen-port-patches
/* Register vsyscall32 into the ABI table */
--- a/arch/x86/xen/Kconfig
+++ b/arch/x86/xen/Kconfig
-@@ -22,7 +22,7 @@ config XEN_DOM0
-
+@@ -37,7 +37,7 @@ config XEN_DOM0
config XEN_PVHVM
- def_bool y
+ bool "Xen PVHVM guest support"
+ default y
- depends on XEN && PCI && X86_LOCAL_APIC
+ depends on PARAVIRT_XEN && PCI && X86_LOCAL_APIC
+ help
+ Support running as a Xen PVHVM guest.
- config XEN_512GB
- bool "Limit Xen pv-domain memory to 512GB"
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
-@@ -194,8 +194,8 @@ unsigned int pvh_start_info_sz = sizeof(
- static void clamp_max_cpus(void)
- {
- #ifdef CONFIG_SMP
-- if (setup_max_cpus > MAX_VIRT_CPUS)
-- setup_max_cpus = MAX_VIRT_CPUS;
-+ if (setup_max_cpus > XEN_LEGACY_MAX_VCPUS)
-+ setup_max_cpus = XEN_LEGACY_MAX_VCPUS;
- #endif
- }
+@@ -173,7 +173,7 @@ void xen_vcpu_restore(void)
-@@ -222,12 +222,12 @@ void xen_vcpu_setup(int cpu)
- if (per_cpu(xen_vcpu, cpu) == &per_cpu(xen_vcpu_info, cpu))
- return;
- }
-- if (xen_vcpu_nr(cpu) < MAX_VIRT_CPUS)
-+ if (xen_vcpu_nr(cpu) < XEN_LEGACY_MAX_VCPUS)
+ void xen_vcpu_info_reset(int cpu)
+ {
+- if (xen_vcpu_nr(cpu) < MAX_VIRT_CPUS) {
++ if (xen_vcpu_nr(cpu) < XEN_LEGACY_MAX_VCPUS) {
per_cpu(xen_vcpu, cpu) =
&HYPERVISOR_shared_info->vcpu_info[xen_vcpu_nr(cpu)];
-
- if (!have_vcpu_info_placement) {
-- if (cpu >= MAX_VIRT_CPUS)
-+ if (cpu >= XEN_LEGACY_MAX_VCPUS)
- clamp_max_cpus();
+ } else {
+--- a/arch/x86/xen/smp.c
++++ b/arch/x86/xen/smp.c
+@@ -126,7 +126,7 @@ void __init xen_smp_cpus_done(unsigned i
return;
- }
+
+ for_each_online_cpu(cpu) {
+- if (xen_vcpu_nr(cpu) < MAX_VIRT_CPUS)
++ if (xen_vcpu_nr(cpu) < XEN_LEGACY_MAX_VCPUS)
+ continue;
+
+ rc = cpu_down(cpu);
--- a/drivers/hwmon/coretemp-xen.c
+++ b/drivers/hwmon/coretemp-xen.c
@@ -583,15 +583,16 @@ static int __init coretemp_init(void)
@@ -1064,7 +1058,7 @@ Automatically created from "patches.kernel.org/patch-2.6.36" by xen-port-patches
exit:
--- a/drivers/xen/Kconfig
+++ b/drivers/xen/Kconfig
-@@ -594,6 +594,7 @@ config XEN_GRANT_DEV_ALLOC
+@@ -598,6 +598,7 @@ config XEN_GRANT_DEV_ALLOC
config SWIOTLB_XEN
def_bool y
@@ -1807,7 +1801,7 @@ Automatically created from "patches.kernel.org/patch-2.6.36" by xen-port-patches
}
+#if !defined(CONFIG_XEN) && !defined(MODULE)
+EXPORT_SYMBOL_GPL(xenbus_probe);
-
++
+static int __init xenbus_probe_initcall(void)
+{
+ if (!xen_domain())
@@ -1819,7 +1813,7 @@ Automatically created from "patches.kernel.org/patch-2.6.36" by xen-port-patches
+ xenbus_probe(NULL);
+ return 0;
+}
-+
+
+device_initcall(xenbus_probe_initcall);
+#endif
@@ -1973,7 +1967,7 @@ Automatically created from "patches.kernel.org/patch-2.6.36" by xen-port-patches
typedef struct xen_hvm_param xen_hvm_param_t;
DEFINE_XEN_GUEST_HANDLE(xen_hvm_param_t);
-@@ -151,6 +152,7 @@ struct xen_hvm_pagetable_dying {
+@@ -112,6 +113,7 @@ struct xen_hvm_pagetable_dying {
/* guest physical address of the toplevel pagetable dying */
uint64_t gpa;
};
@@ -1991,7 +1985,7 @@ Automatically created from "patches.kernel.org/patch-2.6.36" by xen-port-patches
typedef struct xen_memory_exchange xen_memory_exchange_t;
DEFINE_XEN_GUEST_HANDLE(xen_memory_exchange_t);
-@@ -657,4 +658,14 @@ DEFINE_XEN_GUEST_HANDLE(xen_vnuma_topolo
+@@ -659,4 +660,14 @@ DEFINE_XEN_GUEST_HANDLE(xen_vnuma_topolo
/* Next available subop number is 28 */
diff --git a/patches.xen/xen3-patch-2.6.37 b/patches.xen/xen3-patch-2.6.37
index 053c4518d0..14c5b3dae9 100644
--- a/patches.xen/xen3-patch-2.6.37
+++ b/patches.xen/xen3-patch-2.6.37
@@ -8,9 +8,12 @@ References: none
Acked-by: Jeff Mahoney <jeffm@suse.com>
Automatically created from "patches.kernel.org/patch-2.6.37" by xen-port-patches.py
+4.12/arch/x86/xen/Kconfig
+4.12/include/uapi/xen/Kbuild
+
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -2323,7 +2323,6 @@ config ARCH_ENABLE_HUGEPAGE_MIGRATION
+@@ -2342,7 +2342,6 @@ config ARCH_ENABLE_HUGEPAGE_MIGRATION
depends on X86_64 && HUGETLB_PAGE && MIGRATION
menu "Power management and ACPI options"
@@ -18,7 +21,7 @@ Automatically created from "patches.kernel.org/patch-2.6.37" by xen-port-patches
config ARCH_HIBERNATION_HEADER
def_bool y
-@@ -2331,6 +2330,8 @@ config ARCH_HIBERNATION_HEADER
+@@ -2350,6 +2349,8 @@ config ARCH_HIBERNATION_HEADER
source "kernel/power/Kconfig"
@@ -27,7 +30,7 @@ Automatically created from "patches.kernel.org/patch-2.6.37" by xen-port-patches
source "drivers/acpi/Kconfig"
source "drivers/sfi/Kconfig"
-@@ -2467,6 +2468,8 @@ source "drivers/cpuidle/Kconfig"
+@@ -2486,6 +2487,8 @@ source "drivers/cpuidle/Kconfig"
source "drivers/idle/Kconfig"
@@ -36,7 +39,7 @@ Automatically created from "patches.kernel.org/patch-2.6.37" by xen-port-patches
endmenu
-@@ -2545,7 +2548,7 @@ config PCI_OLPC
+@@ -2564,7 +2567,7 @@ config PCI_OLPC
config PCI_XEN
def_bool y
@@ -45,7 +48,7 @@ Automatically created from "patches.kernel.org/patch-2.6.37" by xen-port-patches
select SWIOTLB_XEN
config PCI_DOMAINS
-@@ -2569,21 +2572,6 @@ config PCI_CNB20LE_QUIRK
+@@ -2588,21 +2591,6 @@ config PCI_CNB20LE_QUIRK
You should say N unless you know you need this.
@@ -69,7 +72,7 @@ Automatically created from "patches.kernel.org/patch-2.6.37" by xen-port-patches
config ISA_BUS
--- a/arch/x86/include/asm/hw_irq.h
+++ b/arch/x86/include/asm/hw_irq.h
-@@ -51,6 +51,7 @@ extern irqreturn_t smp_reschedule_interr
+@@ -52,6 +52,7 @@ extern irqreturn_t smp_reschedule_interr
extern irqreturn_t smp_call_function_interrupt(int, void *);
extern irqreturn_t smp_call_function_single_interrupt(int, void *);
extern irqreturn_t smp_reboot_interrupt(int, void *);
@@ -502,7 +505,7 @@ Automatically created from "patches.kernel.org/patch-2.6.37" by xen-port-patches
#endif /* _ASM_X86_TLBFLUSH_H */
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
-@@ -150,7 +150,6 @@ ifeq ($(CONFIG_X86_64),y)
+@@ -144,7 +144,6 @@ ifeq ($(CONFIG_X86_64),y)
obj-y += vsmp_64.o
endif
@@ -3924,7 +3927,7 @@ Automatically created from "patches.kernel.org/patch-2.6.37" by xen-port-patches
+# include <asm/hypervisor.h>
+#endif
#include <linux/ioport.h>
- #include <asm/e820.h>
+ #include <asm/e820/api.h>
@@ -37,6 +41,10 @@ static void remove_e820_regions(struct r
@@ -4612,7 +4615,7 @@ Automatically created from "patches.kernel.org/patch-2.6.37" by xen-port-patches
/*
* Synchronize this task's top level page-table
* with the 'reference' page table.
-@@ -344,31 +352,7 @@ out:
+@@ -348,31 +356,7 @@ out:
void vmalloc_sync_all(void)
{
@@ -4645,7 +4648,7 @@ Automatically created from "patches.kernel.org/patch-2.6.37" by xen-port-patches
}
/*
-@@ -389,6 +373,8 @@ static noinline __kprobes int vmalloc_fa
+@@ -393,6 +377,8 @@ static noinline __kprobes int vmalloc_fa
if (!(address >= VMALLOC_START && address < VMALLOC_END))
return -1;
@@ -4654,7 +4657,7 @@ Automatically created from "patches.kernel.org/patch-2.6.37" by xen-port-patches
/*
* Copy kernel mappings over when needed. This can also
* happen within a race in page table update. In the later
-@@ -752,7 +738,7 @@ __bad_area_nosemaphore(struct pt_regs *r
+@@ -756,7 +742,7 @@ __bad_area_nosemaphore(struct pt_regs *r
tsk->thread.error_code = error_code | (address >= TASK_SIZE);
tsk->thread.trap_no = 14;
@@ -4663,7 +4666,7 @@ Automatically created from "patches.kernel.org/patch-2.6.37" by xen-port-patches
return;
}
-@@ -837,14 +823,14 @@ do_sigbus(struct pt_regs *regs, unsigned
+@@ -841,14 +827,14 @@ do_sigbus(struct pt_regs *regs, unsigned
tsk->thread.trap_no = 14;
#ifdef CONFIG_MEMORY_FAILURE
@@ -4680,7 +4683,7 @@ Automatically created from "patches.kernel.org/patch-2.6.37" by xen-port-patches
}
static noinline void
-@@ -854,7 +840,8 @@ mm_fault_error(struct pt_regs *regs, uns
+@@ -858,7 +844,8 @@ mm_fault_error(struct pt_regs *regs, uns
if (fault & VM_FAULT_OOM) {
out_of_memory(regs, error_code, address);
} else {
@@ -4690,7 +4693,7 @@ Automatically created from "patches.kernel.org/patch-2.6.37" by xen-port-patches
do_sigbus(regs, error_code, address, fault);
else
BUG();
-@@ -915,8 +902,14 @@ spurious_fault(unsigned long error_code,
+@@ -919,8 +906,14 @@ spurious_fault(unsigned long error_code,
if (pmd_large(*pmd))
return spurious_fault_check(error_code, (pte_t *) pmd);
@@ -4706,7 +4709,7 @@ Automatically created from "patches.kernel.org/patch-2.6.37" by xen-port-patches
return 0;
ret = spurious_fault_check(error_code, pte);
-@@ -936,9 +929,9 @@ spurious_fault(unsigned long error_code,
+@@ -940,9 +933,9 @@ spurious_fault(unsigned long error_code,
int show_unhandled_signals = 1;
static inline int
@@ -4718,7 +4721,7 @@ Automatically created from "patches.kernel.org/patch-2.6.37" by xen-port-patches
/* write, present and write, not present: */
if (unlikely(!(vma->vm_flags & VM_WRITE)))
return 1;
-@@ -973,8 +966,10 @@ do_page_fault(struct pt_regs *regs, unsi
+@@ -977,8 +970,10 @@ do_page_fault(struct pt_regs *regs, unsi
struct task_struct *tsk;
unsigned long address;
struct mm_struct *mm;
@@ -4730,7 +4733,7 @@ Automatically created from "patches.kernel.org/patch-2.6.37" by xen-port-patches
/* Set the "privileged fault" bit to something sane. */
if (user_mode_vm(regs))
-@@ -1102,6 +1097,7 @@ do_page_fault(struct pt_regs *regs, unsi
+@@ -1106,6 +1101,7 @@ do_page_fault(struct pt_regs *regs, unsi
bad_area_nosemaphore(regs, error_code, address);
return;
}
@@ -4738,7 +4741,7 @@ Automatically created from "patches.kernel.org/patch-2.6.37" by xen-port-patches
down_read(&mm->mmap_sem);
} else {
/*
-@@ -1145,9 +1141,7 @@ do_page_fault(struct pt_regs *regs, unsi
+@@ -1149,9 +1145,7 @@ do_page_fault(struct pt_regs *regs, unsi
* we can handle it..
*/
good_area:
@@ -4749,7 +4752,7 @@ Automatically created from "patches.kernel.org/patch-2.6.37" by xen-port-patches
bad_area_access_error(regs, error_code, address);
return;
}
-@@ -1157,21 +1151,34 @@ good_area:
+@@ -1161,21 +1155,34 @@ good_area:
* make sure we exit gracefully rather than endlessly redo
* the fault:
*/
@@ -5611,17 +5614,6 @@ Automatically created from "patches.kernel.org/patch-2.6.37" by xen-port-patches
return -ENOMEM;
evtchn_register_pirq(irq);
dev->irq = irq;
---- a/arch/x86/xen/Kconfig
-+++ b/arch/x86/xen/Kconfig
-@@ -17,7 +17,7 @@ config PARAVIRT_XEN
-
- config XEN_DOM0
- def_bool y
-- depends on XEN && PCI_XEN && SWIOTLB_XEN
-+ depends on PARAVIRT_XEN && PCI_XEN && SWIOTLB_XEN
- depends on X86_IO_APIC && ACPI && PCI
-
- config XEN_PVHVM
--- a/drivers/oprofile/oprofile_files.c
+++ b/drivers/oprofile/oprofile_files.c
@@ -296,6 +296,7 @@ static const struct file_operations acti
@@ -5672,7 +5664,7 @@ Automatically created from "patches.kernel.org/patch-2.6.37" by xen-port-patches
default y
--- a/drivers/pci/Makefile
+++ b/drivers/pci/Makefile
-@@ -65,7 +65,7 @@ obj-$(CONFIG_PCI_STUB) += pci-stub.o
+@@ -52,7 +52,7 @@ obj-$(CONFIG_PCI_STUB) += pci-stub.o
obj-$(CONFIG_PCI_ECAM) += ecam.o
@@ -7240,7 +7232,7 @@ Automatically created from "patches.kernel.org/patch-2.6.37" by xen-port-patches
--- a/drivers/xen/evtchn.c
+++ b/drivers/xen/evtchn.c
-@@ -691,7 +691,11 @@ static const struct file_operations evtc
+@@ -711,7 +711,11 @@ static const struct file_operations evtc
static struct miscdevice evtchn_miscdev = {
.minor = MISC_DYNAMIC_MINOR,
@@ -7519,14 +7511,6 @@ Automatically created from "patches.kernel.org/patch-2.6.37" by xen-port-patches
return err;
}
---- a/include/uapi/xen/Kbuild
-+++ b/include/uapi/xen/Kbuild
-@@ -1,5 +1,4 @@
- # UAPI Header export list
- header-y += gntalloc.h
- header-y += gntdev.h
--header-y += privcmd.h
- header-y += public/
--- a/include/xen/evtchn.h
+++ b/include/xen/evtchn.h
@@ -55,6 +55,7 @@ struct irq_cfg {
diff --git a/patches.xen/xen3-patch-2.6.38 b/patches.xen/xen3-patch-2.6.38
index eab2a50259..af2e1c780b 100644
--- a/patches.xen/xen3-patch-2.6.38
+++ b/patches.xen/xen3-patch-2.6.38
@@ -13,7 +13,7 @@ Automatically created from "patches.kernel.org/patch-2.6.38" by xen-port-patches
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -142,7 +142,7 @@ config X86
+@@ -148,7 +148,7 @@ config X86
select HAVE_KERNEL_LZ4
select HAVE_KERNEL_LZMA if !XEN
select HAVE_KERNEL_LZO if !XEN
@@ -22,7 +22,7 @@ Automatically created from "patches.kernel.org/patch-2.6.38" by xen-port-patches
select HAVE_KPROBES
select HAVE_KPROBES_ON_FTRACE
select HAVE_KRETPROBES
-@@ -698,7 +698,7 @@ config STA2X11
+@@ -709,7 +709,7 @@ config STA2X11
config X86_32_IRIS
tristate "Eurobraille/Iris poweroff module"
@@ -31,7 +31,7 @@ Automatically created from "patches.kernel.org/patch-2.6.38" by xen-port-patches
---help---
The Iris machines from EuroBraille do not have APM or ACPI support
to shut themselves down properly. A special I/O sequence is
-@@ -2051,7 +2051,7 @@ config X86_NEED_RELOCS
+@@ -2070,7 +2070,7 @@ config X86_NEED_RELOCS
depends on RANDOMIZE_BASE || (X86_32 && RELOCATABLE)
config PHYSICAL_ALIGN
@@ -544,7 +544,7 @@ Automatically created from "patches.kernel.org/patch-2.6.38" by xen-port-patches
void (*smp_prepare_boot_cpu)(void);
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
-@@ -72,10 +72,11 @@ int acpi_sci_override_gsi __initdata;
+@@ -73,10 +73,11 @@ int acpi_sci_override_gsi __initdata;
#ifndef CONFIG_XEN
int acpi_skip_timer_override __initdata;
int acpi_use_timer_override __initdata;
@@ -1700,7 +1700,7 @@ Automatically created from "patches.kernel.org/patch-2.6.38" by xen-port-patches
}
}
-@@ -838,6 +837,13 @@ mm_fault_error(struct pt_regs *regs, uns
+@@ -842,6 +841,13 @@ mm_fault_error(struct pt_regs *regs, uns
unsigned long address, unsigned int fault)
{
if (fault & VM_FAULT_OOM) {
@@ -2255,7 +2255,7 @@ Automatically created from "patches.kernel.org/patch-2.6.38" by xen-port-patches
#else
--- a/drivers/xen/Kconfig
+++ b/drivers/xen/Kconfig
-@@ -525,7 +525,7 @@ config XEN_DEV_EVTCHN
+@@ -529,7 +529,7 @@ config XEN_DEV_EVTCHN
firing.
If in doubt, say yes.
@@ -2264,7 +2264,7 @@ Automatically created from "patches.kernel.org/patch-2.6.38" by xen-port-patches
bool "Backend driver support"
depends on XEN_DOM0
default y
-@@ -573,7 +573,7 @@ config XEN_XENBUS_FRONTEND
+@@ -577,7 +577,7 @@ config XEN_XENBUS_FRONTEND
config XEN_GNTDEV
tristate "userspace grant access device driver"
diff --git a/patches.xen/xen3-patch-2.6.39 b/patches.xen/xen3-patch-2.6.39
index d6a933ad79..94d49e8c78 100644
--- a/patches.xen/xen3-patch-2.6.39
+++ b/patches.xen/xen3-patch-2.6.39
@@ -12,7 +12,7 @@ Acked-by: jbeulich@novell.com
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -1424,7 +1424,7 @@ config ARCH_PHYS_ADDR_T_64BIT
+@@ -1443,7 +1443,7 @@ config ARCH_PHYS_ADDR_T_64BIT
config ARCH_DMA_ADDR_T_64BIT
def_bool y
@@ -21,7 +21,7 @@ Acked-by: jbeulich@novell.com
config X86_DIRECT_GBPAGES
def_bool y
-@@ -2585,7 +2585,7 @@ config ISA_BUS
+@@ -2604,7 +2604,7 @@ config ISA_BUS
# x86_64 have no ISA slots, but can have ISA-style DMA.
config ISA_DMA_API
@@ -30,7 +30,7 @@ Acked-by: jbeulich@novell.com
default y
help
Enables ISA-style DMA support for devices requiring such controllers.
-@@ -2644,7 +2644,7 @@ config SCx200HR_TIMER
+@@ -2663,7 +2663,7 @@ config SCx200HR_TIMER
config OLPC
bool "One Laptop Per Child support"
@@ -140,7 +140,7 @@ Acked-by: jbeulich@novell.com
#define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN
--- a/arch/x86/include/mach-xen/asm/pgtable_types.h
+++ b/arch/x86/include/mach-xen/asm/pgtable_types.h
-@@ -358,6 +358,8 @@ int phys_mem_access_prot_allowed(struct
+@@ -362,6 +362,8 @@ int phys_mem_access_prot_allowed(struct
/* Install a pte for a particular vaddr in kernel space. */
void set_pte_vaddr(unsigned long vaddr, pte_t pte);
@@ -208,7 +208,7 @@ Acked-by: jbeulich@novell.com
#ifdef CONFIG_SMP
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
-@@ -151,5 +151,5 @@ ifeq ($(CONFIG_X86_64),y)
+@@ -145,5 +145,5 @@ ifeq ($(CONFIG_X86_64),y)
endif
disabled-obj-$(CONFIG_XEN) := crash.o early-quirks.o i8237.o i8253.o i8259.o \
@@ -217,7 +217,7 @@ Acked-by: jbeulich@novell.com
disabled-obj-$(CONFIG_XEN_UNPRIVILEGED_GUEST) += probe_roms_32.o
--- a/arch/x86/kernel/acpi/Makefile
+++ b/arch/x86/kernel/acpi/Makefile
-@@ -10,4 +10,4 @@ obj-$(CONFIG_XEN) += processor_extcntl_
+@@ -12,4 +12,4 @@ obj-$(CONFIG_XEN) += processor_extcntl_
endif
endif
@@ -1184,7 +1184,7 @@ Acked-by: jbeulich@novell.com
#endif
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
-@@ -603,6 +603,7 @@ static void early_init_amd(struct cpuinf
+@@ -604,6 +604,7 @@ static void early_init_amd(struct cpuinf
if (c->x86 == 0x16 && c->x86_model <= 0xf)
msr_set_bit(MSR_AMD64_LS_CFG, 15);
@@ -1192,7 +1192,7 @@ Acked-by: jbeulich@novell.com
/*
* Check whether the machine is affected by erratum 400. This is
* used to select the proper idle routine and to enable the check
-@@ -611,6 +612,7 @@ static void early_init_amd(struct cpuinf
+@@ -612,6 +613,7 @@ static void early_init_amd(struct cpuinf
*/
if (cpu_has_amd_erratum(c, amd_erratum_400))
set_cpu_bug(c, X86_BUG_AMD_E400);
@@ -1200,7 +1200,7 @@ Acked-by: jbeulich@novell.com
}
static void init_amd_k8(struct cpuinfo_x86 *c)
-@@ -668,6 +670,7 @@ static void init_amd_gh(struct cpuinfo_x
+@@ -669,6 +671,7 @@ static void init_amd_gh(struct cpuinfo_x
fam10h_check_enable_mmcfg();
#endif
@@ -1208,7 +1208,7 @@ Acked-by: jbeulich@novell.com
/*
* Disable GART TLB Walk Errors on Fam10h. We do this here because this
* is always needed when GART is enabled, even in a kernel which has no
-@@ -688,6 +691,7 @@ static void init_amd_gh(struct cpuinfo_x
+@@ -689,6 +692,7 @@ static void init_amd_gh(struct cpuinfo_x
* guests on older kvm hosts.
*/
msr_clear_bit(MSR_AMD64_BU_CFG2, 24);
@@ -1216,7 +1216,7 @@ Acked-by: jbeulich@novell.com
if (cpu_has_amd_erratum(c, amd_erratum_383))
set_cpu_bug(c, X86_BUG_AMD_TLB_MMATCH);
-@@ -800,7 +804,9 @@ static void init_amd(struct cpuinfo_x86
+@@ -801,7 +805,9 @@ static void init_amd(struct cpuinfo_x86
if (c->x86 > 0x11)
set_cpu_cap(c, X86_FEATURE_ARAT);
@@ -2661,7 +2661,7 @@ Acked-by: jbeulich@novell.com
}
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
-@@ -429,15 +429,15 @@ config PARAVIRT_XEN_NETDEV_FRONTEND
+@@ -437,15 +437,15 @@ config PARAVIRT_XEN_NETDEV_FRONTEND
domain 0).
The corresponding Linux backend driver is enabled by the
@@ -2680,7 +2680,7 @@ Acked-by: jbeulich@novell.com
help
This driver allows the kernel to act as a Xen network driver
domain which exports paravirtual network devices to other
-@@ -445,7 +445,7 @@ config XEN_NETDEV_BACKEND
+@@ -453,7 +453,7 @@ config XEN_NETDEV_BACKEND
system that implements a compatible front end.
The corresponding Linux frontend driver is enabled by the
@@ -2691,7 +2691,7 @@ Acked-by: jbeulich@novell.com
endpoint for each paravirtual network device to the driver
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
-@@ -66,7 +66,7 @@ obj-$(CONFIG_IEEE802154) += ieee802154/
+@@ -67,7 +67,7 @@ obj-$(CONFIG_IEEE802154) += ieee802154/
obj-$(CONFIG_VMXNET3) += vmxnet3/
obj-$(CONFIG_PARAVIRT_XEN_NETDEV_FRONTEND) += xen-netfront.o
@@ -2709,7 +2709,7 @@ Acked-by: jbeulich@novell.com
xen-netback-y := netback.o xenbus.o interface.o hash.o rx.o
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
-@@ -1946,6 +1946,31 @@ int scsi_decide_disposition(struct scsi_
+@@ -1879,6 +1879,31 @@ int scsi_decide_disposition(struct scsi_
}
case DID_RESET:
return SUCCESS;
@@ -2743,7 +2743,7 @@ Acked-by: jbeulich@novell.com
}
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
-@@ -1775,7 +1775,7 @@ config WATCHDOG_SUN4V
+@@ -1818,7 +1818,7 @@ config WATCHDOG_SUN4V
config XEN_WDT
tristate "Xen Watchdog support"
@@ -2797,7 +2797,7 @@ Acked-by: jbeulich@novell.com
platform_driver_unregister(&xen_wdt_driver);
--- a/drivers/xen/Kconfig
+++ b/drivers/xen/Kconfig
-@@ -581,7 +581,7 @@ config XEN_GNTDEV
+@@ -585,7 +585,7 @@ config XEN_GNTDEV
config XEN_GRANT_DEV_ALLOC
tristate "User-space grant reference allocator driver"
@@ -3740,7 +3740,7 @@ Acked-by: jbeulich@novell.com
#endif
--- a/include/xen/interface/xen.h
+++ b/include/xen/interface/xen.h
-@@ -145,7 +145,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t);
+@@ -146,7 +146,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t);
*/
/* New sched_op hypercall introduced in 0x00030101. */
diff --git a/patches.xen/xen3-patch-3.0 b/patches.xen/xen3-patch-3.0
index 17bf080f19..8ce8f444e8 100644
--- a/patches.xen/xen3-patch-3.0
+++ b/patches.xen/xen3-patch-3.0
@@ -30,14 +30,14 @@ Acked-by: jbeulich@novell.com
ia32_syscall_end:
--- a/arch/x86/include/asm/xen/hypercall.h
+++ b/arch/x86/include/asm/xen/hypercall.h
-@@ -48,6 +48,7 @@
+@@ -49,6 +49,7 @@
#include <xen/interface/sched.h>
#include <xen/interface/physdev.h>
#include <xen/interface/platform.h>
+#include <xen/interface/tmem.h>
#include <xen/interface/xen-mca.h>
- /*
+ struct xen_dm_op_buf;
--- a/arch/x86/include/mach-xen/asm/desc.h
+++ b/arch/x86/include/mach-xen/asm/desc.h
@@ -4,30 +4,33 @@
@@ -382,7 +382,7 @@ Acked-by: jbeulich@novell.com
IDLE_POLL, IDLE_FORCE_MWAIT};
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
-@@ -152,4 +152,4 @@ endif
+@@ -146,4 +146,4 @@ endif
disabled-obj-$(CONFIG_XEN) := crash.o early-quirks.o i8237.o i8253.o i8259.o \
irqinit.o pci-swiotlb.o reboot.o smpboot.o trampoline%.o tsc%.o vsmp%.o
@@ -1573,7 +1573,7 @@ Acked-by: jbeulich@novell.com
#include <asm/traps.h> /* dotraplinkage, ... */
#include <asm/pgalloc.h> /* pgd_*(), ... */
-@@ -832,16 +833,30 @@ do_sigbus(struct pt_regs *regs, unsigned
+@@ -836,16 +837,30 @@ do_sigbus(struct pt_regs *regs, unsigned
force_sig_info_fault(SIGBUS, code, address, tsk, fault);
}
@@ -1606,7 +1606,7 @@ Acked-by: jbeulich@novell.com
}
out_of_memory(regs, error_code, address);
-@@ -852,6 +867,7 @@ mm_fault_error(struct pt_regs *regs, uns
+@@ -856,6 +871,7 @@ mm_fault_error(struct pt_regs *regs, uns
else
BUG();
}
@@ -1614,7 +1614,7 @@ Acked-by: jbeulich@novell.com
}
static int spurious_fault_check(unsigned long error_code, pte_t *pte)
-@@ -974,7 +990,7 @@ do_page_fault(struct pt_regs *regs, unsi
+@@ -978,7 +994,7 @@ do_page_fault(struct pt_regs *regs, unsi
struct mm_struct *mm;
int fault;
int write = error_code & PF_WRITE;
@@ -1623,7 +1623,7 @@ Acked-by: jbeulich@novell.com
(write ? FAULT_FLAG_WRITE : 0);
/* Set the "privileged fault" bit to something sane. */
-@@ -1159,9 +1175,9 @@ good_area:
+@@ -1163,9 +1179,9 @@ good_area:
*/
fault = handle_mm_fault(mm, vma, address, flags);
@@ -1744,7 +1744,7 @@ Acked-by: jbeulich@novell.com
free_vm_area(area);
--- a/drivers/block/Kconfig
+++ b/drivers/block/Kconfig
-@@ -476,16 +476,16 @@ config PARAVIRT_XEN_BLKDEV_FRONTEND
+@@ -444,16 +444,16 @@ config PARAVIRT_XEN_BLKDEV_FRONTEND
block device driver. It communicates with a back-end driver
in another domain which drives the actual block device.
@@ -1766,8 +1766,8 @@ Acked-by: jbeulich@novell.com
in the XenBus configuration. There are no limits to what the block
--- a/drivers/block/Makefile
+++ b/drivers/block/Makefile
-@@ -33,7 +33,7 @@ obj-$(CONFIG_BLK_DEV_SX8) += sx8.o
- obj-$(CONFIG_BLK_DEV_HD) += hd.o
+@@ -30,7 +30,7 @@ obj-$(CONFIG_VIRTIO_BLK) += virtio_blk.o
+ obj-$(CONFIG_BLK_DEV_SX8) += sx8.o
obj-$(CONFIG_PARAVIRT_XEN_BLKDEV_FRONTEND) += xen-blkfront.o
-obj-$(CONFIG_XEN_BLKDEV_BACKEND) += xen-blkback/
diff --git a/patches.xen/xen3-patch-3.1 b/patches.xen/xen3-patch-3.1
index 0215cde642..fe86e214ff 100644
--- a/patches.xen/xen3-patch-3.1
+++ b/patches.xen/xen3-patch-3.1
@@ -13,16 +13,16 @@ Acked-by: jbeulich@suse.com
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -73,7 +73,7 @@ config X86
- select ARCH_WANT_FRAME_POINTERS
+@@ -76,7 +76,7 @@ config X86
select ARCH_WANTS_DYNAMIC_TASK_STRUCT
+ select ARCH_WANTS_THP_SWAP if X86_64
select BUILDTIME_EXTABLE_SORT
- select CLKEVT_I8253
+ select CLKEVT_I8253 if !XEN
select CLOCKSOURCE_VALIDATE_LAST_CYCLE
select CLOCKSOURCE_WATCHDOG if !XEN
select DCACHE_WORD_ACCESS
-@@ -154,7 +154,7 @@ config X86
+@@ -161,7 +161,7 @@ config X86
select HAVE_NMI
select HAVE_OPROFILE
select HAVE_OPTPROBES
@@ -30,7 +30,7 @@ Acked-by: jbeulich@suse.com
+ select HAVE_PCSPKR_PLATFORM if !XEN_UNPRIVILEGED_GUEST
select HAVE_PERF_EVENTS
select HAVE_PERF_EVENTS_NMI if !XEN
- select HAVE_PERF_REGS
+ select HAVE_HARDLOCKUP_DETECTOR_PERF if PERF_EVENTS && HAVE_PERF_EVENTS_NMI
--- a/arch/x86/entry/entry_64_compat-xen.S
+++ b/arch/x86/entry/entry_64_compat-xen.S
@@ -135,7 +135,7 @@ ENTRY(ia32_sysenter_target)
@@ -603,7 +603,7 @@ Acked-by: jbeulich@suse.com
#endif
case 0x60:
/* 0x64 thru 0x67 are valid prefixes in all modes. */
-@@ -730,6 +730,18 @@ __bad_area_nosemaphore(struct pt_regs *r
+@@ -734,6 +734,18 @@ __bad_area_nosemaphore(struct pt_regs *r
if (is_errata100(regs, address))
return;
@@ -622,7 +622,7 @@ Acked-by: jbeulich@suse.com
if (unlikely(show_unhandled_signals))
show_signal_msg(regs, error_code, address, tsk);
-@@ -1086,7 +1098,7 @@ do_page_fault(struct pt_regs *regs, unsi
+@@ -1090,7 +1102,7 @@ do_page_fault(struct pt_regs *regs, unsi
if (unlikely(error_code & PF_RSVD))
pgtable_bad(regs, error_code, address);
@@ -631,7 +631,7 @@ Acked-by: jbeulich@suse.com
/*
* If we're in an interrupt, have no user context or are running
-@@ -1188,11 +1200,11 @@ good_area:
+@@ -1192,11 +1204,11 @@ good_area:
if (flags & FAULT_FLAG_ALLOW_RETRY) {
if (fault & VM_FAULT_MAJOR) {
tsk->maj_flt++;
@@ -689,7 +689,7 @@ Acked-by: jbeulich@suse.com
break;
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
-@@ -5635,7 +5635,11 @@ static void gen6_update_ring_freq(struct
+@@ -6674,7 +6674,11 @@ static void gen6_update_ring_freq(struct
* Default to measured freq if none found, PCU will ensure we
* don't go over
*/
@@ -1213,7 +1213,7 @@ Acked-by: jbeulich@suse.com
config XEN_TPMDEV_BACKEND
tristate "TPM-device backend driver"
depends on XEN_BACKEND
-@@ -435,8 +371,7 @@ config XEN_BALLOON
+@@ -439,8 +375,7 @@ config XEN_BALLOON
config XEN_SELFBALLOONING
bool "Dynamically self-balloon kernel memory to target"
@@ -1223,7 +1223,7 @@ Acked-by: jbeulich@suse.com
help
Self-ballooning dynamically balloons available kernel memory driven
by the current usage of anonymous memory ("committed AS") and
-@@ -452,7 +387,7 @@ config XEN_SELFBALLOONING
+@@ -456,7 +391,7 @@ config XEN_SELFBALLOONING
config XEN_BALLOON_MEMORY_HOTPLUG
bool "Memory hotplug support for Xen balloon driver"
default n
@@ -1232,7 +1232,7 @@ Acked-by: jbeulich@suse.com
help
Memory hotplug support for Xen balloon driver allows expanding memory
available for the system above limit declared at system startup.
-@@ -606,8 +541,8 @@ config XEN_TMEM
+@@ -610,8 +545,8 @@ config XEN_TMEM
config XEN_PCIDEV_BACKEND
tristate "Xen PCI-device backend driver"
@@ -1243,7 +1243,7 @@ Acked-by: jbeulich@suse.com
default m
help
The PCI device backend driver allows the kernel to export arbitrary
-@@ -615,11 +550,6 @@ config XEN_PCIDEV_BACKEND
+@@ -619,11 +554,6 @@ config XEN_PCIDEV_BACKEND
will need to make sure no other driver has bound to the device(s)
you want to make visible to other guests.
@@ -1255,7 +1255,7 @@ Acked-by: jbeulich@suse.com
The "hide" parameter (only applicable if backend driver is compiled
into the kernel) allows you to bind the PCI devices to this module
from the default device drivers. The argument is the list of PCI BDFs:
-@@ -627,6 +557,97 @@ config XEN_PCIDEV_BACKEND
+@@ -631,6 +561,97 @@ config XEN_PCIDEV_BACKEND
If in doubt, say m.
@@ -1414,7 +1414,7 @@ Acked-by: jbeulich@suse.com
void __exit balloon_sysfs_exit(void)
--- a/drivers/xen/blkback/blkback.c
+++ b/drivers/xen/blkback/blkback.c
-@@ -709,3 +709,4 @@ static int __init blkif_init(void)
+@@ -711,3 +711,4 @@ static int __init blkif_init(void)
module_init(blkif_init);
MODULE_LICENSE("Dual BSD/GPL");
@@ -1450,7 +1450,7 @@ Acked-by: jbeulich@suse.com
#define DPRINTK(_f, _a...) pr_debug(_f, ## _a)
--- a/drivers/xen/blktap/blktap.c
+++ b/drivers/xen/blktap/blktap.c
-@@ -1793,3 +1793,4 @@ module_init(blkif_init);
+@@ -1792,3 +1792,4 @@ module_init(blkif_init);
MODULE_LICENSE("Dual BSD/GPL");
/* MODULE_ALIAS("devname:xen/blktap0"); */
@@ -3067,7 +3067,7 @@ Acked-by: jbeulich@suse.com
--- a/include/xen/interface/xen.h
+++ b/include/xen/interface/xen.h
-@@ -927,7 +927,7 @@ typedef struct dom0_vga_console_info {
+@@ -933,7 +933,7 @@ typedef struct dom0_vga_console_info {
uint8_t green_pos, green_size;
uint8_t blue_pos, blue_size;
uint8_t rsvd_pos, rsvd_size;
diff --git a/patches.xen/xen3-patch-3.10 b/patches.xen/xen3-patch-3.10
index ff3e1dcf92..d313f797e9 100644
--- a/patches.xen/xen3-patch-3.10
+++ b/patches.xen/xen3-patch-3.10
@@ -9,12 +9,13 @@ Automatically created from "patch-3.10" by xen-port-patches.py
Acked-by: jbeulich@suse.com
4.10/kernel/locking/mutex.c
+4.13/arch/x86/xen/enlighten_hvm.c
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -166,7 +166,7 @@ config X86
- select HAVE_USER_RETURN_NOTIFIER
+@@ -176,7 +176,7 @@ config X86
select IRQ_FORCED_THREADING
+ select PCI_LOCKLESS_CONFIG
select PERF_EVENTS
- select RTC_LIB
+ select RTC_LIB if !XEN_UNPRIVILEGED_GUEST
@@ -23,7 +24,7 @@ Acked-by: jbeulich@suse.com
select SRCU
--- a/arch/x86/include/asm/hypervisor.h
+++ b/arch/x86/include/asm/hypervisor.h
-@@ -68,5 +68,6 @@ static inline bool hypervisor_x2apic_ava
+@@ -74,5 +74,6 @@ static inline void hypervisor_init_mem_m
#endif /* _ASM_X86_HYPERVISOR_H */
#ifdef HAVE_XEN_PLATFORM_COMPAT_H
@@ -48,7 +49,7 @@ Acked-by: jbeulich@suse.com
FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */
--- a/arch/x86/include/mach-xen/asm/pgtable_types.h
+++ b/arch/x86/include/mach-xen/asm/pgtable_types.h
-@@ -406,7 +406,6 @@ static inline void update_page_count(int
+@@ -410,7 +410,6 @@ static inline void update_page_count(int
* as a pte too.
*/
extern pte_t *lookup_address(unsigned long address, unsigned int *level);
@@ -106,7 +107,7 @@ Acked-by: jbeulich@suse.com
--- a/arch/x86/kernel/cpu/Makefile
+++ b/arch/x86/kernel/cpu/Makefile
-@@ -42,8 +42,7 @@ obj-$(CONFIG_X86_LOCAL_APIC) += perfctr
+@@ -43,8 +43,7 @@ obj-$(CONFIG_X86_LOCAL_APIC) += perfctr
obj-$(CONFIG_HYPERVISOR_GUEST) += vmware.o hypervisor.o mshyperv.o
@@ -130,7 +131,7 @@ Acked-by: jbeulich@suse.com
/*
* nodes_per_socket: Stores the number of nodes per socket.
-@@ -690,10 +692,10 @@ static void init_amd_gh(struct cpuinfo_x
+@@ -691,10 +693,10 @@ static void init_amd_gh(struct cpuinfo_x
* guests on older kvm hosts.
*/
msr_clear_bit(MSR_AMD64_BU_CFG2, 24);
@@ -142,7 +143,7 @@ Acked-by: jbeulich@suse.com
}
#define MSR_AMD64_DE_CFG 0xC0011029
-@@ -913,6 +915,7 @@ static const struct cpu_dev amd_cpu_dev
+@@ -915,6 +917,7 @@ static const struct cpu_dev amd_cpu_dev
cpu_dev_register(amd_cpu_dev);
@@ -150,7 +151,7 @@ Acked-by: jbeulich@suse.com
/*
* AMD errata checking
*
-@@ -976,6 +979,7 @@ static bool cpu_has_amd_erratum(struct c
+@@ -978,6 +981,7 @@ static bool cpu_has_amd_erratum(struct c
return false;
}
@@ -800,7 +801,7 @@ Acked-by: jbeulich@suse.com
/*
* Page fault error code bits:
-@@ -566,7 +566,7 @@ static int is_f00f_bug(struct pt_regs *r
+@@ -570,7 +570,7 @@ static int is_f00f_bug(struct pt_regs *r
/*
* Pentium F0 0F C7 C8 bug workaround:
*/
@@ -809,7 +810,7 @@ Acked-by: jbeulich@suse.com
nr = (address - idt_descr.address) >> 3;
if (nr == 6) {
-@@ -1253,7 +1253,9 @@ good_area:
+@@ -1257,7 +1257,9 @@ good_area:
dotraplinkage void __kprobes
do_page_fault(struct pt_regs *regs, unsigned long error_code)
{
@@ -1127,26 +1128,15 @@ Acked-by: jbeulich@suse.com
__free_page(base);
return 0;
---- a/arch/x86/xen/enlighten.c
-+++ b/arch/x86/xen/enlighten.c
-@@ -1795,7 +1795,7 @@ void __ref xen_hvm_init_shared_info(void
- * in that case multiple vcpus might be online. */
- for_each_online_cpu(cpu) {
- /* Leave it to be NULL. */
-- if (xen_vcpu_nr(cpu) >= MAX_VIRT_CPUS)
-+ if (xen_vcpu_nr(cpu) >= XEN_LEGACY_MAX_VCPUS)
- continue;
- per_cpu(xen_vcpu, cpu) =
- &HYPERVISOR_shared_info->vcpu_info[xen_vcpu_nr(cpu)];
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
-@@ -2910,7 +2910,7 @@ intel_info(const struct drm_i915_private
+@@ -3044,7 +3044,7 @@ intel_info(const struct drm_i915_private
- static inline bool intel_scanout_needs_vtd_wa(struct drm_i915_private *dev_priv)
+ static inline bool intel_vtd_active(void)
{
-#ifdef CONFIG_INTEL_IOMMU
+#if defined(CONFIG_INTEL_IOMMU) || defined(CONFIG_XEN)
- if (INTEL_GEN(dev_priv) >= 6 && intel_iommu_gfx_mapped)
+ if (intel_iommu_gfx_mapped)
return true;
#endif
--- a/drivers/hwmon/coretemp-xen.c
@@ -1483,7 +1473,7 @@ Acked-by: jbeulich@suse.com
}
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
-@@ -994,7 +994,7 @@ config INTEL_SMARTCONNECT
+@@ -1045,7 +1045,7 @@ config INTEL_SMARTCONNECT
config PVPANIC
tristate "pvpanic device support"
@@ -1494,7 +1484,7 @@ Acked-by: jbeulich@suse.com
a paravirtualized device provided by QEMU; it lets a virtual machine
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
-@@ -9597,9 +9597,6 @@ lpfc_cpu_affinity_check(struct lpfc_hba
+@@ -9715,9 +9715,6 @@ lpfc_cpu_affinity_check(struct lpfc_hba
int index = 0;
int vec = 0;
int cpu;
@@ -1504,7 +1494,7 @@ Acked-by: jbeulich@suse.com
/* Init cpu_map array */
memset(phba->sli4_hba.cpu_map, 0xff,
-@@ -9609,8 +9606,8 @@ lpfc_cpu_affinity_check(struct lpfc_hba
+@@ -9727,8 +9724,8 @@ lpfc_cpu_affinity_check(struct lpfc_hba
/* Update CPU map with physical id and core id of each CPU */
cpup = phba->sli4_hba.cpu_map;
for (cpu = 0; cpu < phba->sli4_hba.num_present_cpu; cpu++) {
@@ -2230,7 +2220,7 @@ Acked-by: jbeulich@suse.com
static inline struct xenbus_device *to_xenbus_device(struct device *dev)
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
-@@ -1271,6 +1271,10 @@ int timekeeping_inject_offset(struct tim
+@@ -1299,6 +1299,10 @@ int timekeeping_inject_offset(struct tim
tk_xtime_add(tk, &ts64);
tk_set_wall_to_mono(tk, timespec64_sub(tk->wall_to_monotonic, ts64));
diff --git a/patches.xen/xen3-patch-3.11 b/patches.xen/xen3-patch-3.11
index 7ddaea768c..6406a3942f 100644
--- a/patches.xen/xen3-patch-3.11
+++ b/patches.xen/xen3-patch-3.11
@@ -10,7 +10,7 @@ Acked-by: jbeulich@suse.com
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
-@@ -738,9 +738,9 @@ config KEXEC
+@@ -769,9 +769,9 @@ config CRASH_DUMP
config XEN_DOM0
def_bool y
@@ -24,7 +24,7 @@ Acked-by: jbeulich@suse.com
select SWIOTLB_XEN
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
-@@ -94,7 +94,7 @@ export TEXT_OFFSET GZFLAGS
+@@ -101,7 +101,7 @@ export TEXT_OFFSET GZFLAGS
core-y += arch/arm64/kernel/ arch/arm64/mm/
core-$(CONFIG_NET) += arch/arm64/net/
core-$(CONFIG_KVM) += arch/arm64/kvm/
@@ -36,7 +36,7 @@ Acked-by: jbeulich@suse.com
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -25,7 +25,7 @@ config X86_64
- select ARCH_HAS_GIGANTIC_PAGE
+ select ARCH_HAS_GIGANTIC_PAGE if (MEMORY_ISOLATION && COMPACTION) || CMA
select ARCH_SUPPORTS_INT128
select ARCH_USE_CMPXCHG_LOCKREF
- select HAVE_ARCH_SOFT_DIRTY
@@ -44,7 +44,7 @@ Acked-by: jbeulich@suse.com
select MODULES_USE_ELF_RELA
select X86_DEV_DMA_OPS if !XEN
-@@ -139,7 +139,7 @@ config X86
+@@ -145,7 +145,7 @@ config X86
select HAVE_IRQ_TIME_ACCOUNTING
select HAVE_KERNEL_BZIP2 if !XEN
select HAVE_KERNEL_GZIP
@@ -453,7 +453,7 @@ Acked-by: jbeulich@suse.com
#else
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
-@@ -151,5 +151,6 @@ ifeq ($(CONFIG_X86_64),y)
+@@ -145,5 +145,6 @@ ifeq ($(CONFIG_X86_64),y)
endif
disabled-obj-$(CONFIG_XEN) := crash.o early-quirks.o i8237.o i8253.o i8259.o \
@@ -463,7 +463,7 @@ Acked-by: jbeulich@suse.com
disabled-obj-$(CONFIG_XEN_UNPRIVILEGED_GUEST) += probe_roms.o
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
-@@ -685,7 +685,7 @@ int (*__acpi_register_gsi)(struct device
+@@ -694,7 +694,7 @@ int (*__acpi_register_gsi)(struct device
int trigger, int polarity) = acpi_register_gsi_pic;
void (*__acpi_unregister_gsi)(u32 gsi) = NULL;
@@ -2360,7 +2360,7 @@ Acked-by: jbeulich@suse.com
up_read(&xs_state.watch_mutex);
-@@ -970,8 +971,7 @@ static int xenbus_thread(void *unused)
+@@ -972,8 +973,7 @@ static int xenbus_thread(void *unused)
for (;;) {
err = process_msg();
if (err)
@@ -2385,7 +2385,7 @@ Acked-by: jbeulich@suse.com
/* Not a real protocol. Used to generate ring structs which contain
* the elements common to all protocols only. This way we get a
* compiler-checkable way to use common struct elements, so we can
-@@ -39,6 +45,7 @@ struct blkif_common_response {
+@@ -36,6 +42,7 @@ struct blkif_common_request {
union __attribute__((transparent_union)) blkif_union {
struct blkif_request *generic;
struct blkif_request_discard *discard;
@@ -2393,7 +2393,7 @@ Acked-by: jbeulich@suse.com
};
/* i386 protocol version */
-@@ -59,9 +66,20 @@ struct blkif_x86_32_discard {
+@@ -56,9 +63,20 @@ struct blkif_x86_32_discard {
blkif_sector_t sector_number;/* start sector idx on disk */
uint64_t nr_sectors; /* number of contiguous sectors */
};
@@ -2412,9 +2412,9 @@ Acked-by: jbeulich@suse.com
struct blkif_x86_32_discard discard;
+ struct blkif_x86_32_indirect indirect;
};
- struct blkif_x86_32_response {
- uint64_t id; /* copied from request */
-@@ -87,9 +105,19 @@ struct blkif_x86_64_discard {
+ #pragma pack(pop)
+
+@@ -79,9 +97,19 @@ struct blkif_x86_64_discard {
blkif_sector_t sector_number;/* start sector idx on disk */
uint64_t nr_sectors; /* number of contiguous sectors */
};
@@ -2432,9 +2432,9 @@ Acked-by: jbeulich@suse.com
struct blkif_x86_64_discard discard;
+ struct blkif_x86_64_indirect indirect;
};
- struct blkif_x86_64_response {
- uint64_t __attribute__((__aligned__(8))) id;
-@@ -141,6 +169,14 @@ static void inline blkif_get_x86_32_req(
+
+ #define blkif_native_sring blkif_sring
+@@ -131,6 +159,14 @@ static void inline blkif_get_x86_32_req(
/* All fields up to sector_number got copied above already. */
dst.discard->nr_sectors = src->discard.nr_sectors;
break;
@@ -2449,7 +2449,7 @@ Acked-by: jbeulich@suse.com
}
#endif
}
-@@ -170,6 +206,14 @@ static void inline blkif_get_x86_64_req(
+@@ -160,6 +196,14 @@ static void inline blkif_get_x86_64_req(
/* All fields up to sector_number got copied above already. */
dst.discard->nr_sectors = src->discard.nr_sectors;
break;
@@ -2492,7 +2492,7 @@ Acked-by: jbeulich@suse.com
#endif
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
-@@ -6896,8 +6896,8 @@ static void __setup_per_zone_wmarks(void
+@@ -7042,8 +7042,8 @@ static void __setup_per_zone_wmarks(void
high = percpu_pagelist_fraction
? zone->present_pages / percpu_pagelist_fraction
: 5 * zone_batchsize(zone);
diff --git a/patches.xen/xen3-patch-3.12 b/patches.xen/xen3-patch-3.12
index 9b7199208b..652647cb9c 100644
--- a/patches.xen/xen3-patch-3.12
+++ b/patches.xen/xen3-patch-3.12
@@ -10,7 +10,7 @@ Acked-by: jbeulich@suse.com
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -2055,7 +2055,7 @@ config PHYSICAL_ALIGN
+@@ -2074,7 +2074,7 @@ config PHYSICAL_ALIGN
hex "Alignment value to which kernel should be aligned" if !XEN || EXPERT
default 0x2000 if XEN
default "0x200000"
@@ -19,7 +19,7 @@ Acked-by: jbeulich@suse.com
range 0x200000 0x1000000 if X86_64
---help---
This value puts the alignment restrictions on physical address
-@@ -2750,6 +2750,7 @@ source "drivers/rapidio/Kconfig"
+@@ -2769,6 +2769,7 @@ source "drivers/rapidio/Kconfig"
config X86_SYSFB
bool "Mark VGA/VBE/EFI FB as generic system framebuffer"
@@ -720,7 +720,7 @@ Acked-by: jbeulich@suse.com
if (kgdb_ll_trap(DIE_INT3, "int3", regs, error_code, X86_TRAP_BP,
--- a/arch/x86/mm/fault-xen.c
+++ b/arch/x86/mm/fault-xen.c
-@@ -851,23 +851,15 @@ do_sigbus(struct pt_regs *regs, unsigned
+@@ -855,23 +855,15 @@ do_sigbus(struct pt_regs *regs, unsigned
force_sig_info_fault(SIGBUS, code, address, tsk, fault);
}
@@ -749,7 +749,7 @@ Acked-by: jbeulich@suse.com
if (fault & VM_FAULT_OOM) {
/* Kernel mode? Handle exceptions or die: */
-@@ -875,7 +867,7 @@ mm_fault_error(struct pt_regs *regs, uns
+@@ -879,7 +871,7 @@ mm_fault_error(struct pt_regs *regs, uns
up_read(&current->mm->mmap_sem);
no_context(regs, error_code, address,
SIGSEGV, SEGV_MAPERR);
@@ -758,7 +758,7 @@ Acked-by: jbeulich@suse.com
}
up_read(&current->mm->mmap_sem);
-@@ -893,7 +885,6 @@ mm_fault_error(struct pt_regs *regs, uns
+@@ -897,7 +889,6 @@ mm_fault_error(struct pt_regs *regs, uns
else
BUG();
}
@@ -766,7 +766,7 @@ Acked-by: jbeulich@suse.com
}
static int spurious_fault_check(unsigned long error_code, pte_t *pte)
-@@ -1020,9 +1011,7 @@ __do_page_fault(struct pt_regs *regs, un
+@@ -1024,9 +1015,7 @@ __do_page_fault(struct pt_regs *regs, un
unsigned long address;
struct mm_struct *mm;
int fault;
@@ -777,7 +777,7 @@ Acked-by: jbeulich@suse.com
/* Set the "privileged fault" bit to something sane. */
if (user_mode_vm(regs))
-@@ -1112,6 +1101,7 @@ __do_page_fault(struct pt_regs *regs, un
+@@ -1116,6 +1105,7 @@ __do_page_fault(struct pt_regs *regs, un
if (user_mode_vm(regs)) {
local_irq_enable();
error_code |= PF_USER;
@@ -785,7 +785,7 @@ Acked-by: jbeulich@suse.com
} else {
if (regs->flags & X86_EFLAGS_IF)
local_irq_enable();
-@@ -1138,6 +1128,9 @@ __do_page_fault(struct pt_regs *regs, un
+@@ -1142,6 +1132,9 @@ __do_page_fault(struct pt_regs *regs, un
return;
}
@@ -795,7 +795,7 @@ Acked-by: jbeulich@suse.com
/*
* When running in the kernel we expect faults to occur only to
* addresses in user space. All other faults represent errors in
-@@ -1216,9 +1209,17 @@ good_area:
+@@ -1220,9 +1213,17 @@ good_area:
*/
fault = handle_mm_fault(mm, vma, address, flags);
@@ -905,7 +905,7 @@ Acked-by: jbeulich@suse.com
break;
--- a/drivers/char/tpm/Kconfig
+++ b/drivers/char/tpm/Kconfig
-@@ -123,8 +123,8 @@ config TCG_IBMVTPM
+@@ -124,8 +124,8 @@ config TCG_IBMVTPM
config TCG_XEN
tristate "XEN TPM Interface"
@@ -916,7 +916,7 @@ Acked-by: jbeulich@suse.com
---help---
If you want to make TPM support available to a Xen user domain,
say Yes and it will be accessible from within Linux. See
-@@ -133,11 +133,11 @@ config TCG_XEN
+@@ -134,11 +134,11 @@ config TCG_XEN
To compile this driver as a module, choose M here; the module
will be called xen-tpmfront.
@@ -933,7 +933,7 @@ Acked-by: jbeulich@suse.com
will be called tpm_xenu.
--- a/drivers/char/tpm/Makefile
+++ b/drivers/char/tpm/Makefile
-@@ -18,7 +18,7 @@ obj-$(CONFIG_TCG_INFINEON) += tpm_infine
+@@ -19,7 +19,7 @@ obj-$(CONFIG_TCG_INFINEON) += tpm_infine
obj-$(CONFIG_TCG_IBMVTPM) += tpm_ibmvtpm.o
obj-$(CONFIG_TCG_TIS_ST33ZP24) += st33zp24/
obj-$(CONFIG_TCG_XEN) += xen-tpmfront.o
@@ -1137,7 +1137,7 @@ Acked-by: jbeulich@suse.com
{
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
-@@ -1951,19 +1951,6 @@ int scsi_decide_disposition(struct scsi_
+@@ -1884,19 +1884,6 @@ int scsi_decide_disposition(struct scsi_
* Overall, shouldn't the return value of this function be
* the same when called twice in immediate succession?
*/
@@ -1174,7 +1174,7 @@ Acked-by: jbeulich@suse.com
be->minor = minor;
--- a/drivers/xen/evtchn.c
+++ b/drivers/xen/evtchn.c
-@@ -436,7 +436,7 @@ static void evtchn_unbind_from_user(stru
+@@ -424,7 +424,7 @@ static void evtchn_unbind_from_user(stru
unbind_from_irqhandler(irq, evtchn);
#ifdef CONFIG_XEN
diff --git a/patches.xen/xen3-patch-3.13 b/patches.xen/xen3-patch-3.13
index 0bbfa24997..29baff0c10 100644
--- a/patches.xen/xen3-patch-3.13
+++ b/patches.xen/xen3-patch-3.13
@@ -12,7 +12,7 @@ Acked-by: jbeulich@suse.com
--- a/arch/x86/Kconfig.debug
+++ b/arch/x86/Kconfig.debug
-@@ -41,7 +41,7 @@ config EARLY_PRINTK_DBGP
+@@ -45,7 +45,7 @@ config EARLY_PRINTK_DBGP
config EARLY_PRINTK_EFI
bool "Early printk via the EFI framebuffer"
@@ -174,7 +174,7 @@ Acked-by: jbeulich@suse.com
/*
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
-@@ -151,6 +151,5 @@ ifeq ($(CONFIG_X86_64),y)
+@@ -145,6 +145,5 @@ ifeq ($(CONFIG_X86_64),y)
endif
disabled-obj-$(CONFIG_XEN) := crash.o early-quirks.o i8237.o i8253.o i8259.o \
@@ -184,7 +184,7 @@ Acked-by: jbeulich@suse.com
disabled-obj-$(CONFIG_XEN_UNPRIVILEGED_GUEST) += probe_roms.o
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
-@@ -176,7 +176,13 @@ static int __init acpi_parse_madt(struct
+@@ -177,7 +177,13 @@ static int __init acpi_parse_madt(struct
*
* Returns the logic cpu number which maps to the local apic
*/
@@ -199,7 +199,7 @@ Acked-by: jbeulich@suse.com
{
#ifndef CONFIG_XEN
unsigned int ver = 0;
-@@ -739,7 +745,7 @@ static int acpi_map_cpu2node(acpi_handle
+@@ -748,7 +754,7 @@ static int acpi_map_cpu2node(acpi_handle
return 0;
}
#else
@@ -705,7 +705,7 @@ Acked-by: jbeulich@suse.com
{
int ret = 0;
-@@ -605,7 +608,7 @@ show_fault_oops(struct pt_regs *regs, un
+@@ -609,7 +612,7 @@ show_fault_oops(struct pt_regs *regs, un
printk(KERN_CONT " at %p\n", (void *) address);
printk(KERN_ALERT "IP:");
@@ -714,7 +714,7 @@ Acked-by: jbeulich@suse.com
dump_pagetable(address);
}
-@@ -647,6 +650,20 @@ no_context(struct pt_regs *regs, unsigne
+@@ -651,6 +654,20 @@ no_context(struct pt_regs *regs, unsigne
/* Are we prepared to handle this kernel fault? */
if (fixup_exception(regs)) {
@@ -735,7 +735,7 @@ Acked-by: jbeulich@suse.com
if (current_thread_info()->sig_on_uaccess_error && signal) {
tsk->thread.trap_nr = X86_TRAP_PF;
tsk->thread.error_code = error_code | PF_USER;
-@@ -655,6 +672,10 @@ no_context(struct pt_regs *regs, unsigne
+@@ -659,6 +676,10 @@ no_context(struct pt_regs *regs, unsigne
/* XXX: hwpoison faults will set the wrong code. */
force_sig_info_fault(signal, si_code, address, tsk, 0);
}
@@ -746,7 +746,7 @@ Acked-by: jbeulich@suse.com
return;
}
-@@ -1077,7 +1098,7 @@ __do_page_fault(struct pt_regs *regs, un
+@@ -1081,7 +1102,7 @@ __do_page_fault(struct pt_regs *regs, un
return;
/* kprobes don't want to hook the spurious faults: */
@@ -755,7 +755,7 @@ Acked-by: jbeulich@suse.com
return;
/*
* Don't take the mm semaphore here. If we fixup a prefetch
-@@ -1089,23 +1110,8 @@ __do_page_fault(struct pt_regs *regs, un
+@@ -1093,23 +1114,8 @@ __do_page_fault(struct pt_regs *regs, un
}
/* kprobes don't want to hook the spurious faults: */
@@ -780,7 +780,7 @@ Acked-by: jbeulich@suse.com
if (unlikely(error_code & PF_RSVD))
pgtable_bad(regs, error_code, address);
-@@ -1117,8 +1123,6 @@ __do_page_fault(struct pt_regs *regs, un
+@@ -1121,8 +1127,6 @@ __do_page_fault(struct pt_regs *regs, un
}
}
@@ -789,7 +789,7 @@ Acked-by: jbeulich@suse.com
/*
* If we're in an interrupt, have no user context or are running
* in an atomic region then we must not take the fault:
-@@ -1128,6 +1132,24 @@ __do_page_fault(struct pt_regs *regs, un
+@@ -1132,6 +1136,24 @@ __do_page_fault(struct pt_regs *regs, un
return;
}
@@ -814,7 +814,7 @@ Acked-by: jbeulich@suse.com
if (error_code & PF_WRITE)
flags |= FAULT_FLAG_WRITE;
-@@ -1260,3 +1282,23 @@ do_page_fault(struct pt_regs *regs, unsi
+@@ -1264,3 +1286,23 @@ do_page_fault(struct pt_regs *regs, unsi
__do_page_fault(regs, error_code);
exception_exit(prev_state);
}
@@ -1095,11 +1095,11 @@ Acked-by: jbeulich@suse.com
config ACPI_EXTLOG
tristate "Extended Error Log support"
-- depends on X86_MCE && X86_LOCAL_APIC
-+ depends on X86_MCE && X86_LOCAL_APIC && !XEN
+- depends on X86_MCE && X86_LOCAL_APIC && EDAC
++ depends on X86_MCE && X86_LOCAL_APIC && EDAC && !XEN
select UEFI_CPER
- select RAS
default n
+ help
--- a/drivers/acpi/acpi_processor.c
+++ b/drivers/acpi/acpi_processor.c
@@ -313,9 +313,7 @@ static int acpi_processor_get_info(struc
diff --git a/patches.xen/xen3-patch-3.14 b/patches.xen/xen3-patch-3.14
index 08650c71d4..549091f232 100644
--- a/patches.xen/xen3-patch-3.14
+++ b/patches.xen/xen3-patch-3.14
@@ -8,6 +8,8 @@ References: none
Automatically created from "patch-3.14" by xen-port-patches.py
Acked-by: jbeulich@suse.com
+4.13/drivers/gpu/drm/i915/i915_gem_stolen.c
+
--- a/arch/x86/include/asm/topology.h
+++ b/arch/x86/include/asm/topology.h
@@ -110,9 +110,11 @@ static inline void setup_node_to_cpumask
@@ -143,7 +145,7 @@ Acked-by: jbeulich@suse.com
#define _HPAGE_CHG_MASK (_PAGE_CHG_MASK | _PAGE_PSE)
/*
-@@ -437,7 +438,8 @@ static inline void update_page_count(int
+@@ -441,7 +442,8 @@ static inline void update_page_count(int
*/
extern pte_t *lookup_address(unsigned long address, unsigned int *level);
extern phys_addr_t slow_virt_to_phys(void *__address);
@@ -271,7 +273,7 @@ Acked-by: jbeulich@suse.com
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
-@@ -151,5 +151,6 @@ ifeq ($(CONFIG_X86_64),y)
+@@ -145,5 +145,6 @@ ifeq ($(CONFIG_X86_64),y)
endif
disabled-obj-$(CONFIG_XEN) := crash.o early-quirks.o i8237.o i8253.o i8259.o \
@@ -730,7 +732,7 @@ Acked-by: jbeulich@suse.com
/* Runs on IST stack */
--- a/arch/x86/mm/fault-xen.c
+++ b/arch/x86/mm/fault-xen.c
-@@ -1010,6 +1010,12 @@ static int fault_in_kernel_space(unsigne
+@@ -1014,6 +1014,12 @@ static int fault_in_kernel_space(unsigne
static inline bool smap_violation(int error_code, struct pt_regs *regs)
{
@@ -743,7 +745,7 @@ Acked-by: jbeulich@suse.com
if (error_code & PF_USER)
return false;
-@@ -1023,13 +1029,17 @@ static inline bool smap_violation(int er
+@@ -1027,13 +1033,17 @@ static inline bool smap_violation(int er
* This routine handles page faults. It determines the address,
* and the problem, and then passes it off to one of the appropriate
* routines.
@@ -764,7 +766,7 @@ Acked-by: jbeulich@suse.com
struct mm_struct *mm;
int fault;
unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
-@@ -1043,9 +1053,6 @@ __do_page_fault(struct pt_regs *regs, un
+@@ -1047,9 +1057,6 @@ __do_page_fault(struct pt_regs *regs, un
tsk = current;
mm = tsk->mm;
@@ -774,7 +776,7 @@ Acked-by: jbeulich@suse.com
/*
* Detect and handle instructions that would cause a page fault for
* both a tracked kernel page and a userspace page.
-@@ -1116,11 +1123,9 @@ __do_page_fault(struct pt_regs *regs, un
+@@ -1120,11 +1127,9 @@ __do_page_fault(struct pt_regs *regs, un
if (unlikely(error_code & PF_RSVD))
pgtable_bad(regs, error_code, address);
@@ -789,7 +791,7 @@ Acked-by: jbeulich@suse.com
}
/*
-@@ -1273,32 +1278,50 @@ good_area:
+@@ -1277,32 +1282,50 @@ good_area:
up_read(&mm->mmap_sem);
}
@@ -1530,8 +1532,8 @@ Acked-by: jbeulich@suse.com
xen_tlb_flush_mask(mask);
}
---- a/arch/x86/platform/efi/efi-bgrt.c
-+++ b/arch/x86/platform/efi/efi-bgrt.c
+--- a/drivers/firmware/efi/efi-bgrt.c
++++ b/drivers/firmware/efi/efi-bgrt.c
@@ -19,6 +19,11 @@
#include <linux/efi.h>
#include <linux/efi-bgrt.h>
@@ -1546,7 +1548,7 @@ Acked-by: jbeulich@suse.com
--- a/arch/x86/xen/Kconfig
+++ b/arch/x86/xen/Kconfig
-@@ -53,5 +53,5 @@ config XEN_DEBUG_FS
+@@ -74,5 +74,5 @@ config XEN_DEBUG_FS
config XEN_PVH
bool "Support for running as a PVH guest"
@@ -1647,17 +1649,6 @@ Acked-by: jbeulich@suse.com
default y
help
Export efi runtime memory maps to /sys/firmware/efi/runtime-map.
---- a/drivers/gpu/drm/i915/i915_gem_stolen.c
-+++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
-@@ -410,7 +410,7 @@ int i915_gem_init_stolen(struct drm_i915
- return 0;
- }
-
--#ifdef CONFIG_INTEL_IOMMU
-+#if defined(CONFIG_INTEL_IOMMU) || defined(CONFIG_XEN)
- if (intel_iommu_gfx_mapped && INTEL_GEN(dev_priv) < 8) {
- DRM_INFO("DMAR active, disabling use of stolen memory\n");
- return 0;
--- a/drivers/gpu/drm/ttm/ttm_bo_vm.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_vm.c
@@ -243,6 +243,14 @@ static int ttm_bo_vm_fault(struct vm_fau
@@ -1677,7 +1668,7 @@ Acked-by: jbeulich@suse.com
page_offset;
--- a/drivers/gpu/drm/ttm/ttm_tt.c
+++ b/drivers/gpu/drm/ttm/ttm_tt.c
-@@ -382,6 +382,13 @@ static void ttm_tt_clear_mapping(struct
+@@ -386,6 +386,13 @@ static void ttm_tt_clear_mapping(struct
return;
for (i = 0; i < ttm->num_pages; ++i) {
@@ -2688,7 +2679,7 @@ Acked-by: jbeulich@suse.com
struct irq_cfg {
--- a/include/xen/interface/xen.h
+++ b/include/xen/interface/xen.h
-@@ -615,7 +615,7 @@ DEFINE_GUEST_HANDLE_STRUCT(multicall_ent
+@@ -621,7 +621,7 @@ DEFINE_GUEST_HANDLE_STRUCT(multicall_ent
typedef struct multicall_entry multicall_entry_t;
DEFINE_XEN_GUEST_HANDLE(multicall_entry_t);
diff --git a/patches.xen/xen3-patch-3.15 b/patches.xen/xen3-patch-3.15
index d078f32554..3d1aad881b 100644
--- a/patches.xen/xen3-patch-3.15
+++ b/patches.xen/xen3-patch-3.15
@@ -12,7 +12,7 @@ Acked-by: jbeulich@suse.com
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -1849,7 +1849,7 @@ config EFI_STUB
+@@ -1868,7 +1868,7 @@ config EFI_STUB
config EFI_MIXED
bool "EFI mixed-mode support"
@@ -21,7 +21,7 @@ Acked-by: jbeulich@suse.com
---help---
Enabling this feature allows a 64-bit kernel to be booted
on a 32-bit firmware, provided that your CPU supports 64-bit
-@@ -2053,9 +2053,11 @@ config X86_NEED_RELOCS
+@@ -2072,9 +2072,11 @@ config X86_NEED_RELOCS
config PHYSICAL_ALIGN
hex "Alignment value to which kernel should be aligned" if !XEN || EXPERT
@@ -37,7 +37,7 @@ Acked-by: jbeulich@suse.com
This value puts the alignment restrictions on physical address
--- a/arch/x86/Kconfig.debug
+++ b/arch/x86/Kconfig.debug
-@@ -67,7 +67,7 @@ config X86_PTDUMP
+@@ -90,7 +90,7 @@ config X86_PTDUMP
config EFI_PGT_DUMP
bool "Dump the EFI pagetable"
@@ -48,7 +48,7 @@ Acked-by: jbeulich@suse.com
Enable this if you want to dump the EFI page table before
--- a/arch/x86/include/asm/hardirq.h
+++ b/arch/x86/include/asm/hardirq.h
-@@ -37,7 +37,7 @@ typedef struct {
+@@ -38,7 +38,7 @@ typedef struct {
#ifdef CONFIG_X86_MCE_AMD
unsigned int irq_deferred_error_count;
#endif
@@ -246,7 +246,7 @@ Acked-by: jbeulich@suse.com
#define PGD_IDENT_ATTR 0x001 /* PRESENT (no other attributes) */
#endif
-@@ -437,9 +432,13 @@ static inline void update_page_count(int
+@@ -441,9 +436,13 @@ static inline void update_page_count(int
* as a pte too.
*/
extern pte_t *lookup_address(unsigned long address, unsigned int *level);
@@ -793,7 +793,7 @@ Acked-by: jbeulich@suse.com
--- a/arch/x86/mm/fault-xen.c
+++ b/arch/x86/mm/fault-xen.c
-@@ -593,8 +593,13 @@ show_fault_oops(struct pt_regs *regs, un
+@@ -597,8 +597,13 @@ show_fault_oops(struct pt_regs *regs, un
if (error_code & PF_INSTR) {
unsigned int level;
diff --git a/patches.xen/xen3-patch-3.16 b/patches.xen/xen3-patch-3.16
index b43e986046..b86797f898 100644
--- a/patches.xen/xen3-patch-3.16
+++ b/patches.xen/xen3-patch-3.16
@@ -15,7 +15,7 @@ Acked-by: jbeulich@suse.com
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -1164,11 +1164,11 @@ config X86_16BIT
+@@ -1183,11 +1183,11 @@ config X86_16BIT
config X86_ESPFIX32
def_bool y
@@ -2032,7 +2032,7 @@ Acked-by: jbeulich@suse.com
/*
* Did it hit the DOS screen memory VA from vm86 mode?
-@@ -366,7 +368,7 @@ void vmalloc_sync_all(void)
+@@ -370,7 +372,7 @@ void vmalloc_sync_all(void)
*
* This assumes no large pages in there.
*/
@@ -2041,7 +2041,7 @@ Acked-by: jbeulich@suse.com
{
pgd_t *pgd, *pgd_ref;
pud_t *pud, *pud_ref;
-@@ -433,6 +435,7 @@ static noinline __kprobes int vmalloc_fa
+@@ -437,6 +439,7 @@ static noinline __kprobes int vmalloc_fa
return 0;
}
@@ -2049,7 +2049,7 @@ Acked-by: jbeulich@suse.com
#ifdef CONFIG_CPU_SUP_AMD
static const char errata93_warning[] =
-@@ -780,7 +783,7 @@ __bad_area_nosemaphore(struct pt_regs *r
+@@ -784,7 +787,7 @@ __bad_area_nosemaphore(struct pt_regs *r
* emulation.
*/
if (unlikely((error_code & PF_INSTR) &&
@@ -2058,7 +2058,7 @@ Acked-by: jbeulich@suse.com
if (emulate_vsyscall(regs, address))
return;
}
-@@ -936,7 +939,7 @@ static int spurious_fault_check(unsigned
+@@ -940,7 +943,7 @@ static int spurious_fault_check(unsigned
* There are no security implications to leaving a stale TLB when
* increasing the permissions on a page.
*/
@@ -2067,7 +2067,7 @@ Acked-by: jbeulich@suse.com
spurious_fault(unsigned long error_code, unsigned long address)
{
pgd_t *pgd;
-@@ -984,6 +987,7 @@ spurious_fault(unsigned long error_code,
+@@ -988,6 +991,7 @@ spurious_fault(unsigned long error_code,
return ret;
}
@@ -2075,7 +2075,7 @@ Acked-by: jbeulich@suse.com
int show_unhandled_signals = 1;
-@@ -1039,7 +1043,7 @@ static inline bool smap_violation(int er
+@@ -1043,7 +1047,7 @@ static inline bool smap_violation(int er
* {,trace_}do_page_fault() have notrace on. Having this an actual function
* guarantees there's a function trace entry.
*/
@@ -2084,7 +2084,7 @@ Acked-by: jbeulich@suse.com
__do_page_fault(struct pt_regs *regs, unsigned long error_code,
unsigned long address)
{
-@@ -1282,8 +1286,9 @@ good_area:
+@@ -1286,8 +1290,9 @@ good_area:
up_read(&mm->mmap_sem);
}
@@ -2095,7 +2095,7 @@ Acked-by: jbeulich@suse.com
do_page_fault(struct pt_regs *regs, unsigned long error_code)
{
unsigned long address = read_cr2(); /* Get the faulting address */
-@@ -1301,10 +1306,12 @@ do_page_fault(struct pt_regs *regs, unsi
+@@ -1305,10 +1310,12 @@ do_page_fault(struct pt_regs *regs, unsi
__do_page_fault(regs, error_code, address);
exception_exit(prev_state);
}
@@ -2110,7 +2110,7 @@ Acked-by: jbeulich@suse.com
{
if (user_mode(regs))
trace_page_fault_user(address, regs, error_code);
-@@ -1312,7 +1319,7 @@ static void trace_page_fault_entries(uns
+@@ -1316,7 +1323,7 @@ static void trace_page_fault_entries(uns
trace_page_fault_kernel(address, regs, error_code);
}
@@ -2119,7 +2119,7 @@ Acked-by: jbeulich@suse.com
trace_do_page_fault(struct pt_regs *regs, unsigned long error_code)
{
/*
-@@ -1329,4 +1336,5 @@ trace_do_page_fault(struct pt_regs *regs
+@@ -1333,4 +1340,5 @@ trace_do_page_fault(struct pt_regs *regs
__do_page_fault(regs, error_code, address);
exception_exit(prev_state);
}
diff --git a/patches.xen/xen3-patch-3.17 b/patches.xen/xen3-patch-3.17
index 80fcb360c0..e0f613adf5 100644
--- a/patches.xen/xen3-patch-3.17
+++ b/patches.xen/xen3-patch-3.17
@@ -14,7 +14,7 @@ Acked-by: jbeulich@suse.com
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -1901,7 +1901,7 @@ config KEXEC_FILE
+@@ -1920,7 +1920,7 @@ config KEXEC_FILE
bool "kexec file based system call"
select KEXEC_CORE
select BUILD_BIN2C
@@ -25,7 +25,7 @@ Acked-by: jbeulich@suse.com
---help---
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
-@@ -1092,5 +1092,5 @@ endif # X86_PLATFORM_DEVICES
+@@ -1143,5 +1143,5 @@ endif # X86_PLATFORM_DEVICES
config PMC_ATOM
def_bool y
@@ -1551,7 +1551,7 @@ Acked-by: jbeulich@suse.com
void __init pre_init_apic_IRQ0(void)
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
-@@ -620,7 +620,9 @@ static void early_init_amd(struct cpuinf
+@@ -621,7 +621,9 @@ static void early_init_amd(struct cpuinf
static void init_amd_k8(struct cpuinfo_x86 *c)
{
u32 level;
@@ -2149,7 +2149,7 @@ Acked-by: jbeulich@suse.com
{ MODULES_END, "End Modules" },
--- a/arch/x86/mm/fault-xen.c
+++ b/arch/x86/mm/fault-xen.c
-@@ -586,6 +586,8 @@ static int is_f00f_bug(struct pt_regs *r
+@@ -590,6 +590,8 @@ static int is_f00f_bug(struct pt_regs *r
static const char nx_warning[] = KERN_CRIT
"kernel tried to execute NX-protected page - exploit attempt? (uid: %d)\n";
@@ -2158,7 +2158,7 @@ Acked-by: jbeulich@suse.com
static void
show_fault_oops(struct pt_regs *regs, unsigned long error_code,
-@@ -606,6 +608,10 @@ show_fault_oops(struct pt_regs *regs, un
+@@ -610,6 +612,10 @@ show_fault_oops(struct pt_regs *regs, un
if (pte && pte_present(*pte) && !pte_exec(*pte))
printk(nx_warning, from_kuid(&init_user_ns, current_uid()));
@@ -2169,7 +2169,7 @@ Acked-by: jbeulich@suse.com
}
printk(KERN_ALERT "BUG: unable to handle kernel ");
-@@ -1241,7 +1247,8 @@ good_area:
+@@ -1245,7 +1251,8 @@ good_area:
/*
* If for any reason at all we couldn't handle the fault,
* make sure we exit gracefully rather than endlessly redo
@@ -2612,7 +2612,7 @@ Acked-by: jbeulich@suse.com
/**
--- a/drivers/xen/Kconfig
+++ b/drivers/xen/Kconfig
-@@ -724,7 +724,7 @@ config XEN_HAVE_PVMMU
+@@ -728,7 +728,7 @@ config XEN_HAVE_PVMMU
config XEN_EFI
def_bool y
@@ -2794,7 +2794,7 @@ Acked-by: jbeulich@suse.com
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
-@@ -1272,7 +1272,10 @@ int timekeeping_inject_offset(struct tim
+@@ -1300,7 +1300,10 @@ int timekeeping_inject_offset(struct tim
tk_set_wall_to_mono(tk, timespec64_sub(tk->wall_to_monotonic, ts64));
#ifdef CONFIG_XEN_PRIVILEGED_GUEST
diff --git a/patches.xen/xen3-patch-3.18 b/patches.xen/xen3-patch-3.18
index 985e4cdc36..3669cd6401 100644
--- a/patches.xen/xen3-patch-3.18
+++ b/patches.xen/xen3-patch-3.18
@@ -82,7 +82,7 @@ Acked-by: jbeulich@suse.com
* Conversion functions: convert a page and protection to a page entry,
--- a/arch/x86/include/mach-xen/asm/pgtable_types.h
+++ b/arch/x86/include/mach-xen/asm/pgtable_types.h
-@@ -382,6 +382,20 @@ static inline pteval_t pte_flags(pte_t p
+@@ -386,6 +386,20 @@ static inline pteval_t pte_flags(pte_t p
return __pte_val(pte) & PTE_FLAGS_MASK;
}
@@ -746,7 +746,7 @@ Acked-by: jbeulich@suse.com
#include <linux/sched.h> /* test_thread_flag(), ... */
#include <linux/kdebug.h> /* oops_begin/end, ... */
#include <linux/module.h> /* search_exception_table */
-@@ -358,7 +357,7 @@ out:
+@@ -362,7 +361,7 @@ out:
void vmalloc_sync_all(void)
{
@@ -755,7 +755,7 @@ Acked-by: jbeulich@suse.com
}
/*
-@@ -658,7 +657,6 @@ no_context(struct pt_regs *regs, unsigne
+@@ -662,7 +661,6 @@ no_context(struct pt_regs *regs, unsigne
unsigned long address, int signal, int si_code)
{
struct task_struct *tsk = current;
@@ -763,7 +763,7 @@ Acked-by: jbeulich@suse.com
unsigned long flags;
int sig;
-@@ -718,8 +716,7 @@ no_context(struct pt_regs *regs, unsigne
+@@ -722,8 +720,7 @@ no_context(struct pt_regs *regs, unsigne
show_fault_oops(regs, error_code, address);
@@ -773,7 +773,7 @@ Acked-by: jbeulich@suse.com
printk(KERN_EMERG "Thread overran stack, or stack corrupted\n");
tsk->thread.cr2 = address;
-@@ -942,8 +939,17 @@ static int spurious_fault_check(unsigned
+@@ -946,8 +943,17 @@ static int spurious_fault_check(unsigned
* cross-processor TLB flush, even if no stale TLB entries exist
* on other processors.
*
@@ -791,7 +791,7 @@ Acked-by: jbeulich@suse.com
*/
static noinline int
spurious_fault(unsigned long error_code, unsigned long address)
-@@ -954,8 +960,17 @@ spurious_fault(unsigned long error_code,
+@@ -958,8 +964,17 @@ spurious_fault(unsigned long error_code,
pte_t *pte;
int ret;
@@ -1266,7 +1266,7 @@ Acked-by: jbeulich@suse.com
--- a/drivers/xen/Kconfig
+++ b/drivers/xen/Kconfig
-@@ -644,9 +644,9 @@ config XEN_PCIDEV_BACKEND_CONTROLLER
+@@ -648,9 +648,9 @@ config XEN_PCIDEV_BACKEND_CONTROLLER
endmenu
diff --git a/patches.xen/xen3-patch-3.19 b/patches.xen/xen3-patch-3.19
index 9c90eaf2c0..d449e55ca9 100644
--- a/patches.xen/xen3-patch-3.19
+++ b/patches.xen/xen3-patch-3.19
@@ -389,7 +389,7 @@ Acked-by: jbeulich@suse.com
/* xwr */
#define __P000 PAGE_NONE
-@@ -399,6 +396,57 @@ static inline pmdval_t pmdnuma_flags(pmd
+@@ -403,6 +400,57 @@ static inline pmdval_t pmdnuma_flags(pmd
#define pgprot_val(x) ((x).pgprot)
#define __pgprot(x) ((pgprot_t) { (x) } )
@@ -447,7 +447,7 @@ Acked-by: jbeulich@suse.com
typedef struct page *pgtable_t;
-@@ -452,6 +500,7 @@ static inline void update_page_count(int
+@@ -456,6 +504,7 @@ static inline void update_page_count(int
extern pte_t *lookup_address(unsigned long address, unsigned int *level);
extern pte_t *lookup_address_in_pgd(pgd_t *pgd, unsigned long address,
unsigned int *level);
@@ -3822,7 +3822,7 @@ Acked-by: jbeulich@suse.com
else
--- a/arch/x86/mm/fault-xen.c
+++ b/arch/x86/mm/fault-xen.c
-@@ -853,11 +853,8 @@ do_sigbus(struct pt_regs *regs, unsigned
+@@ -857,11 +857,8 @@ do_sigbus(struct pt_regs *regs, unsigned
unsigned int fault)
{
struct task_struct *tsk = current;
@@ -3834,7 +3834,7 @@ Acked-by: jbeulich@suse.com
/* Kernel mode? Handle exceptions or die: */
if (!(error_code & PF_USER)) {
no_context(regs, error_code, address, SIGBUS, BUS_ADRERR);
-@@ -888,7 +885,6 @@ mm_fault_error(struct pt_regs *regs, uns
+@@ -892,7 +889,6 @@ mm_fault_error(struct pt_regs *regs, uns
unsigned long address, unsigned int fault)
{
if (fatal_signal_pending(current) && !(error_code & PF_USER)) {
@@ -3842,7 +3842,7 @@ Acked-by: jbeulich@suse.com
no_context(regs, error_code, address, 0, 0);
return;
}
-@@ -896,14 +892,11 @@ mm_fault_error(struct pt_regs *regs, uns
+@@ -900,14 +896,11 @@ mm_fault_error(struct pt_regs *regs, uns
if (fault & VM_FAULT_OOM) {
/* Kernel mode? Handle exceptions or die: */
if (!(error_code & PF_USER)) {
@@ -3857,7 +3857,7 @@ Acked-by: jbeulich@suse.com
/*
* We ran out of memory, call the OOM killer, and return the
* userspace (which will retry the fault, or kill us if we got
-@@ -914,6 +907,8 @@ mm_fault_error(struct pt_regs *regs, uns
+@@ -918,6 +911,8 @@ mm_fault_error(struct pt_regs *regs, uns
if (fault & (VM_FAULT_SIGBUS|VM_FAULT_HWPOISON|
VM_FAULT_HWPOISON_LARGE))
do_sigbus(regs, error_code, address, fault);
@@ -3866,7 +3866,7 @@ Acked-by: jbeulich@suse.com
else
BUG();
}
-@@ -1071,7 +1066,7 @@ __do_page_fault(struct pt_regs *regs, un
+@@ -1075,7 +1070,7 @@ __do_page_fault(struct pt_regs *regs, un
struct vm_area_struct *vma;
struct task_struct *tsk;
struct mm_struct *mm;
@@ -3875,7 +3875,7 @@ Acked-by: jbeulich@suse.com
unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
/* Set the "privileged fault" bit to something sane. */
-@@ -1266,47 +1261,50 @@ good_area:
+@@ -1270,47 +1265,50 @@ good_area:
* we get VM_FAULT_RETRY back, the mmap_sem has been unlocked.
*/
fault = handle_mm_fault(mm, vma, address, flags);
@@ -5334,6 +5334,16 @@ Acked-by: jbeulich@suse.com
else
cpuid = acpi_get_cpuid(handle, type, acpi_id);
+--- a/drivers/gpu/drm/amd/amdkfd/Kconfig
++++ b/drivers/gpu/drm/amd/amdkfd/Kconfig
+@@ -4,6 +4,6 @@
+
+ config HSA_AMD
+ tristate "HSA kernel driver for AMD GPU devices"
+- depends on (DRM_RADEON || DRM_AMDGPU) && AMD_IOMMU_V2 && X86_64
++ depends on (DRM_RADEON || DRM_AMDGPU) && AMD_IOMMU_V2 && X86_64 && !XEN
+ help
+ Enable this if you want to use HSA features on AMD GPU devices.
--- a/drivers/hwmon/coretemp-xen.c
+++ b/drivers/hwmon/coretemp-xen.c
@@ -599,7 +599,6 @@ static int coretemp_remove(struct platfo
@@ -5864,7 +5874,7 @@ Acked-by: jbeulich@suse.com
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
-@@ -1224,7 +1224,7 @@ out:
+@@ -1252,7 +1252,7 @@ out:
timekeeping_update(tk, TK_CLEAR_NTP | TK_MIRROR | TK_CLOCK_WAS_SET);
#ifdef CONFIG_XEN_PRIVILEGED_GUEST
@@ -5873,7 +5883,7 @@ Acked-by: jbeulich@suse.com
#endif
write_seqcount_end(&tk_core.seq);
-@@ -1272,10 +1272,7 @@ int timekeeping_inject_offset(struct tim
+@@ -1300,10 +1300,7 @@ int timekeeping_inject_offset(struct tim
tk_set_wall_to_mono(tk, timespec64_sub(tk->wall_to_monotonic, ts64));
#ifdef CONFIG_XEN_PRIVILEGED_GUEST
diff --git a/patches.xen/xen3-patch-3.2 b/patches.xen/xen3-patch-3.2
index 4d46f83bf8..6e3964b899 100644
--- a/patches.xen/xen3-patch-3.2
+++ b/patches.xen/xen3-patch-3.2
@@ -1373,7 +1373,7 @@ Acked-by: jbeulich@suse.com
int io_apic_set_pci_routing(struct device *dev, int irq,
--- a/arch/x86/kernel/cpu/Makefile
+++ b/arch/x86/kernel/cpu/Makefile
-@@ -43,7 +43,7 @@ obj-$(CONFIG_X86_LOCAL_APIC) += perfctr
+@@ -44,7 +44,7 @@ obj-$(CONFIG_X86_LOCAL_APIC) += perfctr
obj-$(CONFIG_HYPERVISOR_GUEST) += vmware.o hypervisor.o mshyperv.o
disabled-obj-$(CONFIG_XEN) := hypervisor.o mshyperv.o perfctr-watchdog.o \
@@ -1384,7 +1384,7 @@ Acked-by: jbeulich@suse.com
quiet_cmd_mkcapflags = MKCAP $@
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
-@@ -739,7 +739,9 @@ static void init_amd_bd(struct cpuinfo_x
+@@ -740,7 +740,9 @@ static void init_amd_bd(struct cpuinfo_x
static void init_amd(struct cpuinfo_x86 *c)
{
@@ -1424,7 +1424,7 @@ Acked-by: jbeulich@suse.com
* Clear/Set all flags overriden by options, need do it
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
-@@ -122,6 +122,7 @@ static void early_init_intel(struct cpui
+@@ -118,6 +118,7 @@ static void early_init_intel(struct cpui
(c->x86 == 0x6 && c->x86_model >= 0x0e))
set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
@@ -1432,7 +1432,7 @@ Acked-by: jbeulich@suse.com
if (c->x86 >= 6 && !cpu_has(c, X86_FEATURE_IA64))
c->microcode = intel_get_microcode_revision();
-@@ -133,14 +134,12 @@ static void early_init_intel(struct cpui
+@@ -129,14 +130,12 @@ static void early_init_intel(struct cpui
* need the microcode to have already been loaded... so if it is
* not, recommend a BIOS update and disable large pages.
*/
@@ -1450,7 +1450,7 @@ Acked-by: jbeulich@suse.com
set_cpu_cap(c, X86_FEATURE_SYSENTER32);
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
-@@ -316,9 +316,14 @@ static void __print_mce(struct mce *m)
+@@ -258,9 +258,14 @@ static void __print_mce(struct mce *m)
* Note this output is parsed by external tools and old fields
* should not be changed.
*/
@@ -1467,7 +1467,7 @@ Acked-by: jbeulich@suse.com
static void print_mce(struct mce *m)
--- a/arch/x86/kernel/cpu/proc.c
+++ b/arch/x86/kernel/cpu/proc.c
-@@ -78,8 +78,10 @@ static int show_cpuinfo(struct seq_file
+@@ -76,8 +76,10 @@ static int show_cpuinfo(struct seq_file
seq_printf(m, "stepping\t: %d\n", c->x86_mask);
else
seq_puts(m, "stepping\t: unknown\n");
@@ -1476,8 +1476,8 @@ Acked-by: jbeulich@suse.com
seq_printf(m, "microcode\t: 0x%x\n", c->microcode);
+#endif
- if (cpu_has(c, X86_FEATURE_TSC)) {
- unsigned int freq = cpufreq_quick_get(cpu);
+ if (cpu_has(c, X86_FEATURE_TSC))
+ seq_printf(m, "cpu MHz\t\t: %u.%03u\n",
--- a/arch/x86/kernel/e820-xen.c
+++ b/arch/x86/kernel/e820-xen.c
@@ -12,6 +12,7 @@
@@ -1542,7 +1542,7 @@ Acked-by: jbeulich@suse.com
#include <asm/io_apic.h>
--- a/arch/x86/kernel/nmi.c
+++ b/arch/x86/kernel/nmi.c
-@@ -239,16 +239,13 @@ pci_serr_error(unsigned char reason, str
+@@ -228,16 +228,13 @@ pci_serr_error(unsigned char reason, str
pr_emerg("Dazed and confused, but trying to continue\n");
/* Clear and disable the PCI SERR error line. */
@@ -1560,7 +1560,7 @@ Acked-by: jbeulich@suse.com
/* check to see if anyone registered against these types of errors */
if (nmi_handle(NMI_IO_CHECK, regs))
return;
-@@ -270,17 +267,7 @@ io_check_error(unsigned char reason, str
+@@ -259,17 +256,7 @@ io_check_error(unsigned char reason, str
}
/* Re-enable the IOCK line, wait for a few seconds */
@@ -1888,7 +1888,7 @@ Acked-by: jbeulich@suse.com
/*
* Page fault error code bits:
-@@ -428,12 +428,14 @@ static noinline __kprobes int vmalloc_fa
+@@ -432,12 +432,14 @@ static noinline __kprobes int vmalloc_fa
return 0;
}
@@ -1903,7 +1903,7 @@ Acked-by: jbeulich@suse.com
/*
* No vm86 mode in 64-bit mode:
-@@ -513,7 +515,11 @@ bad:
+@@ -517,7 +519,11 @@ bad:
*/
static int is_errata93(struct pt_regs *regs, unsigned long address)
{
@@ -2044,7 +2044,7 @@ Acked-by: jbeulich@suse.com
acpi_processor_setup_cpuidle_states(pr);
--- a/drivers/char/agp/intel-gtt.c
+++ b/drivers/char/agp/intel-gtt.c
-@@ -595,7 +595,7 @@ static void intel_gtt_cleanup(void)
+@@ -588,7 +588,7 @@ static void intel_gtt_cleanup(void)
*/
static inline int needs_ilk_vtd_wa(void)
{
@@ -2055,7 +2055,7 @@ Acked-by: jbeulich@suse.com
/* Query intel_iommu to see if we need the workaround. Presumably that
--- a/drivers/edac/Kconfig
+++ b/drivers/edac/Kconfig
-@@ -52,7 +52,7 @@ config EDAC_DEBUG
+@@ -42,7 +42,7 @@ config EDAC_DEBUG
config EDAC_DECODE_MCE
tristate "Decode MCEs in human-readable form (only on AMD for now)"
@@ -2064,24 +2064,24 @@ Acked-by: jbeulich@suse.com
default y
---help---
Enable this option if you want to decode Machine Check Exceptions
-@@ -203,7 +203,7 @@ config EDAC_I5400
+@@ -181,7 +181,7 @@ config EDAC_I5400
config EDAC_I7CORE
tristate "Intel i7 Core (Nehalem) processors"
-- depends on EDAC_MM_EDAC && PCI && X86 && X86_MCE_INTEL
-+ depends on EDAC_MM_EDAC && PCI && X86 && (X86_MCE_INTEL || X86_XEN_MCE)
+- depends on PCI && X86 && X86_MCE_INTEL
++ depends on PCI && X86 && (X86_MCE_INTEL || X86_XEN_MCE)
help
Support for error detection and correction the Intel
i7 Core (Nehalem) Integrated Memory Controller that exists on
-@@ -247,7 +247,7 @@ config EDAC_I7300
+@@ -225,7 +225,7 @@ config EDAC_I7300
config EDAC_SBRIDGE
tristate "Intel Sandy-Bridge/Ivy-Bridge/Haswell Integrated MC"
-- depends on EDAC_MM_EDAC && PCI && X86_64 && X86_MCE_INTEL
-+ depends on EDAC_MM_EDAC && PCI && X86_64 && (X86_MCE_INTEL || X86_XEN_MCE)
- depends on PCI_MMCONFIG
+- depends on PCI && X86_64 && X86_MCE_INTEL && PCI_MMCONFIG
++ depends on PCI && X86_64 && (X86_MCE_INTEL || X86_XEN_MCE) && PCI_MMCONFIG
help
Support for error detection and correction the Intel
+ Sandy Bridge, Ivy Bridge and Haswell Integrated Memory Controllers.
--- a/drivers/hwmon/coretemp-xen.c
+++ b/drivers/hwmon/coretemp-xen.c
@@ -110,7 +110,7 @@ struct pdev_entry {
@@ -2146,7 +2146,7 @@ Acked-by: jbeulich@suse.com
config HT_IRQ
bool "Interrupts on hypertransport devices"
default y
-@@ -119,7 +130,7 @@ config PCI_ECAM
+@@ -122,7 +133,7 @@ config PCI_LOCKLESS_CONFIG
config PCI_IOV
bool "PCI IOV support"
depends on PCI
@@ -2155,7 +2155,7 @@ Acked-by: jbeulich@suse.com
help
I/O Virtualization is a PCI feature supported by some devices
which allows them to create virtual devices which share their
-@@ -129,7 +140,7 @@ config PCI_IOV
+@@ -132,7 +143,7 @@ config PCI_IOV
config PCI_PRI
bool "PCI PRI support"
@@ -2164,7 +2164,7 @@ Acked-by: jbeulich@suse.com
select PCI_ATS
help
PRI is the PCI Page Request Interface. It allows PCI devices that are
-@@ -139,7 +150,7 @@ config PCI_PRI
+@@ -142,7 +153,7 @@ config PCI_PRI
config PCI_PASID
bool "PCI PASID support"
@@ -3566,7 +3566,7 @@ Acked-by: jbeulich@suse.com
#ifdef HAVE_XEN_PLATFORM_COMPAT_H
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
-@@ -384,11 +384,13 @@ struct pci_dev {
+@@ -399,11 +399,13 @@ struct pci_dev {
const struct attribute_group **msi_irq_groups;
#endif
struct pci_vpd *vpd;
@@ -3597,7 +3597,7 @@ Acked-by: jbeulich@suse.com
--- a/include/xen/blkif.h
+++ b/include/xen/blkif.h
-@@ -36,6 +36,11 @@ struct blkif_common_response {
+@@ -33,6 +33,11 @@ struct blkif_common_request {
char dummy;
};
@@ -3609,10 +3609,11 @@ Acked-by: jbeulich@suse.com
/* i386 protocol version */
#pragma pack(push, 4)
struct blkif_x86_32_request {
-@@ -46,13 +51,23 @@ struct blkif_x86_32_request {
+@@ -43,7 +48,18 @@ struct blkif_x86_32_request {
blkif_sector_t sector_number;/* start sector idx on disk (r/w only) */
struct blkif_request_segment seg[BLKIF_MAX_SEGMENTS_PER_REQUEST];
};
+-typedef struct blkif_x86_32_request blkif_x86_32_request_t;
+struct blkif_x86_32_discard {
+ uint8_t operation; /* BLKIF_OP_DISCARD */
+ uint8_t reserved; /* */
@@ -3625,20 +3626,14 @@ Acked-by: jbeulich@suse.com
+ struct blkif_x86_32_request generic;
+ struct blkif_x86_32_discard discard;
+};
- struct blkif_x86_32_response {
- uint64_t id; /* copied from request */
- uint8_t operation; /* copied from request */
- int16_t status; /* BLKIF_RSP_??? */
- };
--typedef struct blkif_x86_32_request blkif_x86_32_request_t;
--typedef struct blkif_x86_32_response blkif_x86_32_response_t;
#pragma pack(pop)
/* x86_64 protocol version */
-@@ -64,18 +79,28 @@ struct blkif_x86_64_request {
+@@ -55,14 +71,25 @@ struct blkif_x86_64_request {
blkif_sector_t sector_number;/* start sector idx on disk (r/w only) */
struct blkif_request_segment seg[BLKIF_MAX_SEGMENTS_PER_REQUEST];
};
+-typedef struct blkif_x86_64_request blkif_x86_64_request_t;
+struct blkif_x86_64_discard {
+ uint8_t operation; /* BLKIF_OP_DISCARD */
+ uint8_t reserved; /* */
@@ -3651,24 +3646,20 @@ Acked-by: jbeulich@suse.com
+ struct blkif_x86_64_request generic;
+ struct blkif_x86_64_discard discard;
+};
- struct blkif_x86_64_response {
- uint64_t __attribute__((__aligned__(8))) id;
- uint8_t operation; /* copied from request */
- int16_t status; /* BLKIF_RSP_??? */
- };
--typedef struct blkif_x86_64_request blkif_x86_64_request_t;
--typedef struct blkif_x86_64_response blkif_x86_64_response_t;
#define blkif_native_sring blkif_sring
- DEFINE_RING_TYPES(blkif_common, struct blkif_common_request, struct blkif_common_response);
--DEFINE_RING_TYPES(blkif_x86_32, struct blkif_x86_32_request, struct blkif_x86_32_response);
--DEFINE_RING_TYPES(blkif_x86_64, struct blkif_x86_64_request, struct blkif_x86_64_response);
-+DEFINE_RING_TYPES(blkif_x86_32, union blkif_x86_32_union, struct blkif_x86_32_response);
-+DEFINE_RING_TYPES(blkif_x86_64, union blkif_x86_64_union, struct blkif_x86_64_response);
+ DEFINE_RING_TYPES(blkif_common, struct blkif_common_request,
+ struct blkif_response);
+-DEFINE_RING_TYPES(blkif_x86_32, struct blkif_x86_32_request,
+- struct blkif_response __attribute__((__packed__)));
+-DEFINE_RING_TYPES(blkif_x86_64, struct blkif_x86_64_request,
++DEFINE_RING_TYPES(blkif_x86_32, union blkif_x86_32_union,
++ struct blkif_response __packed);
++DEFINE_RING_TYPES(blkif_x86_64, union blkif_x86_64_union,
+ struct blkif_response);
union blkif_back_rings {
- blkif_back_ring_t native;
-@@ -91,34 +116,62 @@ enum blkif_protocol {
+@@ -79,34 +106,62 @@ enum blkif_protocol {
BLKIF_PROTOCOL_X86_64 = 3,
};
@@ -3782,7 +3773,7 @@ Acked-by: jbeulich@suse.com
uint64_t id; /* copied from request */
--- a/include/xen/interface/platform.h
+++ b/include/xen/interface/platform.h
-@@ -394,6 +394,7 @@ struct xen_processor_csd {
+@@ -400,6 +400,7 @@ struct xen_processor_csd {
uint32_t coord_type; /* coordination type */
uint32_t num; /* number of processors in same domain */
};
@@ -3790,7 +3781,7 @@ Acked-by: jbeulich@suse.com
typedef struct xen_processor_csd xen_processor_csd_t;
DEFINE_XEN_GUEST_HANDLE(xen_processor_csd_t);
-@@ -405,6 +406,7 @@ struct xen_processor_cx {
+@@ -411,6 +412,7 @@ struct xen_processor_cx {
uint32_t dpcnt; /* number of dependency entries */
XEN_GUEST_HANDLE(xen_processor_csd_t) dp; /* NULL if no dependency */
};
@@ -3798,7 +3789,7 @@ Acked-by: jbeulich@suse.com
typedef struct xen_processor_cx xen_processor_cx_t;
DEFINE_XEN_GUEST_HANDLE(xen_processor_cx_t);
-@@ -440,6 +442,7 @@ struct xen_processor_px {
+@@ -446,6 +448,7 @@ struct xen_processor_px {
uint64_t control; /* control value */
uint64_t status; /* success indicator */
};
@@ -3806,7 +3797,7 @@ Acked-by: jbeulich@suse.com
typedef struct xen_processor_px xen_processor_px_t;
DEFINE_XEN_GUEST_HANDLE(xen_processor_px_t);
-@@ -461,6 +464,7 @@ struct xen_processor_performance {
+@@ -467,6 +470,7 @@ struct xen_processor_performance {
struct xen_psd_package domain_info;
uint32_t shared_type; /* coordination type of this processor */
};
@@ -3814,7 +3805,7 @@ Acked-by: jbeulich@suse.com
typedef struct xen_processor_performance xen_processor_performance_t;
DEFINE_XEN_GUEST_HANDLE(xen_processor_performance_t);
-@@ -472,8 +476,13 @@ struct xenpf_set_processor_pminfo {
+@@ -478,8 +482,13 @@ struct xenpf_set_processor_pminfo {
struct xen_processor_power power;/* Cx: _CST/_CSD */
struct xen_processor_performance perf; /* Px: _PPC/_PCT/_PSS/_PSD */
XEN_GUEST_HANDLE(uint32) pdc; /* _PDC */
@@ -3885,7 +3876,7 @@ Acked-by: jbeulich@suse.com
int xenbus_dev_init(void);
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
-@@ -2357,6 +2357,17 @@ struct vm_struct *alloc_vm_area(size_t s
+@@ -2382,6 +2382,17 @@ struct vm_struct *alloc_vm_area(size_t s
return NULL;
}
diff --git a/patches.xen/xen3-patch-3.3 b/patches.xen/xen3-patch-3.3
index 055fec268c..6191325d61 100644
--- a/patches.xen/xen3-patch-3.3
+++ b/patches.xen/xen3-patch-3.3
@@ -11,6 +11,7 @@ Acked-by: jbeulich@suse.com
3.4/arch/x86/include/mach-xen/asm/i387.h (moved to fpu-internal.h)
3.13/drivers/acpi/processor_core.c (needs re-implementation)
3.13/drivers/acpi/processor_perflib.c (acpi_processor_load_module() disappeared)
+4.13/arch/x86/kernel/cpu/mcheck/mce-inject.c
--- a/arch/x86/entry/entry_64_compat-xen.S
+++ b/arch/x86/entry/entry_64_compat-xen.S
@@ -754,24 +755,6 @@ Acked-by: jbeulich@suse.com
}
}
---- a/arch/x86/kernel/cpu/mcheck/mce-inject.c
-+++ b/arch/x86/kernel/cpu/mcheck/mce-inject.c
-@@ -94,6 +94,7 @@ static int mce_raise_notify(unsigned int
- return NMI_HANDLED;
- }
-
-+#if defined(CONFIG_X86_LOCAL_APIC) && !defined(CONFIG_XEN)
- static void mce_irq_ipi(void *info)
- {
- int cpu = smp_processor_id();
-@@ -105,6 +106,7 @@ static void mce_irq_ipi(void *info)
- raise_exception(m, NULL);
- }
- }
-+#endif
-
- /* Inject mce on current CPU */
- static int raise_local(void)
--- a/arch/x86/kernel/e820-xen.c
+++ b/arch/x86/kernel/e820-xen.c
@@ -19,6 +19,7 @@
@@ -2219,7 +2202,7 @@ Acked-by: jbeulich@suse.com
#endif
--- a/arch/x86/mm/fault-xen.c
+++ b/arch/x86/mm/fault-xen.c
-@@ -635,7 +635,7 @@ pgtable_bad(struct pt_regs *regs, unsign
+@@ -639,7 +639,7 @@ pgtable_bad(struct pt_regs *regs, unsign
static noinline void
no_context(struct pt_regs *regs, unsigned long error_code,
@@ -2228,7 +2211,7 @@ Acked-by: jbeulich@suse.com
{
struct task_struct *tsk = current;
unsigned long *stackend;
-@@ -643,8 +643,17 @@ no_context(struct pt_regs *regs, unsigne
+@@ -647,8 +647,17 @@ no_context(struct pt_regs *regs, unsigne
int sig;
/* Are we prepared to handle this kernel fault? */
@@ -2247,7 +2230,7 @@ Acked-by: jbeulich@suse.com
/*
* 32-bit:
-@@ -673,7 +682,7 @@ no_context(struct pt_regs *regs, unsigne
+@@ -677,7 +686,7 @@ no_context(struct pt_regs *regs, unsigne
stackend = end_of_stack(tsk);
if (tsk != &init_task && *stackend != STACK_END_MAGIC)
@@ -2256,7 +2239,7 @@ Acked-by: jbeulich@suse.com
tsk->thread.cr2 = address;
tsk->thread.trap_no = 14;
-@@ -684,7 +693,7 @@ no_context(struct pt_regs *regs, unsigne
+@@ -688,7 +697,7 @@ no_context(struct pt_regs *regs, unsigne
sig = 0;
/* Executive summary in case the body of the oops scrolled away */
@@ -2265,7 +2248,7 @@ Acked-by: jbeulich@suse.com
oops_end(flags, regs, sig);
}
-@@ -764,7 +773,7 @@ __bad_area_nosemaphore(struct pt_regs *r
+@@ -768,7 +777,7 @@ __bad_area_nosemaphore(struct pt_regs *r
if (is_f00f_bug(regs, address))
return;
@@ -2274,7 +2257,7 @@ Acked-by: jbeulich@suse.com
}
static noinline void
-@@ -828,7 +837,7 @@ do_sigbus(struct pt_regs *regs, unsigned
+@@ -832,7 +841,7 @@ do_sigbus(struct pt_regs *regs, unsigned
/* Kernel mode? Handle exceptions or die: */
if (!(error_code & PF_USER)) {
@@ -2283,7 +2266,7 @@ Acked-by: jbeulich@suse.com
return;
}
-@@ -863,7 +872,7 @@ mm_fault_error(struct pt_regs *regs, uns
+@@ -867,7 +876,7 @@ mm_fault_error(struct pt_regs *regs, uns
if (!(fault & VM_FAULT_RETRY))
up_read(&current->mm->mmap_sem);
if (!(error_code & PF_USER))
@@ -2292,7 +2275,7 @@ Acked-by: jbeulich@suse.com
return 1;
}
if (!(fault & VM_FAULT_ERROR))
-@@ -873,7 +882,8 @@ mm_fault_error(struct pt_regs *regs, uns
+@@ -877,7 +886,8 @@ mm_fault_error(struct pt_regs *regs, uns
/* Kernel mode? Handle exceptions or die: */
if (!(error_code & PF_USER)) {
up_read(&current->mm->mmap_sem);
@@ -3120,7 +3103,7 @@ Acked-by: jbeulich@suse.com
config XEN_XENBUS_DEV
def_bool y
depends on PROC_FS
-@@ -659,7 +655,8 @@ config XEN_SCSI_BACKEND
+@@ -663,7 +659,8 @@ config XEN_SCSI_BACKEND
config XEN_PRIVCMD
tristate
@@ -4826,7 +4809,7 @@ Acked-by: jbeulich@suse.com
}
--- a/include/xen/blkif.h
+++ b/include/xen/blkif.h
-@@ -53,7 +53,7 @@ struct blkif_x86_32_request {
+@@ -50,7 +50,7 @@ struct blkif_x86_32_request {
};
struct blkif_x86_32_discard {
uint8_t operation; /* BLKIF_OP_DISCARD */
@@ -4835,7 +4818,7 @@ Acked-by: jbeulich@suse.com
blkif_vdev_t handle; /* same as for read/write requests */
uint64_t id; /* private guest value, echoed in resp */
blkif_sector_t sector_number;/* start sector idx on disk */
-@@ -81,7 +81,7 @@ struct blkif_x86_64_request {
+@@ -73,7 +73,7 @@ struct blkif_x86_64_request {
};
struct blkif_x86_64_discard {
uint8_t operation; /* BLKIF_OP_DISCARD */
diff --git a/patches.xen/xen3-patch-3.4 b/patches.xen/xen3-patch-3.4
index 3e1932e228..04664d1cbc 100644
--- a/patches.xen/xen3-patch-3.4
+++ b/patches.xen/xen3-patch-3.4
@@ -17,6 +17,7 @@ Acked-by: jbeulich@suse.com
3.12/include/xen/acpi.h
4.1/arch/x86/include/asm/compat.h
4.10/arch/x86/include/mach-xen/asm/fpu/internal.h
+4.13/drivers/gpu/drm/i915/i915_gem_gtt.c
--- a/arch/x86/include/asm/acpi.h
+++ b/arch/x86/include/asm/acpi.h
@@ -31,7 +32,7 @@ Acked-by: jbeulich@suse.com
extern int acpi_lapic;
extern int acpi_ioapic;
extern int acpi_noirq;
-@@ -83,26 +79,6 @@ extern int (*acpi_suspend_lowlevel)(void
+@@ -85,26 +81,6 @@ extern int (*acpi_suspend_lowlevel)(void
/* Physical address to resume after wakeup */
#define acpi_wakeup_address ((unsigned long)(real_mode_header->wakeup_start))
@@ -1018,7 +1019,7 @@ Acked-by: jbeulich@suse.com
}
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
-@@ -710,6 +710,7 @@ static void init_amd_ln(struct cpuinfo_x
+@@ -711,6 +711,7 @@ static void init_amd_ln(struct cpuinfo_x
static void init_amd_bd(struct cpuinfo_x86 *c)
{
@@ -1026,7 +1027,7 @@ Acked-by: jbeulich@suse.com
u64 value;
/* re-enable TopologyExtensions if switched off by BIOS */
-@@ -724,6 +725,7 @@ static void init_amd_bd(struct cpuinfo_x
+@@ -725,6 +726,7 @@ static void init_amd_bd(struct cpuinfo_x
}
}
}
@@ -2261,7 +2262,7 @@ Acked-by: jbeulich@suse.com
unsigned long n = count * (PAGE_SIZE / sizeof(long) / 4);
--- a/arch/x86/mm/fault-xen.c
+++ b/arch/x86/mm/fault-xen.c
-@@ -624,7 +624,7 @@ pgtable_bad(struct pt_regs *regs, unsign
+@@ -628,7 +628,7 @@ pgtable_bad(struct pt_regs *regs, unsign
dump_pagetable(address);
tsk->thread.cr2 = address;
@@ -2270,7 +2271,7 @@ Acked-by: jbeulich@suse.com
tsk->thread.error_code = error_code;
if (__die("Bad pagetable", regs, error_code))
-@@ -645,7 +645,7 @@ no_context(struct pt_regs *regs, unsigne
+@@ -649,7 +649,7 @@ no_context(struct pt_regs *regs, unsigne
/* Are we prepared to handle this kernel fault? */
if (fixup_exception(regs)) {
if (current_thread_info()->sig_on_uaccess_error && signal) {
@@ -2279,7 +2280,7 @@ Acked-by: jbeulich@suse.com
tsk->thread.error_code = error_code | PF_USER;
tsk->thread.cr2 = address;
-@@ -685,7 +685,7 @@ no_context(struct pt_regs *regs, unsigne
+@@ -689,7 +689,7 @@ no_context(struct pt_regs *regs, unsigne
printk(KERN_EMERG "Thread overran stack, or stack corrupted\n");
tsk->thread.cr2 = address;
@@ -2288,7 +2289,7 @@ Acked-by: jbeulich@suse.com
tsk->thread.error_code = error_code;
sig = SIGKILL;
-@@ -763,7 +763,7 @@ __bad_area_nosemaphore(struct pt_regs *r
+@@ -767,7 +767,7 @@ __bad_area_nosemaphore(struct pt_regs *r
/* Kernel addresses are always protection faults: */
tsk->thread.cr2 = address;
tsk->thread.error_code = error_code | (address >= TASK_SIZE);
@@ -2297,7 +2298,7 @@ Acked-by: jbeulich@suse.com
force_sig_info_fault(SIGSEGV, si_code, address, tsk, 0);
-@@ -847,7 +847,7 @@ do_sigbus(struct pt_regs *regs, unsigned
+@@ -851,7 +851,7 @@ do_sigbus(struct pt_regs *regs, unsigned
tsk->thread.cr2 = address;
tsk->thread.error_code = error_code;
@@ -2425,7 +2426,7 @@ Acked-by: jbeulich@suse.com
#include <asm/fixmap.h>
--- a/arch/x86/entry/vdso/vclock_gettime.c
+++ b/arch/x86/entry/vdso/vclock_gettime.c
-@@ -23,6 +23,10 @@
+@@ -24,6 +24,10 @@
#define gtod (&VVAR(vsyscall_gtod_data))
@@ -2436,7 +2437,7 @@ Acked-by: jbeulich@suse.com
extern int __vdso_clock_gettime(clockid_t clock, struct timespec *ts);
extern int __vdso_gettimeofday(struct timeval *tv, struct timezone *tz);
extern time_t __vdso_time(time_t *t);
-@@ -142,6 +146,7 @@ static notrace u64 vread_pvclock(int *mo
+@@ -162,6 +166,7 @@ static notrace u64 vread_hvclock(int *mo
}
#endif
@@ -2444,7 +2445,7 @@ Acked-by: jbeulich@suse.com
notrace static u64 vread_tsc(void)
{
u64 ret = (u64)rdtsc_ordered();
-@@ -221,6 +226,7 @@ notrace static int __always_inline do_mo
+@@ -245,6 +250,7 @@ notrace static int __always_inline do_mo
return mode;
}
@@ -2452,7 +2453,7 @@ Acked-by: jbeulich@suse.com
notrace static void do_realtime_coarse(struct timespec *ts)
{
-@@ -245,6 +251,7 @@ notrace static void do_monotonic_coarse(
+@@ -269,6 +275,7 @@ notrace static void do_monotonic_coarse(
notrace int __vdso_clock_gettime(clockid_t clock, struct timespec *ts)
{
switch (clock) {
@@ -2460,7 +2461,7 @@ Acked-by: jbeulich@suse.com
case CLOCK_REALTIME:
if (do_realtime(ts) == VCLOCK_NONE)
goto fallback;
-@@ -253,6 +260,7 @@ notrace int __vdso_clock_gettime(clockid
+@@ -277,6 +284,7 @@ notrace int __vdso_clock_gettime(clockid
if (do_monotonic(ts) == VCLOCK_NONE)
goto fallback;
break;
@@ -2468,7 +2469,7 @@ Acked-by: jbeulich@suse.com
case CLOCK_REALTIME_COARSE:
do_realtime_coarse(ts);
break;
-@@ -272,6 +280,7 @@ int clock_gettime(clockid_t, struct time
+@@ -296,6 +304,7 @@ int clock_gettime(clockid_t, struct time
notrace int __vdso_gettimeofday(struct timeval *tv, struct timezone *tz)
{
@@ -2476,7 +2477,7 @@ Acked-by: jbeulich@suse.com
if (likely(tv != NULL)) {
if (unlikely(do_realtime((struct timespec *)tv) == VCLOCK_NONE))
return vdso_fallback_gtod(tv, tz);
-@@ -283,6 +292,9 @@ notrace int __vdso_gettimeofday(struct t
+@@ -307,6 +316,9 @@ notrace int __vdso_gettimeofday(struct t
}
return 0;
@@ -2536,7 +2537,7 @@ Acked-by: jbeulich@suse.com
if (ret)
--- a/drivers/acpi/acpi_processor.c
+++ b/drivers/acpi/acpi_processor.c
-@@ -435,7 +435,8 @@ static int acpi_processor_add(struct acp
+@@ -427,7 +427,8 @@ static int acpi_processor_add(struct acp
pr->acpi_id, device);
switch (result) {
default:
@@ -2546,7 +2547,7 @@ Acked-by: jbeulich@suse.com
case -EEXIST:
if (radix_tree_lookup(&processor_device_tree,
pr->acpi_id) == device) {
-@@ -490,14 +491,6 @@ static int acpi_processor_add(struct acp
+@@ -482,14 +483,6 @@ static int acpi_processor_add(struct acp
#endif
err:
@@ -2561,20 +2562,9 @@ Acked-by: jbeulich@suse.com
free_cpumask_var(pr->throttling.shared_cpu_map);
device->driver_data = NULL;
#ifdef CONFIG_XEN
---- a/drivers/gpu/drm/i915/i915_gem_gtt.c
-+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
-@@ -163,7 +163,7 @@ int intel_sanitize_enable_ppgtt(struct d
- if (enable_ppgtt == 3 && has_full_48bit_ppgtt)
- return 3;
-
--#ifdef CONFIG_INTEL_IOMMU
-+#if defined(CONFIG_INTEL_IOMMU) || defined(CONFIG_XEN)
- /* Disable ppgtt on SNB if VT-d is on. */
- if (IS_GEN6(dev_priv) && intel_iommu_gfx_mapped) {
- DRM_INFO("Disabling PPGTT because VT-d is on\n");
--- a/drivers/gpu/drm/ttm/ttm_page_alloc.c
+++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c
-@@ -516,8 +516,7 @@ static int ttm_alloc_new_pages(struct li
+@@ -519,8 +519,7 @@ static int ttm_alloc_new_pages(struct li
r = xen_limit_pages_to_max_mfn(p, 0, 32);
if (r) {
__free_page(p);
@@ -2584,7 +2574,7 @@ Acked-by: jbeulich@suse.com
p = NULL;
} else if (gfp_flags & __GFP_ZERO)
clear_page(page_address(p));
-@@ -769,8 +768,7 @@ static int ttm_get_pages(struct page **p
+@@ -772,8 +771,7 @@ static int ttm_get_pages(struct page **p
if (rc) {
__free_page(p);
@@ -2695,7 +2685,7 @@ Acked-by: jbeulich@suse.com
if (err)
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
-@@ -738,7 +738,7 @@ config INPUT_CMA3000_I2C
+@@ -748,7 +748,7 @@ config INPUT_CMA3000_I2C
config INPUT_XEN_KBDDEV_FRONTEND
tristate "Xen virtual keyboard and mouse support"
@@ -2706,7 +2696,7 @@ Acked-by: jbeulich@suse.com
help
--- a/drivers/xen/Kconfig
+++ b/drivers/xen/Kconfig
-@@ -695,7 +695,7 @@ config XEN_ACPI_HOTPLUG_CPU
+@@ -699,7 +699,7 @@ config XEN_ACPI_HOTPLUG_CPU
config XEN_ACPI_PROCESSOR
tristate "Xen ACPI processor"
@@ -3012,7 +3002,7 @@ Acked-by: jbeulich@suse.com
#endif /* __XEN_PUBLIC_PHYSDEV_H__ */
--- a/include/xen/interface/platform.h
+++ b/include/xen/interface/platform.h
-@@ -313,7 +313,7 @@ DEFINE_XEN_GUEST_HANDLE(xenpf_firmware_i
+@@ -319,7 +319,7 @@ DEFINE_XEN_GUEST_HANDLE(xenpf_firmware_i
#define XENPF_enter_acpi_sleep 51
struct xenpf_enter_acpi_sleep {
/* IN variables */
diff --git a/patches.xen/xen3-patch-3.5 b/patches.xen/xen3-patch-3.5
index 9d28049330..f92433125c 100644
--- a/patches.xen/xen3-patch-3.5
+++ b/patches.xen/xen3-patch-3.5
@@ -33,7 +33,7 @@ Acked-by: jbeulich@suse.com
#
# Arch settings
-@@ -121,7 +121,7 @@ config X86
+@@ -127,7 +127,7 @@ config X86
select HAVE_DEBUG_KMEMLEAK
select HAVE_DEBUG_STACKOVERFLOW
select HAVE_DMA_API_DEBUG
@@ -1230,7 +1230,7 @@ Acked-by: jbeulich@suse.com
#endif
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
-@@ -1324,7 +1324,7 @@ int memory_failure(unsigned long pfn, in
+@@ -1310,7 +1310,7 @@ int memory_failure(unsigned long pfn, in
* mechanism will be done in XEN for Intel CPUs
*/
#if defined (CONFIG_X86_XEN_MCE)
@@ -2373,7 +2373,7 @@ Acked-by: jbeulich@suse.com
conditional_sti(regs);
--- a/arch/x86/mm/fault-xen.c
+++ b/arch/x86/mm/fault-xen.c
-@@ -591,7 +591,7 @@ show_fault_oops(struct pt_regs *regs, un
+@@ -595,7 +595,7 @@ show_fault_oops(struct pt_regs *regs, un
pte_t *pte = lookup_address(address, &level);
if (pte && pte_present(*pte) && !pte_exec(*pte))
diff --git a/patches.xen/xen3-patch-3.6 b/patches.xen/xen3-patch-3.6
index 7df4cf63e4..1f5cc37772 100644
--- a/patches.xen/xen3-patch-3.6
+++ b/patches.xen/xen3-patch-3.6
@@ -911,7 +911,7 @@ Acked-by: jbeulich@suse.com
}
--- a/arch/x86/kernel/cpu/Makefile
+++ b/arch/x86/kernel/cpu/Makefile
-@@ -43,7 +43,7 @@ obj-$(CONFIG_X86_LOCAL_APIC) += perfctr
+@@ -44,7 +44,7 @@ obj-$(CONFIG_X86_LOCAL_APIC) += perfctr
obj-$(CONFIG_HYPERVISOR_GUEST) += vmware.o hypervisor.o mshyperv.o
disabled-obj-$(CONFIG_XEN) := hypervisor.o mshyperv.o perfctr-watchdog.o \
@@ -1019,16 +1019,6 @@ Acked-by: jbeulich@suse.com
}
/*
-@@ -343,6 +343,9 @@ void fixup_irqs(void)
- chip->irq_retrigger(data);
- raw_spin_unlock(&desc->lock);
- }
-+#ifndef CONFIG_XEN
-+ __this_cpu_write(vector_irq[vector], -1);
-+#endif
- }
- }
- #endif
--- a/arch/x86/kernel/cpu/microcode/core-xen.c
+++ b/arch/x86/kernel/cpu/microcode/core-xen.c
@@ -183,7 +183,7 @@ static int request_microcode(const char
@@ -1739,7 +1729,7 @@ Acked-by: jbeulich@suse.com
&supported);
--- a/include/xen/interface/platform.h
+++ b/include/xen/interface/platform.h
-@@ -523,6 +523,7 @@ DEFINE_XEN_GUEST_HANDLE(xenpf_pcpu_versi
+@@ -529,6 +529,7 @@ DEFINE_XEN_GUEST_HANDLE(xenpf_pcpu_versi
struct xenpf_cpu_ol {
uint32_t cpuid;
};
diff --git a/patches.xen/xen3-patch-3.7 b/patches.xen/xen3-patch-3.7
index fea190aaa3..082817e509 100644
--- a/patches.xen/xen3-patch-3.7
+++ b/patches.xen/xen3-patch-3.7
@@ -10,7 +10,7 @@ Acked-by: jbeulich@suse.com
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
-@@ -1832,9 +1832,9 @@ config PARAVIRT_TIME_ACCOUNTING
+@@ -1810,9 +1810,9 @@ config PARAVIRT_TIME_ACCOUNTING
config XEN_DOM0
def_bool y
@@ -24,7 +24,7 @@ Acked-by: jbeulich@suse.com
depends on CPU_V7 && !CPU_V6
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
-@@ -280,7 +280,7 @@ endif
+@@ -281,7 +281,7 @@ endif
core-$(CONFIG_FPE_NWFPE) += arch/arm/nwfpe/
core-$(CONFIG_FPE_FASTFPE) += $(FASTFPE_OBJ)
core-$(CONFIG_VFP) += arch/arm/vfp/
@@ -73,8 +73,8 @@ Acked-by: jbeulich@suse.com
#define MAX_VIRT_CPUS 1
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -108,7 +108,7 @@ config X86
- select HAVE_ARCH_MMAP_RND_COMPAT_BITS if MMU && COMPAT
+@@ -114,7 +114,7 @@ config X86
+ select HAVE_ARCH_COMPAT_MMAP_BASES if MMU && COMPAT
select HAVE_ARCH_SECCOMP_FILTER
select HAVE_ARCH_TRACEHOOK
- select HAVE_ARCH_TRANSPARENT_HUGEPAGE
@@ -82,7 +82,7 @@ Acked-by: jbeulich@suse.com
select HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD if X86_64
select HAVE_ARCH_VMAP_STACK if X86_64
select HAVE_ARCH_WITHIN_STACK_FRAMES
-@@ -1770,6 +1770,7 @@ config ARCH_RANDOM
+@@ -1789,6 +1789,7 @@ config ARCH_RANDOM
config X86_SMAP
def_bool y
prompt "Supervisor Mode Access Prevention" if EXPERT
@@ -240,7 +240,7 @@ Acked-by: jbeulich@suse.com
#endif
#ifndef __ASSEMBLY__
-@@ -361,6 +361,7 @@ int phys_mem_access_prot_allowed(struct
+@@ -365,6 +365,7 @@ int phys_mem_access_prot_allowed(struct
void set_pte_vaddr(unsigned long vaddr, pte_t pte);
extern void xen_pagetable_reserve(u64 start, u64 end);
@@ -304,7 +304,7 @@ Acked-by: jbeulich@suse.com
/*
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
-@@ -725,7 +725,6 @@ static void init_amd_bd(struct cpuinfo_x
+@@ -726,7 +726,6 @@ static void init_amd_bd(struct cpuinfo_x
}
}
}
@@ -312,7 +312,7 @@ Acked-by: jbeulich@suse.com
/*
* The way access filter has a performance penalty on some workloads.
-@@ -737,6 +736,7 @@ static void init_amd_bd(struct cpuinfo_x
+@@ -738,6 +737,7 @@ static void init_amd_bd(struct cpuinfo_x
wrmsrl_safe(MSR_F15H_IC_CFG, value);
}
}
@@ -2113,7 +2113,7 @@ Acked-by: jbeulich@suse.com
/*
* Page fault error code bits:
-@@ -1004,13 +1005,24 @@ static int fault_in_kernel_space(unsigne
+@@ -1008,13 +1009,24 @@ static int fault_in_kernel_space(unsigne
return address >= TASK_SIZE_MAX;
}
@@ -2140,7 +2140,7 @@ Acked-by: jbeulich@suse.com
{
struct vm_area_struct *vma;
struct task_struct *tsk;
-@@ -1114,6 +1126,13 @@ do_page_fault(struct pt_regs *regs, unsi
+@@ -1118,6 +1130,13 @@ do_page_fault(struct pt_regs *regs, unsi
if (unlikely(error_code & PF_RSVD))
pgtable_bad(regs, error_code, address);
@@ -2154,7 +2154,7 @@ Acked-by: jbeulich@suse.com
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address);
/*
-@@ -1227,6 +1246,7 @@ good_area:
+@@ -1231,6 +1250,7 @@ good_area:
/* Clear FAULT_FLAG_ALLOW_RETRY to avoid any risk
* of starvation. */
flags &= ~FAULT_FLAG_ALLOW_RETRY;
@@ -2162,7 +2162,7 @@ Acked-by: jbeulich@suse.com
goto retry;
}
}
-@@ -1235,3 +1255,11 @@ good_area:
+@@ -1239,3 +1259,11 @@ good_area:
up_read(&mm->mmap_sem);
}
@@ -2512,18 +2512,18 @@ Acked-by: jbeulich@suse.com
/* Register acpi_idle_driver if not already registered */
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
-@@ -199,9 +199,6 @@ struct tpm_chip {
+@@ -229,9 +229,6 @@ struct tpm_chip {
acpi_handle acpi_dev_handle;
char ppi_version[TPM_PPI_VERSION_LEN + 1];
#endif /* CONFIG_ACPI */
-#ifdef CONFIG_XEN
- void *priv;
-#endif
- };
- #define to_tpm_chip(d) container_of(d, struct tpm_chip, dev)
-@@ -496,17 +493,15 @@ enum tpm_transmit_flags {
- TPM_TRANSMIT_UNLOCKED = BIT(0),
+ struct tpm_space work_space;
+ u32 nr_commands;
+@@ -512,17 +509,15 @@ enum tpm_transmit_flags {
+ TPM_TRANSMIT_RAW = BIT(1),
};
-#ifdef CONFIG_XEN
@@ -2540,8 +2540,8 @@ Acked-by: jbeulich@suse.com
}
-#endif
- ssize_t tpm_transmit(struct tpm_chip *chip, const u8 *buf, size_t bufsiz,
- unsigned int flags);
+ ssize_t tpm_transmit(struct tpm_chip *chip, struct tpm_space *space,
+ u8 *buf, size_t bufsiz, unsigned int flags);
--- a/drivers/hwmon/coretemp-xen.c
+++ b/drivers/hwmon/coretemp-xen.c
@@ -213,8 +213,11 @@ static const struct tjmax tjmax_table[]
@@ -3560,7 +3560,7 @@ Acked-by: jbeulich@suse.com
--- a/drivers/xen/sys-hypervisor.c
+++ b/drivers/xen/sys-hypervisor.c
-@@ -114,6 +114,7 @@ static int __init xen_sysfs_version_init
+@@ -143,6 +143,7 @@ static int __init xen_sysfs_version_init
/* UUID */
@@ -3568,7 +3568,7 @@ Acked-by: jbeulich@suse.com
static ssize_t uuid_show_fallback(struct hyp_sysfs_attr *attr, char *buffer)
{
char *vm, *val;
-@@ -133,6 +134,9 @@ static ssize_t uuid_show_fallback(struct
+@@ -162,6 +163,9 @@ static ssize_t uuid_show_fallback(struct
kfree(val);
return ret;
}
@@ -4018,7 +4018,7 @@ Acked-by: jbeulich@suse.com
DEFINE_XEN_GUEST_HANDLE(long);
__DEFINE_XEN_GUEST_HANDLE(ulong, unsigned long);
#endif
-@@ -813,7 +810,7 @@ typedef struct shared_info shared_info_t
+@@ -819,7 +816,7 @@ typedef struct shared_info shared_info_t
* 32-bit and runs under a 64-bit hypervisor should _NOT_ use two of the
* pages preceding pt_base and mark them as reserved/unused.
*/
@@ -4056,7 +4056,7 @@ Acked-by: jbeulich@suse.com
unsigned long bytes;
--- a/mm/memory.c
+++ b/mm/memory.c
-@@ -833,7 +833,7 @@ struct page *vm_normal_page(struct vm_ar
+@@ -862,7 +862,7 @@ struct page *vm_normal_page(struct vm_ar
check_pfn:
if (unlikely(pfn > highest_memmap_pfn)) {
#ifdef CONFIG_XEN
diff --git a/patches.xen/xen3-patch-3.8 b/patches.xen/xen3-patch-3.8
index 08db9e7c44..10f10d4fea 100644
--- a/patches.xen/xen3-patch-3.8
+++ b/patches.xen/xen3-patch-3.8
@@ -9,10 +9,11 @@ Automatically created from "patch-3.8" by xen-port-patches.py
Acked-by: jbeulich@suse.com
4.1/arch/x86/include/asm/ptrace.h
+4.13/drivers/gpu/drm/i915/i915_gem_gtt.c
--- a/Documentation/filesystems/proc.txt
+++ b/Documentation/filesystems/proc.txt
-@@ -483,6 +483,7 @@ manner. The codes are the following:
+@@ -490,6 +490,7 @@ manner. The codes are the following:
mm - mixed map area
hg - huge page advise flag
nh - no-huge page advise flag
@@ -22,7 +23,7 @@ Acked-by: jbeulich@suse.com
Note that there is no guarantee that every flag and associated mnemonic will
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -2124,7 +2124,7 @@ config HOTPLUG_CPU
+@@ -2143,7 +2143,7 @@ config HOTPLUG_CPU
config BOOTPARAM_HOTPLUG_CPU0
bool "Set default setting of cpu0_hotpluggable"
default n
@@ -31,7 +32,7 @@ Acked-by: jbeulich@suse.com
---help---
Set whether default state of cpu0_hotpluggable is on or off.
-@@ -2153,7 +2153,7 @@ config BOOTPARAM_HOTPLUG_CPU0
+@@ -2172,7 +2172,7 @@ config BOOTPARAM_HOTPLUG_CPU0
config DEBUG_HOTPLUG_CPU0
def_bool n
prompt "Debug CPU0 hotplug"
@@ -866,7 +867,7 @@ Acked-by: jbeulich@suse.com
/*
* Page fault error code bits:
-@@ -757,13 +757,15 @@ __bad_area_nosemaphore(struct pt_regs *r
+@@ -761,13 +761,15 @@ __bad_area_nosemaphore(struct pt_regs *r
return;
}
#endif
@@ -885,7 +886,7 @@ Acked-by: jbeulich@suse.com
tsk->thread.trap_nr = X86_TRAP_PF;
force_sig_info_fault(SIGSEGV, si_code, address, tsk, 0);
-@@ -812,20 +814,6 @@ bad_area_access_error(struct pt_regs *re
+@@ -816,20 +818,6 @@ bad_area_access_error(struct pt_regs *re
__bad_area(regs, error_code, address, SEGV_ACCERR);
}
@@ -906,7 +907,7 @@ Acked-by: jbeulich@suse.com
static void
do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address,
unsigned int fault)
-@@ -888,7 +876,14 @@ mm_fault_error(struct pt_regs *regs, uns
+@@ -892,7 +880,14 @@ mm_fault_error(struct pt_regs *regs, uns
return 1;
}
@@ -1002,7 +1003,7 @@ Acked-by: jbeulich@suse.com
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
-@@ -685,6 +685,7 @@ static void set_dev_domain_options(struc
+@@ -668,6 +668,7 @@ static void set_dev_domain_options(struc
int pcibios_add_device(struct pci_dev *dev)
{
@@ -1010,7 +1011,7 @@ Acked-by: jbeulich@suse.com
struct setup_data *data;
struct pci_setup_rom *rom;
u64 pa_data;
-@@ -712,6 +713,27 @@ int pcibios_add_device(struct pci_dev *d
+@@ -695,6 +696,27 @@ int pcibios_add_device(struct pci_dev *d
pa_data = data->next;
iounmap(data);
}
@@ -1073,17 +1074,6 @@ Acked-by: jbeulich@suse.com
__ioat_dca_init(struct pci_dev *pdev, void __iomem *iobase)
{
return NULL;
---- a/drivers/gpu/drm/i915/i915_gem_gtt.c
-+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
-@@ -2305,7 +2305,7 @@ void i915_ppgtt_release(struct kref *kre
- */
- static bool needs_idle_maps(struct drm_i915_private *dev_priv)
- {
--#ifdef CONFIG_INTEL_IOMMU
-+#if defined(CONFIG_INTEL_IOMMU) || defined(CONFIG_XEN)
- /* Query intel_iommu to see if we need the workaround. Presumably that
- * was loaded first.
- */
--- a/drivers/hwmon/coretemp-xen.c
+++ b/drivers/hwmon/coretemp-xen.c
@@ -34,7 +34,6 @@
@@ -1499,7 +1489,7 @@ Acked-by: jbeulich@suse.com
--- a/include/xen/interface/platform.h
+++ b/include/xen/interface/platform.h
-@@ -552,6 +552,7 @@ struct xenpf_core_parking {
+@@ -558,6 +558,7 @@ struct xenpf_core_parking {
/* OUT variables: get cpu nums actually be idled */
uint32_t idle_nums;
};
diff --git a/patches.xen/xen3-patch-3.9 b/patches.xen/xen3-patch-3.9
index 66158da5f4..4408ad1235 100644
--- a/patches.xen/xen3-patch-3.9
+++ b/patches.xen/xen3-patch-3.9
@@ -53,7 +53,7 @@ Acked-by: jbeulich@suse.com
static inline bool efi_runtime_supported(void)
--- a/arch/x86/include/asm/page_64.h
+++ b/arch/x86/include/asm/page_64.h
-@@ -7,7 +7,14 @@
+@@ -8,7 +8,14 @@
/* duplicated to the one in bootmem.h */
extern unsigned long max_pfn;
@@ -70,7 +70,7 @@ Acked-by: jbeulich@suse.com
{
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
-@@ -924,7 +924,7 @@ extern unsigned long arch_align_stack(un
+@@ -937,7 +937,7 @@ extern unsigned long arch_align_stack(un
extern void free_init_pages(char *what, unsigned long begin, unsigned long end);
void default_idle(void);
@@ -228,7 +228,7 @@ Acked-by: jbeulich@suse.com
#endif /* _ASM_X86_PGTABLE_64_DEFS_H */
--- a/arch/x86/include/mach-xen/asm/pgtable_types.h
+++ b/arch/x86/include/mach-xen/asm/pgtable_types.h
-@@ -380,13 +380,12 @@ int phys_mem_access_prot_allowed(struct
+@@ -384,13 +384,12 @@ int phys_mem_access_prot_allowed(struct
/* Install a pte for a particular vaddr in kernel space. */
void set_pte_vaddr(unsigned long vaddr, pte_t pte);
@@ -243,7 +243,7 @@ Acked-by: jbeulich@suse.com
PG_LEVEL_NONE,
PG_LEVEL_4K,
PG_LEVEL_2M,
-@@ -407,6 +406,8 @@ static inline void update_page_count(int
+@@ -411,6 +410,8 @@ static inline void update_page_count(int
* as a pte too.
*/
extern pte_t *lookup_address(unsigned long address, unsigned int *level);
@@ -1091,7 +1091,7 @@ Acked-by: jbeulich@suse.com
}
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
-@@ -640,7 +640,6 @@ static void init_amd_k8(struct cpuinfo_x
+@@ -641,7 +641,6 @@ static void init_amd_k8(struct cpuinfo_x
#else
pr_warning("Long-mode LAHF feature wrongly enabled -"
"hypervisor update needed\n");
@@ -1635,13 +1635,13 @@ Acked-by: jbeulich@suse.com
}
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
-@@ -428,7 +428,7 @@ NEXT_PAGE(early_dynamic_pgts)
+@@ -345,7 +345,7 @@ NEXT_PAGE(early_dynamic_pgts)
.data
-#ifndef CONFIG_XEN
+#ifndef CONFIG_PARAVIRT_XEN
- NEXT_PAGE(init_level4_pgt)
+ NEXT_PAGE(init_top_pgt)
.fill 512,8,0
#else
--- a/arch/x86/kernel/head_64-xen.S
@@ -1685,7 +1685,7 @@ Acked-by: jbeulich@suse.com
unsigned int old = t->iopl >> 12;
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
-@@ -279,7 +279,7 @@ void __cpuidle default_idle(void)
+@@ -345,7 +345,7 @@ void __cpuidle default_idle(void)
EXPORT_SYMBOL(default_idle);
#endif
@@ -2569,7 +2569,7 @@ Acked-by: jbeulich@suse.com
},
--- a/arch/x86/mm/fault-xen.c
+++ b/arch/x86/mm/fault-xen.c
-@@ -386,10 +386,12 @@ static noinline __kprobes int vmalloc_fa
+@@ -390,10 +390,12 @@ static noinline __kprobes int vmalloc_fa
if (pgd_none(*pgd_ref))
return -1;
@@ -2584,7 +2584,7 @@ Acked-by: jbeulich@suse.com
/*
* Below here mismatches are bugs because these lower tables
-@@ -948,14 +950,8 @@ spurious_fault(unsigned long error_code,
+@@ -952,14 +954,8 @@ spurious_fault(unsigned long error_code,
if (pmd_large(*pmd))
return spurious_fault_check(error_code, (pte_t *) pmd);
@@ -2600,7 +2600,7 @@ Acked-by: jbeulich@suse.com
return 0;
ret = spurious_fault_check(error_code, pte);
-@@ -1077,7 +1073,10 @@ __do_page_fault(struct pt_regs *regs, un
+@@ -1081,7 +1077,10 @@ __do_page_fault(struct pt_regs *regs, un
}
if (!(error_code & (PF_RSVD | PF_USER | PF_PROT))) {
@@ -5005,7 +5005,7 @@ Acked-by: jbeulich@suse.com
static inline void acpi_processor_cstate_first_run_checks(void)
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
-@@ -495,12 +495,12 @@ enum tpm_transmit_flags {
+@@ -511,12 +511,12 @@ enum tpm_transmit_flags {
static inline void *chip_get_private(const struct tpm_chip *chip)
{
@@ -5019,7 +5019,7 @@ Acked-by: jbeulich@suse.com
+ chip->vendor.priv = priv;
}
- ssize_t tpm_transmit(struct tpm_chip *chip, const u8 *buf, size_t bufsiz,
+ ssize_t tpm_transmit(struct tpm_chip *chip, struct tpm_space *space,
--- a/drivers/char/tpm/tpm_vtpm.c
+++ b/drivers/char/tpm/tpm_vtpm.c
@@ -450,6 +450,11 @@ static u8 vtpm_status(struct tpm_chip *c
@@ -5341,7 +5341,7 @@ Acked-by: jbeulich@suse.com
/**
--- a/drivers/thermal/Kconfig
+++ b/drivers/thermal/Kconfig
-@@ -306,7 +306,7 @@ config DB8500_CPUFREQ_COOLING
+@@ -321,7 +321,7 @@ config DA9062_THERMAL
config INTEL_POWERCLAMP
tristate "Intel PowerClamp idle injection driver"
depends on THERMAL
@@ -5352,7 +5352,7 @@ Acked-by: jbeulich@suse.com
Enable this to enable Intel PowerClamp idle injection driver. This
--- a/drivers/xen/Kconfig
+++ b/drivers/xen/Kconfig
-@@ -661,7 +661,7 @@ config XEN_PRIVCMD
+@@ -665,7 +665,7 @@ config XEN_PRIVCMD
config XEN_STUB
bool "Xen stub drivers"
diff --git a/patches.xen/xen3-patch-4.0 b/patches.xen/xen3-patch-4.0
index a537e6d5f7..a9328ac82c 100644
--- a/patches.xen/xen3-patch-4.0
+++ b/patches.xen/xen3-patch-4.0
@@ -358,7 +358,7 @@ Acked-by: jbeulich@suse.com
/*
* The cache modes defined here are used to translate between pure SW usage
-@@ -379,20 +353,6 @@ static inline pteval_t pte_flags(pte_t p
+@@ -383,20 +357,6 @@ static inline pteval_t pte_flags(pte_t p
return __pte_val(pte) & PTE_FLAGS_MASK;
}
@@ -1747,7 +1747,7 @@ Acked-by: jbeulich@suse.com
void math_state_restore(void)
--- a/arch/x86/mm/fault-xen.c
+++ b/arch/x86/mm/fault-xen.c
-@@ -609,7 +609,7 @@ show_fault_oops(struct pt_regs *regs, un
+@@ -613,7 +613,7 @@ show_fault_oops(struct pt_regs *regs, un
printk(nx_warning, from_kuid(&init_user_ns, current_uid()));
if (pte && pte_present(*pte) && pte_exec(*pte) &&
(pgd_flags(*pgd) & _PAGE_USER) &&
@@ -1974,7 +1974,7 @@ Acked-by: jbeulich@suse.com
xen-balloon_$(CONFIG_XEN) := balloon/
--- a/drivers/xen/blkback/blkback.c
+++ b/drivers/xen/blkback/blkback.c
-@@ -748,7 +748,7 @@ static int __init blkif_init(void)
+@@ -750,7 +750,7 @@ static int __init blkif_init(void)
kfree(pending_reqs);
kfree(pending_grant_handles);
free_empty_pages_and_pagevec(pending_pages, mmap_pages);
diff --git a/patches.xen/xen3-patch-4.1 b/patches.xen/xen3-patch-4.1
index f5a5d2f19a..b056eaa70b 100644
--- a/patches.xen/xen3-patch-4.1
+++ b/patches.xen/xen3-patch-4.1
@@ -8,18 +8,20 @@ References: none
Automatically created from "patch-4.1" by xen-port-patches.py
Acked-by: jbeulich@suse.com
+4.12/arch/x86/kernel/cpu/hypervisor.c
+
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -99,7 +99,7 @@ config X86
+@@ -104,7 +104,7 @@ config X86
+ select HAVE_ACPI_APEI_NMI if ACPI
select HAVE_ALIGNED_STRUCT_PAGE if SLUB
select HAVE_ARCH_AUDITSYSCALL
- select HAVE_ARCH_HARDENED_USERCOPY
- select HAVE_ARCH_HUGE_VMAP if X86_64 || X86_PAE
+ select HAVE_ARCH_HUGE_VMAP if (X86_64 || X86_PAE) && !XEN
select HAVE_ARCH_JUMP_LABEL
select HAVE_ARCH_KASAN if X86_64 && SPARSEMEM_VMEMMAP
select HAVE_ARCH_KGDB if !XEN
-@@ -1038,7 +1038,6 @@ config X86_LOCAL_APIC
+@@ -1049,7 +1049,6 @@ config X86_LOCAL_APIC
config X86_IO_APIC
def_bool y
depends on X86_LOCAL_APIC || X86_UP_IOAPIC
@@ -508,7 +510,7 @@ Acked-by: jbeulich@suse.com
END(ia32_ptregs_common)
--- a/arch/x86/include/asm/setup.h
+++ b/arch/x86/include/asm/setup.h
-@@ -71,7 +71,11 @@ extern char _text[];
+@@ -70,7 +70,11 @@ extern char _text[];
static inline bool kaslr_enabled(void)
{
@@ -694,7 +696,7 @@ Acked-by: jbeulich@suse.com
* PGDIR_SHIFT determines what a top-level page table entry can map
--- a/arch/x86/include/mach-xen/asm/pgtable_types.h
+++ b/arch/x86/include/mach-xen/asm/pgtable_types.h
-@@ -242,7 +242,7 @@ static inline pgd_t xen_make_pgd(pgdval_
+@@ -246,7 +246,7 @@ static inline pgd_t xen_make_pgd(pgdval_
static inline pgdval_t xen_pgd_val(pgd_t pgd)
{
pgdval_t ret = __pgd_val(pgd);
@@ -703,7 +705,7 @@ Acked-by: jbeulich@suse.com
if (likely(ret))
ret = machine_to_phys(ret) | _PAGE_PRESENT;
#else
-@@ -257,7 +257,7 @@ static inline pgdval_t pgd_flags(pgd_t p
+@@ -261,7 +261,7 @@ static inline pgdval_t pgd_flags(pgd_t p
return __pgd_val(pgd) & PTE_FLAGS_MASK;
}
@@ -712,7 +714,7 @@ Acked-by: jbeulich@suse.com
typedef struct { pudval_t pud; } pud_t;
#define __pud_ma(x) ((pud_t) { (x) } )
-@@ -286,7 +286,7 @@ static inline pudval_t xen_pud_val(pud_t
+@@ -290,7 +290,7 @@ static inline pudval_t xen_pud_val(pud_t
}
#endif
@@ -998,13 +1000,14 @@ Acked-by: jbeulich@suse.com
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
-@@ -820,8 +820,10 @@ static void init_amd(struct cpuinfo_x86
+@@ -821,9 +821,11 @@ static void init_amd(struct cpuinfo_x86
if (cpu_has(c, X86_FEATURE_3DNOW) || cpu_has(c, X86_FEATURE_LM))
set_cpu_cap(c, X86_FEATURE_3DNOWPREFETCH);
+#ifndef CONFIG_XEN
- /* AMD CPUs don't reset SS attributes on SYSRET */
- set_cpu_bug(c, X86_BUG_SYSRET_SS_ATTRS);
+ /* AMD CPUs don't reset SS attributes on SYSRET, Xen does. */
+ if (!cpu_has(c, X86_FEATURE_XENPV))
+ set_cpu_bug(c, X86_BUG_SYSRET_SS_ATTRS);
+#endif
}
@@ -1219,17 +1222,6 @@ Acked-by: jbeulich@suse.com
#endif
struct thread_struct *thread = &curr->thread;
---- a/arch/x86/kernel/cpu/hypervisor.c
-+++ b/arch/x86/kernel/cpu/hypervisor.c
-@@ -28,7 +28,7 @@
-
- static const __initconst struct hypervisor_x86 * const hypervisors[] =
- {
--#ifdef CONFIG_XEN
-+#ifdef CONFIG_PARAVIRT_XEN
- &x86_hyper_xen,
- #endif
- &x86_hyper_vmware,
--- a/arch/x86/kernel/cpu/intel_cacheinfo.c
+++ b/arch/x86/kernel/cpu/intel_cacheinfo.c
@@ -809,6 +809,7 @@ unsigned int init_intel_cacheinfo(struct
@@ -3362,7 +3354,7 @@ Acked-by: jbeulich@suse.com
return 0;
while (instr < max_instr) {
-@@ -1044,7 +1044,7 @@ static inline bool smap_violation(int er
+@@ -1048,7 +1048,7 @@ static inline bool smap_violation(int er
if (error_code & PF_USER)
return false;
@@ -3371,7 +3363,7 @@ Acked-by: jbeulich@suse.com
return false;
return true;
-@@ -1070,7 +1070,7 @@ __do_page_fault(struct pt_regs *regs, un
+@@ -1074,7 +1074,7 @@ __do_page_fault(struct pt_regs *regs, un
unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
/* Set the "privileged fault" bit to something sane. */
@@ -3380,7 +3372,7 @@ Acked-by: jbeulich@suse.com
error_code |= PF_USER;
else
error_code &= ~PF_USER;
-@@ -1169,7 +1169,7 @@ __do_page_fault(struct pt_regs *regs, un
+@@ -1173,7 +1173,7 @@ __do_page_fault(struct pt_regs *regs, un
* User-mode registers count as a user access even for any
* potential system fault or CPU buglet:
*/
@@ -3919,7 +3911,7 @@ Acked-by: jbeulich@suse.com
tdata->sd_attrs[i].dev_attr.attr.mode = S_IRUGO;
--- a/drivers/xen/Kconfig
+++ b/drivers/xen/Kconfig
-@@ -734,7 +734,7 @@ config XEN_AUTO_XLATE
+@@ -738,7 +738,7 @@ config XEN_AUTO_XLATE
config XEN_ACPI
def_bool y
diff --git a/patches.xen/xen3-patch-4.10 b/patches.xen/xen3-patch-4.10
index 7ac71c8206..9eef22b6fe 100644
--- a/patches.xen/xen3-patch-4.10
+++ b/patches.xen/xen3-patch-4.10
@@ -10,7 +10,7 @@ Acked-by: jbeulich@suse.com
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -435,7 +435,7 @@ config GOLDFISH
+@@ -446,7 +446,7 @@ config GOLDFISH
config INTEL_RDT_A
bool "Intel Resource Director Technology Allocation support"
default n
@@ -21,7 +21,7 @@ Acked-by: jbeulich@suse.com
Select to enable resource allocation which is a sub-feature of
--- a/arch/x86/entry/calling.h
+++ b/arch/x86/entry/calling.h
-@@ -103,8 +103,8 @@ For 32-bit we have the following convent
+@@ -104,8 +104,8 @@ For 32-bit we have the following convent
#define SIZEOF_PTREGS 21*8
@@ -1763,7 +1763,7 @@ Acked-by: jbeulich@suse.com
--- a/arch/x86/mm/fault-xen.c
+++ b/arch/x86/mm/fault-xen.c
-@@ -421,7 +421,7 @@ out:
+@@ -425,7 +425,7 @@ out:
void vmalloc_sync_all(void)
{
@@ -1772,7 +1772,7 @@ Acked-by: jbeulich@suse.com
}
/*
-@@ -688,8 +688,7 @@ show_fault_oops(struct pt_regs *regs, un
+@@ -692,8 +692,7 @@ show_fault_oops(struct pt_regs *regs, un
printk(KERN_CONT "paging request");
printk(KERN_CONT " at %p\n", (void *) address);
@@ -2574,10 +2574,10 @@ Acked-by: jbeulich@suse.com
switch (backend_state) {
case XenbusStateInitialising:
-@@ -841,17 +837,13 @@ static void xenfb_backend_changed(struct
+@@ -840,17 +836,13 @@ static void xenfb_backend_changed(struct
if (dev->state != XenbusStateConnected)
- goto InitWait; /* no InitWait seen yet, fudge it */
-
+ /* no InitWait seen yet, fudge it */
+ xenbus_switch_state(dev, XenbusStateConnected);
-
- if (xenbus_scanf(XBT_NIL, dev->otherend,
- "feature-resize", "%d", &val) < 0)
@@ -2611,20 +2611,25 @@ Acked-by: jbeulich@suse.com
if (abs)
xenbus_write(XBT_NIL, dev->nodename, "request-abs-pointer", "1");
-@@ -288,11 +287,8 @@ static void xenkbd_backend_changed(struc
-
- case XenbusStateInitWait:
- InitWait:
-- ret = xenbus_scanf(XBT_NIL, info->xbdev->otherend,
-- "feature-abs-pointer", "%d", &val);
-- if (ret < 0)
-- val = 0;
-- if (val) {
-+ if (xenbus_read_unsigned(info->xbdev->otherend,
-+ "feature-abs-pointer", 0)) {
- ret = xenbus_write(XBT_NIL, info->xbdev->nodename,
- "request-abs-pointer", "1");
- if (ret)
+@@ -275,13 +274,12 @@ static void xenkbd_disconnect_backend(st
+ static void xenkbd_set_connected(struct xenbus_device *dev)
+ {
+ struct xenkbd_info *info = dev_get_drvdata(&dev->dev);
+- int ret, val;
+
+- ret = xenbus_scanf(XBT_NIL, info->xbdev->otherend,
+- "feature-abs-pointer", "%d", &val);
+- if (ret > 0 && val) {
+- ret = xenbus_write(XBT_NIL, info->xbdev->nodename,
+- "request-abs-pointer", "1");
++ if (xenbus_read_unsigned(info->xbdev->otherend,
++ "feature-abs-pointer", 0)) {
++ int ret = xenbus_write(XBT_NIL, info->xbdev->nodename,
++ "request-abs-pointer", "1");
++
+ if (ret)
+ printk(KERN_WARNING "xenkbd: can't request abs-pointer");
+ }
--- a/drivers/xen/gntdev/gntdev.c
+++ b/drivers/xen/gntdev/gntdev.c
@@ -24,7 +24,7 @@
diff --git a/patches.xen/xen3-patch-4.11 b/patches.xen/xen3-patch-4.11
index fbf7cc7ec8..5233b10a45 100644
--- a/patches.xen/xen3-patch-4.11
+++ b/patches.xen/xen3-patch-4.11
@@ -10,7 +10,7 @@ Acked-by: jbeulich@suse.com
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -109,7 +109,7 @@ config X86
+@@ -115,7 +115,7 @@ config X86
select HAVE_ARCH_SECCOMP_FILTER
select HAVE_ARCH_TRACEHOOK
select HAVE_ARCH_TRANSPARENT_HUGEPAGE if !XEN
@@ -595,7 +595,7 @@ Acked-by: jbeulich@suse.com
static inline void xen_set_pgd(pgd_t *pgdp, pgd_t pgd)
--- a/arch/x86/include/mach-xen/asm/pgtable_types.h
+++ b/arch/x86/include/mach-xen/asm/pgtable_types.h
-@@ -296,6 +296,8 @@ static inline pgdval_t pgd_flags(pgd_t p
+@@ -300,6 +300,8 @@ static inline pgdval_t pgd_flags(pgd_t p
}
#if CONFIG_PGTABLE_LEVELS > 3
@@ -604,7 +604,7 @@ Acked-by: jbeulich@suse.com
typedef struct { pudval_t pud; } pud_t;
#define __pud_ma(x) ((pud_t) { (x) } )
-@@ -315,6 +317,7 @@ static inline pudval_t xen_pud_val(pud_t
+@@ -319,6 +321,7 @@ static inline pudval_t xen_pud_val(pud_t
return ret;
}
#else
@@ -612,7 +612,7 @@ Acked-by: jbeulich@suse.com
#include <asm-generic/pgtable-nopud.h>
#define __pud_val(x) __pgd_val((x).pgd)
-@@ -349,6 +352,7 @@ static inline pmdval_t xen_pmd_val(pmd_t
+@@ -353,6 +356,7 @@ static inline pmdval_t xen_pmd_val(pmd_t
return ret;
}
#else
@@ -831,7 +831,7 @@ Acked-by: jbeulich@suse.com
/*
* Ring 3 MONITOR/MWAIT feature cannot be detected without
* cpu model and family comparison.
-@@ -103,6 +104,7 @@ static void probe_xeon_phi_r3mwait(struc
+@@ -99,6 +100,7 @@ static void probe_xeon_phi_r3mwait(struc
if (c == &boot_cpu_data)
ELF_HWCAP2 |= HWCAP2_RING3MWAIT;
@@ -3824,8 +3824,8 @@ Acked-by: jbeulich@suse.com
+ struct xs_watch_event *event;
current->flags |= PF_NOFREEZE;
- for (;;) {
-@@ -893,7 +929,7 @@ static int xenwatch_thread(void *unused)
+ xenwatch_pid = current->pid;
+@@ -895,7 +931,7 @@ static int xenwatch_thread(void *unused)
continue;
}
@@ -3834,7 +3834,7 @@ Acked-by: jbeulich@suse.com
#if defined(CONFIG_XEN) || defined(MODULE)
/*
-@@ -904,149 +940,56 @@ static int xenwatch_thread(void *unused)
+@@ -906,149 +942,56 @@ static int xenwatch_thread(void *unused)
* progress. This can occur on resume before the swap
* device is attached.
*/
@@ -4011,9 +4011,9 @@ Acked-by: jbeulich@suse.com
#if !defined(CONFIG_XEN) && !defined(MODULE)
/* Initialize the shared memory rings to talk to xenstored */
-@@ -1060,10 +1003,6 @@ int xs_init(void)
+@@ -1061,10 +1004,6 @@ int xs_init(void)
+ if (IS_ERR(task))
return PTR_ERR(task);
- xenwatch_pid = task->pid;
- task = kthread_run(xenbus_thread, NULL, "xenbus");
- if (IS_ERR(task))
@@ -4054,25 +4054,14 @@ Acked-by: jbeulich@suse.com
#endif /* __LINUX_PUBLIC_PRIVCMD_H__ */
--- a/include/xen/interface/hvm/dm_op.h
+++ b/include/xen/interface/hvm/dm_op.h
-@@ -24,7 +24,7 @@
- #define __XEN_PUBLIC_HVM_DM_OP_H__
-
- struct xen_dm_op_buf {
-- GUEST_HANDLE(void) h;
-+ XEN_GUEST_HANDLE(void) h;
- xen_ulong_t size;
+@@ -385,6 +385,7 @@ struct xen_dm_op_buf {
+ XEN_GUEST_HANDLE(void) h;
+ xen_ulong_t size;
};
- DEFINE_GUEST_HANDLE_STRUCT(xen_dm_op_buf);
---- a/include/xen/interface/xen.h
-+++ b/include/xen/interface/xen.h
-@@ -124,6 +124,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t);
- #define __HYPERVISOR_tmem_op 38
- #define __HYPERVISOR_xc_reserved_op 39 /* reserved for XenClient */
- #define __HYPERVISOR_xenpmu_op 40
-+#define __HYPERVISOR_dm_op 41
-
- /* Architecture-specific hypercall definitions. */
- #define __HYPERVISOR_arch_0 48
++DEFINE_GUEST_HANDLE_STRUCT(xen_dm_op_buf);
+ typedef struct xen_dm_op_buf xen_dm_op_buf_t;
+ DEFINE_XEN_GUEST_HANDLE(xen_dm_op_buf_t);
+
--- a/include/xen/xenbus.h
+++ b/include/xen/xenbus.h
@@ -38,6 +38,7 @@
diff --git a/patches.xen/xen3-patch-4.12 b/patches.xen/xen3-patch-4.12
new file mode 100644
index 0000000000..99f48f480d
--- /dev/null
+++ b/patches.xen/xen3-patch-4.12
@@ -0,0 +1,6244 @@
+From: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
+Subject: Linux: 4.12
+Patch-mainline: Never, SUSE-Xen specific
+References: none
+
+ This patch contains the differences between 4.11 and 4.12.
+
+Automatically created from "patch-4.12" by xen-port-patches.py
+Acked-by: jbeulich@suse.com
+
+--- a/arch/arm/include/asm/device.h
++++ b/arch/arm/include/asm/device.h
+@@ -16,7 +16,7 @@ struct dev_archdata {
+ #ifdef CONFIG_ARM_DMA_USE_IOMMU
+ struct dma_iommu_mapping *mapping;
+ #endif
+-#ifdef CONFIG_XEN
++#ifdef CONFIG_PARAVIRT_XEN
+ const struct dma_map_ops *dev_dma_ops;
+ #endif
+ unsigned int dma_coherent:1;
+--- a/arch/arm/mm/dma-mapping.c
++++ b/arch/arm/mm/dma-mapping.c
+@@ -2408,7 +2408,7 @@ void arch_setup_dma_ops(struct device *d
+
+ set_dma_ops(dev, dma_ops);
+
+-#ifdef CONFIG_XEN
++#ifdef CONFIG_PARAVIRT_XEN
+ if (xen_initial_domain()) {
+ dev->archdata.dev_dma_ops = dev->dma_ops;
+ dev->dma_ops = xen_dma_ops;
+--- a/arch/arm64/include/asm/device.h
++++ b/arch/arm64/include/asm/device.h
+@@ -20,7 +20,7 @@ struct dev_archdata {
+ #ifdef CONFIG_IOMMU_API
+ void *iommu; /* private IOMMU data */
+ #endif
+-#ifdef CONFIG_XEN
++#ifdef CONFIG_PARAVIRT_XEN
+ const struct dma_map_ops *dev_dma_ops;
+ #endif
+ bool dma_coherent;
+--- a/arch/arm64/mm/dma-mapping.c
++++ b/arch/arm64/mm/dma-mapping.c
+@@ -929,7 +929,7 @@ void arch_setup_dma_ops(struct device *d
+ dev->archdata.dma_coherent = coherent;
+ __iommu_setup_dma_ops(dev, dma_base, size, iommu);
+
+-#ifdef CONFIG_XEN
++#ifdef CONFIG_PARAVIRT_XEN
+ if (xen_initial_domain()) {
+ dev->archdata.dev_dma_ops = dev->dma_ops;
+ dev->dma_ops = xen_dma_ops;
+--- a/arch/x86/entry/entry_32-xen.S
++++ b/arch/x86/entry/entry_32-xen.S
+@@ -35,16 +35,13 @@
+ #include <asm/errno.h>
+ #include <asm/segment.h>
+ #include <asm/smp.h>
+-#include <asm/page_types.h>
+ #include <asm/percpu.h>
+ #include <asm/processor-flags.h>
+-#include <asm/ftrace.h>
+ #include <asm/irq_vectors.h>
+ #include <asm/cpufeatures.h>
+ #include <asm/alternative-asm.h>
+ #include <asm/asm.h>
+ #include <asm/smap.h>
+-#include <asm/export.h>
+ #include <asm/frame.h>
+ #include <xen/interface/xen.h>
+
+@@ -259,6 +256,23 @@ ENTRY(__switch_to_asm)
+ END(__switch_to_asm)
+
+ /*
++ * The unwinder expects the last frame on the stack to always be at the same
++ * offset from the end of the page, which allows it to validate the stack.
++ * Calling schedule_tail() directly would break that convention because its an
++ * asmlinkage function so its argument has to be pushed on the stack. This
++ * wrapper creates a proper "end of stack" frame header before the call.
++ */
++ENTRY(schedule_tail_wrapper)
++ FRAME_BEGIN
++
++ pushl %eax
++ call schedule_tail
++ popl %eax
++
++ FRAME_END
++ ret
++ENDPROC(schedule_tail_wrapper)
++/*
+ * A newly forked process directly context switches into this address.
+ *
+ * eax: prev task we switched from
+@@ -266,24 +280,15 @@ END(__switch_to_asm)
+ * edi: kernel thread arg
+ */
+ ENTRY(ret_from_fork)
+- FRAME_BEGIN /* help unwinder find end of stack */
+-
+- /*
+- * schedule_tail() is asmlinkage so we have to put its 'prev' argument
+- * on the stack.
+- */
+- pushl %eax
+- call schedule_tail
+- popl %eax
++ call schedule_tail_wrapper
+
+ testl %ebx, %ebx
+ jnz 1f /* kernel threads are uncommon */
+
+ 2:
+ /* When we fork, we trace the syscall return in the child, too. */
+- leal FRAME_OFFSET(%esp), %eax
++ movl %esp, %eax
+ call syscall_return_slowpath
+- FRAME_END
+ jmp restore_all
+
+ /* kernel thread */
+@@ -604,7 +609,7 @@ ENTRY(iret_exc )
+ * will soon execute iret and the tracer was already set to
+ * the irqstate after the IRET:
+ */
+- DISABLE_INTERRUPTS(CLBR_EAX)
++ DISABLE_INTERRUPTS(CLBR_ANY)
+ lss (%esp), %esp /* switch to espfix segment */
+ jmp .Lrestore_nocheck
+ #endif
+@@ -978,172 +983,6 @@ ENTRY(fixup_4gb_segment)
+ jmp common_exception
+ END(fixup_4gb_segment)
+
+-#ifdef CONFIG_FUNCTION_TRACER
+-#ifdef CONFIG_DYNAMIC_FTRACE
+-
+-ENTRY(mcount)
+- ret
+-END(mcount)
+-
+-ENTRY(ftrace_caller)
+- pushl %eax
+- pushl %ecx
+- pushl %edx
+- pushl $0 /* Pass NULL as regs pointer */
+- movl 4*4(%esp), %eax
+- movl 0x4(%ebp), %edx
+- movl function_trace_op, %ecx
+- subl $MCOUNT_INSN_SIZE, %eax
+-
+-.globl ftrace_call
+-ftrace_call:
+- call ftrace_stub
+-
+- addl $4, %esp /* skip NULL pointer */
+- popl %edx
+- popl %ecx
+- popl %eax
+-.Lftrace_ret:
+-#ifdef CONFIG_FUNCTION_GRAPH_TRACER
+-.globl ftrace_graph_call
+-ftrace_graph_call:
+- jmp ftrace_stub
+-#endif
+-
+-/* This is weak to keep gas from relaxing the jumps */
+-WEAK(ftrace_stub)
+- ret
+-END(ftrace_caller)
+-
+-ENTRY(ftrace_regs_caller)
+- pushf /* push flags before compare (in cs location) */
+-
+- /*
+- * i386 does not save SS and ESP when coming from kernel.
+- * Instead, to get sp, &regs->sp is used (see ptrace.h).
+- * Unfortunately, that means eflags must be at the same location
+- * as the current return ip is. We move the return ip into the
+- * ip location, and move flags into the return ip location.
+- */
+- pushl 4(%esp) /* save return ip into ip slot */
+-
+- pushl $0 /* Load 0 into orig_ax */
+- pushl %gs
+- pushl %fs
+- pushl %es
+- pushl %ds
+- pushl %eax
+- pushl %ebp
+- pushl %edi
+- pushl %esi
+- pushl %edx
+- pushl %ecx
+- pushl %ebx
+-
+- movl 13*4(%esp), %eax /* Get the saved flags */
+- movl %eax, 14*4(%esp) /* Move saved flags into regs->flags location */
+- /* clobbering return ip */
+- movl $__KERNEL_CS, 13*4(%esp)
+-
+- movl 12*4(%esp), %eax /* Load ip (1st parameter) */
+- subl $MCOUNT_INSN_SIZE, %eax /* Adjust ip */
+- movl 0x4(%ebp), %edx /* Load parent ip (2nd parameter) */
+- movl function_trace_op, %ecx /* Save ftrace_pos in 3rd parameter */
+- pushl %esp /* Save pt_regs as 4th parameter */
+-
+-GLOBAL(ftrace_regs_call)
+- call ftrace_stub
+-
+- addl $4, %esp /* Skip pt_regs */
+- movl 14*4(%esp), %eax /* Move flags back into cs */
+- movl %eax, 13*4(%esp) /* Needed to keep addl from modifying flags */
+- movl 12*4(%esp), %eax /* Get return ip from regs->ip */
+- movl %eax, 14*4(%esp) /* Put return ip back for ret */
+-
+- popl %ebx
+- popl %ecx
+- popl %edx
+- popl %esi
+- popl %edi
+- popl %ebp
+- popl %eax
+- popl %ds
+- popl %es
+- popl %fs
+- popl %gs
+- addl $8, %esp /* Skip orig_ax and ip */
+- popf /* Pop flags at end (no addl to corrupt flags) */
+- jmp .Lftrace_ret
+-
+- popf
+- jmp ftrace_stub
+-#else /* ! CONFIG_DYNAMIC_FTRACE */
+-
+-ENTRY(mcount)
+- cmpl $__PAGE_OFFSET, %esp
+- jb ftrace_stub /* Paging not enabled yet? */
+-
+- cmpl $ftrace_stub, ftrace_trace_function
+- jnz .Ltrace
+-#ifdef CONFIG_FUNCTION_GRAPH_TRACER
+- cmpl $ftrace_stub, ftrace_graph_return
+- jnz ftrace_graph_caller
+-
+- cmpl $ftrace_graph_entry_stub, ftrace_graph_entry
+- jnz ftrace_graph_caller
+-#endif
+-.globl ftrace_stub
+-ftrace_stub:
+- ret
+-
+- /* taken from glibc */
+-.Ltrace:
+- pushl %eax
+- pushl %ecx
+- pushl %edx
+- movl 0xc(%esp), %eax
+- movl 0x4(%ebp), %edx
+- subl $MCOUNT_INSN_SIZE, %eax
+-
+- call *ftrace_trace_function
+-
+- popl %edx
+- popl %ecx
+- popl %eax
+- jmp ftrace_stub
+-END(mcount)
+-#endif /* CONFIG_DYNAMIC_FTRACE */
+-EXPORT_SYMBOL(mcount)
+-#endif /* CONFIG_FUNCTION_TRACER */
+-
+-#ifdef CONFIG_FUNCTION_GRAPH_TRACER
+-ENTRY(ftrace_graph_caller)
+- pushl %eax
+- pushl %ecx
+- pushl %edx
+- movl 0xc(%esp), %eax
+- lea 0x4(%ebp), %edx
+- movl (%ebp), %ecx
+- subl $MCOUNT_INSN_SIZE, %eax
+- call prepare_ftrace_return
+- popl %edx
+- popl %ecx
+- popl %eax
+- ret
+-END(ftrace_graph_caller)
+-
+-.globl return_to_handler
+-return_to_handler:
+- pushl %eax
+- pushl %edx
+- movl %ebp, %eax
+- call ftrace_return_to_handler
+- movl %eax, %ecx
+- popl %edx
+- popl %eax
+- jmp *%ecx
+-#endif
+-
+ #ifdef CONFIG_CPU_SUP_AMD
+ # pv syscall call handler stub
+ ENTRY(entry_SYSCALL_PV32)
+--- a/arch/x86/entry/entry_64-xen.S
++++ b/arch/x86/entry/entry_64-xen.S
+@@ -39,7 +39,6 @@
+ #include <asm/smap.h>
+ #include <asm/pgtable_types.h>
+ #include <asm/export.h>
+-#include <asm/frame.h>
+ #include <linux/err.h>
+ #include <xen/interface/xen.h>
+ #include <xen/interface/features.h>
+@@ -338,17 +337,15 @@ END(__switch_to_asm)
+ * r12: kernel thread arg
+ */
+ ENTRY(ret_from_fork)
+- FRAME_BEGIN /* help unwinder find end of stack */
+ movq %rax, %rdi
+- call schedule_tail /* rdi: 'prev' task parameter */
++ call schedule_tail /* rdi: 'prev' task parameter */
+
+- testq %rbx, %rbx /* from kernel_thread? */
+- jnz 1f /* kernel threads are uncommon */
++ testq %rbx, %rbx /* from kernel_thread? */
++ jnz 1f /* kernel threads are uncommon */
+
+ 2:
+- leaq FRAME_OFFSET(%rsp),%rdi /* pt_regs pointer */
++ movq %rsp, %rdi
+ call syscall_return_slowpath /* returns with IRQs disabled */
+- FRAME_END
+ jmp restore_regs_and_iret
+
+ 1:
+@@ -688,7 +685,7 @@ END(paranoid_entry)
+ * On entry, ebx is "no swapgs" flag (1: don't need swapgs, 0: need it)
+ */
+ ENTRY(paranoid_exit)
+- DISABLE_INTERRUPTS(CLBR_NONE)
++ DISABLE_INTERRUPTS(CLBR_ANY)
+ TRACE_IRQS_OFF_DEBUG
+ testl %ebx, %ebx /* swapgs needed? */
+ jnz paranoid_exit_no_swapgs
+--- a/arch/x86/include/asm/e820/types.h
++++ b/arch/x86/include/asm/e820/types.h
+@@ -90,7 +90,11 @@ struct e820_table {
+ /*
+ * Various well-known legacy memory ranges in physical memory:
+ */
++#ifndef CONFIG_XEN
+ #define ISA_START_ADDRESS 0x000a0000
++#else
++#define ISA_START_ADDRESS 0
++#endif
+ #define ISA_END_ADDRESS 0x00100000
+
+ #define BIOS_BEGIN 0x000a0000
+--- a/arch/x86/include/asm/init.h
++++ b/arch/x86/include/asm/init.h
+@@ -6,7 +6,9 @@ struct x86_mapping_info {
+ void *context; /* context for alloc_pgt_page */
+ unsigned long page_flag; /* page flag for PMD or PUD entry */
+ unsigned long offset; /* ident mapping offset */
++#ifndef CONFIG_XEN
+ bool direct_gbpages; /* PUD level 1GB page support */
++#endif
+ };
+
+ int kernel_ident_mapping_init(struct x86_mapping_info *info, pgd_t *pgd_page,
+--- a/arch/x86/include/uapi/asm/e820.h
++++ b/arch/x86/include/uapi/asm/e820.h
+@@ -66,11 +66,7 @@ struct e820map {
+ struct e820entry map[E820_X_MAX];
+ };
+
+-#ifndef CONFIG_XEN
+ #define ISA_START_ADDRESS 0xa0000
+-#else
+-#define ISA_START_ADDRESS 0
+-#endif
+ #define ISA_END_ADDRESS 0x100000
+
+ #define BIOS_BEGIN 0x000a0000
+--- a/arch/x86/include/mach-xen/asm/desc.h
++++ b/arch/x86/include/mach-xen/asm/desc.h
+@@ -4,6 +4,7 @@
+ #include <asm/desc_defs.h>
+ #include <asm/ldt.h>
+ #include <asm/mmu.h>
++#include <asm/fixmap.h>
+
+ #include <linux/smp.h>
+ #include <linux/percpu.h>
+@@ -47,11 +48,43 @@ struct gdt_page {
+
+ DECLARE_PER_CPU_PAGE_ALIGNED(struct gdt_page, gdt_page);
+
+-static inline struct desc_struct *get_cpu_gdt_table(unsigned int cpu)
++/* Provide the original GDT */
++static inline struct desc_struct *get_cpu_gdt_rw(unsigned int cpu)
+ {
+ return per_cpu(gdt_page, cpu).gdt;
+ }
+
++/* Provide the current original GDT */
++static inline struct desc_struct *get_current_gdt_rw(void)
++{
++ return this_cpu_ptr(&gdt_page)->gdt;
++}
++
++/* Get the fixmap index for a specific processor */
++static inline unsigned int get_cpu_gdt_ro_index(int cpu)
++{
++ return FIX_GDT_REMAP_BEGIN + cpu;
++}
++
++/* Provide the fixmap address of the remapped GDT */
++static inline struct desc_struct *get_cpu_gdt_ro(int cpu)
++{
++ unsigned int idx = get_cpu_gdt_ro_index(cpu);
++ return (struct desc_struct *)__fix_to_virt(idx);
++}
++
++/* Provide the current read-only GDT */
++static inline struct desc_struct *get_current_gdt_ro(void)
++{
++ return get_cpu_gdt_ro(smp_processor_id());
++}
++
++/* Provide the physical address of the GDT page. */
++static inline phys_addr_t get_cpu_gdt_paddr(unsigned int cpu)
++{
++ return per_cpu_ptr_to_phys(get_cpu_gdt_rw(cpu));
++}
++
+ #ifdef CONFIG_X86_64
+
+ static inline void pack_gate(gate_desc *gate, unsigned type, unsigned long func,
+@@ -181,7 +214,7 @@ static inline void set_tssldt_descriptor
+
+ static inline void __set_tss_desc(unsigned cpu, unsigned int entry, void *addr)
+ {
+- struct desc_struct *d = get_cpu_gdt_table(cpu);
++ struct desc_struct *d = get_cpu_gdt_rw(cpu);
+ tss_desc tss;
+
+ set_tssldt_descriptor(&tss, (unsigned long)addr, DESC_TSS,
+@@ -201,22 +234,90 @@ static inline void native_set_ldt(const
+
+ set_tssldt_descriptor(&ldt, (unsigned long)addr, DESC_LDT,
+ entries * LDT_ENTRY_SIZE - 1);
+- write_gdt_entry(get_cpu_gdt_table(cpu), GDT_ENTRY_LDT,
++ write_gdt_entry(get_cpu_gdt_rw(cpu), GDT_ENTRY_LDT,
+ &ldt, DESC_LDT);
+ asm volatile("lldt %w0"::"q" (GDT_ENTRY_LDT*8));
+ }
+ }
+
++static inline void native_load_gdt(const struct desc_ptr *dtr)
++{
++ asm volatile("lgdt %0"::"m" (*dtr));
++}
++
++static inline void native_load_idt(const struct desc_ptr *dtr)
++{
++ asm volatile("lidt %0"::"m" (*dtr));
++}
++
++static inline void native_store_gdt(struct desc_ptr *dtr)
++{
++ asm volatile("sgdt %0":"=m" (*dtr));
++}
++
++static inline void native_store_idt(struct desc_ptr *dtr)
++{
++ asm volatile("sidt %0":"=m" (*dtr));
++}
++
++/*
++ * The LTR instruction marks the TSS GDT entry as busy. On 64-bit, the GDT is
++ * a read-only remapping. To prevent a page fault, the GDT is switched to the
++ * original writeable version when needed.
++ */
++#ifdef CONFIG_X86_64
++static inline void native_load_tr_desc(void)
++{
++ struct desc_ptr gdt;
++ int cpu = raw_smp_processor_id();
++ bool restore = 0;
++ struct desc_struct *fixmap_gdt;
++
++ native_store_gdt(&gdt);
++ fixmap_gdt = get_cpu_gdt_ro(cpu);
++
++ /*
++ * If the current GDT is the read-only fixmap, swap to the original
++ * writeable version. Swap back at the end.
++ */
++ if (gdt.address == (unsigned long)fixmap_gdt) {
++ load_direct_gdt(cpu);
++ restore = 1;
++ }
++ asm volatile("ltr %w0"::"q" (GDT_ENTRY_TSS*8));
++ if (restore)
++ load_fixmap_gdt(cpu);
++}
++#else
+ static inline void native_load_tr_desc(void)
+ {
+ asm volatile("ltr %w0"::"q" (GDT_ENTRY_TSS*8));
+ }
++#endif
++
++static inline unsigned long native_store_tr(void)
++{
++ unsigned long tr;
++
++ asm volatile("str %0":"=r" (tr));
++
++ return tr;
++}
++
++static inline void native_load_tls(struct thread_struct *t, unsigned int cpu)
++{
++ struct desc_struct *gdt = get_cpu_gdt_rw(cpu);
++ unsigned int i;
++
++ for (i = 0; i < GDT_ENTRY_TLS_ENTRIES; i++)
++ gdt[GDT_ENTRY_TLS_MIN + i] = t->tls_array[i];
++}
+
+ DECLARE_PER_CPU(bool, __tss_limit_invalid);
+
+ static inline void force_reload_TR(void)
+ {
+- struct desc_struct *d = get_cpu_gdt_table(smp_processor_id());
++ struct desc_struct *d = get_current_gdt_rw();
+ tss_desc tss;
+
+ memcpy(&tss, &d[GDT_ENTRY_TSS], sizeof(tss_desc));
+@@ -263,44 +364,6 @@ static inline void invalidate_tss_limit(
+ else
+ this_cpu_write(__tss_limit_invalid, true);
+ }
+-
+-static inline void native_load_gdt(const struct desc_ptr *dtr)
+-{
+- asm volatile("lgdt %0"::"m" (*dtr));
+-}
+-
+-static inline void native_load_idt(const struct desc_ptr *dtr)
+-{
+- asm volatile("lidt %0"::"m" (*dtr));
+-}
+-
+-static inline void native_store_gdt(struct desc_ptr *dtr)
+-{
+- asm volatile("sgdt %0":"=m" (*dtr));
+-}
+-
+-static inline void native_store_idt(struct desc_ptr *dtr)
+-{
+- asm volatile("sidt %0":"=m" (*dtr));
+-}
+-
+-static inline unsigned long native_store_tr(void)
+-{
+- unsigned long tr;
+-
+- asm volatile("str %0":"=r" (tr));
+-
+- return tr;
+-}
+-
+-static inline void native_load_tls(struct thread_struct *t, unsigned int cpu)
+-{
+- struct desc_struct *gdt = get_cpu_gdt_table(cpu);
+- unsigned int i;
+-
+- for (i = 0; i < GDT_ENTRY_TLS_ENTRIES; i++)
+- gdt[GDT_ENTRY_TLS_MIN + i] = t->tls_array[i];
+-}
+ #else
+ #include <asm/pgtable.h>
+
+@@ -315,7 +378,7 @@ extern int write_gdt_entry(struct desc_s
+ static inline void xen_load_tls(struct thread_struct *t, unsigned int cpu)
+ {
+ unsigned int i;
+- struct desc_struct *gdt = get_cpu_gdt_table(cpu) + GDT_ENTRY_TLS_MIN;
++ struct desc_struct *gdt = get_cpu_gdt_rw(cpu) + GDT_ENTRY_TLS_MIN;
+
+ for (i = 0; i < GDT_ENTRY_TLS_ENTRIES; i++)
+ if (HYPERVISOR_update_descriptor(
+--- /dev/null
++++ b/arch/x86/include/mach-xen/asm/early_ioremap.h
+@@ -0,0 +1,2 @@
++#include <asm-generic/early_ioremap.h>
++#include <asm/e820/api.h>
+--- a/arch/x86/include/mach-xen/asm/fixmap.h
++++ b/arch/x86/include/mach-xen/asm/fixmap.h
+@@ -109,6 +109,10 @@ enum fixed_addresses {
+ #ifdef CONFIG_X86_INTEL_MID
+ FIX_LNW_VRTC,
+ #endif
++ /* Fixmap entries to remap the GDTs, one per processor. */
++ FIX_GDT_REMAP_BEGIN,
++ FIX_GDT_REMAP_END = FIX_GDT_REMAP_BEGIN + NR_CPUS - 1,
++
+ __end_of_permanent_fixed_addresses,
+
+ /*
+--- a/arch/x86/include/mach-xen/asm/hypervisor.h
++++ b/arch/x86/include/mach-xen/asm/hypervisor.h
+@@ -67,8 +67,7 @@ extern start_info_t *xen_start_info;
+ #define is_initial_xendomain() 0
+ #endif
+
+-#define init_hypervisor(c) ((void)(c))
+-#define init_hypervisor_platform() init_hypervisor(&boot_cpu_data)
++#define init_hypervisor_platform() ((void)0)
+
+ #ifdef CONFIG_XEN
+ DECLARE_PER_CPU(struct vcpu_runstate_info, runstate);
+@@ -101,7 +100,8 @@ void xen_invlpg(unsigned long ptr);
+ void xen_l1_entry_update(pte_t *ptr, pte_t val);
+ void xen_l2_entry_update(pmd_t *ptr, pmd_t val);
+ void xen_l3_entry_update(pud_t *ptr, pud_t val); /* x86_64/PAE */
+-void xen_l4_entry_update(pgd_t *ptr, pgd_t val); /* x86_64 only */
++void xen_l4_entry_update(p4d_t *ptr, p4d_t val); /* x86_64 only */
++void xen_l5_entry_update(pgd_t *ptr, pgd_t val); /* 5-level paging only */
+ void xen_pgd_pin(unsigned long ptr);
+ void xen_pgd_unpin(unsigned long ptr);
+
+--- a/arch/x86/include/mach-xen/asm/mmu_context.h
++++ b/arch/x86/include/mach-xen/asm/mmu_context.h
+@@ -320,8 +320,4 @@ static inline bool arch_vma_access_permi
+ return __pkru_allows_pkey(vma_pkey(vma), write);
+ }
+
+-static inline bool arch_pte_access_permitted(pte_t pte, bool write)
+-{
+- return __pkru_allows_pkey(pte_flags_pkey(pte_flags(pte)), write);
+-}
+ #endif /* _ASM_X86_MMU_CONTEXT_H */
+--- a/arch/x86/include/mach-xen/asm/pci.h
++++ b/arch/x86/include/mach-xen/asm/pci.h
+@@ -7,6 +7,7 @@
+ #include <linux/string.h>
+ #include <linux/scatterlist.h>
+ #include <asm/io.h>
++#include <asm/pat.h>
+ #include <asm/x86_init.h>
+
+ #ifdef __KERNEL__
+@@ -108,10 +109,8 @@ int pcibios_set_irq_routing(struct pci_d
+
+
+ #define HAVE_PCI_MMAP
+-extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
+- enum pci_mmap_state mmap_state,
+- int write_combine);
+-
++#define arch_can_pci_mmap_wc() pat_enabled()
++#define ARCH_GENERIC_PCI_MMAP_RESOURCE
+
+ #ifdef CONFIG_PCI
+ extern void early_quirks(void);
+--- a/arch/x86/include/mach-xen/asm/pgalloc.h
++++ b/arch/x86/include/mach-xen/asm/pgalloc.h
+@@ -15,9 +15,11 @@ static inline void paravirt_alloc_pmd(st
+ static inline void paravirt_alloc_pmd_clone(unsigned long pfn, unsigned long clonepfn,
+ unsigned long start, unsigned long count) {}
+ static inline void paravirt_alloc_pud(struct mm_struct *mm, unsigned long pfn) {}
++static inline void paravirt_alloc_p4d(struct mm_struct *mm, unsigned long pfn) {}
+ static inline void paravirt_release_pte(unsigned long pfn) {}
+ static inline void paravirt_release_pmd(unsigned long pfn) {}
+ static inline void paravirt_release_pud(unsigned long pfn) {}
++static inline void paravirt_release_p4d(unsigned long pfn) {}
+
+ #ifdef CONFIG_X86_64
+ void early_make_page_readonly(const void *, unsigned int feature);
+@@ -129,13 +131,12 @@ static inline void pud_populate(struct m
+ #endif /* CONFIG_X86_PAE */
+
+ #if CONFIG_PGTABLE_LEVELS > 3
+-#define __user_pgd(pgd) ((pgd) + PTRS_PER_PGD)
+
+ /*
+- * We need to use the batch mode here, but pgd_pupulate() won't be
++ * We need to use the batch mode here, but p4d_populate() won't be
+ * be called frequently.
+ */
+-static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pud_t *pud)
++static inline void p4d_populate(struct mm_struct *mm, p4d_t *p4d, pud_t *pud)
+ {
+ paravirt_alloc_pud(mm, __pa(pud) >> PAGE_SHIFT);
+ if (unlikely(PagePinned(virt_to_page((mm)->pgd)))) {
+@@ -143,11 +144,15 @@ static inline void pgd_populate(struct m
+ (unsigned long)pud,
+ pfn_pte(virt_to_phys(pud)>>PAGE_SHIFT,
+ PAGE_KERNEL_RO), 0));
+- set_pgd(pgd, __pgd(_PAGE_TABLE | __pa(pud)));
+- set_pgd(__user_pgd(pgd), __pgd(_PAGE_TABLE | __pa(pud)));
++ set_p4d(p4d, __p4d(_PAGE_TABLE | __pa(pud)));
++#if CONFIG_PGTABLE_LEVELS == 4
++ set_p4d(__user_p4d(p4d), __p4d(_PAGE_TABLE | __pa(pud)));
++#endif
+ } else {
+- *(pgd) = __pgd(_PAGE_TABLE | __pa(pud));
+- *__user_pgd(pgd) = *(pgd);
++ *(p4d) = __p4d(_PAGE_TABLE | __pa(pud));
++#if CONFIG_PGTABLE_LEVELS == 4
++ *__user_p4d(p4d) = *(p4d);
++#endif
+ }
+ }
+
+@@ -170,6 +175,48 @@ static inline void __pud_free_tlb(struct
+ ___pud_free_tlb(tlb, pud);
+ }
+
++#if CONFIG_PGTABLE_LEVELS > 4
++
++/*
++ * We need to use the batch mode here, but pgd_populate() won't be
++ * be called frequently.
++ */
++static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, p4d_t *p4d)
++{
++ paravirt_alloc_p4d(mm, __pa(p4d) >> PAGE_SHIFT);
++ if (unlikely(PagePinned(virt_to_page((mm)->pgd)))) {
++ BUG_ON(HYPERVISOR_update_va_mapping(
++ (unsigned long)p4d,
++ pfn_pte(virt_to_phys(p4d)>>PAGE_SHIFT,
++ PAGE_KERNEL_RO), 0));
++ set_pgd(pgd, __pgd(_PAGE_TABLE | __pa(p4d)));
++ set_pgd(__user_pgd(pgd), __pgd(_PAGE_TABLE | __pa(p4d)));
++ } else {
++ *(pgd) = __pgd(_PAGE_TABLE | __pa(p4d));
++ *__user_pgd(pgd) = *(pgd);
++ }
++}
++
++static inline p4d_t *p4d_alloc_one(struct mm_struct *mm, unsigned long addr)
++{
++ return (p4d_t *)pmd_alloc_one(mm, addr);
++}
++
++static inline void p4d_free(struct mm_struct *mm, p4d_t *p4d)
++{
++ BUG_ON((unsigned long)p4d & (PAGE_SIZE-1));
++ __pmd_free(virt_to_page(p4d));
++}
++
++extern void ___p4d_free_tlb(struct mmu_gather *tlb, p4d_t *p4d);
++
++static inline void __p4d_free_tlb(struct mmu_gather *tlb, p4d_t *p4d,
++ unsigned long address)
++{
++ ___p4d_free_tlb(tlb, p4d);
++}
++
++#endif /* CONFIG_PGTABLE_LEVELS > 4 */
+ #endif /* CONFIG_PGTABLE_LEVELS > 3 */
+ #endif /* CONFIG_PGTABLE_LEVELS > 2 */
+
+--- a/arch/x86/include/mach-xen/asm/pgtable.h
++++ b/arch/x86/include/mach-xen/asm/pgtable.h
+@@ -2,8 +2,6 @@
+ #define _ASM_X86_PGTABLE_H
+
+ #include <asm/page.h>
+-#include <asm/e820.h>
+-
+ #include <asm/pgtable_types.h>
+
+ /*
+@@ -47,11 +45,19 @@ extern struct mm_struct *pgd_page_get_mm
+
+ #define set_pmd(pmdp, pmd) xen_set_pmd(pmdp, pmd)
+
+-#ifndef __PAGETABLE_PUD_FOLDED
++#ifndef __PAGETABLE_P4D_FOLDED
+ #define set_pgd(pgdp, pgd) xen_set_pgd(pgdp, pgd)
+ #define pgd_clear(pgd) xen_pgd_clear(pgd)
+ #endif
+
++#ifndef set_p4d
++# define set_p4d(p4dp, p4d) xen_set_p4d(p4dp, p4d)
++#endif
++
++#ifndef __PAGETABLE_PUD_FOLDED
++#define p4d_clear(p4d) xen_p4d_clear(p4d)
++#endif
++
+ #ifndef set_pud
+ # define set_pud(pudp, pud) xen_set_pud(pudp, pud)
+ #endif
+@@ -68,6 +74,11 @@ extern struct mm_struct *pgd_page_get_mm
+ #define pgd_val(x) xen_pgd_val(x)
+ #define __pgd(x) xen_make_pgd(x)
+
++#ifndef __PAGETABLE_P4D_FOLDED
++#define p4d_val(x) xen_p4d_val(x)
++#define __p4d(x) xen_make_p4d(x)
++#endif
++
+ #ifndef __PAGETABLE_PUD_FOLDED
+ #define pud_val(x) xen_pud_val(x)
+ #define __pud(x) xen_make_pud(x)
+@@ -175,6 +186,17 @@ static inline unsigned long pud_pfn(pud_
+ return (pud_val(pud) & pud_pfn_mask(pud)) >> PAGE_SHIFT;
+ }
+
++static inline unsigned long p4d_pfn(p4d_t p4d)
++{
++ return (p4d_val(p4d) & p4d_pfn_mask(p4d)) >> PAGE_SHIFT;
++}
++