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 X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 950E9C433E1 for ; Fri, 14 Aug 2020 09:55:02 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (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 08F1F204EA for ; Fri, 14 Aug 2020 09:55:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=axtens.net header.i=@axtens.net header.b="TpsVAgQq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 08F1F204EA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=axtens.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4BSf1c1vRTzDqld for ; Fri, 14 Aug 2020 19:55:00 +1000 (AEST) Received: from ozlabs.org (bilbo.ozlabs.org [203.11.71.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4BSdzT6l47zDqkL for ; Fri, 14 Aug 2020 19:53:09 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=axtens.net Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=axtens.net header.i=@axtens.net header.a=rsa-sha256 header.s=google header.b=TpsVAgQq; dkim-atps=neutral Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4BSdzS6KDQz8tVT for ; Fri, 14 Aug 2020 19:53:08 +1000 (AEST) Received: by ozlabs.org (Postfix) id 4BSdzS5yPdz9sTb; Fri, 14 Aug 2020 19:53:08 +1000 (AEST) Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=axtens.net (client-ip=2607:f8b0:4864:20::541; helo=mail-pg1-x541.google.com; envelope-from=dja@axtens.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=axtens.net Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=axtens.net header.i=@axtens.net header.a=rsa-sha256 header.s=google header.b=TpsVAgQq; dkim-atps=neutral Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BSdzS4Mrgz9sTY for ; Fri, 14 Aug 2020 19:53:08 +1000 (AEST) Received: by mail-pg1-x541.google.com with SMTP id d19so4281309pgl.10 for ; Fri, 14 Aug 2020 02:53:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axtens.net; s=google; h=from:to:subject:in-reply-to:references:date:message-id:mime-version :content-transfer-encoding; bh=fsCD7zD2MxrwGk93OeM/3r+CG6iBZAKBBzf66uRZoyE=; b=TpsVAgQqJWII2V6+VUh/zCj8fIXjarsV6dYesPT7dlppSXdr+4oNn5fYqD5pfvRDEO qfg8h9D7tR/MI6UGZ0Iu+nHMZCbh6mmiqedbntHdfF/oOoBoU86LCGYdFvUgcNJEDiAY WOGYuglCjzn1n19hrGjG+LHzEaL8Uyak4rfwQ= 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:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=fsCD7zD2MxrwGk93OeM/3r+CG6iBZAKBBzf66uRZoyE=; b=RONYc1Wtfp8b8SjD4zgTBCxLLD4rc2LfBt8CQ8QHviCavaLE0C3JyCeZS5jcS8V7zO esXYnI/VKF60bpH40gdcZOqy+xajV+EytCidNqxPz7dYHKwz8pffnhn0c0qoxqZK6bZi EhaOSNaD+KI1MfPZaEnjlHRJaEpnacb9hYL9+nd/tQhy6j+qcq82fq5fwX2b/mj7JJ2q Oqy3F7ZNCxpjU0EwqbEfDVIV0eu4QiD6jSXeJgVGA1Mx/S8yN5M/k4P/DFbI42lWoj6O CV/jU4GbAM7exFt5vLRdV5faEFvo464Nx80PZG29dNnSxO0urwNwm60C23EE5TIrUYBG M28w== X-Gm-Message-State: AOAM530dSa6YAyPhk4CM9UZWA6zl6OFi0txBusKdE2uu/y/ueR0J9WYW d7v/jF1Bc2c+V/l/TbNrW/+nxSGngrQ/6g== X-Google-Smtp-Source: ABdhPJzUBNCqpE2JJFiQL1gmlThG9qJowVlc0qC2NhluyaYuANrnf3TJTbK36Z5Wm8hmMiubgQ72Uw== X-Received: by 2002:a62:3583:: with SMTP id c125mr427295pfa.1.1597398784773; Fri, 14 Aug 2020 02:53:04 -0700 (PDT) Received: from localhost (2001-44b8-111e-5c00-41cb-aa01-d83e-f00e.static.ipv6.internode.on.net. [2001:44b8:111e:5c00:41cb:aa01:d83e:f00e]) by smtp.gmail.com with ESMTPSA id m19sm7841495pgd.21.2020.08.14.02.53.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2020 02:53:04 -0700 (PDT) From: Daniel Axtens To: Christophe Leroy , linuxppc-dev@ozlabs.org Subject: Re: [PATCH 2/4] powerpc: Introduce asm-prototypes.h In-Reply-To: References: <1463534212-4879-1-git-send-email-dja@axtens.net> <1463534212-4879-2-git-send-email-dja@axtens.net> Date: Fri, 14 Aug 2020 19:53:00 +1000 Message-ID: <87sgcpmu4j.fsf@dja-thinkpad.axtens.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Christophe Leroy writes: > Le 18/05/2016 =C3=A0 03:16, Daniel Axtens a =C3=A9crit=C2=A0: >> Sparse picked up a number of functions that are implemented in C and >> then only referred to in asm code. >>=20 >> This introduces asm-prototypes.h, which provides a place for >> prototypes of these functions. > > It looks like this is a mis-use of asm-prototypes.h > > On other architectures, asm-prototypes.h is there to allow MODVERSION to= =20 > sent versions for exported assembly functions (I checked history of that= =20 > file in x86 and arm64). Hmm, I was young(er) and (more) inexperienced 4 years ago and wouldn't have thought to check x86 and arm64. > It looks like you have used it on the other way round, you have declared= =20 > in it C functions used by ASM functions, whereas it is supposed to be=20 > dedicated to declaring exported ASM functions used by C functions. > > Any plan to fix that ? What should we call it? Kind regards, Daniel > > Christophe > >>=20 >> This silences some sparse warnings. >>=20 >> Signed-off-by: Daniel Axtens >> --- >> arch/powerpc/include/asm/asm-prototypes.h | 79 +++++++++++++++= ++++++++ >> arch/powerpc/kernel/machine_kexec_64.c | 1 + >> arch/powerpc/kernel/smp.c | 1 + >> arch/powerpc/kernel/traps.c | 1 + >> arch/powerpc/lib/vmx-helper.c | 1 + >> arch/powerpc/platforms/powernv/opal-tracepoints.c | 1 + >> arch/powerpc/platforms/pseries/lpar.c | 1 + >> 7 files changed, 85 insertions(+) >> create mode 100644 arch/powerpc/include/asm/asm-prototypes.h >>=20 >> diff --git a/arch/powerpc/include/asm/asm-prototypes.h b/arch/powerpc/in= clude/asm/asm-prototypes.h >> new file mode 100644 >> index 000000000000..6ee0a9d80bbc >> --- /dev/null >> +++ b/arch/powerpc/include/asm/asm-prototypes.h >> @@ -0,0 +1,79 @@ >> +/* >> + * This program is free software; you can redistribute it and/or modify >> + * it under the terms of the GNU General Public License, version 2, as >> + * published by the Free Software Foundation. >> + * >> + * This program is distributed in the hope that it will be useful, >> + * but WITHOUT ANY WARRANTY; without even the implied warranty of >> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >> + * GNU General Public License for more details. >> + * >> + * Copyright IBM Corp. 2016 >> + * >> + * Authors: Daniel Axtens >> + */ >> + >> +/* >> + * This file is for prototypes of C functions that are only called >> + * from asm, and any associated variables. >> + */ >> + >> +#include >> +#include >> + >> +/* SMP */ >> +extern struct thread_info *current_set[NR_CPUS]; >> +extern struct thread_info *secondary_ti; >> +void start_secondary(void *unused); >> + >> +/* kexec */ >> +struct paca_struct; >> +struct kimage; >> +extern struct paca_struct kexec_paca; >> +void kexec_copy_flush(struct kimage *image); >> + >> +/* pSeries hcall tracing */ >> +extern struct static_key hcall_tracepoint_key; >> +void __trace_hcall_entry(unsigned long opcode, unsigned long *args); >> +void __trace_hcall_exit(long opcode, unsigned long retval, >> + unsigned long *retbuf); >> +/* OPAL tracing */ >> +#ifdef HAVE_JUMP_LABEL >> +extern struct static_key opal_tracepoint_key; >> +#endif >> + >> +void __trace_opal_entry(unsigned long opcode, unsigned long *args); >> +void __trace_opal_exit(long opcode, unsigned long retval); >> + >> +/* VMX copying */ >> +int enter_vmx_usercopy(void); >> +int exit_vmx_usercopy(void); >> +int enter_vmx_copy(void); >> +void * exit_vmx_copy(void *dest); >> + >> +/* Traps */ >> +long machine_check_early(struct pt_regs *regs); >> +long hmi_exception_realmode(struct pt_regs *regs); >> +void SMIException(struct pt_regs *regs); >> +void handle_hmi_exception(struct pt_regs *regs); >> +void instruction_breakpoint_exception(struct pt_regs *regs); >> +void RunModeException(struct pt_regs *regs); >> +void __kprobes single_step_exception(struct pt_regs *regs); >> +void __kprobes program_check_exception(struct pt_regs *regs); >> +void alignment_exception(struct pt_regs *regs); >> +void StackOverflow(struct pt_regs *regs); >> +void nonrecoverable_exception(struct pt_regs *regs); >> +void kernel_fp_unavailable_exception(struct pt_regs *regs); >> +void altivec_unavailable_exception(struct pt_regs *regs); >> +void vsx_unavailable_exception(struct pt_regs *regs); >> +void fp_unavailable_tm(struct pt_regs *regs); >> +void altivec_unavailable_tm(struct pt_regs *regs); >> +void vsx_unavailable_tm(struct pt_regs *regs); >> +void facility_unavailable_exception(struct pt_regs *regs); >> +void TAUException(struct pt_regs *regs); >> +void altivec_assist_exception(struct pt_regs *regs); >> +void unrecoverable_exception(struct pt_regs *regs); >> +void kernel_bad_stack(struct pt_regs *regs); >> +void system_reset_exception(struct pt_regs *regs); >> +void machine_check_exception(struct pt_regs *regs); >> +void __kprobes emulation_assist_interrupt(struct pt_regs *regs); >> diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kerne= l/machine_kexec_64.c >> index b8c202d63ecb..50bf55135ef8 100644 >> --- a/arch/powerpc/kernel/machine_kexec_64.c >> +++ b/arch/powerpc/kernel/machine_kexec_64.c >> @@ -29,6 +29,7 @@ >> #include >> #include >> #include >> +#include >>=20=20=20 >> #ifdef CONFIG_PPC_BOOK3E >> int default_machine_kexec_prepare(struct kimage *image) >> diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c >> index 55c924b65f71..f1adc3c4f4ca 100644 >> --- a/arch/powerpc/kernel/smp.c >> +++ b/arch/powerpc/kernel/smp.c >> @@ -53,6 +53,7 @@ >> #include >> #include >> #include >> +#include >>=20=20=20 >> #ifdef DEBUG >> #include >> diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c >> index 9229ba63c370..11d15e7270e0 100644 >> --- a/arch/powerpc/kernel/traps.c >> +++ b/arch/powerpc/kernel/traps.c >> @@ -60,6 +60,7 @@ >> #include >> #include >> #include >> +#include >> #include >>=20=20=20 >> #if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC) >> diff --git a/arch/powerpc/lib/vmx-helper.c b/arch/powerpc/lib/vmx-helper= .c >> index b27e030fc9f8..bf925cdcaca9 100644 >> --- a/arch/powerpc/lib/vmx-helper.c >> +++ b/arch/powerpc/lib/vmx-helper.c >> @@ -21,6 +21,7 @@ >> #include >> #include >> #include >> +#include >>=20=20=20 >> int enter_vmx_usercopy(void) >> { >> diff --git a/arch/powerpc/platforms/powernv/opal-tracepoints.c b/arch/po= werpc/platforms/powernv/opal-tracepoints.c >> index e11273b2386d..1e496b780efd 100644 >> --- a/arch/powerpc/platforms/powernv/opal-tracepoints.c >> +++ b/arch/powerpc/platforms/powernv/opal-tracepoints.c >> @@ -1,6 +1,7 @@ >> #include >> #include >> #include >> +#include >>=20=20=20 >> #ifdef HAVE_JUMP_LABEL >> struct static_key opal_tracepoint_key =3D STATIC_KEY_INIT; >> diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platfo= rms/pseries/lpar.c >> index 7f6100d91b4b..03ff9867a610 100644 >> --- a/arch/powerpc/platforms/pseries/lpar.c >> +++ b/arch/powerpc/platforms/pseries/lpar.c >> @@ -45,6 +45,7 @@ >> #include >> #include >> #include >> +#include >>=20=20=20 >> #include "pseries.h" >>=20=20=20 >>=20