Message ID | 20180801075820.3753-6-takahiro.akashi@linaro.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9DF231822 for <patchwork-linux-arm@patchwork.kernel.org>; Wed, 1 Aug 2018 08:54:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8CDF128EBA for <patchwork-linux-arm@patchwork.kernel.org>; Wed, 1 Aug 2018 08:54:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8140A2B191; Wed, 1 Aug 2018 08:54:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2BC0928EBA for <patchwork-linux-arm@patchwork.kernel.org>; Wed, 1 Aug 2018 08:54:18 +0000 (UTC) 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=JGxeOTTUiQ+upTAtbI9ERcaRALLtpr+J0A5SRXfAGIo=; b=WWe/glAtowEH7GoeNkCa+njlX5 vBD6iua05OSBYOktH9v69CfnDwo9QU7pGZfxDORLI9c/BOxvg+pmoGLq4FC2wgJF2cX/gIXF6KGxU /Sw8X1bDyzP9v7IK245p8hpvf9l51w4khG+jEQ7foPMYuPYUDc0waoSEKHOGq3keMU3gxcTX1ARHX DOvBNRkuxOa4nNiIBX+G/v5EmW0LjfemvfOe0rYI6BmerxWypfWymdWju3MJEEgnOKQH+fLdf5Xmp Mspzdwt6YIDA8dnJGRF/NlNBULtUw9loNSu6Bag+pusLZVv5ABMV0mnMbUBApCHTMxNlCvuqK2B6g aMzlTMtA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fkmtY-0008IZ-79; Wed, 01 Aug 2018 08:54:12 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fkmsj-00071q-HN for linux-arm-kernel@bombadil.infradead.org; Wed, 01 Aug 2018 08:53:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=H9V/pRhzf1RnH7rtjNBLRuYtR4l5xIhl8He5yhS2iQg=; b=cehZGBwpS4wQXjhj51bP6uvbK 0zbKI5EZVsU9M3YTP2qfFZHxMEHVWbHscf5tqGbuKUXAdXKzlUKfla9TeIes8ppTDExVFvUweBWUl E4t9UWrIxnJ6qogSRgKEzr67rXEGEnCxuPIYLDJ10ELv8BETPhHf3aX1GLf5BgHTkamlpO1ickB9V XFSlIQxHz5tAq3yscrsx1++DQPxe0QviR9BmTSNaaFjA88D+69HS7kCzmhwCMRPq7gSnKEdxvekl/ lyWi1yC8/Vj+34+7G1LPjsjTOP8IY/gA7CXTMLb1vFf9qaAW74fcmUJDdWPL/ewZ3whL42X3ULwlh wW2MdF3rA==; Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fkm3T-0002PM-I9 for linux-arm-kernel@lists.infradead.org; Wed, 01 Aug 2018 08:00:24 +0000 Received: by mail-pf1-x443.google.com with SMTP id e13-v6so7433449pff.7 for <linux-arm-kernel@lists.infradead.org>; Wed, 01 Aug 2018 01:00:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=H9V/pRhzf1RnH7rtjNBLRuYtR4l5xIhl8He5yhS2iQg=; b=Dv6Ao5gbCEtv75PDFcno/cC/X0jP0Kp+YSXjdpVy2ycLWc28q9h03Q+dW3/n3iDhi0 WzYC/SbZjSVaYgsCyAp3rEq3HxWR1dl8CJD6iLTGOYG1WdBTT3Y1Sw3PQJGYMbFDj1va 4y0hNmbkjjjgQt24IaFB+VzuDY/MYvhdnsC4o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=H9V/pRhzf1RnH7rtjNBLRuYtR4l5xIhl8He5yhS2iQg=; b=MItBZ3XBKU6s6ikqhIkPYKgPBNMDhzqoM4lE/lgqkfG79DP4O6vJxHHM+DOvf3kcVw hqDejd/v5k2Zwrw764nE98U2eUxjcNoBMvnWoOKYCfxoSSAnp6IJKGXa6TMHc9cpLYVi bjKNmUxc1YdSRfWLn4TZA8DmFRvY8qIgR13FNZQGutz/xvVVywCS0GyVhEvtHyBj92Fl h5C+mt4JxIG5oi67zFtVaTWDhn8QULPEFvi+i8wCqryVKTsmsF/TAf7XyJ1tegef5Bvy zeCbHv67Mro6xQ4uLi0Ko01TIwmC8lPIUHOiRcyUQ5zmueeLnn6D23/scGT1whku7FTr K01g== X-Gm-Message-State: AOUpUlHejbN7xX47ka6PBMpvogQVcNBXXsSIaGHWAnV1ZXgrY14X4hP7 sY9zJbLqqzxrnIiR4nQ1EbnNPg== X-Google-Smtp-Source: AAOMgpd77a85zHpHjYF49EVfk4NZft8mM871fKOIxngiuOlnjLs07tPx8w70cZs9VRa0wjVguKXQ8A== X-Received: by 2002:a65:6398:: with SMTP id h24-v6mr23529895pgv.245.1533110409558; Wed, 01 Aug 2018 01:00:09 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id h130-v6sm34714091pgc.88.2018.08.01.01.00.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Aug 2018 01:00:09 -0700 (PDT) From: AKASHI Takahiro <takahiro.akashi@linaro.org> To: catalin.marinas@arm.com, will.deacon@arm.com, dhowells@redhat.com, vgoyal@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, dyoung@redhat.com, bhe@redhat.com, arnd@arndb.de, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com Subject: [PATCH v13 05/16] kexec_file: kexec_walk_memblock() only walks a dedicated region at kdump Date: Wed, 1 Aug 2018 16:58:09 +0900 Message-Id: <20180801075820.3753-6-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180801075820.3753-1-takahiro.akashi@linaro.org> References: <20180801075820.3753-1-takahiro.akashi@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180801_040023_607888_E16937CB X-CRM114-Status: GOOD ( 16.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: ard.biesheuvel@linaro.org, bhsharma@redhat.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, prudo@linux.ibm.com, AKASHI Takahiro <takahiro.akashi@linaro.org>, james.morse@arm.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
subject: arm64: kexec: add kexec_file_load() support
|
expand
|
diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c index 1073ef56a95d..370d7d8ff27f 100644 --- a/kernel/kexec_file.c +++ b/kernel/kexec_file.c @@ -511,8 +511,11 @@ static int kexec_walk_memblock(struct kexec_buf *kbuf, phys_addr_t mstart, mend; struct resource res = { }; + if (kbuf->image->type == KEXEC_TYPE_CRASH) + return func(&crashk_res, kbuf); + if (kbuf->top_down) { - for_each_free_mem_range_reverse(i, NUMA_NO_NODE, 0, + for_each_free_mem_range_reverse(i, NUMA_NO_NODE, MEMBLOCK_NONE, &mstart, &mend, NULL) { /* * In memblock, end points to the first byte after the @@ -526,8 +529,8 @@ static int kexec_walk_memblock(struct kexec_buf *kbuf, break; } } else { - for_each_free_mem_range(i, NUMA_NO_NODE, 0, &mstart, &mend, - NULL) { + for_each_free_mem_range(i, NUMA_NO_NODE, MEMBLOCK_NONE, + &mstart, &mend, NULL) { /* * In memblock, end points to the first byte after the * range while in kexec, end points to the last byte
In kdump case, there exists only one dedicated memblock region as usable memory (crashk_res). With this patch, kexec_walk_memblock() runs a given callback function on this region. Cosmetic change: 0 to MEMBLOCK_NONE at for_each_free_mem_range*() Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Cc: Dave Young <dyoung@redhat.com> Cc: Vivek Goyal <vgoyal@redhat.com> Cc: Baoquan He <bhe@redhat.com> --- kernel/kexec_file.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)