From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8AA14C606D1 for ; Mon, 8 Jul 2019 21:16:40 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5B536216FD for ; Mon, 8 Jul 2019 21:16:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="CTVvYn3C"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b="mbcbklPn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5B536216FD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=soleen.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cLuN509HlKt/4onRSyP8aZn2yfJvqbqKw2JYBDzlJi8=; b=CTVvYn3CPE4fBq f86Oj4ofxE+HU6+6I0I+zwucL8ePG182n0Qd9mNIo3oNqeD7Z5lcyaLcNKAtJOKrCGAPdktZt3ezS TOwMEs07jexeHFh3YUQHC1AGJx2N9VUfwS/xrjlpxpGU/9F0QNl9OYQSiz4jnhpy/BLU4s46liTQo ywlMSKwsvKhL6VW1U/uNV2fXQXnN+1xmJX1VDDN7PngESqjhCxuUoqfqkyVzXvof2/6bFsIU348hN vRDnVEFxupGOmKEEl4v7vF2lZ0y23JMn7iIq5HuSPUjGXnW/W9rIgTfaU32/j4MmhK6TXspxnIeb4 P2WEWohxkC5rJPao+Q2Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hkazw-0002BP-1h; Mon, 08 Jul 2019 21:16:32 +0000 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hkaz0-0001OR-Vm for linux-arm-kernel@lists.infradead.org; Mon, 08 Jul 2019 21:15:37 +0000 Received: by mail-qt1-x844.google.com with SMTP id h18so12089874qtm.9 for ; Mon, 08 Jul 2019 14:15:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=VdsesycGrscxvl9VUJv2OrYGiO6I5hjIVNNGDZpPz+A=; b=mbcbklPnE9aSK5WgO3DjHoIPCmDRPu0y6gFhVqT2wERSQkqrlINfT1Dum/1YBHqVIA MHfCGiZYhNcyqdpiDNvMZSUSkBjk9mmUm2UzAXxyreXwkDarMe79+dMnFwRPOh7+l6Tk aB6rNkHgLO7Y1Jiz9NmlCAtxcQsnJZJn3GDc2qcLNW/H2zSoSBaJvjnwMgsVYjZasY6h wMgRHG4K4lnwl6PWSVbLTrSouwk/nknjx/sQIWAwaSwgSoByC78yhCB9mcQr5qM4iUFx zS5tOkS+Tj8MCjoQW99WEy4HdQ8WxAlpnEJNn0bceuRbwkIodt64QR6c1sZewin18v6i Sqww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VdsesycGrscxvl9VUJv2OrYGiO6I5hjIVNNGDZpPz+A=; b=kfguVBm9gaFFBKmiY8oousPtzytYZwTp9kTmNBk3W1s2A/5qW1TvisT9Y3lRfWAWlh wKHJbdU4aWgdVXTwC6z/BEnDenSh9PJ3AZzyzTzUaJpeAfySyLwFH2/SpkXPkryAAcZy IcbE+9Kmut41VdGjniGrRci2Px6B0bnLacFs6+UTEV39HVgjB1rBBeMrmHk2lfSrantZ 1dVnBtlgeJ1Ir620gGBvy78m7Wp4rftMfHP3Id2CJo6xAiekwZqKNl5xQGeC5SoSuAG/ 2Yfqv0f8iLdWk14k1mjOgfO3n6870Mkx0EZ/nmQIcC7gAEqG8Swsgk75V6x8M8z9EqZl xIsA== X-Gm-Message-State: APjAAAUfYf8PXrI0Ivaf/kbq4Uup6MOGWuz2eUaaH2Jdc1tPTKnbe/Vz 1uh3pIMrT/g+rZ26/Gie3IR7RbikiAI= X-Google-Smtp-Source: APXvYqxh88FuDHDTA50xcvkZxoDS6gx6EQNHyyvXUFPd1oxFXlmv0rBVOQea/c8sZqigS6xV/quFaw== X-Received: by 2002:a0c:89b7:: with SMTP id 52mr16660367qvr.199.1562620533833; Mon, 08 Jul 2019 14:15:33 -0700 (PDT) Received: from localhost.localdomain (c-73-69-118-222.hsd1.nh.comcast.net. [73.69.118.222]) by smtp.gmail.com with ESMTPSA id b67sm8335620qkd.82.2019.07.08.14.15.32 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 08 Jul 2019 14:15:33 -0700 (PDT) From: Pavel Tatashin To: pasha.tatashin@soleen.com, jmorris@namei.org, sashal@kernel.org, ebiederm@xmission.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, corbet@lwn.net, catalin.marinas@arm.com, will@kernel.org, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [v1 2/5] kexec: add resource for normal kexec region Date: Mon, 8 Jul 2019 17:15:25 -0400 Message-Id: <20190708211528.12392-3-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190708211528.12392-1-pasha.tatashin@soleen.com> References: <20190708211528.12392-1-pasha.tatashin@soleen.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190708_141535_290180_3C3408E1 X-CRM114-Status: GOOD ( 12.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org crashk_res resource is used to reserve memory for crash kernel. There is also, however, a benefit to reserve memory for normal kernel to speed up reboot performance. This is because during regular kexec reboot, kernel performs relocations to the final destination of the loaded segments, and the relocation might take a long time especially if initramfs is big. Therefore, similarly to crashk_res, add kexeck_res that will be used to reserve memory for normal kexec kernel. Signed-off-by: Pavel Tatashin --- include/linux/ioport.h | 1 + include/linux/kexec.h | 6 ++++-- kernel/kexec_core.c | 9 +++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/include/linux/ioport.h b/include/linux/ioport.h index da0ebaec25f0..3b18a3c112f3 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h @@ -133,6 +133,7 @@ enum { IORES_DESC_PERSISTENT_MEMORY_LEGACY = 5, IORES_DESC_DEVICE_PRIVATE_MEMORY = 6, IORES_DESC_DEVICE_PUBLIC_MEMORY = 7, + IORES_DESC_KEXEC_KERNEL = 8, }; /* helpers to define resources */ diff --git a/include/linux/kexec.h b/include/linux/kexec.h index b9b1bc5f9669..4c1121b385fb 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h @@ -303,12 +303,14 @@ extern int kexec_load_disabled; #define KEXEC_FILE_FLAGS (KEXEC_FILE_UNLOAD | KEXEC_FILE_ON_CRASH | \ KEXEC_FILE_NO_INITRAMFS) -/* Location of a reserved region to hold the crash kernel. - */ +/* Location of a reserved region to hold the crash kernel. */ extern struct resource crashk_res; extern struct resource crashk_low_res; extern note_buf_t __percpu *crash_notes; +/* Location of a reserved region to hold normal kexec kernel. */ +extern struct resource kexeck_res; + /* flag to track if kexec reboot is in progress */ extern bool kexec_in_progress; diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c index 2c5b72863b7b..932feadbeb3a 100644 --- a/kernel/kexec_core.c +++ b/kernel/kexec_core.c @@ -70,6 +70,15 @@ struct resource crashk_low_res = { .desc = IORES_DESC_CRASH_KERNEL }; +/* Location of the reserved area for the normal kexec kernel */ +struct resource kexeck_res = { + .name = "Kexec kernel", + .start = 0, + .end = 0, + .flags = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM, + .desc = IORES_DESC_KEXEC_KERNEL +}; + int kexec_should_crash(struct task_struct *p) { /* -- 2.22.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel