From patchwork Mon Jan 25 19:19:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pasha Tatashin X-Patchwork-Id: 12044169 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=-17.0 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=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 7A056C433DB for ; Mon, 25 Jan 2021 19:26:35 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 2B41D21D79 for ; Mon, 25 Jan 2021 19:26:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2B41D21D79 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=merlin.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=FW7j+sr8nxFh0l9iYgl3T9N+auDkpex0XGogkteu7I8=; b=wFX1wVPnOHMNGGQbxsoztqiYID hMUlFL6wyaECpzZBBRAXvvMtrc3RlPjXtMfJ758+RFXdaNu4FSNEZyEvMdSKGlKS53Y1sDUQ/gaP0 9fUgnG8KBdrwpDlrQ+/bIEdeD/XXsYRLQZFQWVc0O9sgQbJoR7/qBI0Dp1CfApZyxpFGBeF8juLI5 qQnXxh5b84T+HO0vekvEsh97lhqioabw3Se4UwLXGq9QeqSDQ4mnDw5yG7RrUF/pzn9G3Cga95Ac3 6yO+3sKmNrQtDuAE5Hq+RtkRaI+26ySCyzelGLA0LtPqqhh2lZ3o0kTHiCcZX8+SWYQD0WnEPPQnH 6TpGmH4A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l47TF-0000jC-0l; Mon, 25 Jan 2021 19:24:17 +0000 Received: from mail-qv1-f42.google.com ([209.85.219.42]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l47P4-0007G8-D0 for linux-arm-kernel@lists.infradead.org; Mon, 25 Jan 2021 19:20:18 +0000 Received: by mail-qv1-f42.google.com with SMTP id h21so6715993qvb.8 for ; Mon, 25 Jan 2021 11:19: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=bntzwWb0HnF+pu1wTRlxa4nGPd0MURNpYR8uZbvPwl4=; b=aznWjElVYsHK1zXw38ZeQN4JK2jZE1LCcfMo91RU+SnIfejFZOlOFF6GnXfHtUxTuB nx+vd0X1j3aObV6HjWaRTYR3YFz3OMIKiMzQsFdP8O//rc3JyHEGvZ1eza4Hx9FhM9Xu MLPWDXzEokhcrZo7iPjKXIf8uyiVouOu6eWmBrQdBUyASn920C6UxGCP11uwpZJnT8Aq c0PQ22aHJcWhVfHa+IuSyf3iqMVoSgtM7PDqmk74MOJ5xqFyGUnmJ1Dw4Bg7hGJGR+Jq o7Vrk/rs5TNslgwP46rBg/KriUXV461e/WvbyR+EfD1Cn1cQnLm6i4tN3YvEpNTWjQwh psfA== 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=bntzwWb0HnF+pu1wTRlxa4nGPd0MURNpYR8uZbvPwl4=; b=B61oFOHxiMcW+D7j7kn2JQltMI1ozfz0rJIXYsAMO1BEMo5D7H9/v0n/VFVasAvPti MpHL7JcEXwcx4lXEXag+3qaS+JjvqPS1hjlv1473ihPxqLGhFailVTC8IbyuBwKwsknI qBJdbCREzP7mZ32ehYo7yToULUi1xwYqVmtshlZu7EioubKWZUrOOVzixjzag4uoxecz tuSoUk7ZgLanZ+0DzUzvu0WNuUnAtfZBpX7FgSdlwzKzy1dmdGIaiRKlDNgvjzONagBy Y9IDlnttt6lnX4Gw+JTesbjrXhs5NyppQTG1erkWckcpR8tcNtZJUmlUO54F4xtJmQ+x bTlQ== X-Gm-Message-State: AOAM5339jmYJjfqW5QtP7KoSQPRSPGd6HVUwgsejyZkrc9A2oD5zMToa qZuGWV0261zW7547wsBZLwq4wg== X-Google-Smtp-Source: ABdhPJytuTHdBIVuiybjpt5hI8b1ljcElIFMcTl+j/BWrIjw/SnfAX/Yl/DjO9FsYiUxo5xvziJ1Kw== X-Received: by 2002:a05:6214:138e:: with SMTP id g14mr2241683qvz.7.1611602396408; Mon, 25 Jan 2021 11:19:56 -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.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jan 2021 11:19:55 -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 18/18] arm64: kexec: remove head from relocation argument Date: Mon, 25 Jan 2021 14:19:23 -0500 Message-Id: <20210125191923.1060122-19-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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210125_141958_511223_CFABDA53 X-CRM114-Status: GOOD ( 11.50 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Now, that relocation is done using virtual addresses, reloc_arg->head is not needed anymore. Signed-off-by: Pavel Tatashin --- arch/arm64/include/asm/kexec.h | 2 -- arch/arm64/kernel/asm-offsets.c | 1 - arch/arm64/kernel/machine_kexec.c | 1 - 3 files changed, 4 deletions(-) diff --git a/arch/arm64/include/asm/kexec.h b/arch/arm64/include/asm/kexec.h index 049cde429b1b..2fa4109bd582 100644 --- a/arch/arm64/include/asm/kexec.h +++ b/arch/arm64/include/asm/kexec.h @@ -97,7 +97,6 @@ extern const char arm64_kexec_el2_vectors[]; /* * kern_reloc_arg is passed to kernel relocation function as an argument. - * head kimage->head, allows to traverse through relocation segments. * entry_addr kimage->start, where to jump from relocation function (new * kernel, or purgatory entry address). * kern_arg0 first argument to kernel is its dtb address. The other @@ -113,7 +112,6 @@ extern const char arm64_kexec_el2_vectors[]; * copy_len Number of bytes that need to be copied */ struct kern_reloc_arg { - phys_addr_t head; phys_addr_t entry_addr; phys_addr_t kern_arg0; phys_addr_t kern_arg1; diff --git a/arch/arm64/kernel/asm-offsets.c b/arch/arm64/kernel/asm-offsets.c index 06278611451d..94f050ad6471 100644 --- a/arch/arm64/kernel/asm-offsets.c +++ b/arch/arm64/kernel/asm-offsets.c @@ -153,7 +153,6 @@ int main(void) BLANK(); #endif #ifdef CONFIG_KEXEC_CORE - DEFINE(KEXEC_KRELOC_HEAD, offsetof(struct kern_reloc_arg, head)); DEFINE(KEXEC_KRELOC_ENTRY_ADDR, offsetof(struct kern_reloc_arg, entry_addr)); DEFINE(KEXEC_KRELOC_KERN_ARG0, offsetof(struct kern_reloc_arg, kern_arg0)); DEFINE(KEXEC_KRELOC_KERN_ARG1, offsetof(struct kern_reloc_arg, kern_arg1)); diff --git a/arch/arm64/kernel/machine_kexec.c b/arch/arm64/kernel/machine_kexec.c index dc1b7e5a54fb..c2dff232a85b 100644 --- a/arch/arm64/kernel/machine_kexec.c +++ b/arch/arm64/kernel/machine_kexec.c @@ -168,7 +168,6 @@ int machine_kexec_post_load(struct kimage *kimage) memcpy(reloc_code, __relocate_new_kernel_start, reloc_size); kimage->arch.kern_reloc = __pa(reloc_code) + func_offset; kimage->arch.kern_reloc_arg = __pa(kern_reloc_arg); - kern_reloc_arg->head = kimage->head; kern_reloc_arg->entry_addr = kimage->start; kern_reloc_arg->kern_arg0 = kimage->arch.dtb_mem;