public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/2] x86: xen: add missing prototypes
@ 2023-06-14  7:34 Juergen Gross
  2023-06-14  7:35 ` [PATCH v4 1/2] x86/xen: add prototypes for paravirt mmu functions Juergen Gross
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Juergen Gross @ 2023-06-14  7:34 UTC (permalink / raw)
  To: linux-kernel, x86
  Cc: Juergen Gross, Boris Ostrovsky, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen, H. Peter Anvin, xen-devel,
	Stefano Stabellini, Oleksandr Tyshchenko

Avoid missing prototype warnings.

Arnd Bergmann (1):
  x86: xen: add missing prototypes

Juergen Gross (1):
  x86/xen: add prototypes for paravirt mmu functions

 arch/x86/xen/efi.c     |  2 ++
 arch/x86/xen/mmu_pv.c  | 16 ++++++++++++++++
 arch/x86/xen/smp.h     |  4 ++++
 arch/x86/xen/smp_pv.c  |  1 -
 arch/x86/xen/xen-ops.h |  3 +++
 include/xen/xen.h      |  3 +++
 6 files changed, 28 insertions(+), 1 deletion(-)

-- 
2.35.3


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v4 1/2] x86/xen: add prototypes for paravirt mmu functions
  2023-06-14  7:34 [PATCH v4 0/2] x86: xen: add missing prototypes Juergen Gross
@ 2023-06-14  7:35 ` Juergen Gross
  2023-06-14  7:35 ` [PATCH v4 2/2] x86: xen: add missing prototypes Juergen Gross
  2023-06-14 20:46 ` [PATCH v4 0/2] " Boris Ostrovsky
  2 siblings, 0 replies; 4+ messages in thread
From: Juergen Gross @ 2023-06-14  7:35 UTC (permalink / raw)
  To: linux-kernel, x86
  Cc: Juergen Gross, Boris Ostrovsky, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen, H. Peter Anvin, xen-devel,
	Arnd Bergmann

The paravirt MMU functions called via the PV_CALLEE_SAVE_REGS_THUNK()
macro can't be defined to be static, as the macro is generating a
function via asm() statement calling the paravirt MMU function.

In order to avoid warnings when specifying "-Wmissing-prototypes" for
the build, add local prototypes (there should never be any external
caller of those functions).

Reported-by: Arnd Bergmann <arnd@kernel.org>
Signed-off-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/xen/mmu_pv.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/x86/xen/mmu_pv.c b/arch/x86/xen/mmu_pv.c
index b3b8d289b9ab..e0a975165de7 100644
--- a/arch/x86/xen/mmu_pv.c
+++ b/arch/x86/xen/mmu_pv.c
@@ -86,6 +86,22 @@
 #include "mmu.h"
 #include "debugfs.h"
 
+/*
+ * Prototypes for functions called via PV_CALLEE_SAVE_REGS_THUNK() in order
+ * to avoid warnings with "-Wmissing-prototypes".
+ */
+pteval_t xen_pte_val(pte_t pte);
+pgdval_t xen_pgd_val(pgd_t pgd);
+pmdval_t xen_pmd_val(pmd_t pmd);
+pudval_t xen_pud_val(pud_t pud);
+p4dval_t xen_p4d_val(p4d_t p4d);
+pte_t xen_make_pte(pteval_t pte);
+pgd_t xen_make_pgd(pgdval_t pgd);
+pmd_t xen_make_pmd(pmdval_t pmd);
+pud_t xen_make_pud(pudval_t pud);
+p4d_t xen_make_p4d(p4dval_t p4d);
+pte_t xen_make_pte_init(pteval_t pte);
+
 #ifdef CONFIG_X86_VSYSCALL_EMULATION
 /* l3 pud for userspace vsyscall mapping */
 static pud_t level3_user_vsyscall[PTRS_PER_PUD] __page_aligned_bss;
