Received: by 10.192.165.156 with SMTP id m28csp2273759imm; Thu, 12 Apr 2018 11:27:01 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+MEH1vc+XripTWf/6LQu6RAF6bWOpKjGMSuuNTSdHYswAVEZCBFDRYili8aCQ2iJ4yZUjW X-Received: by 10.167.133.198 with SMTP id z6mr337528pfn.38.1523557620965; Thu, 12 Apr 2018 11:27:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523557620; cv=none; d=google.com; s=arc-20160816; b=bshUlOLzr57n+L7RkEhQBCh2OSCqBKtAqPguLYlH7GXDDCLbN8rBHh4V1NII8UHw5m ti/Wc70BCfIbrWGODUrSk5d8RAqQ3QqHKoxr8pITYty29R724LHBR+qqRnIjrvsLTHyj O3EKw6DMLHto5c5o/7J7eMIHGpSwPFnjMJsdUhykLxoPabnhRwOUQpQoSEa0uP5vXIxp wmHzg7lUy8yS879TyDp7NrIO0I/HTYyVXX5QBsbMBwr/CEt4c4rlG/moN1Rw7WDn/iPD 1mgJuj4lufoQSZ0d08PFmRgEmnYfrBftG6HJ+8iKWWx2WxWp0WUkY1JtcHH3YRn3XG7s YQMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:dmarc-filter:arc-authentication-results; bh=IxWZN+zJURpH8pq6GCUF4HQWR17Y6kdOSfuCvXDu06k=; b=E0jlEyK0P1+N6ahi5OAL3R+XU2wo1ys595qqIVwR0FWKdb+4tixOcFZP19/bptFg9W sVH4dOiqUBOosOECvBiWsPuKymIq9yzF+BJxMn93Y+qo7cwmd9/LTnglszT8FzHioNkb /6wCiDzY0XpK+ZHCwclpdPvYmcL0Uktp6TRZnipwslj2tVRoDJCf354dhh88iwEpQfzk AeRrCuu1N9KAWmgvYNEMGaFxvDnCPOKV5GzeZfIPo3XdTdUxYeFiLoMLv4DzVKn2Ou1l MSEcmCJ8qi7bcJXWf/KG9ZOBkNrD+Lf28oAfQLWkIoDvQ6n3q4rf8cxGihokRTxgdbNX XDYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 76si2533844pge.732.2018.04.12.11.26.47; Thu, 12 Apr 2018 11:27:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753202AbeDLSXk (ORCPT + 99 others); Thu, 12 Apr 2018 14:23:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:39746 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752763AbeDLSXi (ORCPT ); Thu, 12 Apr 2018 14:23:38 -0400 Received: from localhost (unknown [69.71.5.252]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1287C2178E; Thu, 12 Apr 2018 18:23:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1287C2178E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=helgaas@kernel.org Subject: [PATCH v1 1/2] kexec: Remove "weak" from kexec_file function declarations From: Bjorn Helgaas To: Eric Biederman Cc: Thiago Jung Bauermann , Dave Young , Michael Ellerman , kexec@lists.infradead.org, linux-kernel@vger.kernel.org Date: Thu, 12 Apr 2018 13:23:36 -0500 Message-ID: <152355741673.36693.13178321454821440236.stgit@bhelgaas-glaptop.roam.corp.google.com> In-Reply-To: <152355706051.36693.9856090891621551967.stgit@bhelgaas-glaptop.roam.corp.google.com> References: <152355706051.36693.9856090891621551967.stgit@bhelgaas-glaptop.roam.corp.google.com> User-Agent: StGit/0.18 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bjorn Helgaas Weak header file declarations are error-prone because they make every definition weak, and the linker chooses one based on link order (see 10629d711ed7 ("PCI: Remove __weak annotation from pcibios_get_phb_of_node decl")). For the following functions: arch_kexec_kernel_image_probe() arch_kexec_kernel_image_load() arch_kimage_file_post_load_cleanup() arch_kexec_kernel_verify_sig() arch_kexec_apply_relocations_add() arch_kexec_apply_relocations() kernel/kexec_file.c contains weak definitions, and x86 and powerpc arch code contains definitions intended to be non-weak. But the annotations in the header file make *all* the definitions weak, so it's unclear which ones will be used. Remove the "weak" attribute from the declarations so we always prefer non-weak definitions over the weak ones. Fixes: a43cac0d9dc2 ("kexec: split kexec_file syscall code to kexec_file.c") Signed-off-by: Bjorn Helgaas CC: stable@vger.kernel.org # v4.3+ --- include/linux/kexec.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/include/linux/kexec.h b/include/linux/kexec.h index f16f6ceb3875..8bf0ff90885c 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h @@ -277,16 +277,16 @@ int crash_shrink_memory(unsigned long new_size); size_t crash_get_memory_size(void); void crash_free_reserved_phys_range(unsigned long begin, unsigned long end); -int __weak arch_kexec_kernel_image_probe(struct kimage *image, void *buf, - unsigned long buf_len); -void * __weak arch_kexec_kernel_image_load(struct kimage *image); -int __weak arch_kimage_file_post_load_cleanup(struct kimage *image); -int __weak arch_kexec_kernel_verify_sig(struct kimage *image, void *buf, - unsigned long buf_len); -int __weak arch_kexec_apply_relocations_add(const Elf_Ehdr *ehdr, - Elf_Shdr *sechdrs, unsigned int relsec); -int __weak arch_kexec_apply_relocations(const Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, - unsigned int relsec); +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_kimage_file_post_load_cleanup(struct kimage *image); +int arch_kexec_kernel_verify_sig(struct kimage *image, void *buf, + unsigned long buf_len); +int arch_kexec_apply_relocations_add(const Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, + unsigned int relsec); +int arch_kexec_apply_relocations(const Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, + unsigned int relsec); void arch_kexec_protect_crashkres(void); void arch_kexec_unprotect_crashkres(void);