From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751464AbdALKIS (ORCPT ); Thu, 12 Jan 2017 05:08:18 -0500 Received: from terminus.zytor.com ([198.137.202.10]:39046 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751050AbdALKIQ (ORCPT ); Thu, 12 Jan 2017 05:08:16 -0500 Date: Thu, 12 Jan 2017 02:07:16 -0800 From: tip-bot for Arnd Bergmann Message-ID: Cc: hpa@zytor.com, torvalds@linux-foundation.org, peterz@infradead.org, toshi.kani@hpe.com, richard.weiyang@gmail.com, mingo@kernel.org, dvlasenk@redhat.com, dan.j.williams@intel.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, arnd@arndb.de Reply-To: linux-kernel@vger.kernel.org, tglx@linutronix.de, arnd@arndb.de, hpa@zytor.com, torvalds@linux-foundation.org, peterz@infradead.org, toshi.kani@hpe.com, richard.weiyang@gmail.com, mingo@kernel.org, dvlasenk@redhat.com, dan.j.williams@intel.com In-Reply-To: <20170111144926.695369-1-arnd@arndb.de> References: <20170111144926.695369-1-arnd@arndb.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/boot] x86/e820/32: Fix e820_search_gap() error handling on x86-32 Git-Commit-ID: c19a5f35e315837170ee337eed21c7087ea94192 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: c19a5f35e315837170ee337eed21c7087ea94192 Gitweb: http://git.kernel.org/tip/c19a5f35e315837170ee337eed21c7087ea94192 Author: Arnd Bergmann AuthorDate: Wed, 11 Jan 2017 15:49:04 +0100 Committer: Ingo Molnar CommitDate: Thu, 12 Jan 2017 09:40:06 +0100 x86/e820/32: Fix e820_search_gap() error handling on x86-32 GCC correctly points out that on 32-bit kernels, e820_search_gap() not finding a start now leads to pci_mem_start ('gapstart') being set to an uninitialized value: arch/x86/kernel/e820.c: In function 'e820_setup_gap': arch/x86/kernel/e820.c:641:16: error: 'gapstart' may be used uninitialized in this function [-Werror=maybe-uninitialized] This restores the behavior from before this cleanup: b4ed1d15b453 ("x86/e820: Make e820_search_gap() static and remove unused variables") ... defaulting to address 0x10000000 if nothing was found. Signed-off-by: Arnd Bergmann Cc: Dan Williams Cc: Denys Vlasenko Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Toshi Kani Cc: Wei Yang Fixes: b4ed1d15b453 ("x86/e820: Make e820_search_gap() static and remove unused variables") Link: http://lkml.kernel.org/r/20170111144926.695369-1-arnd@arndb.de Signed-off-by: Ingo Molnar --- arch/x86/kernel/e820.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index 46f2afd..b2bbad6 100644 --- a/arch/x86/kernel/e820.c +++ b/arch/x86/kernel/e820.c @@ -626,14 +626,16 @@ __init void e820_setup_gap(void) gapsize = 0x400000; found = e820_search_gap(&gapstart, &gapsize); -#ifdef CONFIG_X86_64 if (!found) { +#ifdef CONFIG_X86_64 gapstart = (max_pfn << PAGE_SHIFT) + 1024*1024; printk(KERN_ERR "e820: cannot find a gap in the 32bit address range\n" "e820: PCI devices with unassigned 32bit BARs may break!\n"); - } +#else + gapstart = 0x10000000; #endif + } /* * e820_reserve_resources_late protect stolen RAM already