From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tejun Heo Subject: [PATCH 1/6] x86: Fix memblock_x86_check_reserved_size() use in efi_reserve_boot_services() Date: Tue, 12 Jul 2011 09:58:05 +0200 Message-ID: <1310457490-3356-2-git-send-email-tj@kernel.org> References: <1310457490-3356-1-git-send-email-tj@kernel.org> Return-path: In-Reply-To: <1310457490-3356-1-git-send-email-tj@kernel.org> Sender: linux-kernel-owner@vger.kernel.org To: mingo@redhat.com, hpa@zytor.com, tglx@linutronix.de, benh@kernel.crashing.org, yinghai@kernel.org Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, x86@kernel.org, Tejun Heo List-Id: linux-arch.vger.kernel.org The return value of memblock_x86_check_reserved_size() doesn't indicate whether there's an overlapping reservatoin or not. It indicates whether the caller needs to iterate further to discover all reserved portions of the specified area. efi_reserve_boot_esrvices() wants to check whether the boot services area overlaps with other reservations but incorrectly used membloc_x86_check_reserved_size(). Use memblock_is_region_reserved() instead. Signed-off-by: Tejun Heo Cc: Yinghai Lu Cc: Benjamin Herrenschmidt Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" --- arch/x86/platform/efi/efi.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index 899e393..a4c322c 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c @@ -325,8 +325,7 @@ void __init efi_reserve_boot_services(void) if ((start+size >= virt_to_phys(_text) && start <= virt_to_phys(_end)) || !e820_all_mapped(start, start+size, E820_RAM) || - memblock_x86_check_reserved_size(&start, &size, - 1<num_pages = 0; memblock_dbg(PFX "Could not reserve boot range " -- 1.7.6 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-bw0-f46.google.com ([209.85.214.46]:48684 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751124Ab1GLH6X (ORCPT ); Tue, 12 Jul 2011 03:58:23 -0400 From: Tejun Heo Subject: [PATCH 1/6] x86: Fix memblock_x86_check_reserved_size() use in efi_reserve_boot_services() Date: Tue, 12 Jul 2011 09:58:05 +0200 Message-ID: <1310457490-3356-2-git-send-email-tj@kernel.org> In-Reply-To: <1310457490-3356-1-git-send-email-tj@kernel.org> References: <1310457490-3356-1-git-send-email-tj@kernel.org> Sender: linux-arch-owner@vger.kernel.org List-ID: To: mingo@redhat.com, hpa@zytor.com, tglx@linutronix.de, benh@kernel.crashing.org, yinghai@kernel.org Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, x86@kernel.org, Tejun Heo Message-ID: <20110712075805.q5mNpn4LBCAjvcAJnvX-JIrOUc7SJKdjm2qmhs4jEtY@z> The return value of memblock_x86_check_reserved_size() doesn't indicate whether there's an overlapping reservatoin or not. It indicates whether the caller needs to iterate further to discover all reserved portions of the specified area. efi_reserve_boot_esrvices() wants to check whether the boot services area overlaps with other reservations but incorrectly used membloc_x86_check_reserved_size(). Use memblock_is_region_reserved() instead. Signed-off-by: Tejun Heo Cc: Yinghai Lu Cc: Benjamin Herrenschmidt Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" --- arch/x86/platform/efi/efi.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index 899e393..a4c322c 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c @@ -325,8 +325,7 @@ void __init efi_reserve_boot_services(void) if ((start+size >= virt_to_phys(_text) && start <= virt_to_phys(_end)) || !e820_all_mapped(start, start+size, E820_RAM) || - memblock_x86_check_reserved_size(&start, &size, - 1<num_pages = 0; memblock_dbg(PFX "Could not reserve boot range " -- 1.7.6