Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp689795imu; Fri, 7 Dec 2018 07:28:11 -0800 (PST) X-Google-Smtp-Source: AFSGD/Xl0JytW+LLYg6P/3c7+gFuylkq/ffHlEdbyZv3YmMvl7GjqzXZHTMu04WVroIvoidTFQOC X-Received: by 2002:a17:902:7107:: with SMTP id a7mr2521763pll.290.1544196491514; Fri, 07 Dec 2018 07:28:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544196491; cv=none; d=google.com; s=arc-20160816; b=z7fgfuykgSQAZ7WEG3xvBnlU5yxYUR73ecX/YXDUxlP1T+jY1vu5lnCsLEqM8wORr7 ocNUIhxh0k1X6Ps8TDKwoiCkl4i2PYe0dqp1o6F8PcHo5fXlME4+4XP0RRUYVoi0ho5d 4qcvVo8DaChaG+D2Pkz3O2La4dd/fcfJYy4GiZzVTZsIQ/Vp/CRjXqTua2ML5f9DojJk XLP7+bcDee1aGdtOoTaaLYQ8VtcHklWg4TN1A6O9q653JEAX8/MKm1TPdkXl2e7q/aZO lYOXUmiUfj0VGUJBSKVmyuni1u9yRZ+cIksmwtZ7g0Zv3M58jc3BDRVXTWAVofSUAXUR M2/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=LWzi5N9ErnaoM0xtxI+fsrH2tP7+GEG9Yks3l1TlQ9c=; b=zQdjQrnCOGT2OKHFX2pnreJcHlEJXXjRyg2ZU91ESqhPSRYSWBrLX7A25MbEw+FtNB 1LzIGNpRTnfqcPpuLE1hPXQZDQWcUaG7DbClo+OE2rh7H4Nly+blx7DXRhuW4f7twhwX RghsYykaxE67V4MXqVtcxqjImqWQZN39Yoy8nGqJeFeL1Owrrztbqe6dJm9ZO6N+Pkl7 n08EmAYhQlIDbHgqt3lPly81q6XlJoZwVmZIrcFdU6mELtTpv9Md9kV0ssSSGyHHGf+K hF5KQlWMOYIRJ05Sjg/9bEE5kJasFWyzdgd3zWe1y5o57L1d2kpPpZmZ5Uf6zz/GQ/5B 131A== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t5si2815006pgm.79.2018.12.07.07.27.55; Fri, 07 Dec 2018 07:28:11 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726124AbeLGP1I (ORCPT + 99 others); Fri, 7 Dec 2018 10:27:08 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:44262 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726041AbeLGP1I (ORCPT ); Fri, 7 Dec 2018 10:27:08 -0500 Received: by mail-lj1-f196.google.com with SMTP id k19-v6so3855852lji.11 for ; Fri, 07 Dec 2018 07:27:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LWzi5N9ErnaoM0xtxI+fsrH2tP7+GEG9Yks3l1TlQ9c=; b=j/hQaZjf49QZgjtLKC+zZHJRzRMA8PLbd3EaGjDr7/1BHwe6oYiIAGfCaCE+/PYgTw f8nKNDNcgeggViU32qaAwbnFXsDPe/r8yKq4EryLzoYJY5XV7DWMKjE2sQ2X+qXVBIiK oI/Fs9gbmD0kl6tSpVA04ku5ElUteN6jYdi1L5Q4AJnduJ31Q0g8Cy2n6BwWA0Sy6iru 9xk9O+Wz3EbDenpbOCClZMMd1hcyHRxVwJRcXRlBL8irNBIvMTekG4J5AtuOGare87YD PDJEtwy/hDHWWCqPfcBDWJNq+p5psGNxJumVFGzOW8ZQV3FR8UxC215a6ZcwaPYrGJfP cDeQ== X-Gm-Message-State: AA+aEWbmb2yUq/USk5l/g7MCb2DZdRKr5FU7mbL6+LnIG7BBsC9YuJ/m oXM3daCVrMwiKse8syrjLpl5hAbsKk/DlhdfbENwqw== X-Received: by 2002:a2e:96c6:: with SMTP id d6-v6mr1768292ljj.35.1544196426315; Fri, 07 Dec 2018 07:27:06 -0800 (PST) MIME-Version: 1.0 References: <20181207101439.190918-1-james.morse@arm.com> In-Reply-To: <20181207101439.190918-1-james.morse@arm.com> From: Bhupesh Sharma Date: Fri, 7 Dec 2018 20:56:53 +0530 Message-ID: Subject: Re: [PATCH arm64/kexec] arm64: kexec_file: forbid kdump via kexec_file_load() To: James Morse Cc: linux-arm-kernel , Linux Kernel Mailing List , devicetree@vger.kernel.org, kexec mailing list , Will Deacon , robh+dt@kernel.org, AKASHI Takahiro , Catalin Marinas , dhowells@redhat.com, Vivek Goyal , herbert@gondor.apana.org.au, davem@davemloft.net, Dave Young , Baoquan He , arnd@arndb.de, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, prudo@linux.ibm.com, Ard Biesheuvel , frowand.list@gmail.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi James, On Fri, Dec 7, 2018 at 3:44 PM James Morse wrote: > > Now that kexec_walk_memblock() can do the crash-kernel placement itself > architectures that don't support kdump via kexe_file_load() need to > explicitly forbid it. > > We don't support this on arm64 until the kernel can add the elfcorehdr > and usable-memory-range fields to the DT. Without these the crash-kernel > overwrites the previous kernel's memory during startup. > > Add a check to refuse crash image loading. > > Signed-off-by: James Morse > --- > > Context: http://lore.kernel.org/r/20181206155424.GA4422@arm.com > > arch/arm64/kernel/kexec_image.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/arch/arm64/kernel/kexec_image.c b/arch/arm64/kernel/kexec_image.c > index 1ad1d5f8f024..07bf740bea91 100644 > --- a/arch/arm64/kernel/kexec_image.c > +++ b/arch/arm64/kernel/kexec_image.c > @@ -47,6 +47,10 @@ static void *image_load(struct kimage *image, > struct kexec_segment *kernel_segment; > int ret; > > + /* We don't support crash kernels yet. */ > + if (image->type == KEXEC_TYPE_CRASH) > + return ERR_PTR(-EOPNOTSUPP); > + > /* > * We require a kernel with an unambiguous Image header. Per > * Documentation/booting.txt, this is the case when image_size > -- > 2.19.2 > TBH, I would have loved the complete 'kexec_file_load' support to have made way upstream for arm64 as well, but I understand that it is stuck till we have an agreement on the DT side of things. So, refusing a crash image loading in such a case makes sense for now. So, please feel free to add: Reviewed-by: Bhupesh Sharma Thanks, Bhupesh