xen: move xen_setup_callback_vector() definition to include/xen/hvm.h
Subsystems (3)
PATCH 1/1 xen: move xen_setup_callback_vector() definition to include/xen/hvm.h
Kbuild test robot reports the following problem on ARM:
Quoted 1 line
Quoted 1 line
drivers/xen/events/events_base.c:1664:6: warning: no previous prototype
for 'xen_setup_callback_vector' [-Wmissing-prototypes]
1664 | void xen_setup_callback_vector(void) {}
| ^~~~~~~~~~~~~~~~~~~~~~~~~
The problem is that xen_setup_callback_vector is a x86 only thing, its definition is present in arch/x86/xen/xen-ops.h but not on ARM. In events_base.c we have a stub for !CONFIG_XEN_PVHVM but it is not declared as 'static'.
On x86 the situation is hardly better: drivers/xen/events/events_base.c doesn't include 'xen-ops.h' from arch/x86/xen/, it includes its namesake from include/xen/ so we also get the 'no previous prototype' warning.
Currently, xen_setup_callback_vector() has two call sites: one in drivers/xen/events_base.c and another in arch/x86/xen/suspend_hvm.c. The former is placed under #ifdef CONFIG_X86 and the later is only compiled in when CONFIG_XEN_PVHVM.
Resolve the issue by moving xen_setup_callback_vector() declaration to arch neutral 'include/xen/hvm.h' as the implementation lives in arch neutral drivers/xen/events/events_base.c.
---
- The patch needs to be applied on top of 'x86/xen: Split HVM vector callback setup and interrupt gate allocation' ('tip/entry' branch currently). This patch doesn't introduce the issue (and that's why I don't add 'Fixes:' tag) but it renames xen_callback_vector() -> xen_setup_callback_vector().
--- arch/x86/xen/suspend_hvm.c | 1 + arch/x86/xen/xen-ops.h | 1 - include/xen/hvm.h | 2 ++ 3 files changed, 3 insertions(+), 1 deletion(-)
arch/x86/xen/suspend_hvm.c +1 -0
@@ -2,6 +2,7 @@#include <linux/types.h> #include <xen/xen.h> +#include <xen/hvm.h> #include <xen/features.h> #include <xen/interface/features.h>
arch/x86/xen/xen-ops.h +0 -1
@@ -55,7 +55,6 @@ void xen_enable_sysenter(void);void xen_enable_syscall (void );void xen_vcpu_restore (void ); -void xen_setup_callback_vector (void );void xen_hvm_init_shared_info (void );void xen_unplug_emulated_devices (void );
include/xen/hvm.h +2 -0
@@ -58,4 +58,6 @@ static inline int hvm_get_parameter(int idx, uint64_t *value)#define HVM_CALLBACK_VECTOR (x) (((uint64_t)HVM_CALLBACK_VIA_TYPE_VECTOR)<<\ HVM_CALLBACK_VIA_TYPE_SHIFT | (x)) +void xen_setup_callback_vector (void ); +#endif /* XEN_HVM_H__ */
Signature · 1 line
2.25.4
Quoted 20 lines · Vitaly Kuznetsov
Kbuildtest robot reports the following problem on ARM:Quoted 1 line
Quoted 1 line
drivers/xen/events/events_base.c:1664:6: warning: no previous prototypefor '
xen_setup_callback_vector' [-Wmissing-prototypes]
1664 | voidxen_setup_callback_vector(void){}
| ^~~~~~~~~~~~~~~~~~~~~~~~~
The problem is thatxen_setup_callback_vectoris a x86 only thing, its definition is present inarch/x86/xen/xen-ops.hbut not on ARM. Inevents_base.cwe have a stub for !CONFIG_XEN_PVHVM but it is not declared as 'static'.On x86 the situation is hardly better:
drivers/xen/events/events_base.cdoesn't include 'xen-ops.h' fromarch/x86/xen/, it includes its namesake frominclude/xen/so we also get the 'no previous prototype' warning.Currently,
xen_setup_callback_vector()has two call sites: one indrivers/xen/events_base.cand another inarch/x86/xen/suspend_hvm.c. The former is placed under #ifdefCONFIG_X86and the later is only compiled in whenCONFIG_XEN_PVHVM.
Quoted 6 lines
Resolve the issue by moving
xen_setup_callback_vector()declaration to arch neutral 'include/xen/hvm.h' as the implementation lives in arch neutraldrivers/xen/events/events_base.c.Reported-by kbuild test robot <[email protected]>Signed-off-by Vitaly Kuznetsov <[email protected]>
Juergen
[tip: x86/entry] xen: Move xen_setup_callback_vector() definition to include/xen/hvm.h
In reply to Vitaly KuznetsovThe following commit has been merged into the x86/entry branch of tip:
The following commit has been merged into the x86/entry branch of tip:
Commit-ID: 28447ea4154239025044381144f849ff749ee9ef Gitweb: https://git.kernel.org/tip/28447ea4154239025044381144f849ff749ee9ef Author: Vitaly Kuznetsov <[email protected]> AuthorDate: Wed, 20 May 2020 18:16:00 +02:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Thu, 28 May 2020 15:39:18 +02:00
xen: Move xen_setup_callback_vector() definition to include/xen/hvm.h
Kbuild test robot reports the following problem on ARM:
for 'xen_setup_callback_vector' [-Wmissing-prototypes]
1664 | void xen_setup_callback_vector(void) {}
| ^~~~~~~~~~~~~~~~~~~~~~~~~
The problem is that xen_setup_callback_vector is a x86 only thing, its definition is present in arch/x86/xen/xen-ops.h but not on ARM. In events_base.c there is a stub for !CONFIG_XEN_PVHVM but it is not declared as 'static'.
On x86 the situation is hardly better: drivers/xen/events/events_base.c doesn't include 'xen-ops.h' from arch/x86/xen/, it includes its namesake from include/xen/ which also results in a 'no previous prototype' warning.
Currently, xen_setup_callback_vector() has two call sites: one in drivers/xen/events_base.c and another in arch/x86/xen/suspend_hvm.c. The former is placed under #ifdef CONFIG_X86 and the later is only compiled in when CONFIG_XEN_PVHVM.
Resolve the issue by moving xen_setup_callback_vector() declaration to arch neutral 'include/xen/hvm.h' as the implementation lives in arch neutral drivers/xen/events/events_base.c.
--- arch/x86/xen/suspend_hvm.c | 1 + arch/x86/xen/xen-ops.h | 1 - include/xen/hvm.h | 2 ++ 3 files changed, 3 insertions(+), 1 deletion(-)
arch/x86/xen/suspend_hvm.c +1 -0
@@ -2,6 +2,7 @@#include <linux/types.h> #include <xen/xen.h> +#include <xen/hvm.h> #include <xen/features.h> #include <xen/interface/features.h>
arch/x86/xen/xen-ops.h +0 -1
@@ -54,7 +54,6 @@ void xen_enable_sysenter(void);void xen_enable_syscall (void );void xen_vcpu_restore (void ); -void xen_setup_callback_vector (void );void xen_hvm_init_shared_info (void );void xen_unplug_emulated_devices (void );
include/xen/hvm.h +2 -0
@@ -58,4 +58,6 @@ static inline int hvm_get_parameter(int idx, uint64_t *value)#define HVM_CALLBACK_VECTOR (x) (((uint64_t)HVM_CALLBACK_VIA_TYPE_VECTOR)<<\ HVM_CALLBACK_VIA_TYPE_SHIFT | (x)) +void xen_setup_callback_vector (void ); +#endif /* XEN_HVM_H__ */