Skip to contentSkip to conversation

introduce stub directory to storing empty/stub headers

PATCH Superseded Oleksii Kurochko 1 participant 4 messages Sep 6, 2023

v5 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v5 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 V5:
- Update SPDX license.
- Remove code related to UML in Makefile.asm-generic.
- Include $(src)/Makefile instead of $(kbuild-file).
- Update comment message in Makefile.asm-generic.
- Update .gitignore.
- Update path to generated headers in CFLAGS.
- Use the latest version of Linux's Makefile.asm-generic.
- Introduce asm-generic's vm_event.h.
- Switch ARM to use asm-generic/vm_event.h.
---
Changes in V4:
- add asm-generic support
- update path of vm_event.h from include/asm-generic/asm to include/asm-generic
---
Changes in V3:
- add Acked-by: Stefano Stabellini <[email protected]> for "xen: move arm/include/asm/vm_event.h to asm-generic"
- update SPDX tag.
- move asm/vm_event.h to asm-generic.
- rename stubs dir to asm-generic.

---
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: asm-generic support
xen: move arm/include/asm/vm_event.h to stubs

 .gitignore                          |  1 +
 xen/Makefile                        | 10 ++++-
 xen/arch/arm/include/asm/Makefile   |  2 +
 xen/arch/arm/include/asm/vm_event.h | 66 -----------------------------
 xen/include/asm-generic/vm_event.h  | 55 ++++++++++++++++++++++++
 xen/scripts/Makefile.asm-generic    | 53 +++++++++++++++++++++++
 6 files changed, 120 insertions(+), 67 deletions(-)
 create mode 100644 xen/arch/arm/include/asm/Makefile
 delete mode 100644 xen/arch/arm/include/asm/vm_event.h
 create mode 100644 xen/include/asm-generic/vm_event.h
 create mode 100644 xen/scripts/Makefile.asm-generic
Signature · 1 line
2.41.0
#3 lore raw

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

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
* instead of "include <public/domctl.h>" -> "public/vm_event.h"

As vm_event.h was moved to asm-generic then it is needed to create Makefile in arm/include/asm/ and add generated-y += vm_event.h to it.

---
Changes in V5:
- Update the commit message
- Remove Acked-by:...
- Switch ARM to use asm-generic/vm_event.h
---
Changes in V4:
- update path of vm_event.h from include/asm-generic/asm to include/asm-generic
---
Changes in V3:
- add Acked-by: Stefano Stabellini <[email protected]> for "xen: move arm/include/asm/vm_event.h to asm-generic"
- update SPDX tag.
- move asm/vm_event.h to asm-generic.
---
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/Makefile   |  2 +
 xen/arch/arm/include/asm/vm_event.h | 66 -----------------------------
 xen/include/asm-generic/vm_event.h  | 55 ++++++++++++++++++++++++
 3 files changed, 57 insertions(+), 66 deletions(-)
 create mode 100644 xen/arch/arm/include/asm/Makefile
 delete mode 100644 xen/arch/arm/include/asm/vm_event.h
 create mode 100644 xen/include/asm-generic/vm_event.h
xen/arch/arm/include/asm/Makefile new file +2 -0
new file mode 100644
index 0000000000..821addb0bf
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0-only
+generic-y += vm_event.h
xen/arch/arm/include/asm/vm_event.h deleted +0 -66

66 lines not on this page · raw message

xen/include/asm-generic/vm_event.h new file +55 -0

55 lines not on this page · raw message

Signature · 1 line
2.41.0
#1 lore raw

PATCH v5 1/2 xen: asm-generic support

In reply to Oleksii Kurochko

Some headers are shared between individual architectures or are empty. To avoid duplication of these headers, asm-generic is introduced.

With the following patch, an architecture uses generic headers mentioned in the file arch/$(ARCH)/include/asm/Makefile

To use a generic header is needed to add to
arch/$(ARCH)/include/asm/Makefile :

        generic-y += <name-of-header-file.h>

