From: tip-bot for Yinghai Lu <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
yinghai@kernel.org, joshuacov@googlemail.com, tglx@linutronix.de,
hpa@linux.intel.com
Subject: [tip:x86/urgent] x86, mtrr: Fix original mtrr range get for mtrr_cleanup
Date: Tue, 18 Jun 2013 09:52:02 -0700 [thread overview]
Message-ID: <tip-d8d386c10630d8f7837700f4c466443d49e12cc0@git.kernel.org> (raw)
In-Reply-To: <1371154622-8929-2-git-send-email-yinghai@kernel.org>
Commit-ID: d8d386c10630d8f7837700f4c466443d49e12cc0
Gitweb: http://git.kernel.org/tip/d8d386c10630d8f7837700f4c466443d49e12cc0
Author: Yinghai Lu <yinghai@kernel.org>
AuthorDate: Thu, 13 Jun 2013 13:17:01 -0700
Committer: H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Tue, 18 Jun 2013 11:32:02 -0500
x86, mtrr: Fix original mtrr range get for mtrr_cleanup
Joshua reported: Commit cd7b304dfaf1 (x86, range: fix missing merge
during add range) broke mtrr cleanup on his setup in 3.9.5.
corresponding commit in upstream is fbe06b7bae7c.
*BAD*gran_size: 64K chunk_size: 16M num_reg: 6 lose cover RAM: -0G
https://bugzilla.kernel.org/show_bug.cgi?id=59491
So it rejects new var mtrr layout.
It turns out we have some problem with initial mtrr range retrieval.
The current sequence is:
x86_get_mtrr_mem_range
==> bunchs of add_range_with_merge
==> bunchs of subract_range
==> clean_sort_range
add_range_with_merge for [0,1M)
sort_range()
add_range_with_merge could have blank slots, so we can not just
sort only, that will have final result have extra blank slot in head.
So move that calling add_range_with_merge for [0,1M), with that we
could avoid extra clean_sort_range calling.
Reported-by: Joshua Covington <joshuacov@googlemail.com>
Tested-by: Joshua Covington <joshuacov@googlemail.com>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Link: http://lkml.kernel.org/r/1371154622-8929-2-git-send-email-yinghai@kernel.org
Cc: <stable@vger.kernel.org> v3.9
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
arch/x86/kernel/cpu/mtrr/cleanup.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/x86/kernel/cpu/mtrr/cleanup.c b/arch/x86/kernel/cpu/mtrr/cleanup.c
index 35ffda5..5f90b85 100644
--- a/arch/x86/kernel/cpu/mtrr/cleanup.c
+++ b/arch/x86/kernel/cpu/mtrr/cleanup.c
@@ -714,15 +714,15 @@ int __init mtrr_cleanup(unsigned address_bits)
if (mtrr_tom2)
x_remove_size = (mtrr_tom2 >> PAGE_SHIFT) - x_remove_base;
- nr_range = x86_get_mtrr_mem_range(range, 0, x_remove_base, x_remove_size);
/*
* [0, 1M) should always be covered by var mtrr with WB
* and fixed mtrrs should take effect before var mtrr for it:
*/
- nr_range = add_range_with_merge(range, RANGE_NUM, nr_range, 0,
+ nr_range = add_range_with_merge(range, RANGE_NUM, 0, 0,
1ULL<<(20 - PAGE_SHIFT));
- /* Sort the ranges: */
- sort_range(range, nr_range);
+ /* add from var mtrr at last */
+ nr_range = x86_get_mtrr_mem_range(range, nr_range,
+ x_remove_base, x_remove_size);
range_sums = sum_ranges(range, nr_range);
printk(KERN_INFO "total RAM covered: %ldM\n",
next prev parent reply other threads:[~2013-06-18 16:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-13 20:17 [PATCH v3 0/2] x86, mtrr: fixs " Yinghai Lu
2013-06-13 20:17 ` [PATCH v3 1/2] x86, mtrr: Fix original mtrr range get " Yinghai Lu
2013-06-18 16:25 ` Josh Boyer
2013-06-18 16:52 ` tip-bot for Yinghai Lu [this message]
2013-06-13 20:17 ` [PATCH v3 2/2] range: Do not add new blank slot with add_range_with_merge Yinghai Lu
2013-06-18 16:52 ` [tip:x86/urgent] " tip-bot for Yinghai Lu
2013-06-18 16:29 ` [PATCH v3 0/2] x86, mtrr: fixs for mtrr_cleanup H. Peter Anvin
2013-06-18 17:28 ` Yinghai Lu
2013-06-18 17:33 ` H. Peter Anvin
2013-06-18 18:24 ` Yinghai Lu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-d8d386c10630d8f7837700f4c466443d49e12cc0@git.kernel.org \
--to=tipbot@zytor.com \
--cc=hpa@linux.intel.com \
--cc=hpa@zytor.com \
--cc=joshuacov@googlemail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
--cc=yinghai@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome