Skip to contentSkip to conversation

introduce stub directory to storing empty/stub headers

PATCH Superseded Oleksii Kurochko 4 participants 7 messages Aug 29, 2023 – Aug 30, 2023

v2 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v2 cover introduce stub directory to storing empty/stub headers

A lot of empty/stub headers should be introduced during the early steps of adding support of new architecture.

An example can be found here:
1. https://lore.kernel.org/xen-devel/[email protected]/
2. https://lore.kernel.org/xen-devel/a92f99e8f697da99d77bfde562a549dbef3760ce.1692816595.git.sanastasio@raptorengineering.com/

As part of the patch series, asm/vm_event.h was moved to the stubs directory because It is the same for ARM, PPC, and RISC-V.

Changes in V2:
- change public/domctl.h to public/vm_event.h.
- update commit message of [PATCH v2 2/2] xen: move arm/include/asm/vm_event.h to stubs

Oleksii Kurochko (2):
xen: add stubs dir to include path
xen: move arm/include/asm/vm_event.h to stubs

 xen/Makefile                        |  1 +
 xen/arch/arm/include/asm/vm_event.h | 66 -----------------------------
 xen/include/stubs/asm/vm_event.h    | 55 ++++++++++++++++++++++++
 3 files changed, 56 insertions(+), 66 deletions(-)
 delete mode 100644 xen/arch/arm/include/asm/vm_event.h
 create mode 100644 xen/include/stubs/asm/vm_event.h
Signature · 1 line
2.41.0
#1 lore raw

PATCH v2 1/2 xen: add stubs dir to include path

stubs dir will contain empty/stubs generic for all architectures headers.

---
Changes in V2:
- Nothing changed.

---
 xen/Makefile | 1 +
 1 file changed, 1 insertion(+)
xen/Makefile +1 -0
index f57e5a596c..64c3542c84 100644
@@ -438,6 +438,7 @@ ifdef building_out_of_srctree
 endif
 CFLAGS += -I$(srctree)/include
 CFLAGS += -I$(srctree)/arch/$(SRCARCH)/include
+CFLAGS += -I$(srctree)/include/stubs
 
 # Note that link order matters!
 ALL_OBJS-y                := common/built_in.o
Signature · 1 line
2.41.0
#2 lore raw

Re: [PATCH v2 1/2] xen: add stubs dir to include path

xen/Makefile ifdef building_out_of_srctree · line 444

Quoted 10 lines · Oleksii Kurochko
xen/Makefile +1 -0
@@ -438,6 +438,7 @@ ifdef building_out_of_srctree
 endif
 CFLAGS += -I$(srctree)/include
 CFLAGS += -I$(srctree)/arch/$(SRCARCH)/include
+CFLAGS += -I$(srctree)/include/stubs
 
 # Note that link order matters!
 ALL_OBJS-y                := common/built_in.o

I have to admit that I'm not entirely happy with the name. I wonder what other REST maintainers think. In particular I would consider using Linux'es "asm-generic" name instead, allowing to cover both stub headers like the one to be introduced here, but also other kinds of "fallback" ones.

Jan

#3 lore raw

Re: [PATCH v2 1/2] xen: add stubs dir to include path

Hi Jan,

Quoted 11 lines · Jan Beulich
Quoted 8 lines · Oleksii Kurochko
xen/Makefile +0 -0
@@ -438,6 +438,7 @@ ifdef building_out_of_srctree

endif
CFLAGS += -I$(srctree)/include
CFLAGS += -I$(srctree)/arch/$(SRCARCH)/include
+CFLAGS += -I$(srctree)/include/stubs

Quoted 9 lines
Quoted 2 lines

# Note that link order matters!
ALL_OBJS-y := common/built_in.o

I have to admit that I'm not entirely happy with the name. I wonder what other REST maintainers think. In particular I would consider using Linux'es "asm-generic" name instead, allowing to cover both stub headers like the one to be introduced here, but also other kinds of "fallback" ones.

This is a great idea.
+1 on asm-generic

Cheers
Bertrand

Quoted 2 lines

Jan

author
#4 lore raw

Re: [PATCH v2 1/2] xen: add stubs dir to include path

