From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BDAADC433EF for ; Wed, 23 Feb 2022 11:32:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4F3198D0006; Wed, 23 Feb 2022 06:32:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 452768D0001; Wed, 23 Feb 2022 06:32:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2F3C78D0006; Wed, 23 Feb 2022 06:32:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0192.hostedemail.com [216.40.44.192]) by kanga.kvack.org (Postfix) with ESMTP id 219FB8D0001 for ; Wed, 23 Feb 2022 06:32:58 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id E0AD59F30E for ; Wed, 23 Feb 2022 11:32:57 +0000 (UTC) X-FDA: 79173832794.11.2360840 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf17.hostedemail.com (Postfix) with ESMTP id 6775140005 for ; Wed, 23 Feb 2022 11:32:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645615977; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hwQLMtEcBC3XALlAa6IT7v4zUNwzhN/4Kn6SmvYX9qs=; b=S0SRgkw5V8Ax3+k0P1mNA/xdqevH5kC2wSYqVl0GxWrBKobPrJJEofPPyiTrPEubmniWeW H++spNB+oanteowRJKA7C2SLwW0H8Cvhb8J+uoVqeFrwqIMQjJrbD7v86qGLn/7am3DInq tZEVNIvYvZz+srOUYyVO20BiEjnupJA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-377-fFlfqDnAPRC_m8p-UZVHVQ-1; Wed, 23 Feb 2022 06:32:55 -0500 X-MC-Unique: fFlfqDnAPRC_m8p-UZVHVQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6CFC41091DA0; Wed, 23 Feb 2022 11:32:54 +0000 (UTC) Received: from MiWiFi-R3L-srv.smartont.net (ovpn-13-167.pek2.redhat.com [10.72.13.167]) by smtp.corp.redhat.com (Postfix) with ESMTP id B00FA76C2B; Wed, 23 Feb 2022 11:32:51 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: kexec@lists.infradead.org, dyoung@redhat.com, akpm@linux-foundation.org, bhe@redhat.com, x86@kernel.org, linux-mm@kvack.org Subject: [PATCH v2 2/2] kexec_file: clean up arch_kexec_kernel_image_load Date: Wed, 23 Feb 2022 19:32:25 +0800 Message-Id: <20220223113225.63106-3-bhe@redhat.com> In-Reply-To: <20220223113225.63106-1-bhe@redhat.com> References: <20220223113225.63106-1-bhe@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Rspamd-Queue-Id: 6775140005 X-Stat-Signature: dppmuj3h7o5yzz9xjp1naix4wjozo4ug X-Rspam-User: Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=S0SRgkw5; spf=none (imf17.hostedemail.com: domain of bhe@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam05 X-HE-Tag: 1645615977-58914 Content-Transfer-Encoding: quoted-printable 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: Function arch_kexec_kernel_image_load() has a common weak version which is a wrapper of kexec_image_load_default() , and has only one arch dependent version in x86_64. Now the x86_64 dependent function is not needed any more. So clean it up. And also rename kexec_image_load_default() to kexec_kernel_image_load() f= or better reflecting its functionality. Signed-off-by: Baoquan He Acked-by: Dave Young --- arch/x86/kernel/machine_kexec_64.c | 11 ----------- include/linux/kexec.h | 1 - kernel/kexec_file.c | 9 ++------- 3 files changed, 2 insertions(+), 19 deletions(-) diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine= _kexec_64.c index 1f0eb0eed546..6b14d9274def 100644 --- a/arch/x86/kernel/machine_kexec_64.c +++ b/arch/x86/kernel/machine_kexec_64.c @@ -372,17 +372,6 @@ void machine_kexec(struct kimage *image) /* arch-dependent functionality related to kexec file-based syscall */ =20 #ifdef CONFIG_KEXEC_FILE -void *arch_kexec_kernel_image_load(struct kimage *image) -{ - if (!image->fops || !image->fops->load) - return ERR_PTR(-ENOEXEC); - - return image->fops->load(image, image->kernel_buf, - image->kernel_buf_len, image->initrd_buf, - image->initrd_buf_len, image->cmdline_buf, - image->cmdline_buf_len); -} - /* * Apply purgatory relocations. * diff --git a/include/linux/kexec.h b/include/linux/kexec.h index 0c994ae37729..47b70402c0a4 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h @@ -186,7 +186,6 @@ void *kexec_purgatory_get_symbol_addr(struct kimage *= image, const char *name); /* Architectures may override the below functions */ int arch_kexec_kernel_image_probe(struct kimage *image, void *buf, unsigned long buf_len); -void *arch_kexec_kernel_image_load(struct kimage *image); int arch_kexec_apply_relocations_add(struct purgatory_info *pi, Elf_Shdr *section, const Elf_Shdr *relsec, diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c index 8347fc158d2b..b6a1347f546e 100644 --- a/kernel/kexec_file.c +++ b/kernel/kexec_file.c @@ -60,7 +60,7 @@ int __weak arch_kexec_kernel_image_probe(struct kimage = *image, void *buf, return kexec_image_probe_default(image, buf, buf_len); } =20 -static void *kexec_image_load_default(struct kimage *image) +static void *kexec_kernel_image_load(struct kimage *image) { if (!image->fops || !image->fops->load) return ERR_PTR(-ENOEXEC); @@ -71,11 +71,6 @@ static void *kexec_image_load_default(struct kimage *i= mage) image->cmdline_buf_len); } =20 -void * __weak arch_kexec_kernel_image_load(struct kimage *image) -{ - return kexec_image_load_default(image); -} - int kexec_image_post_load_cleanup_default(struct kimage *image) { if (!image->fops || !image->fops->cleanup) @@ -279,7 +274,7 @@ kimage_file_prepare_segments(struct kimage *image, in= t kernel_fd, int initrd_fd, ima_add_kexec_buffer(image); =20 /* Call arch image load handlers */ - ldata =3D arch_kexec_kernel_image_load(image); + ldata =3D kexec_kernel_image_load(image); =20 if (IS_ERR(ldata)) { ret =3D PTR_ERR(ldata); --=20 2.31.1