Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp6643461imm; Mon, 23 Jul 2018 23:59:20 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeT7ewfD89/OBUFwK/42UZRyzTI+gVxgU35aN4vRO4A2qw79AIiyhWLKOlq8b0r9crYcYHP X-Received: by 2002:a63:e001:: with SMTP id e1-v6mr15095391pgh.380.1532415560191; Mon, 23 Jul 2018 23:59:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532415560; cv=none; d=google.com; s=arc-20160816; b=lWv4zOnR7BRaMx8lOBVkxWsLH297LP6JF3kV9NhRxfbZbIx0FkNP3t5xR3i9yA0QiX xrWOMCflgcCMp9cvsvJ3mKqzWq9q9JQbB/F4zOSAIm6DfJYsK5/R2oFdOP6ygS2aX2eA yZAzVSCB3RtkE2HD2eb6F7ZGtfjFi0meadGjbIAWqq3b9Ue8bhhhr7rAbLxb2qMVv9AC 8alyNJOd4W6O5j81VQDWj2X+ktjxwfSsa2DzhofYlphU0Y0tUK4rPL82Pb0hhZFwaviv tgzjhhoDyREh/Of4iSpzphPk5AjyIuSOB0m9mLU+14AD5BpG3o+B+QJ+Z0RQoCopF9W/ xBMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=qX+9ZLjYleTqiYTR/9AsWjndzTTMAgGfRwkaazjqic0=; b=iIbwPce76d8tNlwe6xgu9nd5NOeZa9mCH6kEGpWuJEcrC1Gm3oJG3PlMaakVojf9DI XowZLXpaP7jFo6DPeUSBKIq92GkGSqlnRhF99hYFOlc2sUQB5fRBsUJFjee1pih2jFO9 u8rZUsMcfbIUq4L8pB3zM7S5BxkzJHLGHSiZTh+v7lVgB/8Xp8cIMzI9dAPwdJ/J2+mN G2101ZIVJ6NLy3k3Ruf1wPSarNVLZ4lbmqMh7fr3+aV0rNnpmUVK5GctpMhVm3kjepnN KeGxrzjW7kiWbh7ntu3NRtz/UORZUCvQYTXaqrfaEutCgNaudkmz7E9andQegko//xlh 7HEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Gjx6vY7E; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a24-v6si7523842pgi.515.2018.07.23.23.59.05; Mon, 23 Jul 2018 23:59:20 -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; dkim=pass header.i=@linaro.org header.s=google header.b=Gjx6vY7E; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388480AbeGXICu (ORCPT + 99 others); Tue, 24 Jul 2018 04:02:50 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:37356 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388331AbeGXICt (ORCPT ); Tue, 24 Jul 2018 04:02:49 -0400 Received: by mail-pf1-f195.google.com with SMTP id a26-v6so623643pfo.4 for ; Mon, 23 Jul 2018 23:57:52 -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=qX+9ZLjYleTqiYTR/9AsWjndzTTMAgGfRwkaazjqic0=; b=Gjx6vY7EwRTKIrVY9J55sUQ34HHFlTe4FmpRadgter9yKeBuzeehOo01GQ1nzj7rQx IZZnGZQGxgEy+Nyb24xy4H0OmFFN3qMUY2CgDgPuxd6PM27plx5Ier0qF4WBMg74Y3nR 3/P+rUjJOAnix3Ymmp41EkC6E95ZGNa/i+SuY= 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=qX+9ZLjYleTqiYTR/9AsWjndzTTMAgGfRwkaazjqic0=; b=H8gOE+UDUEPkebKkDxPGu1I9PRHT355o8UB0uXpSRMxsUSqW86lgFsKWqp9+/4Z6oc QzyvR5Tr7AHl1mH9cAsJjRzCDgxVq3Uf4x2zL3omL+IhE6k+huWskgJCfVjdaVy3iKG5 8FgcZxtL8BlNK5a59ZFaHDXnFhDdZQJAnQPKMpNjRNzMGQ8HxARvaPCtfPflXyndYW/s JBXFc73noE1hQaxKZhQw9EhW7YONgS4oGNYhU2gGfoSL6YU4aN/YMYRAQEj7We+kG3f+ zWuabaYboxNWnVlbAJCQbLmXpeurejA00xOxZHkWoWffztkAAOaHBzg9qnXBDBYPZrQ/ srVw== X-Gm-Message-State: AOUpUlGuNTzzUJgxy7lur3h2VNo3F0fsz4d3J5XZSBvR+bpzZegiUSkM CHNPosDCiqt0WbI9gZNsapkIGQ== X-Received: by 2002:a63:f756:: with SMTP id f22-v6mr14890781pgk.289.1532415472243; Mon, 23 Jul 2018 23:57:52 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id u185-v6sm16092326pfu.134.2018.07.23.23.57.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Jul 2018 23:57:51 -0700 (PDT) From: AKASHI Takahiro 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 Cc: ard.biesheuvel@linaro.org, james.morse@arm.com, bhsharma@redhat.com, kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, AKASHI Takahiro Subject: [PATCH v12 05/16] kexec_file: kexec_walk_memblock() only walks a dedicated region at kdump Date: Tue, 24 Jul 2018 15:57:48 +0900 Message-Id: <20180724065759.19186-6-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180724065759.19186-1-takahiro.akashi@linaro.org> References: <20180724065759.19186-1-takahiro.akashi@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: AKASHI Takahiro Cc: Dave Young Cc: Vivek Goyal Cc: Baoquan He --- kernel/kexec_file.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c index 2f0691b0f8ad..bb23f9280a7a 100644 --- a/kernel/kexec_file.c +++ b/kernel/kexec_file.c @@ -511,6 +511,9 @@ 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, &mstart, &mend, NULL) { -- 2.18.0