In reply to Jan Beulich
Quoted 12 lines · Jan Beulich
Quoted 10 lines · Oleksii Kurochko
xen/Makefile +0 -0
@@ -438,6 +438,7 @@ ifdef building_out_of_srctree

 endif
 CFLAGS += -I$(srctree)/include
 CFLAGS += -I$(srctree)/arch/$(SRCARCH)/include
+CFLAGS += -I$(srctree)/include/stubs

 # Note that link order matters!
 ALL_OBJS-y                := common/built_in.o

Quoted 8 lines

I have to admit that I'm not entirely happy with the name. I wonder what
other REST maintainers think. In particular I would consider using Linux'es "asm-generic" name instead, allowing to cover both stub headers
like the one to be introduced here, but also other kinds of "fallback"
ones.

It make sense. I'll update the patch series.

~ Oleksii

#5 lore raw

PATCH v2 2/2 xen: move arm/include/asm/vm_event.h to stubs

In reply to Oleksii Kurochko

asm/vm_event.h is common for ARM and RISC-V so it will be moved to stubs dir.

Original asm/vm_event.h from ARM was updated:
* use SPDX-License-Identifier.
* update comment messages of stubs.
* update #ifdef.
* change public/domctl.h to public/vm_event.h.

---
Changes in V2:
- change public/domctl.h to public/vm_event.h.
- update commit message of [PATCH v2 2/2] xen: move arm/include/asm/vm_event.h to stubs

---
 xen/arch/arm/include/asm/vm_event.h | 66 -----------------------------
 xen/include/stubs/asm/vm_event.h    | 55 ++++++++++++++++++++++++
 2 files changed, 55 insertions(+), 66 deletions(-)
 delete mode 100644 xen/arch/arm/include/asm/vm_event.h
 create mode 100644 xen/include/stubs/asm/vm_event.h
xen/arch/arm/include/asm/vm_event.h deleted +0 -66
deleted file mode 100644
index 4d861373b3..0000000000
@@ -1,66 +0,0 @@
-/*
- * vm_event.h: architecture specific vm_event handling routines
- *
- * Copyright (c) 2015 Tamas K Lengyel ([email protected])
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope 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.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __ASM_ARM_VM_EVENT_H__
-#define __ASM_ARM_VM_EVENT_H__
-
-#include <xen/sched.h>
-#include <public/domctl.h>
-
-static inline int vm_event_init_domain(struct domain *d)
-{
-    /* Nothing to do. */
-    return 0;
-}
-
-static inline void vm_event_cleanup_domain(struct domain *d)
-{
-    memset(&d->monitor, 0, sizeof(d->monitor));
-}
-
-static inline void vm_event_toggle_singlestep(struct domain *d, struct vcpu *v,
-                                              vm_event_response_t *rsp)
-{
-    /* Not supported on ARM. */
-}
-
-static inline
-void vm_event_register_write_resume(struct vcpu *v, vm_event_response_t *rsp)
-{
-    /* Not supported on ARM. */
-}
-
-static inline
-void vm_event_emulate_check(struct vcpu *v, vm_event_response_t *rsp)
-{
-    /* Not supported on ARM. */
-}
-
-static inline
-void vm_event_sync_event(struct vcpu *v, bool value)
-{
-    /* Not supported on ARM. */
-}
-
-static inline
-void vm_event_reset_vmtrace(struct vcpu *v)
-{
-    /* Not supported on ARM. */
-}
-
-#endif /* __ASM_ARM_VM_EVENT_H__ */
xen/include/stubs/asm/vm_event.h new file +55 -0

55 lines not on this page · raw message

Signature · 1 line
2.41.0
Acked-by on v2 2/2
#6 lore raw

Re: [PATCH v2 2/2] xen: move arm/include/asm/vm_event.h to stubs

Quoted 99 lines · Oleksii Kurochko

asm/vm_event.h is common for ARM and RISC-V so it will be moved to stubs dir.

Original asm/vm_event.h from ARM was updated:
* use SPDX-License-Identifier.
* update comment messages of stubs.
* update #ifdef.
* change public/domctl.h to public/vm_event.h.

---
Changes in V2:
- change public/domctl.h to public/vm_event.h.
- update commit message of [PATCH v2 2/2] xen: move arm/include/asm/vm_event.h to stubs

