From patchwork Mon Jan 25 19:19:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pasha Tatashin X-Patchwork-Id: 12044125 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 7CEDEC433E0 for ; Mon, 25 Jan 2021 19:19:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1C40721D94 for ; Mon, 25 Jan 2021 19:19:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1C40721D94 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=soleen.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3E0318D0025; Mon, 25 Jan 2021 14:19:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 38F9E8D0023; Mon, 25 Jan 2021 14:19:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 280538D0025; Mon, 25 Jan 2021 14:19:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0130.hostedemail.com [216.40.44.130]) by kanga.kvack.org (Postfix) with ESMTP id 0EF6E8D0023 for ; Mon, 25 Jan 2021 14:19:43 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id BF79E3622 for ; Mon, 25 Jan 2021 19:19:42 +0000 (UTC) X-FDA: 77745261804.15.anger91_050c14927588 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin15.hostedemail.com (Postfix) with ESMTP id 8691D1814B0D2 for ; Mon, 25 Jan 2021 19:19:42 +0000 (UTC) X-HE-Tag: anger91_050c14927588 X-Filterd-Recvd-Size: 5055 Received: from mail-qt1-f174.google.com (mail-qt1-f174.google.com [209.85.160.174]) by imf03.hostedemail.com (Postfix) with ESMTP for ; Mon, 25 Jan 2021 19:19:41 +0000 (UTC) Received: by mail-qt1-f174.google.com with SMTP id d15so10498038qtw.12 for ; Mon, 25 Jan 2021 11:19:41 -0800 (PST) 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=5oItsXz80VGMkIK9n/+4yNTlc3wm3VkQinupbSJHsbU=; b=PZYpwfrFvSlaUCkpDD05HG1cJCDlDOf+CUaa46d/3Sf4IeCJvLQ226vo3BkaPzPeVK JZbb1ZDcCU7ye9jeVV1OG5khyvwWUIfNQO1CqaBvXmiHejT5L+rDVKo6Rm4kpcbugs9G ne9oGFKvOQsVFYgujx0RQze9i3AqNviHN45Bb0YFDIo741ZRjS1YRjfDGXn69eAi4PAV JIhvMTg3YI2g+4P9Vz7u/dSGxJd8MHa37mdnHAj1kcTor+MsBSmxNUee4ll41ONPNKp7 VCcG8A9NH9nt8ykRu91p3nz82wHjF6r3JWAGbffQLeTodD/nuGq7TYWmm9RrzYzoTo1a sSsA== 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=5oItsXz80VGMkIK9n/+4yNTlc3wm3VkQinupbSJHsbU=; b=UW8MjkTgO5oNQnYW4coyZ4KWQWVKGp0UviIKF5RvtATF7FnMxQzajMDFFy0+O8lOOm PfQ3/ork162KSIhqBZOn/mI/CGO+rKWy1tpnv1ItX03YIuJjmXQixystJtHjabeHq/62 2WhB7rRm8xNsfQaf1hpuawq81U3/scdrV1vmGmsWCYr9CfaCeyFPfvkf0N1aYGQx4hVy yUiYBf4BGrF0rqufEPkqeLMBC1LLrnMgWIn+EWVXODLpZmVLNY7ElyWK8EetJVORWmqJ iLoS82F8InxVbENVA3ccjqLJ1Vsbk0vgJvlmNZ70OdzzGlWu37Ai1rDFEQozwsLcqrmw IE1A== X-Gm-Message-State: AOAM530ZhM2q42QBqdisWBA3aaBLW7HSTmnBhLETtvpz8EBzJpB4CnJM Lid96JzTnHX3RPZI6f4GbtdLJg== X-Google-Smtp-Source: ABdhPJydaAMyVai0d0oDbWxmrL/nu0WOLUZ8DiszpSfhSyLHotQkTYoRRSqhOnxoO+wBONtIKJSi8w== X-Received: by 2002:ac8:490e:: with SMTP id e14mr1966761qtq.99.1611602380917; Mon, 25 Jan 2021 11:19:40 -0800 (PST) Received: from localhost.localdomain (c-73-69-118-222.hsd1.nh.comcast.net. [73.69.118.222]) by smtp.gmail.com with ESMTPSA id s6sm9047638qtx.63.2021.01.25.11.19.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jan 2021 11:19:40 -0800 (PST) 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-arm-kernel@lists.infradead.org, maz@kernel.org, james.morse@arm.com, vladimir.murzin@arm.com, matthias.bgg@gmail.com, linux-mm@kvack.org, mark.rutland@arm.com, steve.capper@arm.com, rfontana@redhat.com, tglx@linutronix.de, selindag@gmail.com, tyhicks@linux.microsoft.com Subject: [PATCH v10 10/18] arm64: kexec: call kexec_image_info only once Date: Mon, 25 Jan 2021 14:19:15 -0500 Message-Id: <20210125191923.1060122-11-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210125191923.1060122-1-pasha.tatashin@soleen.com> References: <20210125191923.1060122-1-pasha.tatashin@soleen.com> MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Currently, kexec_image_info() is called during load time, and right before kernel is being kexec'ed. There is no need to do both. So, call it only once when segments are loaded and the physical location of page with copy of arm64_relocate_new_kernel is known. Signed-off-by: Pavel Tatashin Acked-by: James Morse --- arch/arm64/kernel/machine_kexec.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/arm64/kernel/machine_kexec.c b/arch/arm64/kernel/machine_kexec.c index a8aaa6562429..90a335c74442 100644 --- a/arch/arm64/kernel/machine_kexec.c +++ b/arch/arm64/kernel/machine_kexec.c @@ -66,6 +66,7 @@ int machine_kexec_post_load(struct kimage *kimage) memcpy(reloc_code, arm64_relocate_new_kernel, arm64_relocate_new_kernel_size); kimage->arch.kern_reloc = __pa(reloc_code); + kexec_image_info(kimage); /* Flush the reloc_code in preparation for its execution. */ __flush_dcache_area(reloc_code, arm64_relocate_new_kernel_size); @@ -84,8 +85,6 @@ int machine_kexec_post_load(struct kimage *kimage) */ int machine_kexec_prepare(struct kimage *kimage) { - kexec_image_info(kimage); - if (kimage->type != KEXEC_TYPE_CRASH && cpus_are_stuck_in_kernel()) { pr_err("Can't kexec: CPUs are stuck in the kernel.\n"); return -EBUSY; @@ -170,8 +169,6 @@ void machine_kexec(struct kimage *kimage) WARN(in_kexec_crash && (stuck_cpus || smp_crash_stop_failed()), "Some CPUs may be stale, kdump will be unreliable.\n"); - kexec_image_info(kimage); - /* Flush the kimage list and its buffers. */ kexec_list_flush(kimage);