For each mentioned header in arch/$(ARCH)/include/asm/Makefile, the necessary wrapper in arch/$(ARCH)/include/generated/asm will be generated.

As the base Makefile.asm-generic from Linux kernel was taken. ( 06c2afb862f9da8 "Linux 6.5-rc1" ).

---
Changes in V5:
- Update the commit message
- Update SPDX license in Makefile.
- Remove code related to UML
- Include $(src)/Makefile instead of $(kbuild-file)
- Update comment message in Makefile.asm-generic
- Update .gitignore
- Update path to generated headers in CFLAGS.
- Use the latest version of Linux's Makefile.asm-generic
---
Changes in V4:
- introduce asm-generic support
- update commit message
---
Changes in V3:
- Rename stubs dir to asm-generic
---
Changes in V2:
- Nothing changed.

---
 .gitignore                       |  1 +
 xen/Makefile                     | 10 +++++-
 xen/scripts/Makefile.asm-generic | 53 ++++++++++++++++++++++++++++++++
 3 files changed, 63 insertions(+), 1 deletion(-)
 create mode 100644 xen/scripts/Makefile.asm-generic
.gitignore +1 -0
index 50273adb8d..287166f8fc 100644
@@ -267,6 +267,7 @@ xen/arch/*/efi/efi.h
 xen/arch/*/efi/pe.c
 xen/arch/*/efi/runtime.c
 xen/arch/*/include/asm/asm-offsets.h
+xen/arch/*/include/generated
 xen/build-dir-cppcheck/
 xen/common/config_data.S
 xen/common/config.gz
xen/Makefile +9 -1
index f57e5a596c..a86b64303d 100644
@@ -438,6 +438,7 @@ ifdef building_out_of_srctree
 endif
 CFLAGS += -I$(srctree)/include
 CFLAGS += -I$(srctree)/arch/$(SRCARCH)/include
+CFLAGS += -I$(objtree)/arch/$(SRCARCH)/include/generated
 
 # Note that link order matters!
 ALL_OBJS-y                := common/built_in.o
@@ -580,6 +581,7 @@ _clean:
 	rm -f $(TARGET).efi $(TARGET).efi.map $(TARGET).efi.elf $(TARGET).efi.stripped
 	rm -f asm-offsets.s arch/*/include/asm/asm-offsets.h
 	rm -f .banner .allconfig.tmp include/xen/compile.h
+	rm -rf $(objtree)/arch/*/include/generated
 
 .PHONY: _distclean
 _distclean: clean
@@ -589,7 +591,7 @@ $(TARGET).gz: $(TARGET)
 	gzip -n -f -9 < $< > [email protected]
 	mv [email protected] $@
 
-$(TARGET): outputmakefile FORCE
+$(TARGET): outputmakefile asm-generic FORCE
 	$(Q)$(MAKE) $(build)=tools
 	$(Q)$(MAKE) $(build)=. include/xen/compile.h
 	$(Q)$(MAKE) $(build)=include all
@@ -667,6 +669,12 @@ endif # need-sub-make
 PHONY += FORCE
 FORCE:
 
+# Support for using generic headers in asm-generic
+PHONY += asm-generic
+asm-generic:
+	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.asm-generic \
+	            obj=arch/$(SRCARCH)/include/generated/asm
+
 # Declare the contents of the PHONY variable as phony.  We keep that
 # information in a variable so we can use it in if_changed and friends.
 .PHONY: $(PHONY)
xen/scripts/Makefile.asm-generic new file +53 -0

53 lines not on this page · raw message

Signature · 1 line
2.41.0
author
#2 lore raw

Re: [PATCH v5 1/2] xen: asm-generic support

Hi all,

Missed the comment (https://lore.kernel.org/xen-
devel/[email protected]/T/#m99a4 dc8280439e84021c4e0546dc9ff539a60191 ) of Anthony so I'll sent a new one patch series tomorrow.

Sorry for inconvenience.

~ Oleksii