Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2014-11-20 10:19:35 +0100
committerJan Beulich <jbeulich@suse.com>2014-11-20 10:19:35 +0100
commitc2cd2fcd33ba0e8d39a4358822019be162e0e11a (patch)
treed2c80aee3d42542d57e8c0bb4f89b46142c9ff8d
parent96f9010fa4ab13a140813c5eb2a3227140180094 (diff)
- x86: use optimized ioresource lookup in ioremap function
(Boot time optimisations (bnc#895387)). - Refresh patches.xen/xen3-patch-2.6.37.
-rw-r--r--patches.xen/xen3-patch-2.6.372
-rw-r--r--patches.xen/xen3-x86-use-optimized-ioresource-lookup-in-ioremap-function.patch76
-rw-r--r--series.conf1
3 files changed, 77 insertions, 2 deletions
diff --git a/patches.xen/xen3-patch-2.6.37 b/patches.xen/xen3-patch-2.6.37
index f6003306e9..2bde81c7e6 100644
--- a/patches.xen/xen3-patch-2.6.37
+++ b/patches.xen/xen3-patch-2.6.37
@@ -1,5 +1,3 @@
-TODO: xen_add_device() needs to reserve space for the optarr[] member (when setting XEN_PCI_DEV_PXM)
-
From: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Linux: 2.6.37
Patch-mainline: 2.6.37
diff --git a/patches.xen/xen3-x86-use-optimized-ioresource-lookup-in-ioremap-function.patch b/patches.xen/xen3-x86-use-optimized-ioresource-lookup-in-ioremap-function.patch
new file mode 100644
index 0000000000..755930a577
--- /dev/null
+++ b/patches.xen/xen3-x86-use-optimized-ioresource-lookup-in-ioremap-function.patch
@@ -0,0 +1,76 @@
+From 461d340b4698b15787748aedb9048a9982aa6332 Mon Sep 17 00:00:00 2001
+From: Mike Travis <travis@sgi.com>
+Date: Mon, 13 Oct 2014 15:54:05 -0700
+Subject: [PATCH] x86: use optimized ioresource lookup in ioremap function
+
+References: Boot time optimisations (bnc#895387)
+Patch-mainline: v3.18
+
+Use the optimized ioresource lookup, "region_is_ram", for the ioremap
+function. If the region is not found, it falls back to the
+"page_is_ram" function. If it is found and it is RAM, then the usual
+warning message is issued, and the ioremap operation is aborted.
+Otherwise, the ioremap operation continues.
+
+Signed-off-by: Mike Travis <travis@sgi.com>
+Acked-by: Alex Thorlton <athorlton@sgi.com>
+Reviewed-by: Cliff Wickman <cpw@sgi.com>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: H. Peter Anvin <hpa@zytor.com>
+Cc: Mark Salter <msalter@redhat.com>
+Cc: Dave Young <dyoung@redhat.com>
+Cc: Rik van Riel <riel@redhat.com>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Mel Gorman <mgorman@suse.de>
+Cc: Ingo Molnar <mingo@elte.hu>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Mel Gorman <mgorman@suse.de>
+Automatically created from "patches.suse/x86-use-optimized-ioresource-lookup-in-ioremap-function.patch" by xen-port-patches.py
+
+--- sle11sp3.orig/arch/x86/mm/ioremap-xen.c 2011-08-22 11:31:41.000000000 +0200
++++ sle11sp3/arch/x86/mm/ioremap-xen.c 2014-10-31 13:48:09.000000000 +0100
+@@ -235,6 +235,7 @@ static void __iomem *__ioremap_caller(re
+ int retval;
+ domid_t domid = DOMID_IO;
+ void __iomem *ret_addr;
++ int ram_region;
+
+ /* Don't allow wraparound or zero size */
+ last_addr = phys_addr + size - 1;
+@@ -257,14 +258,27 @@ static void __iomem *__ioremap_caller(re
+ /*
+ * Don't allow anybody to remap normal RAM that we're using..
+ */
+- last_mfn = PFN_DOWN(last_addr);
+- for (mfn = PFN_DOWN(phys_addr); mfn <= last_mfn; mfn++) {
+- unsigned long pfn = mfn_to_local_pfn(mfn);
+-
+- if (pfn_valid(pfn)) {
+- if (!PageReserved(pfn_to_page(pfn)))
+- return NULL;
+- domid = DOMID_SELF;
++ /* First check if whole region can be identified as RAM or not */
++ ram_region = is_initial_xendomain() ? region_is_ram(phys_addr, size)
++ : -1;
++ if (ram_region > 0) {
++ WARN_ONCE(1, "ioremap on RAM at %#Lx - %#Lx\n",
++ (unsigned long long)phys_addr,
++ (unsigned long long)last_addr);
++ return NULL;
++ }
++
++ /* If could not be identified(-1), check page by page */
++ if (ram_region < 0) {
++ last_mfn = PFN_DOWN(last_addr);
++ for (mfn = PFN_DOWN(phys_addr); mfn <= last_mfn; mfn++) {
++ unsigned long pfn = mfn_to_local_pfn(mfn);
++
++ if (pfn_valid(pfn)) {
++ if (!PageReserved(pfn_to_page(pfn)))
++ return NULL;
++ domid = DOMID_SELF;
++ }
+ }
+ }
+ WARN_ON_ONCE(domid == DOMID_SELF);
diff --git a/series.conf b/series.conf
index 4a21997e45..f0379a9b27 100644
--- a/series.conf
+++ b/series.conf
@@ -16883,6 +16883,7 @@
patches.xen/xen3-thp-avoid-atomic64_read-in-pmd_read_atomic-for-32-bit-PAE.patch
patches.xen/xen3-mm-Cross-Memory-Attach.patch
patches.xen/xen3-lockref-implement-lockless-reference-count-updates-using-cmpxchg
+ patches.xen/xen3-x86-use-optimized-ioresource-lookup-in-ioremap-function.patch
patches.xen/xen3-pnp_fix_misleading_error_msg.patch
patches.xen/xen3-btrfs-0480-change-scrub-to-support-big-blocks.patch
patches.xen/xen3-scsi_error-classify-some-ILLEGAL_REQUEST-sense-.patch