mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jacob Shin <jacob.shin@amd.com>
To: X86-ML <x86@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Yinghai Lu <yinghai@kernel.org>, "H. Peter Anvin" <hpa@zytor.com>,
	Andreas Herrmann <andreas.herrmann3@amd.com>,
	Tejun Heo <tj@kernel.org>,
	Borislav Petkov <borislav.petkov@amd.com>,
	Jacob Shin <jacob.shin@amd.com>
Subject: [PATCH 5/5] x86: Move enabling of PSE and PGE out of init_memory_mapping
Date: Mon, 13 Aug 2012 16:47:04 -0500	[thread overview]
Message-ID: <1344894424-4434-6-git-send-email-jacob.shin@amd.com> (raw)
In-Reply-To: <1344894424-4434-1-git-send-email-jacob.shin@amd.com>

Since we now call init_memory_mapping for each E820_RAM region in a
loop, move cr4 writes out to setup_arch.

Signed-off-by: Jacob Shin <jacob.shin@amd.com>
---
 arch/x86/kernel/setup.c |   10 ++++++++++
 arch/x86/mm/init.c      |   10 ----------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index f71fa310..69b43f2 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -342,6 +342,16 @@ static void __init init_memory(void)
 
 	init_gbpages();
 
+	/* Enable PSE if available */
+	if (cpu_has_pse)
+		set_in_cr4(X86_CR4_PSE);
+
+	/* Enable PGE if available */
+	if (cpu_has_pge) {
+		set_in_cr4(X86_CR4_PGE);
+		__supported_pte_mask |= _PAGE_GLOBAL;
+	}
+
 	for (i = 0; i < e820.nr_map; i++) {
 		struct e820entry *ei = &e820.map[i];
 		u64 start = ei->addr;
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index df8baaa..e2b21e0 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -157,16 +157,6 @@ unsigned long __init_refok init_memory_mapping(unsigned long start,
 	use_gbpages = direct_gbpages;
 #endif
 
-	/* Enable PSE if available */
-	if (cpu_has_pse)
-		set_in_cr4(X86_CR4_PSE);
-
-	/* Enable PGE if available */
-	if (cpu_has_pge) {
-		set_in_cr4(X86_CR4_PGE);
-		__supported_pte_mask |= _PAGE_GLOBAL;
-	}
-
 	if (use_gbpages)
 		page_size_mask |= 1 << PG_LEVEL_1G;
 	if (use_pse)
-- 
1.7.9.5



  parent reply	other threads:[~2012-08-13 21:47 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-13 21:46 [PATCH V2 0/5] x86: Create direct mappings for E820_RAM only Jacob Shin
2012-08-13 21:47 ` [PATCH 1/5] x86: Only direct map addresses that are marked as E820_RAM Jacob Shin
2012-08-13 21:58   ` Tejun Heo
2012-08-13 22:00     ` H. Peter Anvin
2012-08-13 21:47 ` [PATCH 2/5] x86: find_early_table_space based on memory ranges that are being mapped Jacob Shin
2012-08-13 21:47 ` [PATCH 3/5] x86: Keep track of direct mapped pfn ranges Jacob Shin
2012-08-13 22:09   ` Tejun Heo
2012-08-13 21:47 ` [PATCH 4/5] x86: Fixup code testing if a pfn is direct mapped Jacob Shin
2012-08-13 21:47 ` Jacob Shin [this message]
2012-08-13 23:02   ` [PATCH 5/5] x86: Move enabling of PSE and PGE out of init_memory_mapping Tejun Heo
2012-08-14  8:34 ` [PATCH V2 0/5] x86: Create direct mappings for E820_RAM only Dave Young
2012-08-14  9:06   ` Dave Young
2012-08-14 22:54   ` Jacob Shin
2012-08-15  5:51     ` WANG Chao
  -- strict thread matches above, loose matches on Subject: below --
2012-08-09 21:23 [PATCH 0/5] Only create direct mappings for E820_RAM regions Jacob Shin
2012-08-09 21:23 ` [PATCH 5/5] x86: Move enabling of PSE and PGE out of init_memory_mapping Jacob Shin
2012-08-11 20:01   ` Tejun Heo
2012-08-13  7:34     ` Borislav Petkov
2012-08-13 23:20       ` Tejun Heo
2012-08-14  8:49         ` Borislav Petkov
2012-08-14 19:52           ` Jacob Shin
2012-08-14 20:20             ` Tejun Heo

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=1344894424-4434-6-git-send-email-jacob.shin@amd.com \
    --to=jacob.shin@amd.com \
    --cc=andreas.herrmann3@amd.com \
    --cc=borislav.petkov@amd.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    --cc=x86@kernel.org \
    --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

all inboxes | Powered by JetHome®