From patchwork Wed Jan 27 17:27:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pasha Tatashin X-Patchwork-Id: 12050787 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.1 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 38E7FC433DB for ; Wed, 27 Jan 2021 18:39:58 +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 D5133601FB for ; Wed, 27 Jan 2021 18:39:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D5133601FB 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=cLrrceUuNqtfVoGcFpe62vYyPMICXScLVPVm0AzDPfE=; b=Htb+L9mZ3N/WfgO+u7cYkuudM2 6ZU7RdHM1gxO+8g1U8oGpyjFR243fSrF+mqOhZPFJlgTiDNPQDTqn28WGKhjkBsYbEPx5AYOdSdaq NmzRPM8wuPTXtBfCHudsXxgFoN7f+B/5wt71fUglASOUE1jzGWaE6FZTQX8WZi51Z1eRAJAhEHYET N23Y64JHHcirKNcX19KbcjJpIXgGl6kA6Q5ojvkt0Hq4DasCS+roDfTJywTZuRjI5wHKgc93IutbB gzdSvfHHq5aORV7zMSznaPl2HQonOtoJBrzU/AE2r7I/YSo4SIUxr4ns3R1e7is1I5Bj6DqnIOIL2 9uP/ywmw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l4pig-0003ES-Vp; Wed, 27 Jan 2021 18:39:11 +0000 Received: from mail-qv1-xf2a.google.com ([2607:f8b0:4864:20::f2a]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l4obB-0005tV-MY for linux-arm-kernel@lists.infradead.org; Wed, 27 Jan 2021 17:27:36 +0000 Received: by mail-qv1-xf2a.google.com with SMTP id j13so1413569qvu.10 for ; Wed, 27 Jan 2021 09:27:19 -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=cfSnNSnfVduFxCPOvWfs9p+QSvXlJihsz/H5U3Y4H1U=; b=JSF/HlHCJzShZn7ALunS0BkmdIvbsb31kLfU+RnIPOJjHHHbnPC+hKp5GzFf5aNfG0 PCnd0hUx8KnQTQJAs7hc3j8UjBo0nhsavr2YgBKj48WT2dlprkP86SX5YogstiQFgEW1 fQXmcUFNK/whrTvXsAd2ttbgakW8eugEXjKNmuKRJBUbncvkUaYlDCqNXZhKNp4QGgZi s9l3aBEqnDiNAea7t1MlSQvIt3uOdGGZZwDbfriUGm56jfCILeRPYfkcC4aBIVfBChfU myBdivbvXZCSHraxlvN/kcYnz6cOQzbdEGPqEKU9R4Tk+vISJcmeJUo2Io2EH78AfPDL BLQA== 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=cfSnNSnfVduFxCPOvWfs9p+QSvXlJihsz/H5U3Y4H1U=; b=PdIW7Op9uJzaamIV+qc3aHnduAk7kviTHaFOfzohhlrz3qpTUAhDDf5hJMtWselCTd ayDzWTasrDGRFRB2cAjB6MbP0E8Tp+oHEHB80Sp4roWEmKaJC75vEPaC7C1hHs3g8sey aV/JS7mBVuKAd6QythGP4LZwmUP2Pxn+tZ3XutKBzoyJ6tAnrnl/PKX8PwXRRbtHRJ+/ f4B9BeNqBlD0yy198B6/dW0Jr0XF/9/mET0RtCSd0/YXwSi9r2PFWqGFn6qKfAjDZrZk HDwTX7pOwI9oeGMYvTXbhtdqn0O0mCrFuyCUJ/m99VDGPROnSl11LO3bWib39G/SYbFr SXsA== X-Gm-Message-State: AOAM532Kv06quz80O3uhwbRSTNWuepRtDiPWdRp785QKnFR1YsVE/edX miF7Q3lYrHJvM1pJLd+xPL2hOA== X-Google-Smtp-Source: ABdhPJwHsa1PlzOcEErpv+fEXO2+H7UWl48S+Yfvc0TUYpC69d2qgqgALhqP+OIOSgJyhuzsv33wBA== X-Received: by 2002:a0c:99c4:: with SMTP id y4mr11377443qve.9.1611768437920; Wed, 27 Jan 2021 09:27:17 -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 z2sm1728019qtz.71.2021.01.27.09.27.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jan 2021 09:27:17 -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 v11 6/6] arm64: kexec: remove head from relocation argument Date: Wed, 27 Jan 2021 12:27:06 -0500 Message-Id: <20210127172706.617195-7-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210127172706.617195-1-pasha.tatashin@soleen.com> References: <20210127172706.617195-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-20210127_122723_726780_8B7B4D9A X-CRM114-Status: GOOD ( 11.91 ) 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 9588c91f67c6..07da8d623d8e 100644 --- a/arch/arm64/kernel/machine_kexec.c +++ b/arch/arm64/kernel/machine_kexec.c @@ -166,7 +166,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;