Linux 3.1-git4 (upstream dc47d3810cdc)

This commit is contained in:
Josh Boyer 2011-11-01 15:13:32 -04:00
parent bf976a17c4
commit 906f34d53b
16 changed files with 28 additions and 2098 deletions

View File

@ -1,54 +0,0 @@
From 6b7025ea927d290a59d2772828435c1893f0267f Mon Sep 17 00:00:00 2001
From: Rik van Riel <riel@redhat.com>
Date: Fri, 7 Oct 2011 16:17:22 +0100
Subject: [PATCH 1/2] mm: vmscan: Limit direct reclaim for higher order
allocations
When suffering from memory fragmentation due to unfreeable pages,
THP page faults will repeatedly try to compact memory. Due to the
unfreeable pages, compaction fails.
Needless to say, at that point page reclaim also fails to create
free contiguous 2MB areas. However, that doesn't stop the current
code from trying, over and over again, and freeing a minimum of 4MB
(2UL << sc->order pages) at every single invocation.
This resulted in my 12GB system having 2-3GB free memory, a
corresponding amount of used swap and very sluggish response times.
This can be avoided by having the direct reclaim code not reclaim from
zones that already have plenty of free memory available for compaction.
If compaction still fails due to unmovable memory, doing additional
reclaim will only hurt the system, not help.
Signed-off-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Mel Gorman <mgorman@suse.de>
---
mm/vmscan.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 6072d74..8c03534 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2022,6 +2022,16 @@ static void shrink_zones(int priority, struct zonelist *zonelist,
continue;
if (zone->all_unreclaimable && priority != DEF_PRIORITY)
continue; /* Let kswapd poll it */
+ if (COMPACTION_BUILD) {
+ /*
+ * If we already have plenty of memory free
+ * for compaction, don't free any more.
+ */
+ if (sc->order > PAGE_ALLOC_COSTLY_ORDER &&
+ (compaction_suitable(zone, sc->order) ||
+ compaction_deferred(zone)))
+ continue;
+ }
/*
* This steals pages from memory cgroups over softlimit
* and returns the number of reclaimed pages and
--
1.7.6.4

View File

@ -1,81 +0,0 @@
From c01043c9aa51a63bd01c60e53494ca4a7e994542 Mon Sep 17 00:00:00 2001
From: Mel Gorman <mgorman@suse.de>
Date: Fri, 7 Oct 2011 16:17:23 +0100
Subject: [PATCH 2/2] mm: Abort reclaim/compaction if compaction can proceed
If compaction can proceed, shrink_zones() stops doing any work but
the callers still shrink_slab(), raises the priority and potentially
sleeps. This patch aborts direct reclaim/compaction entirely if
compaction can proceed.
Signed-off-by: Mel Gorman <mgorman@suse.de>
---
mm/vmscan.c | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 8c03534..b295a38 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2000,14 +2000,19 @@ restart:
*
* If a zone is deemed to be full of pinned pages then just give it a light
* scan then give up on it.
+ *
+ * This function returns true if a zone is being reclaimed for a costly
+ * high-order allocation and compaction is either ready to begin or deferred.
+ * This indicates to the caller that it should retry the allocation or fail.
*/
-static void shrink_zones(int priority, struct zonelist *zonelist,
+static bool shrink_zones(int priority, struct zonelist *zonelist,
struct scan_control *sc)
{
struct zoneref *z;
struct zone *zone;
unsigned long nr_soft_reclaimed;
unsigned long nr_soft_scanned;
+ bool should_abort_reclaim = false;
for_each_zone_zonelist_nodemask(zone, z, zonelist,
gfp_zone(sc->gfp_mask), sc->nodemask) {
@@ -2025,12 +2030,15 @@ static void shrink_zones(int priority, struct zonelist *zonelist,
if (COMPACTION_BUILD) {
/*
* If we already have plenty of memory free
- * for compaction, don't free any more.
+ * for compaction in this zone , don't free any
+ * more.
*/
if (sc->order > PAGE_ALLOC_COSTLY_ORDER &&
(compaction_suitable(zone, sc->order) ||
- compaction_deferred(zone)))
+ compaction_deferred(zone))) {
+ should_abort_reclaim = true;
continue;
+ }
}
/*
* This steals pages from memory cgroups over softlimit
@@ -2049,6 +2057,8 @@ static void shrink_zones(int priority, struct zonelist *zonelist,
shrink_zone(priority, zone, sc);
}
+
+ return should_abort_reclaim;
}
static bool zone_reclaimable(struct zone *zone)
@@ -2113,7 +2123,9 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist,
sc->nr_scanned = 0;
if (!priority)
disable_swap_token(sc->mem_cgroup);
- shrink_zones(priority, zonelist, sc);
+ if (shrink_zones(priority, zonelist, sc))
+ break;
+
/*
* Don't shrink slabs when reclaiming memory from
* over limit cgroups
--
1.7.6.4

6
TODO
View File

@ -1,18 +1,12 @@
**** Queued for 3.2 ***********************************************************************************
* linux-2.6-debug-taint-vm.patch
* epoll-fix-spurious-lockdep-warnings.patch
* hvcs_pi_buf_alloc.patch
* acpi-ensure-thermal-limits-match-cpu-freq.patch
* revert-efi-rtclock.patch
* block-stray-block-put-after-teardown.patch
* crypto-register-cryptd-first.patch
* efi-dont-map-boot-services-on-32bit.patch
* powerpc-Fix-deadlock-in-icswx-code.patch
* usb-add-quirk-for-logitech-webcams.patch (reworked, sent upstream)
* 000[12]-mm-*
* x86-efi-Calling-__pa-with-an-ioremap-address-is-invalid.patch (also CC'd to
stable)
* epoll-limit-paths.patch (in linux-next via -mm tree)
**** Other stuff that should go upstream (in decreasing likelyhood) ************************************

View File

@ -55,6 +55,7 @@ CONFIG_HIGH_RES_TIMERS=y
CONFIG_LEDS=y
CONFIG_LEDS_CPU=y
# CONFIG_LEDS_RENESAS_TPU is not set
CONFIG_MTD_AFS_PARTS=y
CONFIG_MTD_ARM_INTEGRATOR=y

View File

@ -688,6 +688,8 @@ CONFIG_VIDEO_OMAP2_VOUT=m
# CONFIG_VIDEO_AU0828 is not set
# CONFIG_VIDEO_SR030PC30 is not set
# CONFIG_VIDEO_OMAP3 is not set
# CONFIG_VIDEO_MT9P031 is not set
# CONFIG_VIDEO_MT9T001 is not set
# CONFIG_SOC_CAMERA is not set
CONFIG_USB_ET61X251=m
CONFIG_USB_SN9C102=m

View File

@ -2094,7 +2094,6 @@ CONFIG_INPUT_UINPUT=m
CONFIG_INPUT_WISTRON_BTNS=m
CONFIG_INPUT_ATLAS_BTNS=m
CONFIG_INPUT_ATI_REMOTE=m
CONFIG_INPUT_ATI_REMOTE2=m
CONFIG_INPUT_KEYSPAN_REMOTE=m
@ -2628,6 +2627,9 @@ CONFIG_VIDEO_ZORAN_LML33R10=m
CONFIG_VIDEO_ZORAN_ZR36060=m
CONFIG_VIDEO_FB_IVTV=m
CONFIG_VIDEO_SAA7164=m
CONFIG_VIDEO_TM6000=m
CONFIG_VIDEO_TM6000_ALSA=m
CONFIG_VIDEO_TM6000_DVB=m
CONFIG_VIDEO_TLG2300=m
# CONFIG_VIDEO_TIMBERDALE is not set
# CONFIG_VIDEO_M5MOLS is not set
@ -2755,6 +2757,13 @@ CONFIG_DVB_USB_ANYSEE=m
CONFIG_DVB_USB_DW2102=m
CONFIG_DVB_USB_FRIIO=m
CONFIG_DVB_USB_EC168=m
CONFIG_DVB_USB_PCTV452E=m
CONFIG_DVB_USB_IT913X=m
CONFIG_DVB_USB_MXL111SF=m
CONFIG_DVB_TDA10071=m
CONFIG_DVB_LNBP22=m
CONFIG_DVB_A8293=m
CONFIG_DVB_IT913X_FE=m
CONFIG_DVB_DM1105=m
CONFIG_DVB_S921=m
CONFIG_DVB_ISL6405=m
@ -2834,6 +2843,7 @@ CONFIG_VIDEO_PVRUSB2_SYSFS=y
CONFIG_RC_CORE=m
CONFIG_RC_LOOPBACK=m
CONFIG_RC_MAP=m
CONFIG_RC_ATI_REMOTE=m
CONFIG_IR_NEC_DECODER=m
CONFIG_IR_RC5_DECODER=m
CONFIG_IR_RC6_DECODER=m
@ -2849,6 +2859,7 @@ CONFIG_IR_NUVOTON=m
CONFIG_IR_FINTEK=m
CONFIG_IR_REDRAT3=m
CONFIG_V4L_MEM2MEM_DRIVERS=y
# CONFIG_VIDEO_MEM2MEM_TESTDEV is not set
@ -3308,6 +3319,7 @@ CONFIG_USB_GSPCA_SPCA561=m
CONFIG_USB_GSPCA_STK014=m
CONFIG_USB_GSPCA_SUNPLUS=m
CONFIG_USB_GSPCA_T613=m
CONFIG_USB_GSPCA_TOPRO=m
CONFIG_USB_GSPCA_TV8532=m
CONFIG_USB_GSPCA_VC032X=m
CONFIG_USB_GSPCA_ZC3XX=m
@ -3954,6 +3966,9 @@ CONFIG_CRYPTO_ANSI_CPRNG=m
CONFIG_CRYPTO_DEV_HIFN_795X=m
CONFIG_CRYPTO_DEV_HIFN_795X_RNG=y
CONFIG_CRYPTO_PCRYPT=m
CONFIG_CRYPTO_USER=m
# Random number generation
@ -4413,7 +4428,6 @@ CONFIG_UWB_I1480U=m
CONFIG_STAGING=y
# CONFIG_ET131X is not set
# CONFIG_SLICOSS is not set
# CONFIG_VIDEO_TM6000 is not set
# CONFIG_WLAGS49_H2 is not set
# CONFIG_WLAGS49_H25 is not set
# CONFIG_VIDEO_DT3155 is not set
@ -4461,7 +4475,7 @@ CONFIG_USB_ATMEL=m
# CONFIG_TOUCHSCREEN_CLEARPAD_TM1217 is not set
# CONFIG_RTS_PSTOR is not set
# CONFIG_DRM_PSB is not set
# CONFIG_ALTERA_STAPL is not set
CONFIG_ALTERA_STAPL=m
# CONFIG_DVB_CXD2099 is not set
# CONFIG_USBIP_CORE is not set
# CONFIG_BRCMSMAC is not set

View File

@ -44,6 +44,9 @@ CONFIG_CRYPTO_AES_X86_64=y
CONFIG_CRYPTO_TWOFISH_X86_64=m
CONFIG_CRYPTO_SALSA20_X86_64=m
CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL=m
CONFIG_CRYPTO_SHA1_SSSE3=m
CONFIG_CRYPTO_BLOWFISH_X86_64=m
CONFIG_CRYPTO_TWOFISH_X86_64_3WAY=m
# CONFIG_I2C_ALI1535 is not set
# CONFIG_I2C_ALI1563 is not set

View File

@ -1,26 +0,0 @@
commit 9d4c522a113f6caa8b792ae829a25490fa87b1a2
Author: Herbert Xu <herbert@gondor.apana.org.au>
Date: Fri Aug 19 16:11:23 2011 +0800
crypto: cryptd - Use subsys_initcall to prevent races with aesni
As cryptd is depeneded on by other algorithms such as aesni-intel,
it needs to be registered before them. When everything is built
as modules, this occurs naturally. However, for this to work when
they are built-in, we need to use subsys_initcall in cryptd.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
diff --git a/crypto/cryptd.c b/crypto/cryptd.c
index e46d21a..671d4d6 100644
--- a/crypto/cryptd.c
+++ b/crypto/cryptd.c
@@ -945,7 +945,7 @@ static void __exit cryptd_exit(void)
crypto_unregister_template(&cryptd_tmpl);
}
-module_init(cryptd_init);
+subsys_initcall(cryptd_init);
module_exit(cryptd_exit);
MODULE_LICENSE("GPL");

View File

@ -1,119 +0,0 @@
From: Nelson Elhage <nelhage@nelhage.com>
Subject: epoll: fix suprious lockdep warnings
epoll can acquire multiple ep->mutex on multiple "struct eventpoll"s
at once in the case where one epoll fd is monitoring another epoll
fd. This is perfectly OK, since we're careful about the lock ordering,
but causes spurious lockdep warnings. Annotate the recursion using
mutex_lock_nested, and add a comment explaining the nesting rules for
good measure.
Reported-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Nelson Elhage <nelhage@nelhage.com>
---
I've tested this on a synthetic epoll test case, that just adds e1 to
e2 and then does an epoll_wait(). I verified that it caused lockdep
problems on 3.0 and that this patch fixed it, but I haven't done more
extensive testing. Paul, are you able to test systemd against this?
fs/eventpoll.c | 25 ++++++++++++++++++-------
1 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index f9cfd16..0cb7bc6 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -76,6 +76,15 @@
* Events that require holding "epmutex" are very rare, while for
* normal operations the epoll private "ep->mtx" will guarantee
* a better scalability.
+ * It is possible to acquire multiple "ep->mtx"es at once in the case
+ * when one epoll fd is added to another. In this case, we always
+ * acquire the locks in the order of nesting (i.e. after epoll_ctl(e1,
+ * EPOLL_CTL_ADD, e2), e1->mtx will always be acquired before
+ * e2->mtx). Since we disallow cycles of epoll file descriptors, this
+ * ensures that the mutexes are well-ordered. In order to communicate
+ * this nesting to lockdep, when walking a tree of epoll file
+ * descriptors, we use the current recursion depth as the lockdep
+ * subkey.
*/
/* Epoll private bits inside the event mask */
@@ -464,13 +473,15 @@ static void ep_unregister_pollwait(struct eventpoll *ep, struct epitem *epi)
* @ep: Pointer to the epoll private data structure.
* @sproc: Pointer to the scan callback.
* @priv: Private opaque data passed to the @sproc callback.
+ * @depth: The current depth of recursive f_op->poll calls.
*
* Returns: The same integer error code returned by the @sproc callback.
*/
static int ep_scan_ready_list(struct eventpoll *ep,
int (*sproc)(struct eventpoll *,
struct list_head *, void *),
- void *priv)
+ void *priv,
+ int depth)
{
int error, pwake = 0;
unsigned long flags;
@@ -481,7 +492,7 @@ static int ep_scan_ready_list(struct eventpoll *ep,
* We need to lock this because we could be hit by
* eventpoll_release_file() and epoll_ctl().
*/
- mutex_lock(&ep->mtx);
+ mutex_lock_nested(&ep->mtx, depth);
/*
* Steal the ready list, and re-init the original one to the
@@ -670,7 +681,7 @@ static int ep_read_events_proc(struct eventpoll *ep, struct list_head *head,
static int ep_poll_readyevents_proc(void *priv, void *cookie, int call_nests)
{
- return ep_scan_ready_list(priv, ep_read_events_proc, NULL);
+ return ep_scan_ready_list(priv, ep_read_events_proc, NULL, call_nests + 1);
}
static unsigned int ep_eventpoll_poll(struct file *file, poll_table *wait)
@@ -737,7 +748,7 @@ void eventpoll_release_file(struct file *file)
ep = epi->ep;
list_del_init(&epi->fllink);
- mutex_lock(&ep->mtx);
+ mutex_lock_nested(&ep->mtx, 0);
ep_remove(ep, epi);
mutex_unlock(&ep->mtx);
}
@@ -1134,7 +1145,7 @@ static int ep_send_events(struct eventpoll *ep,
esed.maxevents = maxevents;
esed.events = events;
- return ep_scan_ready_list(ep, ep_send_events_proc, &esed);
+ return ep_scan_ready_list(ep, ep_send_events_proc, &esed, 0);
}
static inline struct timespec ep_set_mstimeout(long ms)
@@ -1267,7 +1278,7 @@ static int ep_loop_check_proc(void *priv, void *cookie, int call_nests)
struct rb_node *rbp;
struct epitem *epi;
- mutex_lock(&ep->mtx);
+ mutex_lock_nested(&ep->mtx, call_nests + 1);
for (rbp = rb_first(&ep->rbr); rbp; rbp = rb_next(rbp)) {
epi = rb_entry(rbp, struct epitem, rbn);
if (unlikely(is_file_epoll(epi->ffd.file))) {
@@ -1409,7 +1420,7 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
}
- mutex_lock(&ep->mtx);
+ mutex_lock_nested(&ep->mtx, 0);
/*
* Try to lookup the file inside our RB tree, Since we grabbed "mtx"
--
1.7.4.1
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

View File

@ -84,7 +84,7 @@ Summary: The Linux kernel
# The rc snapshot level
%define rcrev 0
# The git snapshot level
%define gitrev 3
%define gitrev 4
# Set rpm version accordingly
%define rpmversion 3.%{upstream_sublevel}.0
%endif
@ -623,8 +623,6 @@ Patch100: taint-vbox.patch
Patch160: linux-2.6-32bit-mmap-exec-randomization.patch
Patch161: linux-2.6-i386-nx-emulation.patch
Patch202: linux-2.6-debug-taint-vm.patch
Patch383: linux-2.6-defaults-aspm.patch
Patch390: linux-2.6-defaults-acpi-video.patch
@ -674,10 +672,6 @@ Patch2899: linux-2.6-v4l-dvb-fixes.patch
Patch2900: linux-2.6-v4l-dvb-update.patch
Patch2901: linux-2.6-v4l-dvb-experimental.patch
Patch2903: media-DiBcom-protect-the-I2C-bufer-access.patch
Patch2904: media-dib0700-protect-the-dib0700-buffer-access.patch
Patch2905: media-dib0700-correct-error-message.patch
# fs fixes
# NFSv4
@ -685,12 +679,8 @@ Patch2905: media-dib0700-correct-error-message.patch
# patches headed upstream
Patch12016: disable-i8042-check-on-apple-mac.patch
Patch12022: x86-efi-Calling-__pa-with-an-ioremap-address-is-invalid.patch
Patch12024: epoll-fix-spurious-lockdep-warnings.patch
Patch12026: block-stray-block-put-after-teardown.patch
Patch12027: usb-add-quirk-for-logitech-webcams.patch
Patch12029: crypto-register-cryptd-first.patch
Patch12030: epoll-limit-paths.patch
Patch12303: dmar-disable-when-ricoh-multifunction.patch
@ -709,10 +699,6 @@ Patch20000: utrace.patch
Patch21000: arm-omap-dt-compat.patch
Patch21001: arm-smsc-support-reading-mac-address-from-device-tree.patch
#rhbz #735946
Patch21020: 0001-mm-vmscan-Limit-direct-reclaim-for-higher-order-allo.patch
Patch21021: 0002-mm-Abort-reclaim-compaction-if-compaction-can-procee.patch
#rhbz 749166
Patch21050: xfs-Fix-possible-memory-corruption-in-xfs_readlink.patch
@ -1245,9 +1231,6 @@ ApplyPatch linux-2.6-acpi-debug-infinite-loop.patch
ApplyPatch acpi-ensure-thermal-limits-match-cpu-freq.patch
ApplyPatch acpi-sony-nonvs-blacklist.patch
# Various low-impact patches to aid debugging.
ApplyPatch linux-2.6-debug-taint-vm.patch
#
# PCI
#
@ -1320,15 +1303,10 @@ ApplyOptionalPatch linux-2.6-v4l-dvb-experimental.patch
# Patches headed upstream
ApplyPatch disable-i8042-check-on-apple-mac.patch
ApplyPatch epoll-fix-spurious-lockdep-warnings.patch
ApplyPatch epoll-limit-paths.patch
ApplyPatch block-stray-block-put-after-teardown.patch
ApplyPatch usb-add-quirk-for-logitech-webcams.patch
ApplyPatch crypto-register-cryptd-first.patch
ApplyPatch x86-efi-Calling-__pa-with-an-ioremap-address-is-invalid.patch
# rhbz#605888
ApplyPatch dmar-disable-when-ricoh-multifunction.patch
@ -1340,17 +1318,9 @@ ApplyPatch hvcs_pi_buf_alloc.patch
ApplyPatch powerpc-Fix-deadlock-in-icswx-code.patch
ApplyPatch media-DiBcom-protect-the-I2C-bufer-access.patch
ApplyPatch media-dib0700-protect-the-dib0700-buffer-access.patch
ApplyPatch media-dib0700-correct-error-message.patch
# utrace.
ApplyPatch utrace.patch
#rhbz #735946
ApplyPatch 0001-mm-vmscan-Limit-direct-reclaim-for-higher-order-allo.patch
ApplyPatch 0002-mm-Abort-reclaim-compaction-if-compaction-can-procee.patch
ApplyPatch select-regmap-from-wm8400.patch
#rhbz 750402
@ -2059,6 +2029,9 @@ fi
# ||----w |
# || ||
%changelog
* Tue Nov 01 2011 Josh Boyer <jwboyer@redhat.com>
- Linux 3.1-git4
* Tue Nov 01 2011 Dave Jones <davej@redhat.com>
- allow building the perf rpm for ARM (rhbz 741325)

View File

@ -1,66 +0,0 @@
From 77c78bac236c7b07d390be65f357c85a79cce890 Mon Sep 17 00:00:00 2001
From: Dave Jones <davej@redhat.com>
Date: Wed, 26 Oct 2011 18:44:26 -0400
Subject: [PATCH] Add more debugging information to the VM subsystem
Dump modules in bad_page, and print taint information in other areas
---
mm/page_alloc.c | 1 +
mm/slab.c | 8 ++++----
mm/slub.c | 2 +-
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 6e8ecb6..83a0205 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -318,6 +318,7 @@ static void bad_page(struct page *page)
current->comm, page_to_pfn(page));
dump_page(page);
+ print_modules();
dump_stack();
out:
/* Leave bad fields for debug, except PageBuddy could make trouble */
diff --git a/mm/slab.c b/mm/slab.c
index 708efe8..114a66d 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -1927,8 +1927,8 @@ static void check_poison_obj(struct kmem_cache *cachep, void *objp)
/* Print header */
if (lines == 0) {
printk(KERN_ERR
- "Slab corruption: %s start=%p, len=%d\n",
- cachep->name, realobj, size);
+ "Slab corruption (%s): %s start=%p, len=%d\n",
+ print_tainted(), cachep->name, realobj, size);
print_objinfo(cachep, objp, 0);
}
/* Hexdump the affected line */
@@ -3037,8 +3037,8 @@ static void check_slabp(struct kmem_cache *cachep, struct slab *slabp)
if (entries != cachep->num - slabp->inuse) {
bad:
printk(KERN_ERR "slab: Internal list corruption detected in "
- "cache '%s'(%d), slabp %p(%d). Hexdump:\n",
- cachep->name, cachep->num, slabp, slabp->inuse);
+ "cache '%s'(%d), slabp %p(%d). Tainted(%s) Hexdump:\n",
+ cachep->name, cachep->num, slabp, slabp->inuse, print_tainted());
print_hex_dump(KERN_ERR, "", DUMP_PREFIX_OFFSET, 16, 1, slabp,
sizeof(*slabp) + cachep->num * sizeof(kmem_bufctl_t),
1);
diff --git a/mm/slub.c b/mm/slub.c
index 95215aa..bbec29e 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -570,7 +570,7 @@ static void slab_bug(struct kmem_cache *s, char *fmt, ...)
va_end(args);
printk(KERN_ERR "========================================"
"=====================================\n");
- printk(KERN_ERR "BUG %s: %s\n", s->name, buf);
+ printk(KERN_ERR "BUG %s (%s): %s\n", s->name, print_tainted(), buf);
printk(KERN_ERR "----------------------------------------"
"-------------------------------------\n\n");
}
--
1.7.6.4

File diff suppressed because it is too large Load Diff

View File

@ -1,103 +0,0 @@
From: Olivier Grenie <olivier.grenie@dibcom.fr>
Date: Thu, 4 Aug 2011 16:10:03 +0000 (-0300)
Subject: [media] dib0700: correct error message
X-Git-Tag: next-20110927~67^2~4^2~223
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fnext%2Flinux-next.git;a=commitdiff_plain;h=680417bb318adc5f1f8f392730776176fbcdedd8
[media] dib0700: correct error message
The goal of this patch is to correct a previous patch. In case of error,
the err() function should be used instead of dprintk() function.
[mchehab@redhat.com: as I've replaced dprintk by deb_info, on the the
previous patch, to avoid breaking bisect, I had to fix a merge conflict
on this one]
Signed-off-by: Olivier Grenie <olivier.grenie@dibcom.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
diff --git a/drivers/media/dvb/dvb-usb/dib0700_core.c b/drivers/media/dvb/dvb-usb/dib0700_core.c
index a224e94..b693ed1 100644
--- a/drivers/media/dvb/dvb-usb/dib0700_core.c
+++ b/drivers/media/dvb/dvb-usb/dib0700_core.c
@@ -31,7 +31,7 @@ int dib0700_get_version(struct dvb_usb_device *d, u32 *hwversion,
int ret;
if (mutex_lock_interruptible(&d->usb_mutex) < 0) {
- deb_info("could not acquire lock");
+ err("could not acquire lock");
return 0;
}
@@ -117,7 +117,7 @@ int dib0700_set_gpio(struct dvb_usb_device *d, enum dib07x0_gpios gpio, u8 gpio_
int ret;
if (mutex_lock_interruptible(&d->usb_mutex) < 0) {
- deb_info("could not acquire lock");
+ err("could not acquire lock");
return 0;
}
@@ -138,7 +138,7 @@ static int dib0700_set_usb_xfer_len(struct dvb_usb_device *d, u16 nb_ts_packets)
if (st->fw_version >= 0x10201) {
if (mutex_lock_interruptible(&d->usb_mutex) < 0) {
- deb_info("could not acquire lock");
+ err("could not acquire lock");
return 0;
}
@@ -227,7 +227,7 @@ static int dib0700_i2c_xfer_new(struct i2c_adapter *adap, struct i2c_msg *msg,
} else {
/* Write request */
if (mutex_lock_interruptible(&d->usb_mutex) < 0) {
- deb_info("could not acquire lock");
+ err("could not acquire lock");
return 0;
}
st->buf[0] = REQUEST_NEW_I2C_WRITE;
@@ -273,7 +273,7 @@ static int dib0700_i2c_xfer_legacy(struct i2c_adapter *adap,
if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
return -EAGAIN;
if (mutex_lock_interruptible(&d->usb_mutex) < 0) {
- deb_info("could not acquire lock");
+ err("could not acquire lock");
return 0;
}
@@ -368,7 +368,7 @@ static int dib0700_set_clock(struct dvb_usb_device *d, u8 en_pll,
int ret;
if (mutex_lock_interruptible(&d->usb_mutex) < 0) {
- deb_info("could not acquire lock");
+ err("could not acquire lock");
return 0;
}
@@ -400,7 +400,7 @@ int dib0700_set_i2c_speed(struct dvb_usb_device *d, u16 scl_kHz)
return -EINVAL;
if (mutex_lock_interruptible(&d->usb_mutex) < 0) {
- deb_info("could not acquire lock");
+ err("could not acquire lock");
return 0;
}
@@ -560,7 +560,7 @@ int dib0700_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
}
if (mutex_lock_interruptible(&adap->dev->usb_mutex) < 0) {
- deb_info("could not acquire lock");
+ err("could not acquire lock");
return 0;
}
@@ -610,7 +610,7 @@ int dib0700_change_protocol(struct rc_dev *rc, u64 rc_type)
int new_proto, ret;
if (mutex_lock_interruptible(&d->usb_mutex) < 0) {
- deb_info("could not acquire lock");
+ err("could not acquire lock");
return 0;
}

View File

@ -1,248 +0,0 @@
From: Olivier Grenie <olivier.grenie@dibcom.fr>
Date: Mon, 1 Aug 2011 15:45:58 +0000 (-0300)
Subject: [media] dib0700: protect the dib0700 buffer access
X-Git-Tag: next-20110927~67^2~4^2~224
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fnext%2Flinux-next.git;a=commitdiff_plain;h=bff469f4167fdabfe15294f375577d7eadbaa1bb
[media] dib0700: protect the dib0700 buffer access
This patch protects the common buffer access inside the dib0700 in order
to manage concurrent access. This protection is done using mutex.
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Florian Mickler <florian@mickler.org>
Cc: stable@kernel.org
Signed-off-by: Javier Marcet <javier@marcet.info>
Signed-off-by: Olivier Grenie <olivier.grenie@dibcom.fr>
Signed-off-by: Patrick Boettcher <patrick.boettcher@dibcom.fr>
[mchehab@redhat.com: dprint requires 3 arguments. Replaced by dib_info]
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
diff --git a/drivers/media/dvb/dvb-usb/dib0700_core.c b/drivers/media/dvb/dvb-usb/dib0700_core.c
index 5eb91b4..a224e94 100644
--- a/drivers/media/dvb/dvb-usb/dib0700_core.c
+++ b/drivers/media/dvb/dvb-usb/dib0700_core.c
@@ -30,6 +30,11 @@ int dib0700_get_version(struct dvb_usb_device *d, u32 *hwversion,
struct dib0700_state *st = d->priv;
int ret;
+ if (mutex_lock_interruptible(&d->usb_mutex) < 0) {
+ deb_info("could not acquire lock");
+ return 0;
+ }
+
ret = usb_control_msg(d->udev, usb_rcvctrlpipe(d->udev, 0),
REQUEST_GET_VERSION,
USB_TYPE_VENDOR | USB_DIR_IN, 0, 0,
@@ -46,6 +51,7 @@ int dib0700_get_version(struct dvb_usb_device *d, u32 *hwversion,
if (fwtype != NULL)
*fwtype = (st->buf[12] << 24) | (st->buf[13] << 16) |
(st->buf[14] << 8) | st->buf[15];
+ mutex_unlock(&d->usb_mutex);
return ret;
}
@@ -108,7 +114,12 @@ int dib0700_ctrl_rd(struct dvb_usb_device *d, u8 *tx, u8 txlen, u8 *rx, u8 rxlen
int dib0700_set_gpio(struct dvb_usb_device *d, enum dib07x0_gpios gpio, u8 gpio_dir, u8 gpio_val)
{
struct dib0700_state *st = d->priv;
- s16 ret;
+ int ret;
+
+ if (mutex_lock_interruptible(&d->usb_mutex) < 0) {
+ deb_info("could not acquire lock");
+ return 0;
+ }
st->buf[0] = REQUEST_SET_GPIO;
st->buf[1] = gpio;
@@ -116,6 +127,7 @@ int dib0700_set_gpio(struct dvb_usb_device *d, enum dib07x0_gpios gpio, u8 gpio_
ret = dib0700_ctrl_wr(d, st->buf, 3);
+ mutex_unlock(&d->usb_mutex);
return ret;
}
@@ -125,6 +137,11 @@ static int dib0700_set_usb_xfer_len(struct dvb_usb_device *d, u16 nb_ts_packets)
int ret;
if (st->fw_version >= 0x10201) {
+ if (mutex_lock_interruptible(&d->usb_mutex) < 0) {
+ deb_info("could not acquire lock");
+ return 0;
+ }
+
st->buf[0] = REQUEST_SET_USB_XFER_LEN;
st->buf[1] = (nb_ts_packets >> 8) & 0xff;
st->buf[2] = nb_ts_packets & 0xff;
@@ -132,6 +149,7 @@ static int dib0700_set_usb_xfer_len(struct dvb_usb_device *d, u16 nb_ts_packets)
deb_info("set the USB xfer len to %i Ts packet\n", nb_ts_packets);
ret = dib0700_ctrl_wr(d, st->buf, 3);
+ mutex_unlock(&d->usb_mutex);
} else {
deb_info("this firmware does not allow to change the USB xfer len\n");
ret = -EIO;
@@ -208,6 +226,10 @@ static int dib0700_i2c_xfer_new(struct i2c_adapter *adap, struct i2c_msg *msg,
} else {
/* Write request */
+ if (mutex_lock_interruptible(&d->usb_mutex) < 0) {
+ deb_info("could not acquire lock");
+ return 0;
+ }
st->buf[0] = REQUEST_NEW_I2C_WRITE;
st->buf[1] = msg[i].addr << 1;
st->buf[2] = (en_start << 7) | (en_stop << 6) |
@@ -227,6 +249,7 @@ static int dib0700_i2c_xfer_new(struct i2c_adapter *adap, struct i2c_msg *msg,
USB_TYPE_VENDOR | USB_DIR_OUT,
0, 0, st->buf, msg[i].len + 4,
USB_CTRL_GET_TIMEOUT);
+ mutex_unlock(&d->usb_mutex);
if (result < 0) {
deb_info("i2c write error (status = %d)\n", result);
break;
@@ -249,6 +272,10 @@ static int dib0700_i2c_xfer_legacy(struct i2c_adapter *adap,
if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
return -EAGAIN;
+ if (mutex_lock_interruptible(&d->usb_mutex) < 0) {
+ deb_info("could not acquire lock");
+ return 0;
+ }
for (i = 0; i < num; i++) {
/* fill in the address */
@@ -279,6 +306,7 @@ static int dib0700_i2c_xfer_legacy(struct i2c_adapter *adap,
break;
}
}
+ mutex_unlock(&d->usb_mutex);
mutex_unlock(&d->i2c_mutex);
return i;
@@ -337,7 +365,12 @@ static int dib0700_set_clock(struct dvb_usb_device *d, u8 en_pll,
u16 pll_loopdiv, u16 free_div, u16 dsuScaler)
{
struct dib0700_state *st = d->priv;
- s16 ret;
+ int ret;
+
+ if (mutex_lock_interruptible(&d->usb_mutex) < 0) {
+ deb_info("could not acquire lock");
+ return 0;
+ }
st->buf[0] = REQUEST_SET_CLOCK;
st->buf[1] = (en_pll << 7) | (pll_src << 6) |
@@ -352,6 +385,7 @@ static int dib0700_set_clock(struct dvb_usb_device *d, u8 en_pll,
st->buf[9] = dsuScaler & 0xff; /* LSB */
ret = dib0700_ctrl_wr(d, st->buf, 10);
+ mutex_unlock(&d->usb_mutex);
return ret;
}
@@ -360,10 +394,16 @@ int dib0700_set_i2c_speed(struct dvb_usb_device *d, u16 scl_kHz)
{
struct dib0700_state *st = d->priv;
u16 divider;
+ int ret;
if (scl_kHz == 0)
return -EINVAL;
+ if (mutex_lock_interruptible(&d->usb_mutex) < 0) {
+ deb_info("could not acquire lock");
+ return 0;
+ }
+
st->buf[0] = REQUEST_SET_I2C_PARAM;
divider = (u16) (30000 / scl_kHz);
st->buf[1] = 0;
@@ -379,7 +419,11 @@ int dib0700_set_i2c_speed(struct dvb_usb_device *d, u16 scl_kHz)
deb_info("setting I2C speed: %04x %04x %04x (%d kHz).",
(st->buf[2] << 8) | (st->buf[3]), (st->buf[4] << 8) |
st->buf[5], (st->buf[6] << 8) | st->buf[7], scl_kHz);
- return dib0700_ctrl_wr(d, st->buf, 8);
+
+ ret = dib0700_ctrl_wr(d, st->buf, 8);
+ mutex_unlock(&d->usb_mutex);
+
+ return ret;
}
@@ -515,6 +559,11 @@ int dib0700_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
}
}
+ if (mutex_lock_interruptible(&adap->dev->usb_mutex) < 0) {
+ deb_info("could not acquire lock");
+ return 0;
+ }
+
st->buf[0] = REQUEST_ENABLE_VIDEO;
/* this bit gives a kind of command,
* rather than enabling something or not */
@@ -548,7 +597,10 @@ int dib0700_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
deb_info("data for streaming: %x %x\n", st->buf[1], st->buf[2]);
- return dib0700_ctrl_wr(adap->dev, st->buf, 4);
+ ret = dib0700_ctrl_wr(adap->dev, st->buf, 4);
+ mutex_unlock(&adap->dev->usb_mutex);
+
+ return ret;
}
int dib0700_change_protocol(struct rc_dev *rc, u64 rc_type)
@@ -557,6 +609,11 @@ int dib0700_change_protocol(struct rc_dev *rc, u64 rc_type)
struct dib0700_state *st = d->priv;
int new_proto, ret;
+ if (mutex_lock_interruptible(&d->usb_mutex) < 0) {
+ deb_info("could not acquire lock");
+ return 0;
+ }
+
st->buf[0] = REQUEST_SET_RC;
st->buf[1] = 0;
st->buf[2] = 0;
@@ -567,23 +624,29 @@ int dib0700_change_protocol(struct rc_dev *rc, u64 rc_type)
else if (rc_type == RC_TYPE_NEC)
new_proto = 0;
else if (rc_type == RC_TYPE_RC6) {
- if (st->fw_version < 0x10200)
- return -EINVAL;
+ if (st->fw_version < 0x10200) {
+ ret = -EINVAL;
+ goto out;
+ }
new_proto = 2;
- } else
- return -EINVAL;
+ } else {
+ ret = -EINVAL;
+ goto out;
+ }
st->buf[1] = new_proto;
ret = dib0700_ctrl_wr(d, st->buf, 3);
if (ret < 0) {
err("ir protocol setup failed");
- return ret;
+ goto out;
}
d->props.rc.core.protocol = rc_type;
+out:
+ mutex_unlock(&d->usb_mutex);
return ret;
}

View File

@ -1,2 +1,3 @@
8d43453f8159b2332ad410b19d86a931 linux-3.1.tar.bz2
f6754489c6fb6de511c3fcd2b2fa4474 patch-3.1-git3.bz2
349569748e059f2b64adab5eb7cf42e6 patch-3.1-git4.bz2

View File

@ -1,211 +0,0 @@
Path: news.gmane.org!not-for-mail
From: Matt Fleming <matt@console-pimps.org>
Newsgroups: gmane.linux.kernel
Subject: [PATCH v2] x86, efi: Calling __pa() with an ioremap'd address is invalid
Date: Fri, 14 Oct 2011 12:36:45 +0100
Lines: 160
Approved: news@gmane.org
Message-ID: <1318592205-11193-1-git-send-email-matt@console-pimps.org>
NNTP-Posting-Host: lo.gmane.org
X-Trace: dough.gmane.org 1318592224 30879 80.91.229.12 (14 Oct 2011 11:37:04 GMT)
X-Complaints-To: usenet@dough.gmane.org
NNTP-Posting-Date: Fri, 14 Oct 2011 11:37:04 +0000 (UTC)
Cc: Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
"H. Peter Anvin" <hpa@zytor.com>, Zhang Rui <rui.zhang@intel.com>,
Huang Ying <huang.ying.caritas@gmail.com>,
linux-kernel@vger.kernel.org
To: Matthew Garrett <mjg@redhat.com>
Original-X-From: linux-kernel-owner@vger.kernel.org Fri Oct 14 13:36:59 2011
Return-path: <linux-kernel-owner@vger.kernel.org>
Envelope-to: glk-linux-kernel-3@lo.gmane.org
Original-Received: from vger.kernel.org ([209.132.180.67])
by lo.gmane.org with esmtp (Exim 4.69)
(envelope-from <linux-kernel-owner@vger.kernel.org>)
id 1REg4Q-0001UQ-SA
for glk-linux-kernel-3@lo.gmane.org; Fri, 14 Oct 2011 13:36:59 +0200
Original-Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
id S1755420Ab1JNLgv (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>);
Fri, 14 Oct 2011 07:36:51 -0400
Original-Received: from arkanian.console-pimps.org ([212.110.184.194]:46859 "EHLO
arkanian.console-pimps.org" rhost-flags-OK-OK-OK-OK)
by vger.kernel.org with ESMTP id S1751315Ab1JNLgu (ORCPT
<rfc822;linux-kernel@vger.kernel.org>);
Fri, 14 Oct 2011 07:36:50 -0400
Original-Received: by arkanian.console-pimps.org (Postfix, from userid 1002)
id 443C1C0009; Fri, 14 Oct 2011 12:36:49 +0100 (BST)
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on
arkanian.vm.bytemark.co.uk
X-Spam-Level:
X-Spam-Status: No, score=-5.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00
autolearn=ham version=3.2.5
Original-Received: from localhost (02ddb86b.bb.sky.com [2.221.184.107])
by arkanian.console-pimps.org (Postfix) with ESMTPSA id F0D40C0008;
Fri, 14 Oct 2011 12:36:47 +0100 (BST)
X-Mailer: git-send-email 1.7.4.4
Original-Sender: linux-kernel-owner@vger.kernel.org
Precedence: bulk
List-ID: <linux-kernel.vger.kernel.org>
X-Mailing-List: linux-kernel@vger.kernel.org
Xref: news.gmane.org gmane.linux.kernel:1203294
Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1203294>
From: Matt Fleming <matt.fleming@intel.com>
If we encounter an efi_memory_desc_t without EFI_MEMORY_WB set in
->attribute we currently call set_memory_uc(), which in turn calls
__pa() on a potentially ioremap'd address. On CONFIG_X86_32 this is
invalid, resulting in the following oops,
BUG: unable to handle kernel paging request at f7f22280
IP: [<c10257b9>] reserve_ram_pages_type+0x89/0x210
*pdpt = 0000000001978001 *pde = 0000000001ffb067 *pte = 0000000000000000
Oops: 0000 [#1] PREEMPT SMP
Modules linked in:
Pid: 0, comm: swapper Not tainted 3.0.0-acpi-efi-0805 #3
EIP: 0060:[<c10257b9>] EFLAGS: 00010202 CPU: 0
EIP is at reserve_ram_pages_type+0x89/0x210
EAX: 0070e280 EBX: 38714000 ECX: f7814000 EDX: 00000000
ESI: 00000000 EDI: 38715000 EBP: c189fef0 ESP: c189fea8
DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
Process swapper (pid: 0, ti=c189e000 task=c18bbe60 task.ti=c189e000)
Stack:
80000200 ff108000 00000000 c189ff00 00038714 00000000 00000000 c189fed0
c104f8ca 00038714 00000000 00038715 00000000 00000000 00038715 00000000
00000010 38715000 c189ff48 c1025aff 38715000 00000000 00000010 00000000
Call Trace:
[<c104f8ca>] ? page_is_ram+0x1a/0x40
[<c1025aff>] reserve_memtype+0xdf/0x2f0
[<c1024dc9>] set_memory_uc+0x49/0xa0
[<c19334d0>] efi_enter_virtual_mode+0x1c2/0x3aa
[<c19216d4>] start_kernel+0x291/0x2f2
[<c19211c7>] ? loglevel+0x1b/0x1b
[<c19210bf>] i386_start_kernel+0xbf/0xc8
So, if we're ioremap'ing an address range let's setup the mapping with
the correct caching attribute instead of modifying it after the fact.
Also, take this opportunity to unify the 32/64-bit efi_ioremap()
implementations because they can both be implemented with
ioremap_{cache,nocache}. When asked about the original reason behind
using init_memory_mapping() for the 64-bit version Huang Ying said,
"The intention of init_memory_mapping() usage is to make EFI virtual
address unchanged after kexec. But in fact, init_memory_mapping()
can not handle some memory range, so ioremap_xxx() is introduced as
a fix. Now we decide to use ioremap_xxx() anyway and use some other
scheme for kexec support, so init_memory_mapping() here is
unnecessary. IMHO, init_memory_mapping() is not as good as
ioremap_xxx() here."
And because efi_ioremap() now consists of 4 lines, let's just inline
it directly into the one callsite in efi_enter_virtual_mode().
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Huang Ying <huang.ying.caritas@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
---
arch/x86/include/asm/efi.h | 5 -----
arch/x86/platform/efi/efi.c | 24 ++++++++++++++----------
arch/x86/platform/efi/efi_64.c | 17 -----------------
3 files changed, 14 insertions(+), 32 deletions(-)
diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h
index 7093e4a..b8d8bfc 100644
--- a/arch/x86/include/asm/efi.h
+++ b/arch/x86/include/asm/efi.h
@@ -33,8 +33,6 @@ extern unsigned long asmlinkage efi_call_phys(void *, ...);
#define efi_call_virt6(f, a1, a2, a3, a4, a5, a6) \
efi_call_virt(f, a1, a2, a3, a4, a5, a6)
-#define efi_ioremap(addr, size, type) ioremap_cache(addr, size)
-
#else /* !CONFIG_X86_32 */
extern u64 efi_call0(void *fp);
@@ -84,9 +82,6 @@ extern u64 efi_call6(void *fp, u64 arg1, u64 arg2, u64 arg3,
efi_call6((void *)(efi.systab->runtime->f), (u64)(a1), (u64)(a2), \
(u64)(a3), (u64)(a4), (u64)(a5), (u64)(a6))
-extern void __iomem *efi_ioremap(unsigned long addr, unsigned long size,
- u32 type);
-
#endif /* CONFIG_X86_32 */
extern int add_efi_memmap;
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index 3ae4128..6ea011c 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -670,10 +670,21 @@ void __init efi_enter_virtual_mode(void)
end_pfn = PFN_UP(end);
if (end_pfn <= max_low_pfn_mapped
|| (end_pfn > (1UL << (32 - PAGE_SHIFT))
- && end_pfn <= max_pfn_mapped))
+ && end_pfn <= max_pfn_mapped)) {
va = __va(md->phys_addr);
- else
- va = efi_ioremap(md->phys_addr, size, md->type);
+
+ if (!(md->attribute & EFI_MEMORY_WB)) {
+ addr = (u64) (unsigned long)va;
+ npages = md->num_pages;
+ memrange_efi_to_native(&addr, &npages);
+ set_memory_uc(addr, npages);
+ }
+ } else {
+ if (!(md->attribute & EFI_MEMORY_WB))
+ va = ioremap_nocache(md->phys_addr, size);
+ else
+ va = ioremap_cache(md->phys_addr, size);
+ }
md->virt_addr = (u64) (unsigned long) va;
@@ -683,13 +694,6 @@ void __init efi_enter_virtual_mode(void)
continue;
}
- if (!(md->attribute & EFI_MEMORY_WB)) {
- addr = md->virt_addr;
- npages = md->num_pages;
- memrange_efi_to_native(&addr, &npages);
- set_memory_uc(addr, npages);
- }
-
systab = (u64) (unsigned long) efi_phys.systab;
if (md->phys_addr <= systab && systab < end) {
systab += md->virt_addr - md->phys_addr;
diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c
index ac3aa54..312250c 100644
--- a/arch/x86/platform/efi/efi_64.c
+++ b/arch/x86/platform/efi/efi_64.c
@@ -80,20 +80,3 @@ void __init efi_call_phys_epilog(void)
local_irq_restore(efi_flags);
early_code_mapping_set_exec(0);
}
-
-void __iomem *__init efi_ioremap(unsigned long phys_addr, unsigned long size,
- u32 type)
-{
- unsigned long last_map_pfn;
-
- if (type == EFI_MEMORY_MAPPED_IO)
- return ioremap(phys_addr, size);
-
- last_map_pfn = init_memory_mapping(phys_addr, phys_addr + size);
- if ((last_map_pfn << PAGE_SHIFT) < phys_addr + size) {
- unsigned long top = last_map_pfn << PAGE_SHIFT;
- efi_ioremap(top, size - (top - phys_addr), type);
- }
-
- return (void __iomem *)__va(phys_addr);
-}
--
1.7.4.4