-- 
2.35.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v4 2/2] x86: xen: add missing prototypes
  2023-06-14  7:34 [PATCH v4 0/2] x86: xen: add missing prototypes Juergen Gross
  2023-06-14  7:35 ` [PATCH v4 1/2] x86/xen: add prototypes for paravirt mmu functions Juergen Gross
@ 2023-06-14  7:35 ` Juergen Gross
  2023-06-14 20:46 ` [PATCH v4 0/2] " Boris Ostrovsky
  2 siblings, 0 replies; 4+ messages in thread
From: Juergen Gross @ 2023-06-14  7:35 UTC (permalink / raw)
  To: linux-kernel, x86
  Cc: Arnd Bergmann, Juergen Gross, Boris Ostrovsky, Thomas Gleixner,
	Ingo Molnar, Borislav Petkov, Dave Hansen, H. Peter Anvin,
	Stefano Stabellini, Oleksandr Tyshchenko, xen-devel

From: Arnd Bergmann <arnd@arndb.de>

These function are all called from assembler files, or from inline
assembler, so there is no immediate need for a prototype in a header,
but if -Wmissing-prototypes is enabled, the compiler warns about them:

arch/x86/xen/efi.c:130:13: error: no previous prototype for 'xen_efi_init' [-Werror=missing-prototypes]
arch/x86/platform/pvh/enlighten.c:120:13: error: no previous prototype for 'xen_prepare_pvh' [-Werror=missing-prototypes]
arch/x86/xen/enlighten_pv.c:1233:34: error: no previous prototype for 'xen_start_kernel' [-Werror=missing-prototypes]
arch/x86/xen/irq.c:22:14: error: no previous prototype for 'xen_force_evtchn_callback' [-Werror=missing-prototypes]
arch/x86/entry/common.c:302:24: error: no previous prototype for 'xen_pv_evtchn_do_upcall' [-Werror=missing-prototypes]

Declare all of them in an appropriate header file to avoid the warnings.
For consistency, also move the asm_cpu_bringup_and_idle() declaration
out of smp_pv.c.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Juergen Gross <jgross@suse.com>
---
v4: [jgross]: remove some stubs, carve out mmu_pv.c prototypes into
    other patch
v3: move declations of conditional function in an #ifdef with a stub
v2: fix up changelog
---
 arch/x86/xen/efi.c     | 2 ++
 arch/x86/xen/smp.h     | 4 ++++
 arch/x86/xen/smp_pv.c  | 1 -
 arch/x86/xen/xen-ops.h | 3 +++
 include/xen/xen.h      | 3 +++
 5 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/arch/x86/xen/efi.c b/arch/x86/xen/efi.c
index 7d7ffb9c826a..863d0d6b3edc 100644
--- a/arch/x86/xen/efi.c
+++ b/arch/x86/xen/efi.c
@@ -16,6 +16,8 @@
 #include <asm/setup.h>
 #include <asm/xen/hypercall.h>
 
+#include "xen-ops.h"
+
 static efi_char16_t vendor[100] __initdata;
 
 static efi_system_table_t efi_systab_xen __initdata = {
diff --git a/arch/x86/xen/smp.h b/arch/x86/xen/smp.h
index 22fb982ff971..c20cbb14c82b 100644
--- a/arch/x86/xen/smp.h
+++ b/arch/x86/xen/smp.h
@@ -2,6 +2,10 @@
 #ifndef _XEN_SMP_H
 
 #ifdef CONFIG_SMP
+
+void asm_cpu_bringup_and_idle(void);
+asmlinkage void cpu_bringup_and_idle(void);
+
 extern void xen_send_IPI_mask(const struct cpumask *mask,
 			      int vector);
 extern void xen_send_IPI_mask_allbutself(const struct cpumask *mask,
diff --git a/arch/x86/xen/smp_pv.c b/arch/x86/xen/smp_pv.c
index a9cf8c8fa074..9ccf9759870d 100644
--- a/arch/x86/xen/smp_pv.c
+++ b/arch/x86/xen/smp_pv.c
@@ -55,7 +55,6 @@ static DEFINE_PER_CPU(struct xen_common_irq, xen_irq_work) = { .irq = -1 };
 static DEFINE_PER_CPU(struct xen_common_irq, xen_pmu_irq) = { .irq = -1 };
 
 static irqreturn_t xen_irq_work_interrupt(int irq, void *dev_id);
-void asm_cpu_bringup_and_idle(void);
 
 static void cpu_bringup(void)
 {
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h
index a10903785a33..1bbbe216e6e1 100644
--- a/arch/x86/xen/xen-ops.h
+++ b/arch/x86/xen/xen-ops.h
@@ -148,9 +148,12 @@ int xen_cpuhp_setup(int (*cpu_up_prepare_cb)(unsigned int),
 void xen_pin_vcpu(int cpu);
 
 void xen_emergency_restart(void);
+void xen_force_evtchn_callback(void);
+
 #ifdef CONFIG_XEN_PV
 void xen_pv_pre_suspend(void);
 void xen_pv_post_suspend(int suspend_cancelled);
+void xen_start_kernel(struct start_info *si);
 #else
 static inline void xen_pv_pre_suspend(void) {}
 static inline void xen_pv_post_suspend(int suspend_cancelled) {}
diff --git a/include/xen/xen.h b/include/xen/xen.h
index 0efeb652f9b8..f989162983c3 100644
--- a/include/xen/xen.h
+++ b/include/xen/xen.h
@@ -31,6 +31,9 @@ extern uint32_t xen_start_flags;
 
 #include <xen/interface/hvm/start_info.h>
 extern struct hvm_start_info pvh_start_info;
+void xen_prepare_pvh(void);
+struct pt_regs;
+void xen_pv_evtchn_do_upcall(struct pt_regs *regs);
 
 #ifdef CONFIG_XEN_DOM0
 #include <xen/interface/xen.h>
-- 
2.35.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v4 0/2] x86: xen: add missing prototypes
  2023-06-14  7:34 [PATCH v4 0/2] x86: xen: add missing prototypes Juergen Gross
  2023-06-14  7:35 ` [PATCH v4 1/2] x86/xen: add prototypes for paravirt mmu functions Juergen Gross
  2023-06-14  7:35 ` [PATCH v4 2/2] x86: xen: add missing prototypes Juergen Gross
@ 2023-06-14 20:46 ` Boris Ostrovsky
  2 siblings, 0 replies; 4+ messages in thread
From: Boris Ostrovsky @ 2023-06-14 20:46 UTC (permalink / raw)
  To: Juergen Gross, linux-kernel, x86
  Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
	H. Peter Anvin, xen-devel, Stefano Stabellini,
	Oleksandr Tyshchenko



On 6/14/23 3:34 AM, Juergen Gross wrote:
> Avoid missing prototype warnings.
> 
> Arnd Bergmann (1):
>    x86: xen: add missing prototypes
> 
> Juergen Gross (1):
>    x86/xen: add prototypes for paravirt mmu functions
> 
>   arch/x86/xen/efi.c     |  2 ++
>   arch/x86/xen/mmu_pv.c  | 16 ++++++++++++++++
>   arch/x86/xen/smp.h     |  4 ++++
>   arch/x86/xen/smp_pv.c  |  1 -
>   arch/x86/xen/xen-ops.h |  3 +++
>   include/xen/xen.h      |  3 +++
>   6 files changed, 28 insertions(+), 1 deletion(-)
> 


Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-06-14 20:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-14  7:34 [PATCH v4 0/2] x86: xen: add missing prototypes Juergen Gross
2023-06-14  7:35 ` [PATCH v4 1/2] x86/xen: add prototypes for paravirt mmu functions Juergen Gross
2023-06-14  7:35 ` [PATCH v4 2/2] x86: xen: add missing prototypes Juergen Gross
2023-06-14 20:46 ` [PATCH v4 0/2] " Boris Ostrovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox