Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758039AbYAUGvo (ORCPT ); Mon, 21 Jan 2008 01:51:44 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752044AbYAUGvf (ORCPT ); Mon, 21 Jan 2008 01:51:35 -0500 Received: from sca-es-mail-1.Sun.COM ([192.18.43.132]:59355 "EHLO sca-es-mail-1.sun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751385AbYAUGve (ORCPT ); Mon, 21 Jan 2008 01:51:34 -0500 Date: Sun, 20 Jan 2008 22:56:48 -0800 From: Yinghai Lu Subject: [PATCH] x86_32: trim memory by updating e820 v2 In-reply-to: <200801202255.58642.yinghai.lu@sun.com> To: Andi Kleen , Ingo Molnar , "H. Peter Anvin" Cc: LKML , Jesse Barnes , Andrew Morton Message-id: <200801202256.48365.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> <200801202255.02645.yinghai.lu@sun.com> <200801202255.58642.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: 6517 Lines: 194 [PATCH] x86_32: trim memory by updating 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 test 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