Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754089Ab2HMVrg (ORCPT ); Mon, 13 Aug 2012 17:47:36 -0400 Received: from tx2ehsobe001.messaging.microsoft.com ([65.55.88.11]:51259 "EHLO tx2outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753157Ab2HMVr0 (ORCPT ); Mon, 13 Aug 2012 17:47:26 -0400 X-Forefront-Antispam-Report: CIP:163.181.249.109;KIP:(null);UIP:(null);IPV:NLI;H:ausb3twp02.amd.com;RD:none;EFVD:NLI X-SpamScore: 0 X-BigFish: VPS0(zzzz1202hzz8275bhz2dh668h839hd24he5bhf0ah107ah) X-WSS-ID: 0M8PR6X-02-BJ4-02 X-M-MSG: From: Jacob Shin To: X86-ML CC: LKML , Yinghai Lu , "H. Peter Anvin" , Andreas Herrmann , Tejun Heo , Borislav Petkov , Jacob Shin 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 Message-ID: <1344894424-4434-6-git-send-email-jacob.shin@amd.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1344894424-4434-1-git-send-email-jacob.shin@amd.com> References: <1344894424-4434-1-git-send-email-jacob.shin@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-OriginatorOrg: amd.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1651 Lines: 60 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 --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/