Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757512AbYAUFiv (ORCPT ); Mon, 21 Jan 2008 00:38:51 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751934AbYAUFim (ORCPT ); Mon, 21 Jan 2008 00:38:42 -0500 Received: from sca-es-mail-2.Sun.COM ([192.18.43.133]:62509 "EHLO sca-es-mail-2.sun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751720AbYAUFil (ORCPT ); Mon, 21 Jan 2008 00:38:41 -0500 Date: Sun, 20 Jan 2008 21:44:46 -0800 From: Yinghai Lu Subject: [PATCH] x86_32: trim memory by updating e820 In-reply-to: <200801202140.57829.yinghai.lu@sun.com> To: Ingo Molnar , "H. Peter Anvin" Cc: Andi Kleen , LKML , Jesse Barnes , Andrew Morton Message-id: <200801202144.46869.yinghai.lu@sun.com> Organization: Sun MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7BIT Content-disposition: inline References: <200801192045.17291.yinghai.lu@sun.com> <200801201608.15401.ak@suse.de> <200801202140.57829.yinghai.lu@sun.com> User-Agent: KMail/1.9.6 (enterprise 20070904.708012) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5858 Lines: 176 [PATCH] x86_32: trim memory by updating e820 need to be applied after the patch for x86_64 version mtrr fix e820 v2. when mtrr is not covering all e820 table, need to trim the ram, need to update e820 reuse some code for x86_64 here need to add early_identify_cpu for x86_32, and move mtrr_bp_init early compiled only, need someone test it. Index: linux-2.6/arch/x86/kernel/cpu/common.c =================================================================== --- linux-2.6.orig/arch/x86/kernel/cpu/common.c +++ linux-2.6/arch/x86/kernel/cpu/common.c @@ -396,11 +396,9 @@ __setup("serialnumber", x86_serial_nr_se /* * This does the hard work of actually picking apart the CPU stuff... */ -void __cpuinit identify_cpu(struct cpuinfo_x86 *c) +void __cpuinit early_identify_cpu(struct cpuinfo_x86 *c) { - int i; - c->loops_per_jiffy = loops_per_jiffy; c->x86_cache_size = -1; c->x86_vendor = X86_VENDOR_UNKNOWN; c->cpuid_level = -1; /* CPUID not detected */ @@ -424,7 +422,14 @@ void __cpuinit identify_cpu(struct cpuin if (this_cpu->c_identify) this_cpu->c_identify(c); +} +void __cpuinit identify_cpu(struct cpuinfo_x86 *c) +{ + int i; + + c->loops_per_jiffy = loops_per_jiffy; + early_identify_cpu(c); /* * Vendor-specific initialization. In this section we * canonicalize the feature flags, meaning if there are @@ -485,7 +490,6 @@ void __init identify_boot_cpu(void) identify_cpu(&boot_cpu_data); sysenter_setup(); enable_sep_cpu(); - mtrr_bp_init(); } void __cpuinit identify_secondary_cpu(struct cpuinfo_x86 *c) Index: linux-2.6/arch/x86/kernel/setup_32.c =================================================================== --- linux-2.6.orig/arch/x86/kernel/setup_32.c +++ linux-2.6/arch/x86/kernel/setup_32.c @@ -49,6 +49,7 @@ #include