From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760533Ab0JZVl5 (ORCPT ); Tue, 26 Oct 2010 17:41:57 -0400 Received: from g5t0007.atlanta.hp.com ([15.192.0.44]:30025 "EHLO g5t0007.atlanta.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933291Ab0JZVlu (ORCPT ); Tue, 26 Oct 2010 17:41:50 -0400 Subject: [PATCH v5 8/9] x86: update iomem_resource end based on CPU physical address capabilities To: Jesse Barnes From: Bjorn Helgaas Cc: Bob Picco , Brian Bloniarz , Charles Butterfield , Denys Vlasenko , Ingo Molnar , linux-pci@vger.kernel.org, "Horst H. von Brand" , "H. Peter Anvin" , linux-kernel@vger.kernel.org, Stefan Becker , Chuck Ebbert , Fabrice Bellet , Yinghai Lu , Leann Ogasawara , Linus Torvalds , Thomas Gleixner Date: Tue, 26 Oct 2010 15:41:49 -0600 Message-ID: <20101026214149.29808.68778.stgit@bob.kio> In-Reply-To: <20101026214033.29808.15272.stgit@bob.kio> References: <20101026214033.29808.15272.stgit@bob.kio> User-Agent: StGit/0.15 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The iomem_resource map reflects the available physical address space. We statically initialize the end to -1, i.e., 0xffffffff_ffffffff, but of course we can only use as much as the CPU can address. This patch updates the end based on the CPU capabilities, so we don't mistakenly allocate space that isn't usable, as we're likely to do when allocating from the top-down. Signed-off-by: Bjorn Helgaas --- arch/x86/kernel/setup.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 95a3274..85268f8 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -769,6 +769,7 @@ void __init setup_arch(char **cmdline_p) x86_init.oem.arch_setup(); + iomem_resource.end = (1ULL << boot_cpu_data.x86_phys_bits) - 1; setup_memory_map(); parse_setup_data(); /* update the e820_saved too */