diff mbox series

[v1,05/29] xen/asm-generic: introduce stub header event.h

Message ID 69563e3f41cb6971f93630d9df59395f159bd3c4.1694702259.git.oleksii.kurochko@gmail.com (mailing list archive)
State New, archived
Headers show
Series Introduce stub headers necessary for full Xen build | expand

Commit Message

Oleksii Kurochko Sept. 14, 2023, 2:56 p.m. UTC
The patch introduces stub header needed for full Xen build.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/include/asm-generic/event.h | 39 +++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 xen/include/asm-generic/event.h

Comments

Jan Beulich Oct. 19, 2023, 9:18 a.m. UTC | #1
On 14.09.2023 16:56, Oleksii Kurochko wrote:
> --- /dev/null
> +++ b/xen/include/asm-generic/event.h
> @@ -0,0 +1,39 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +#ifndef __ASM_GENERIC_EVENT_H__
> +#define __ASM_GENERIC_EVENT_H__
> +
> +#include <xen/sched.h>
> +
> +static inline void vcpu_mark_events_pending(struct vcpu *v)
> +{
> +}

While this will satisfy callers from a build perspective, no port
will be functional with an implementation like this. Yet the
generic headers need to provide the required functionality, not
just build stubs.

Going further in the series, I won't repeat this kind of comment.
Unless others disagree, my view is that headers put here should
be of use beyond initial bring-up of a new port.

Jan
Oleksii Kurochko Oct. 23, 2023, 10:23 a.m. UTC | #2
On Thu, 2023-10-19 at 11:18 +0200, Jan Beulich wrote:
> On 14.09.2023 16:56, Oleksii Kurochko wrote:
> > --- /dev/null
> > +++ b/xen/include/asm-generic/event.h
> > @@ -0,0 +1,39 @@
> > +/* SPDX-License-Identifier: GPL-2.0-only */
> > +#ifndef __ASM_GENERIC_EVENT_H__
> > +#define __ASM_GENERIC_EVENT_H__
> > +
> > +#include <xen/sched.h>
> > +
> > +static inline void vcpu_mark_events_pending(struct vcpu *v)
> > +{
> > +}
> 
> While this will satisfy callers from a build perspective, no port
> will be functional with an implementation like this. Yet the
> generic headers need to provide the required functionality, not
> just build stubs.
It makes sense but then we will have the similar patches when new
architecture is introduced.

> 
> Going further in the series, I won't repeat this kind of comment.
> Unless others disagree, my view is that headers put here should
> be of use beyond initial bring-up of a new port.
> 
Then we have two options here:
1. leave only declaration of the function.
2. remove it from asm-generic.

~ Oleksii
Jan Beulich Oct. 23, 2023, 10:40 a.m. UTC | #3
On 23.10.2023 12:23, Oleksii wrote:
> On Thu, 2023-10-19 at 11:18 +0200, Jan Beulich wrote:
>> On 14.09.2023 16:56, Oleksii Kurochko wrote:
>>> --- /dev/null
>>> +++ b/xen/include/asm-generic/event.h
>>> @@ -0,0 +1,39 @@
>>> +/* SPDX-License-Identifier: GPL-2.0-only */
>>> +#ifndef __ASM_GENERIC_EVENT_H__
>>> +#define __ASM_GENERIC_EVENT_H__
>>> +
>>> +#include <xen/sched.h>
>>> +
>>> +static inline void vcpu_mark_events_pending(struct vcpu *v)
>>> +{
>>> +}
>>
>> While this will satisfy callers from a build perspective, no port
>> will be functional with an implementation like this. Yet the
>> generic headers need to provide the required functionality, not
>> just build stubs.
> It makes sense but then we will have the similar patches when new
> architecture is introduced.
> 
>>
>> Going further in the series, I won't repeat this kind of comment.
>> Unless others disagree, my view is that headers put here should
>> be of use beyond initial bring-up of a new port.
>>
> Then we have two options here:
> 1. leave only declaration of the function.

Which would then require a stub to be introduced in the arch, or else
linking will fail (unless all calls can be compile-time eliminated,
which I doubt would be the case here).

As before a requirement (imo) is that headers introduced into
asm-generic/ are functional. An arch would introduce its own instance
if it wants to do certain things better, or if it has further needs.

Jan

> 2. remove it from asm-generic.
> 
> ~ Oleksii
diff mbox series

Patch

diff --git a/xen/include/asm-generic/event.h b/xen/include/asm-generic/event.h
new file mode 100644
index 0000000000..d25ba36aad
--- /dev/null
+++ b/xen/include/asm-generic/event.h
@@ -0,0 +1,39 @@ 
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef __ASM_GENERIC_EVENT_H__
+#define __ASM_GENERIC_EVENT_H__
+
+#include <xen/sched.h>
+
+static inline void vcpu_mark_events_pending(struct vcpu *v)
+{
+}
+
+static inline int vcpu_event_delivery_is_enabled(struct vcpu *v)
+{
+    return 0;
+}
+
+static inline int local_events_need_delivery(void)
+{
+    return 0;
+}
+
+static inline void local_event_delivery_enable(void)
+{
+}
+
+static inline bool arch_virq_is_global(unsigned int virq)
+{
+    return true;
+}
+
+#endif /* __ASM_GENERIC_EVENT_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */