Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1349378imm; Tue, 2 Oct 2018 06:56:08 -0700 (PDT) X-Google-Smtp-Source: ACcGV62TchRQsx5nGCzpHzxXCOtzO1ma8s/eWwsgLLQ3hL61etQdZu7FkSqkcbXo1Fr0+KSv83p2 X-Received: by 2002:a62:455b:: with SMTP id s88-v6mr16258257pfa.203.1538488568173; Tue, 02 Oct 2018 06:56:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538488568; cv=none; d=google.com; s=arc-20160816; b=cCRMCCtL7c9SYWd8Y3aTp9041IrTpRT8tP9x3BhFiyDH1mIhsHa2DPzCWafEJN8Q+L 2aYqRHvoOHYF1kuK253L0N2Y0Yt7kyoRxav1cuyXnlf6fwuV6FxqpOflZydqBnAwxAwE jBLdi4fA+jYRpXfQ5n2xDDs8jIBZrJc3sDLRA+ZEwhI08rQaLjv5Psu0ADTmCpcdd6vU LSh2TiHYS+w7YAympKNk5neB6abi/lZOR4WA3MESh/DOGuHGfMZts0ukRKMFPh5s7E4l YzGtsB0yD6KdnndEMpE30LxR7BKC/YCC7mVmoyEBJe4X8jHBDJAilLlulHSPDTu17/aw UuHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=9PsZGDANcc8sVgXOeWk9SJh2Bhbg/MC1nV0RxN7O4M0=; b=mrJOiZkba5yTxO0qM2wVMmcrTlS5B/uhcLbvDJ3fNPdzlPwW5MIjA+1bfPNiB2bZPx aacv+gMl4/UZ+mJaC8r1HfeknhVd4D3P2bZ8lZPhI9T6ECyDzv2mqY1ULHKw4/Ftxl57 GIuDS8ofo7QOoN6hFzOJgNpU/T6C+DVtmsxJ+CoxodGAL/rCxLADi6XI0I6wV9NLMNE7 WqFPUITvYHDLB23esUdJkKQFg6pQCaUQfvFsLttjB+nZ4z66Kw4oYml3DJ/hR0EG5LPn eorHeFtd3627Adw7pDtYYpjG25nZLhSDpOOX//rGcdjp9A+EcRx81h0HXRiMtcdPpOGo 3s0w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s16-v6si3465329pfk.62.2018.10.02.06.55.53; Tue, 02 Oct 2018 06:56:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731222AbeJBUPT (ORCPT + 99 others); Tue, 2 Oct 2018 16:15:19 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:34340 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731212AbeJBUPS (ORCPT ); Tue, 2 Oct 2018 16:15:18 -0400 Received: from localhost (24-104-73-23-ip-static.hfc.comcastbusiness.net [24.104.73.23]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 13087BF0; Tue, 2 Oct 2018 13:31:55 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hari Bathini , David Gibson , Dave Young , Michael Ellerman , Sasha Levin Subject: [PATCH 4.14 025/137] powerpc/kdump: Handle crashkernel memory reservation failure Date: Tue, 2 Oct 2018 06:23:46 -0700 Message-Id: <20181002132500.235804619@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181002132458.446916963@linuxfoundation.org> References: <20181002132458.446916963@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hari Bathini [ Upstream commit 8950329c4a64c6d3ca0bc34711a1afbd9ce05657 ] Memory reservation for crashkernel could fail if there are holes around kdump kernel offset (128M). Fail gracefully in such cases and print an error message. Signed-off-by: Hari Bathini Tested-by: David Gibson Reviewed-by: Dave Young Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/kernel/machine_kexec.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/arch/powerpc/kernel/machine_kexec.c +++ b/arch/powerpc/kernel/machine_kexec.c @@ -186,7 +186,12 @@ void __init reserve_crashkernel(void) (unsigned long)(crashk_res.start >> 20), (unsigned long)(memblock_phys_mem_size() >> 20)); - memblock_reserve(crashk_res.start, crash_size); + if (!memblock_is_region_memory(crashk_res.start, crash_size) || + memblock_reserve(crashk_res.start, crash_size)) { + pr_err("Failed to reserve memory for crashkernel!\n"); + crashk_res.start = crashk_res.end = 0; + return; + } } int overlaps_crashkernel(unsigned long start, unsigned long size)