From patchwork Wed Mar 3 00:22:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pasha Tatashin X-Patchwork-Id: 12114211 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.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,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 B58F5C433DB for ; Wed, 3 Mar 2021 20:46:49 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 5B77164EF4 for ; Wed, 3 Mar 2021 20:46:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5B77164EF4 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+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=desiato.20200630; 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=N1L8QQUtsGz6gXhIWKu7VofoVG3uEimmklfclzGedFM=; b=ipQoooZMb6qmOsY+/MH8RXfxI gOlIJ7EMAkMJNtGbMD0o5VCrw33/v0TPK18oXIDYn2ORY0wtd6w4UhEQHPRGDpOqn6rbart8UCyng m5P5SNQbqNrZf1N0Dkxy7OtyZwHc2sc7eTQnTb+R/A7XUCpgPQf0M+LHSV1Wvqi1+me3ROtldHVmc s+zMA8r8J7KCFyD3afFI1zfeT6ad7A10vbcYlq8wUr4INZwIjcg67viuIB4H7lIiuq3PnymQjBELL eCgs+iC9chHGToKLjaVKIC9ZPNmzlsfnjUyXxwtmzLuwjSVMxl+GyklvSU7ZyRUd1xgBdzUhpd0M0 uSWEZsvEQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lHYKA-006SqM-Lu; Wed, 03 Mar 2021 20:42:26 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lHT6e-005J7Y-2E for linux-arm-kernel@desiato.infradead.org; Wed, 03 Mar 2021 15:08:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description; bh=xvI3SX7JlP3yoyw6A9a93CvHYXbBacBuW7cN/tDXEXM=; b=RGjiQfz1fmzi7CHo80SRyqmJEV zjvfsHcHPql6ICZKfEzwV5nBtsApMATMme/BKFwZueofWXCxA6rBN3OeuKIVUSMRTZIFrUfPvN5+w NIDy/U0ZTcyuHJCg+Iv4YloF7XjAjSTXU5dVRm9vDaT79aHvP7XJRFmEu4PerD6iqdvTnKShXvCCv /jPuLyPgVk2eiEmSMyty+Fxm3pDhg0prDQTOsiEZi7WKjCkx/6euiUJzihPOxv2FI2Olq3K1zPg3C jG3nYphaT3JyN/FTygs8CgNfgD1zoURu/ROHB6csIkQqTfjN9PMZmOmZu3jbl2xdd0V9Hq3VaFDui vm8I93NQ==; Received: from mail-qt1-x82f.google.com ([2607:f8b0:4864:20::82f]) by casper.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lHFJ0-000jhU-19 for linux-arm-kernel@lists.infradead.org; Wed, 03 Mar 2021 00:23:58 +0000 Received: by mail-qt1-x82f.google.com with SMTP id b3so16242392qtj.10 for ; Tue, 02 Mar 2021 16:23:57 -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=xvI3SX7JlP3yoyw6A9a93CvHYXbBacBuW7cN/tDXEXM=; b=oPIjUKZfKiJwU7NlOxCWJ5OPY57CbXoshRc624GxpBnFgpup2P/nV58n0kK9/w2XTx brLP+1+u8lqb56VBhBgco7Y8J95WM0noHIV2xeYo4P7naJMOF8jyTmpN1bSO7ZzqBYkf wLnTE9IuEPsdQ9DhW53OsI8CGals1KWGCUuu9oUKLerRbT0Eefa0xtN6bNdQt8IR07uA 2nsXk3Z0vFKr1jZmw1N75kg8R6bKWnQATRIxJn4n7gJcwpld3SrUrVk/3xub3eHr43iP T9Uf5ZzJh8r4nx+VCew3/uiDHEi1lSTdW1/r3/oOd9UBCwABx/E9DzUpEJ1T7iG2PJER ybYQ== 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=xvI3SX7JlP3yoyw6A9a93CvHYXbBacBuW7cN/tDXEXM=; b=IGYbvqV30lK2cAzTlG6tQxzmOZICOzQHcrVuGPDkkYrp7zSRlrhyC3d6iy1pwJCuzt 4lE7UiQdTv36Ilws1zkeirIx+mR2EmBl2jGpZNwsliH6B9QgqLc2vLN2t5m0RfX14dDK qWA4MulGrcey045OreYo9P5fDC0u848esAa0zwViShoyqFQ7NHDAhZR4NaYVyxHeCEGd ElsfPadVTVcu9oAtt/k5jatWWvs/TD06zLrp+o92WizT1Chxjdj15BCDBgFDhpvNZLqP o4lTrdeQ4kdfLvwmLRVYsaX4T7bm7UIJDLJHvE59O3LaI6On8duZ9knaG89okHvSJUye 3n9A== X-Gm-Message-State: AOAM532TzmfAgjwZe/a7XdeWBZpqxzPMkQhJO94tLzBRH2sHG5zB2I60 OvEb3Bu7iU2CzrAxMVJZMeX17g== X-Google-Smtp-Source: ABdhPJx5815Pblab/QccqNxqmgkFadcK+ZfVV2aeyidjFjH4QiHxtUtFGn8129DzTiPluIgZh9HpDw== X-Received: by 2002:ac8:64c:: with SMTP id e12mr20040140qth.103.1614730975050; Tue, 02 Mar 2021 16:22:55 -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 r3sm16690512qkm.129.2021.03.02.16.22.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 16:22:54 -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 v12 17/17] arm64: kexec: Remove cpu-reset.h Date: Tue, 2 Mar 2021 19:22:30 -0500 Message-Id: <20210303002230.1083176-18-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210303002230.1083176-1-pasha.tatashin@soleen.com> References: <20210303002230.1083176-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-20210303_002358_923216_B72AA93D X-CRM114-Status: GOOD ( 15.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This header contains only cpu_soft_restart() which is never used directly anymore. So, remove this header, and rename the helper to be cpu_soft_restart(). Suggested-by: James Morse Signed-off-by: Pavel Tatashin --- arch/arm64/include/asm/kexec.h | 6 ++++++ arch/arm64/kernel/cpu-reset.S | 7 +++---- arch/arm64/kernel/cpu-reset.h | 30 ------------------------------ arch/arm64/kernel/machine_kexec.c | 6 ++---- 4 files changed, 11 insertions(+), 38 deletions(-) delete mode 100644 arch/arm64/kernel/cpu-reset.h diff --git a/arch/arm64/include/asm/kexec.h b/arch/arm64/include/asm/kexec.h index 5fc87b51f8a9..ee71ae3b93ed 100644 --- a/arch/arm64/include/asm/kexec.h +++ b/arch/arm64/include/asm/kexec.h @@ -90,6 +90,12 @@ static inline void crash_prepare_suspend(void) {} static inline void crash_post_resume(void) {} #endif +#if defined(CONFIG_KEXEC_CORE) +void cpu_soft_restart(unsigned long el2_switch, unsigned long entry, + unsigned long arg0, unsigned long arg1, + unsigned long arg2); +#endif + #define ARCH_HAS_KIMAGE_ARCH struct kimage_arch { diff --git a/arch/arm64/kernel/cpu-reset.S b/arch/arm64/kernel/cpu-reset.S index 37721eb6f9a1..5d47d6c92634 100644 --- a/arch/arm64/kernel/cpu-reset.S +++ b/arch/arm64/kernel/cpu-reset.S @@ -16,8 +16,7 @@ .pushsection .idmap.text, "awx" /* - * __cpu_soft_restart(el2_switch, entry, arg0, arg1, arg2) - Helper for - * cpu_soft_restart. + * cpu_soft_restart(el2_switch, entry, arg0, arg1, arg2) * * @el2_switch: Flag to indicate a switch to EL2 is needed. * @entry: Location to jump to for soft reset. @@ -29,7 +28,7 @@ * branch to what would be the reset vector. It must be executed with the * flat identity mapping. */ -SYM_CODE_START(__cpu_soft_restart) +SYM_CODE_START(cpu_soft_restart) /* Clear sctlr_el1 flags. */ mrs x12, sctlr_el1 mov_q x13, SCTLR_ELx_FLAGS @@ -51,6 +50,6 @@ SYM_CODE_START(__cpu_soft_restart) mov x1, x3 // arg1 mov x2, x4 // arg2 br x8 -SYM_CODE_END(__cpu_soft_restart) +SYM_CODE_END(cpu_soft_restart) .popsection diff --git a/arch/arm64/kernel/cpu-reset.h b/arch/arm64/kernel/cpu-reset.h deleted file mode 100644 index f6d95512fec6..000000000000 --- a/arch/arm64/kernel/cpu-reset.h +++ /dev/null @@ -1,30 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* - * CPU reset routines - * - * Copyright (C) 2015 Huawei Futurewei Technologies. - */ - -#ifndef _ARM64_CPU_RESET_H -#define _ARM64_CPU_RESET_H - -#include - -void __cpu_soft_restart(unsigned long el2_switch, unsigned long entry, - unsigned long arg0, unsigned long arg1, unsigned long arg2); - -static inline void __noreturn cpu_soft_restart(unsigned long entry, - unsigned long arg0, - unsigned long arg1, - unsigned long arg2) -{ - typeof(__cpu_soft_restart) *restart; - - restart = (void *)__pa_symbol(__cpu_soft_restart); - - cpu_install_idmap(); - restart(0, entry, arg0, arg1, arg2); - unreachable(); -} - -#endif diff --git a/arch/arm64/kernel/machine_kexec.c b/arch/arm64/kernel/machine_kexec.c index a1c9bee0cddd..ef7ba93f2bd6 100644 --- a/arch/arm64/kernel/machine_kexec.c +++ b/arch/arm64/kernel/machine_kexec.c @@ -23,8 +23,6 @@ #include #include -#include "cpu-reset.h" - /** * kexec_image_info - For debugging output. */ @@ -197,10 +195,10 @@ void machine_kexec(struct kimage *kimage) * In kexec_file case, the kernel starts directly without purgatory. */ if (kimage->head & IND_DONE) { - typeof(__cpu_soft_restart) *restart; + typeof(cpu_soft_restart) *restart; cpu_install_idmap(); - restart = (void *)__pa_symbol(__cpu_soft_restart); + restart = (void *)__pa_symbol(cpu_soft_restart); restart(is_hyp_callable(), kimage->start, kimage->arch.dtb_mem, 0, 0); } else {