---
 xen/arch/arm/include/asm/vm_event.h | 66 -----------------------------
 xen/include/stubs/asm/vm_event.h    | 55 ++++++++++++++++++++++++
 2 files changed, 55 insertions(+), 66 deletions(-)
 delete mode 100644 xen/arch/arm/include/asm/vm_event.h
 create mode 100644 xen/include/stubs/asm/vm_event.h
xen/arch/arm/include/asm/vm_event.h deleted +0 -66
deleted file mode 100644
index 4d861373b3..0000000000
@@ -1,66 +0,0 @@
-/*
- * vm_event.h: architecture specific vm_event handling routines
- *
- * Copyright (c) 2015 Tamas K Lengyel ([email protected])
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope 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.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __ASM_ARM_VM_EVENT_H__
-#define __ASM_ARM_VM_EVENT_H__
-
-#include <xen/sched.h>
-#include <public/domctl.h>
-
-static inline int vm_event_init_domain(struct domain *d)
-{
-    /* Nothing to do. */
-    return 0;
-}
-
-static inline void vm_event_cleanup_domain(struct domain *d)
-{
-    memset(&d->monitor, 0, sizeof(d->monitor));
-}
-
-static inline void vm_event_toggle_singlestep(struct domain *d, struct vcpu *v,
-                                              vm_event_response_t *rsp)
-{
-    /* Not supported on ARM. */
-}
-
-static inline
-void vm_event_register_write_resume(struct vcpu *v, vm_event_response_t *rsp)
-{
-    /* Not supported on ARM. */
-}
-
-static inline
-void vm_event_emulate_check(struct vcpu *v, vm_event_response_t *rsp)
-{
-    /* Not supported on ARM. */
-}
-
-static inline
-void vm_event_sync_event(struct vcpu *v, bool value)
-{
-    /* Not supported on ARM. */
-}
-
-static inline
-void vm_event_reset_vmtrace(struct vcpu *v)
-{
-    /* Not supported on ARM. */
-}
-
-#endif /* __ASM_ARM_VM_EVENT_H__ */
xen/include/stubs/asm/vm_event.h new file +0 -0
new file mode 100644
index 0000000000..cc89ffe5fb

xen/include/stubs/asm/vm_event.h line 1

Quoted 1 line
xen/include/stubs/asm/vm_event.h new file +1 -0
@@ -0,0 +1,55 @@
+/* SPDX-License-Identifier:  GPL-2.0 */

GPL-2.0 is deprecated, please use GPL-2.0-only

Aside from that:

Quoted 57 lines
xen/include/stubs/asm/vm_event.h new file +54 -0
+/*
+ * vm_event.h: stubs for architecture specific vm_event handling routines
+ *
+ * Copyright (c) 2015 Tamas K Lengyel ([email protected])
+ */
+
+#ifndef __ASM_STUB_VM_EVENT_H__
+#define __ASM_STUB_VM_EVENT_H__
+
+#include <xen/sched.h>
+#include <public/vm_event.h>
+
+static inline int vm_event_init_domain(struct domain *d)
+{
+    /* Nothing to do. */
+    return 0;
+}
+
+static inline void vm_event_cleanup_domain(struct domain *d)
+{
+    memset(&d->monitor, 0, sizeof(d->monitor));
+}
+
+static inline void vm_event_toggle_singlestep(struct domain *d, struct vcpu *v,
+                                              vm_event_response_t *rsp)
+{
+    /* Nothing to do. */
+}
+
+static inline
+void vm_event_register_write_resume(struct vcpu *v, vm_event_response_t *rsp)
+{
+    /* Nothing to do. */
+}
+
+static inline
+void vm_event_emulate_check(struct vcpu *v, vm_event_response_t *rsp)
+{
+    /* Nothing to do. */
+}
+
+static inline
+void vm_event_sync_event(struct vcpu *v, bool value)
+{
+    /* Nothing to do. */
+}
+
+static inline
+void vm_event_reset_vmtrace(struct vcpu *v)
+{
+    /* Nothing to do. */
+}
+
+#endif /* __ASM_STUB_VM_EVENT_H__ */
Signature · 1 line
2.41.0