* [PATCH v4 0/2] introduce stub directory to storing empty/stub headers @ 2023-09-01 16:02 Oleksii Kurochko 2023-09-01 16:02 ` [PATCH v4 1/2] xen: asm-generic support Oleksii Kurochko 2023-09-01 16:02 ` [PATCH v4 2/2] xen: move arm/include/asm/vm_event.h to asm-generic Oleksii Kurochko 0 siblings, 2 replies; 22+ messages in thread From: Oleksii Kurochko @ 2023-09-01 16:02 UTC (permalink / raw) To: xen-devel Cc: Jan Beulich, Oleksii Kurochko, Andrew Cooper, George Dunlap, Julien Grall, Stefano Stabellini, Wei Liu, Bertrand Marquis, Volodymyr Babchuk, Shawn Anastasio, Bob Eshleman, Alistair Francis, Connor Davis, Roger Pau Monné, Tamas K Lengyel, Alexandru Isaila, Petre Pircalabu 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/cover.1692181079.git.oleksii.kurochko@gmail.com/ 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 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 <sstabellini@kernel.org> 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 asm-generic xen/Makefile | 10 +++++- xen/arch/arm/include/asm/Kbuild | 1 + xen/arch/ppc/include/asm/Kbuild | 1 + xen/arch/riscv/include/asm/Kbuild | 1 + xen/arch/x86/include/asm/Kbuild | 1 + xen/include/asm-generic/vm_event.h | 55 ++++++++++++++++++++++++++++++ xen/scripts/Makefile.asm-generic | 23 +++++++++++++ 7 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 xen/arch/arm/include/asm/Kbuild create mode 100644 xen/arch/ppc/include/asm/Kbuild create mode 100644 xen/arch/riscv/include/asm/Kbuild create mode 100644 xen/arch/x86/include/asm/Kbuild create mode 100644 xen/include/asm-generic/vm_event.h create mode 100644 xen/scripts/Makefile.asm-generic -- 2.41.0 ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH v4 1/2] xen: asm-generic support 2023-09-01 16:02 [PATCH v4 0/2] introduce stub directory to storing empty/stub headers Oleksii Kurochko @ 2023-09-01 16:02 ` Oleksii Kurochko 2023-09-04 13:39 ` Bertrand Marquis ` (2 more replies) 2023-09-01 16:02 ` [PATCH v4 2/2] xen: move arm/include/asm/vm_event.h to asm-generic Oleksii Kurochko 1 sibling, 3 replies; 22+ messages in thread From: Oleksii Kurochko @ 2023-09-01 16:02 UTC (permalink / raw) To: xen-devel Cc: Jan Beulich, Oleksii Kurochko, Andrew Cooper, George Dunlap, Julien Grall, Stefano Stabellini, Wei Liu, Bertrand Marquis, Volodymyr Babchuk, Shawn Anastasio, Bob Eshleman, Alistair Francis, Connor Davis, Roger Pau Monné 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/Kbuild. To use a generic header is needed to add to arch/$(ARCH)/include/asm/Kbuild : generic-y += <name-of-header-file.h> For each mentioned header in arch/$(ARCH)/include/asm/Kbuild, kbuild will generate the necessary wrapper in arch/$(ARCH)/include/generated/asm. Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> --- Changes in V4: - introduce asm-generic support - update commit message --- Changes in V3: - Rename stubs dir to asm-generic --- Changes in V2: - Nothing changed. --- xen/Makefile | 10 +++++++++- xen/arch/arm/include/asm/Kbuild | 1 + xen/arch/ppc/include/asm/Kbuild | 1 + xen/arch/riscv/include/asm/Kbuild | 1 + xen/arch/x86/include/asm/Kbuild | 1 + xen/scripts/Makefile.asm-generic | 23 +++++++++++++++++++++++ 6 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 xen/arch/arm/include/asm/Kbuild create mode 100644 xen/arch/ppc/include/asm/Kbuild create mode 100644 xen/arch/riscv/include/asm/Kbuild create mode 100644 xen/arch/x86/include/asm/Kbuild create mode 100644 xen/scripts/Makefile.asm-generic diff --git a/xen/Makefile b/xen/Makefile index f57e5a596c..698d6ddeb8 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -438,6 +438,7 @@ ifdef building_out_of_srctree endif CFLAGS += -I$(srctree)/include CFLAGS += -I$(srctree)/arch/$(SRCARCH)/include +CFLAGS += -I$(srctree)/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 arch/*/include/generated .PHONY: _distclean _distclean: clean @@ -589,7 +591,7 @@ $(TARGET).gz: $(TARGET) gzip -n -f -9 < $< > $@.new mv $@.new $@ -$(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) diff --git a/xen/arch/arm/include/asm/Kbuild b/xen/arch/arm/include/asm/Kbuild new file mode 100644 index 0000000000..a4e40e534e --- /dev/null +++ b/xen/arch/arm/include/asm/Kbuild @@ -0,0 +1 @@ +# SPDX-License-Identifier: GPL-2.0-only diff --git a/xen/arch/ppc/include/asm/Kbuild b/xen/arch/ppc/include/asm/Kbuild new file mode 100644 index 0000000000..a4e40e534e --- /dev/null +++ b/xen/arch/ppc/include/asm/Kbuild @@ -0,0 +1 @@ +# SPDX-License-Identifier: GPL-2.0-only diff --git a/xen/arch/riscv/include/asm/Kbuild b/xen/arch/riscv/include/asm/Kbuild new file mode 100644 index 0000000000..a4e40e534e --- /dev/null +++ b/xen/arch/riscv/include/asm/Kbuild @@ -0,0 +1 @@ +# SPDX-License-Identifier: GPL-2.0-only diff --git a/xen/arch/x86/include/asm/Kbuild b/xen/arch/x86/include/asm/Kbuild new file mode 100644 index 0000000000..a4e40e534e --- /dev/null +++ b/xen/arch/x86/include/asm/Kbuild @@ -0,0 +1 @@ +# SPDX-License-Identifier: GPL-2.0-only diff --git a/xen/scripts/Makefile.asm-generic b/xen/scripts/Makefile.asm-generic new file mode 100644 index 0000000000..0aac3f50b8 --- /dev/null +++ b/xen/scripts/Makefile.asm-generic @@ -0,0 +1,23 @@ +# SPDX-License-Identifier: GPL-2.0 +# include/asm-generic contains a lot of files that are used +# verbatim by several architectures. +# +# This Makefile reads the file arch/$(SRCARCH)/include/asm/Kbuild +# and for each file listed in this file with generic-y creates +# a small wrapper file in $(obj) (arch/$(SRCARCH)/include/generated/asm) + +kbuild-file := $(srctree)/arch/$(SRCARCH)/include/asm/Kbuild +include $(kbuild-file) + +include scripts/Kbuild.include + +# Create output directory if not already present +_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj)) + +quiet_cmd_wrap = WRAP $@ +cmd_wrap = echo "\#include <asm-generic/$*.h>" >$@ + +all: $(patsubst %, $(obj)/%, $(generic-y)) + +$(obj)/%.h: + $(call cmd,wrap) -- 2.41.0 ^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH v4 1/2] xen: asm-generic support 2023-09-01 16:02 ` [PATCH v4 1/2] xen: asm-generic support Oleksii Kurochko @ 2023-09-04 13:39 ` Bertrand Marquis 2023-09-05 13:37 ` Oleksii 2023-09-06 11:37 ` Oleksii 2023-09-06 12:16 ` Jan Beulich 2023-09-06 15:57 ` Anthony PERARD 2 siblings, 2 replies; 22+ messages in thread From: Bertrand Marquis @ 2023-09-04 13:39 UTC (permalink / raw) To: Oleksii Kurochko Cc: Xen-devel, Jan Beulich, Andrew Cooper, George Dunlap, Julien Grall, Stefano Stabellini, Wei Liu, Volodymyr Babchuk, Shawn Anastasio, Bob Eshleman, Alistair Francis, Connor Davis, Roger Pau Monné Hi Oleksii, > On 1 Sep 2023, at 18:02, Oleksii Kurochko <oleksii.kurochko@gmail.com> wrote: > > 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/Kbuild. Kbuild refers to "Kernel build" I guess. I am ok to keep that name to keep things simpler when compared to Linux scripts but it would be good to mention that in the commit message for future reference. > > To use a generic header is needed to add to > arch/$(ARCH)/include/asm/Kbuild : > generic-y += <name-of-header-file.h> > > For each mentioned header in arch/$(ARCH)/include/asm/Kbuild, > kbuild will generate the necessary wrapper in > arch/$(ARCH)/include/generated/asm. > > Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> > --- > Changes in V4: > - introduce asm-generic support > - update commit message > --- > Changes in V3: > - Rename stubs dir to asm-generic > --- > Changes in V2: > - Nothing changed. > --- > xen/Makefile | 10 +++++++++- > xen/arch/arm/include/asm/Kbuild | 1 + > xen/arch/ppc/include/asm/Kbuild | 1 + > xen/arch/riscv/include/asm/Kbuild | 1 + > xen/arch/x86/include/asm/Kbuild | 1 + > xen/scripts/Makefile.asm-generic | 23 +++++++++++++++++++++++ > 6 files changed, 36 insertions(+), 1 deletion(-) > create mode 100644 xen/arch/arm/include/asm/Kbuild > create mode 100644 xen/arch/ppc/include/asm/Kbuild > create mode 100644 xen/arch/riscv/include/asm/Kbuild > create mode 100644 xen/arch/x86/include/asm/Kbuild > create mode 100644 xen/scripts/Makefile.asm-generic > > diff --git a/xen/Makefile b/xen/Makefile > index f57e5a596c..698d6ddeb8 100644 > --- a/xen/Makefile > +++ b/xen/Makefile > @@ -438,6 +438,7 @@ ifdef building_out_of_srctree > endif > CFLAGS += -I$(srctree)/include > CFLAGS += -I$(srctree)/arch/$(SRCARCH)/include > +CFLAGS += -I$(srctree)/arch/$(SRCARCH)/include/generated Why are we generating files in the source tree ? Shouldn't we keep it unmodified ? > > # 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 arch/*/include/generated > You must use the same as for CFLAGS here so $(srctree) would be needed. (or something else depending on the fix for previous comment) > .PHONY: _distclean > _distclean: clean > @@ -589,7 +591,7 @@ $(TARGET).gz: $(TARGET) > gzip -n -f -9 < $< > $@.new > mv $@.new $@ > > -$(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) > diff --git a/xen/arch/arm/include/asm/Kbuild b/xen/arch/arm/include/asm/Kbuild > new file mode 100644 > index 0000000000..a4e40e534e > --- /dev/null > +++ b/xen/arch/arm/include/asm/Kbuild > @@ -0,0 +1 @@ > +# SPDX-License-Identifier: GPL-2.0-only > diff --git a/xen/arch/ppc/include/asm/Kbuild b/xen/arch/ppc/include/asm/Kbuild > new file mode 100644 > index 0000000000..a4e40e534e > --- /dev/null > +++ b/xen/arch/ppc/include/asm/Kbuild > @@ -0,0 +1 @@ > +# SPDX-License-Identifier: GPL-2.0-only > diff --git a/xen/arch/riscv/include/asm/Kbuild b/xen/arch/riscv/include/asm/Kbuild > new file mode 100644 > index 0000000000..a4e40e534e > --- /dev/null > +++ b/xen/arch/riscv/include/asm/Kbuild > @@ -0,0 +1 @@ > +# SPDX-License-Identifier: GPL-2.0-only > diff --git a/xen/arch/x86/include/asm/Kbuild b/xen/arch/x86/include/asm/Kbuild > new file mode 100644 > index 0000000000..a4e40e534e > --- /dev/null > +++ b/xen/arch/x86/include/asm/Kbuild > @@ -0,0 +1 @@ > +# SPDX-License-Identifier: GPL-2.0-only > diff --git a/xen/scripts/Makefile.asm-generic b/xen/scripts/Makefile.asm-generic > new file mode 100644 > index 0000000000..0aac3f50b8 > --- /dev/null > +++ b/xen/scripts/Makefile.asm-generic > @@ -0,0 +1,23 @@ > +# SPDX-License-Identifier: GPL-2.0 > +# include/asm-generic contains a lot of files that are used > +# verbatim by several architectures. > +# > +# This Makefile reads the file arch/$(SRCARCH)/include/asm/Kbuild > +# and for each file listed in this file with generic-y creates > +# a small wrapper file in $(obj) (arch/$(SRCARCH)/include/generated/asm) > + > +kbuild-file := $(srctree)/arch/$(SRCARCH)/include/asm/Kbuild > +include $(kbuild-file) > + > +include scripts/Kbuild.include > + > +# Create output directory if not already present > +_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj)) > + > +quiet_cmd_wrap = WRAP $@ > +cmd_wrap = echo "\#include <asm-generic/$*.h>" >$@ > + > +all: $(patsubst %, $(obj)/%, $(generic-y)) > + > +$(obj)/%.h: > + $(call cmd,wrap) In fact i think your files are not generated in the srctree so this will break if you use out of tree compilation. Cheers Bertrand > -- > 2.41.0 > ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v4 1/2] xen: asm-generic support 2023-09-04 13:39 ` Bertrand Marquis @ 2023-09-05 13:37 ` Oleksii 2023-09-05 14:10 ` Bertrand Marquis 2023-09-06 11:37 ` Oleksii 1 sibling, 1 reply; 22+ messages in thread From: Oleksii @ 2023-09-05 13:37 UTC (permalink / raw) To: Bertrand Marquis Cc: Xen-devel, Jan Beulich, Andrew Cooper, George Dunlap, Julien Grall, Stefano Stabellini, Wei Liu, Volodymyr Babchuk, Shawn Anastasio, Bob Eshleman, Alistair Francis, Connor Davis, Roger Pau Monné Hi Bertrand, On Mon, 2023-09-04 at 13:39 +0000, Bertrand Marquis wrote: > Hi Oleksii, > > > On 1 Sep 2023, at 18:02, Oleksii Kurochko > > <oleksii.kurochko@gmail.com> wrote: > > > > 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/Kbuild. > > Kbuild refers to "Kernel build" I guess. > I am ok to keep that name to keep things simpler when compared to > Linux scripts but it would be good to mention that in the commit > message for future reference. Sure. I'll add that Kbuild refers to "Kernel build" > > > > > To use a generic header is needed to add to > > arch/$(ARCH)/include/asm/Kbuild : > > generic-y += <name-of-header-file.h> > > > > For each mentioned header in arch/$(ARCH)/include/asm/Kbuild, > > kbuild will generate the necessary wrapper in > > arch/$(ARCH)/include/generated/asm. > > > > Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> > > --- > > Changes in V4: > > - introduce asm-generic support > > - update commit message > > --- > > Changes in V3: > > - Rename stubs dir to asm-generic > > --- > > Changes in V2: > > - Nothing changed. > > --- > > xen/Makefile | 10 +++++++++- > > xen/arch/arm/include/asm/Kbuild | 1 + > > xen/arch/ppc/include/asm/Kbuild | 1 + > > xen/arch/riscv/include/asm/Kbuild | 1 + > > xen/arch/x86/include/asm/Kbuild | 1 + > > xen/scripts/Makefile.asm-generic | 23 +++++++++++++++++++++++ > > 6 files changed, 36 insertions(+), 1 deletion(-) > > create mode 100644 xen/arch/arm/include/asm/Kbuild > > create mode 100644 xen/arch/ppc/include/asm/Kbuild > > create mode 100644 xen/arch/riscv/include/asm/Kbuild > > create mode 100644 xen/arch/x86/include/asm/Kbuild > > create mode 100644 xen/scripts/Makefile.asm-generic > > > > diff --git a/xen/Makefile b/xen/Makefile > > index f57e5a596c..698d6ddeb8 100644 > > --- a/xen/Makefile > > +++ b/xen/Makefile > > @@ -438,6 +438,7 @@ ifdef building_out_of_srctree > > endif > > CFLAGS += -I$(srctree)/include > > CFLAGS += -I$(srctree)/arch/$(SRCARCH)/include > > +CFLAGS += -I$(srctree)/arch/$(SRCARCH)/include/generated > > Why are we generating files in the source tree ? > Shouldn't we keep it unmodified ? I think you are right. I got myself confused because I do not use out-of-tree compilation so for me it looked like $(srctree). It would be better to use $(objtree) instead. > > > > > # 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 arch/*/include/generated > > > > You must use the same as for CFLAGS here so $(srctree) would be > needed. > (or something else depending on the fix for previous comment) Thanks. I'll change to the value mentioned in CFLAGS. > > > .PHONY: _distclean > > _distclean: clean > > @@ -589,7 +591,7 @@ $(TARGET).gz: $(TARGET) > > gzip -n -f -9 < $< > $@.new > > mv $@.new $@ > > > > -$(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) > > diff --git a/xen/arch/arm/include/asm/Kbuild > > b/xen/arch/arm/include/asm/Kbuild > > new file mode 100644 > > index 0000000000..a4e40e534e > > --- /dev/null > > +++ b/xen/arch/arm/include/asm/Kbuild > > @@ -0,0 +1 @@ > > +# SPDX-License-Identifier: GPL-2.0-only > > diff --git a/xen/arch/ppc/include/asm/Kbuild > > b/xen/arch/ppc/include/asm/Kbuild > > new file mode 100644 > > index 0000000000..a4e40e534e > > --- /dev/null > > +++ b/xen/arch/ppc/include/asm/Kbuild > > @@ -0,0 +1 @@ > > +# SPDX-License-Identifier: GPL-2.0-only > > diff --git a/xen/arch/riscv/include/asm/Kbuild > > b/xen/arch/riscv/include/asm/Kbuild > > new file mode 100644 > > index 0000000000..a4e40e534e > > --- /dev/null > > +++ b/xen/arch/riscv/include/asm/Kbuild > > @@ -0,0 +1 @@ > > +# SPDX-License-Identifier: GPL-2.0-only > > diff --git a/xen/arch/x86/include/asm/Kbuild > > b/xen/arch/x86/include/asm/Kbuild > > new file mode 100644 > > index 0000000000..a4e40e534e > > --- /dev/null > > +++ b/xen/arch/x86/include/asm/Kbuild > > @@ -0,0 +1 @@ > > +# SPDX-License-Identifier: GPL-2.0-only > > diff --git a/xen/scripts/Makefile.asm-generic > > b/xen/scripts/Makefile.asm-generic > > new file mode 100644 > > index 0000000000..0aac3f50b8 > > --- /dev/null > > +++ b/xen/scripts/Makefile.asm-generic > > @@ -0,0 +1,23 @@ > > +# SPDX-License-Identifier: GPL-2.0 > > +# include/asm-generic contains a lot of files that are used > > +# verbatim by several architectures. > > +# > > +# This Makefile reads the file arch/$(SRCARCH)/include/asm/Kbuild > > +# and for each file listed in this file with generic-y creates > > +# a small wrapper file in $(obj) > > (arch/$(SRCARCH)/include/generated/asm) > > + > > +kbuild-file := $(srctree)/arch/$(SRCARCH)/include/asm/Kbuild > > +include $(kbuild-file) > > + > > +include scripts/Kbuild.include > > + > > +# Create output directory if not already present > > +_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj)) > > + > > +quiet_cmd_wrap = WRAP $@ > > +cmd_wrap = echo "\#include <asm-generic/$*.h>" >$@ > > + > > +all: $(patsubst %, $(obj)/%, $(generic-y)) > > + > > +$(obj)/%.h: > > + $(call cmd,wrap) > > In fact i think your files are not generated in the srctree so this > will break if you use out of tree compilation. Why not? They will be generated in $obj which equal to obj=arch/$(SRCARCH)/include/generated/asm ( in my case ). Anyway I think that obj should be equal to what is mentioned in CFLAGS. ~ Oleksii ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v4 1/2] xen: asm-generic support 2023-09-05 13:37 ` Oleksii @ 2023-09-05 14:10 ` Bertrand Marquis 2023-09-06 10:36 ` Oleksii 0 siblings, 1 reply; 22+ messages in thread From: Bertrand Marquis @ 2023-09-05 14:10 UTC (permalink / raw) To: Oleksii Cc: Xen-devel, Jan Beulich, Andrew Cooper, George Dunlap, Julien Grall, Stefano Stabellini, Wei Liu, Volodymyr Babchuk, Shawn Anastasio, Bob Eshleman, Alistair Francis, Connor Davis, Roger Pau Monné, Anthony PERARD Hi Oleksii, > On 5 Sep 2023, at 15:37, Oleksii <oleksii.kurochko@gmail.com> wrote: > > Hi Bertrand, > > On Mon, 2023-09-04 at 13:39 +0000, Bertrand Marquis wrote: >> Hi Oleksii, >> >>> On 1 Sep 2023, at 18:02, Oleksii Kurochko >>> <oleksii.kurochko@gmail.com> wrote: >>> >>> 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/Kbuild. >> >> Kbuild refers to "Kernel build" I guess. >> I am ok to keep that name to keep things simpler when compared to >> Linux scripts but it would be good to mention that in the commit >> message for future reference. > Sure. I'll add that Kbuild refers to "Kernel build" >> >>> >>> To use a generic header is needed to add to >>> arch/$(ARCH)/include/asm/Kbuild : >>> generic-y += <name-of-header-file.h> >>> >>> For each mentioned header in arch/$(ARCH)/include/asm/Kbuild, >>> kbuild will generate the necessary wrapper in >>> arch/$(ARCH)/include/generated/asm. >>> >>> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> >>> --- >>> Changes in V4: >>> - introduce asm-generic support >>> - update commit message >>> --- >>> Changes in V3: >>> - Rename stubs dir to asm-generic >>> --- >>> Changes in V2: >>> - Nothing changed. >>> --- >>> xen/Makefile | 10 +++++++++- >>> xen/arch/arm/include/asm/Kbuild | 1 + >>> xen/arch/ppc/include/asm/Kbuild | 1 + >>> xen/arch/riscv/include/asm/Kbuild | 1 + >>> xen/arch/x86/include/asm/Kbuild | 1 + >>> xen/scripts/Makefile.asm-generic | 23 +++++++++++++++++++++++ >>> 6 files changed, 36 insertions(+), 1 deletion(-) >>> create mode 100644 xen/arch/arm/include/asm/Kbuild >>> create mode 100644 xen/arch/ppc/include/asm/Kbuild >>> create mode 100644 xen/arch/riscv/include/asm/Kbuild >>> create mode 100644 xen/arch/x86/include/asm/Kbuild >>> create mode 100644 xen/scripts/Makefile.asm-generic >>> >>> diff --git a/xen/Makefile b/xen/Makefile >>> index f57e5a596c..698d6ddeb8 100644 >>> --- a/xen/Makefile >>> +++ b/xen/Makefile >>> @@ -438,6 +438,7 @@ ifdef building_out_of_srctree >>> endif >>> CFLAGS += -I$(srctree)/include >>> CFLAGS += -I$(srctree)/arch/$(SRCARCH)/include >>> +CFLAGS += -I$(srctree)/arch/$(SRCARCH)/include/generated >> >> Why are we generating files in the source tree ? >> Shouldn't we keep it unmodified ? > I think you are right. > I got myself confused because I do not use out-of-tree compilation so > for me it looked like $(srctree). > > It would be better to use $(objtree) instead. Ack >> >>> >>> # 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 arch/*/include/generated >>> >> >> You must use the same as for CFLAGS here so $(srctree) would be >> needed. >> (or something else depending on the fix for previous comment) > Thanks. I'll change to the value mentioned in CFLAGS. > >> >>> .PHONY: _distclean >>> _distclean: clean >>> @@ -589,7 +591,7 @@ $(TARGET).gz: $(TARGET) >>> gzip -n -f -9 < $< > $@.new >>> mv $@.new $@ >>> >>> -$(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) >>> diff --git a/xen/arch/arm/include/asm/Kbuild >>> b/xen/arch/arm/include/asm/Kbuild >>> new file mode 100644 >>> index 0000000000..a4e40e534e >>> --- /dev/null >>> +++ b/xen/arch/arm/include/asm/Kbuild >>> @@ -0,0 +1 @@ >>> +# SPDX-License-Identifier: GPL-2.0-only >>> diff --git a/xen/arch/ppc/include/asm/Kbuild >>> b/xen/arch/ppc/include/asm/Kbuild >>> new file mode 100644 >>> index 0000000000..a4e40e534e >>> --- /dev/null >>> +++ b/xen/arch/ppc/include/asm/Kbuild >>> @@ -0,0 +1 @@ >>> +# SPDX-License-Identifier: GPL-2.0-only >>> diff --git a/xen/arch/riscv/include/asm/Kbuild >>> b/xen/arch/riscv/include/asm/Kbuild >>> new file mode 100644 >>> index 0000000000..a4e40e534e >>> --- /dev/null >>> +++ b/xen/arch/riscv/include/asm/Kbuild >>> @@ -0,0 +1 @@ >>> +# SPDX-License-Identifier: GPL-2.0-only >>> diff --git a/xen/arch/x86/include/asm/Kbuild >>> b/xen/arch/x86/include/asm/Kbuild >>> new file mode 100644 >>> index 0000000000..a4e40e534e >>> --- /dev/null >>> +++ b/xen/arch/x86/include/asm/Kbuild >>> @@ -0,0 +1 @@ >>> +# SPDX-License-Identifier: GPL-2.0-only >>> diff --git a/xen/scripts/Makefile.asm-generic >>> b/xen/scripts/Makefile.asm-generic >>> new file mode 100644 >>> index 0000000000..0aac3f50b8 >>> --- /dev/null >>> +++ b/xen/scripts/Makefile.asm-generic >>> @@ -0,0 +1,23 @@ >>> +# SPDX-License-Identifier: GPL-2.0 >>> +# include/asm-generic contains a lot of files that are used >>> +# verbatim by several architectures. >>> +# >>> +# This Makefile reads the file arch/$(SRCARCH)/include/asm/Kbuild >>> +# and for each file listed in this file with generic-y creates >>> +# a small wrapper file in $(obj) >>> (arch/$(SRCARCH)/include/generated/asm) >>> + >>> +kbuild-file := $(srctree)/arch/$(SRCARCH)/include/asm/Kbuild >>> +include $(kbuild-file) >>> + >>> +include scripts/Kbuild.include >>> + >>> +# Create output directory if not already present >>> +_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj)) >>> + >>> +quiet_cmd_wrap = WRAP $@ >>> +cmd_wrap = echo "\#include <asm-generic/$*.h>" >$@ >>> + >>> +all: $(patsubst %, $(obj)/%, $(generic-y)) >>> + >>> +$(obj)/%.h: >>> + $(call cmd,wrap) >> >> In fact i think your files are not generated in the srctree so this >> will break if you use out of tree compilation. > Why not? They will be generated in $obj which equal to > obj=arch/$(SRCARCH)/include/generated/asm ( in my case ). Right they are generated in the build tree but if it is not the same as srctree it will not work due to CFLAGS. > > Anyway I think that obj should be equal to what is mentioned in CFLAGS. We generate other files like asm-offsets.h and it could in fact be that both srctree and build tree are already in include path. There is in makefile a rule already removing asm-offsets.h which is generated and this one does not use a prefix so we should follow this standard in fact. So we should not use any prefix (srctree or obj) i think. @anthony: any suggestion here ? Bertrand > > ~ Oleksii ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v4 1/2] xen: asm-generic support 2023-09-05 14:10 ` Bertrand Marquis @ 2023-09-06 10:36 ` Oleksii 0 siblings, 0 replies; 22+ messages in thread From: Oleksii @ 2023-09-06 10:36 UTC (permalink / raw) To: Bertrand Marquis Cc: Xen-devel, Jan Beulich, Andrew Cooper, George Dunlap, Julien Grall, Stefano Stabellini, Wei Liu, Volodymyr Babchuk, Shawn Anastasio, Bob Eshleman, Alistair Francis, Connor Davis, Roger Pau Monné, Anthony PERARD On Tue, 2023-09-05 at 14:10 +0000, Bertrand Marquis wrote: > Hi Oleksii, > > > On 5 Sep 2023, at 15:37, Oleksii <oleksii.kurochko@gmail.com> > > wrote: > > > > Hi Bertrand, > > > > On Mon, 2023-09-04 at 13:39 +0000, Bertrand Marquis wrote: > > > Hi Oleksii, > > > > > > > On 1 Sep 2023, at 18:02, Oleksii Kurochko > > > > <oleksii.kurochko@gmail.com> wrote: > > > > > > > > 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/Kbuild. > > > > > > Kbuild refers to "Kernel build" I guess. > > > I am ok to keep that name to keep things simpler when compared to > > > Linux scripts but it would be good to mention that in the commit > > > message for future reference. > > Sure. I'll add that Kbuild refers to "Kernel build" > > > > > > > > > > > To use a generic header is needed to add to > > > > arch/$(ARCH)/include/asm/Kbuild : > > > > generic-y += <name-of-header-file.h> > > > > > > > > For each mentioned header in arch/$(ARCH)/include/asm/Kbuild, > > > > kbuild will generate the necessary wrapper in > > > > arch/$(ARCH)/include/generated/asm. > > > > > > > > Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> > > > > --- > > > > Changes in V4: > > > > - introduce asm-generic support > > > > - update commit message > > > > --- > > > > Changes in V3: > > > > - Rename stubs dir to asm-generic > > > > --- > > > > Changes in V2: > > > > - Nothing changed. > > > > --- > > > > xen/Makefile | 10 +++++++++- > > > > xen/arch/arm/include/asm/Kbuild | 1 + > > > > xen/arch/ppc/include/asm/Kbuild | 1 + > > > > xen/arch/riscv/include/asm/Kbuild | 1 + > > > > xen/arch/x86/include/asm/Kbuild | 1 + > > > > xen/scripts/Makefile.asm-generic | 23 +++++++++++++++++++++++ > > > > 6 files changed, 36 insertions(+), 1 deletion(-) > > > > create mode 100644 xen/arch/arm/include/asm/Kbuild > > > > create mode 100644 xen/arch/ppc/include/asm/Kbuild > > > > create mode 100644 xen/arch/riscv/include/asm/Kbuild > > > > create mode 100644 xen/arch/x86/include/asm/Kbuild > > > > create mode 100644 xen/scripts/Makefile.asm-generic > > > > > > > > diff --git a/xen/Makefile b/xen/Makefile > > > > index f57e5a596c..698d6ddeb8 100644 > > > > --- a/xen/Makefile > > > > +++ b/xen/Makefile > > > > @@ -438,6 +438,7 @@ ifdef building_out_of_srctree > > > > endif > > > > CFLAGS += -I$(srctree)/include > > > > CFLAGS += -I$(srctree)/arch/$(SRCARCH)/include > > > > +CFLAGS += -I$(srctree)/arch/$(SRCARCH)/include/generated > > > > > > Why are we generating files in the source tree ? > > > Shouldn't we keep it unmodified ? > > I think you are right. > > I got myself confused because I do not use out-of-tree compilation > > so > > for me it looked like $(srctree). > > > > It would be better to use $(objtree) instead. > > Ack > > > > > > > > > > > > # 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 arch/*/include/generated > > > > > > > > > > You must use the same as for CFLAGS here so $(srctree) would be > > > needed. > > > (or something else depending on the fix for previous comment) > > Thanks. I'll change to the value mentioned in CFLAGS. > > > > > > > > > .PHONY: _distclean > > > > _distclean: clean > > > > @@ -589,7 +591,7 @@ $(TARGET).gz: $(TARGET) > > > > gzip -n -f -9 < $< > $@.new > > > > mv $@.new $@ > > > > > > > > -$(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) > > > > diff --git a/xen/arch/arm/include/asm/Kbuild > > > > b/xen/arch/arm/include/asm/Kbuild > > > > new file mode 100644 > > > > index 0000000000..a4e40e534e > > > > --- /dev/null > > > > +++ b/xen/arch/arm/include/asm/Kbuild > > > > @@ -0,0 +1 @@ > > > > +# SPDX-License-Identifier: GPL-2.0-only > > > > diff --git a/xen/arch/ppc/include/asm/Kbuild > > > > b/xen/arch/ppc/include/asm/Kbuild > > > > new file mode 100644 > > > > index 0000000000..a4e40e534e > > > > --- /dev/null > > > > +++ b/xen/arch/ppc/include/asm/Kbuild > > > > @@ -0,0 +1 @@ > > > > +# SPDX-License-Identifier: GPL-2.0-only > > > > diff --git a/xen/arch/riscv/include/asm/Kbuild > > > > b/xen/arch/riscv/include/asm/Kbuild > > > > new file mode 100644 > > > > index 0000000000..a4e40e534e > > > > --- /dev/null > > > > +++ b/xen/arch/riscv/include/asm/Kbuild > > > > @@ -0,0 +1 @@ > > > > +# SPDX-License-Identifier: GPL-2.0-only > > > > diff --git a/xen/arch/x86/include/asm/Kbuild > > > > b/xen/arch/x86/include/asm/Kbuild > > > > new file mode 100644 > > > > index 0000000000..a4e40e534e > > > > --- /dev/null > > > > +++ b/xen/arch/x86/include/asm/Kbuild > > > > @@ -0,0 +1 @@ > > > > +# SPDX-License-Identifier: GPL-2.0-only > > > > diff --git a/xen/scripts/Makefile.asm-generic > > > > b/xen/scripts/Makefile.asm-generic > > > > new file mode 100644 > > > > index 0000000000..0aac3f50b8 > > > > --- /dev/null > > > > +++ b/xen/scripts/Makefile.asm-generic > > > > @@ -0,0 +1,23 @@ > > > > +# SPDX-License-Identifier: GPL-2.0 > > > > +# include/asm-generic contains a lot of files that are used > > > > +# verbatim by several architectures. > > > > +# > > > > +# This Makefile reads the file > > > > arch/$(SRCARCH)/include/asm/Kbuild > > > > +# and for each file listed in this file with generic-y creates > > > > +# a small wrapper file in $(obj) > > > > (arch/$(SRCARCH)/include/generated/asm) > > > > + > > > > +kbuild-file := $(srctree)/arch/$(SRCARCH)/include/asm/Kbuild > > > > +include $(kbuild-file) > > > > + > > > > +include scripts/Kbuild.include > > > > + > > > > +# Create output directory if not already present > > > > +_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj)) > > > > + > > > > +quiet_cmd_wrap = WRAP $@ > > > > +cmd_wrap = echo "\#include <asm-generic/$*.h>" >$@ > > > > + > > > > +all: $(patsubst %, $(obj)/%, $(generic-y)) > > > > + > > > > +$(obj)/%.h: > > > > + $(call cmd,wrap) > > > > > > In fact i think your files are not generated in the srctree so > > > this > > > will break if you use out of tree compilation. > > Why not? They will be generated in $obj which equal to > > obj=arch/$(SRCARCH)/include/generated/asm ( in my case ). > > Right they are generated in the build tree but if it is not the same > as srctree it will not work due to CFLAGS. > > > > > Anyway I think that obj should be equal to what is mentioned in > > CFLAGS. > > We generate other files like asm-offsets.h and it could in fact be > that > both srctree and build tree are already in include path. > > There is in makefile a rule already removing asm-offsets.h which is > generated > and this one does not use a prefix so we should follow this standard > in fact. > > So we should not use any prefix (srctree or obj) i think. I think you are right. Lets avoid usage of srctree/obj. ~ Oleksii ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v4 1/2] xen: asm-generic support 2023-09-04 13:39 ` Bertrand Marquis 2023-09-05 13:37 ` Oleksii @ 2023-09-06 11:37 ` Oleksii 2023-09-06 13:03 ` Bertrand Marquis 1 sibling, 1 reply; 22+ messages in thread From: Oleksii @ 2023-09-06 11:37 UTC (permalink / raw) To: Bertrand Marquis Cc: Xen-devel, Jan Beulich, Andrew Cooper, George Dunlap, Julien Grall, Stefano Stabellini, Wei Liu, Volodymyr Babchuk, Shawn Anastasio, Bob Eshleman, Alistair Francis, Connor Davis, Roger Pau Monné Hello Bertrand On Mon, 2023-09-04 at 13:39 +0000, Bertrand Marquis wrote: > > diff --git a/xen/scripts/Makefile.asm-generic > > b/xen/scripts/Makefile.asm-generic > > new file mode 100644 > > index 0000000000..0aac3f50b8 > > --- /dev/null > > +++ b/xen/scripts/Makefile.asm-generic > > @@ -0,0 +1,23 @@ > > +# SPDX-License-Identifier: GPL-2.0 > > +# include/asm-generic contains a lot of files that are used > > +# verbatim by several architectures. > > +# > > +# This Makefile reads the file arch/$(SRCARCH)/include/asm/Kbuild > > +# and for each file listed in this file with generic-y creates > > +# a small wrapper file in $(obj) > > (arch/$(SRCARCH)/include/generated/asm) > > + > > +kbuild-file := $(srctree)/arch/$(SRCARCH)/include/asm/Kbuild > > +include $(kbuild-file) > > + > > +include scripts/Kbuild.include > > + > > +# Create output directory if not already present > > +_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj)) > > + > > +quiet_cmd_wrap = WRAP $@ > > +cmd_wrap = echo "\#include <asm-generic/$*.h>" >$@ > > + > > +all: $(patsubst %, $(obj)/%, $(generic-y)) > > + > > +$(obj)/%.h: > > + $(call cmd,wrap) > > In fact i think your files are not generated in the srctree so this > will break if you use out of tree compilation. I checked that and in both cases it generated in correct place. First case: $ CONTAINER_NO_PULL=1 CONTAINER=riscv64 ./automation/scripts/containerize make XEN_TARGET_ARCH=riscv64 -C xen build $ ls -la xen/arch/riscv/include/generated/asm/vm_event.h -rw-r--r--. 1 ok ok 34 вер 6 14:32 xen/arch/riscv/include/generated/asm/vm_event.h Second case: ( out-of-tree ) $ CONTAINER_NO_PULL=1 CONTAINER=riscv64 ./automation/scripts/containerize make O=xen_build XEN_TARGET_ARCH=riscv64 -C xen build V=1 $ ls -la xen/xen_build/arch/riscv/include/generated/asm/vm_event.h -rw-r--r--. 1 ok ok 34 вер 6 14:34 xen/xen_build/arch/riscv/include/generated/asm/vm_event.h Could you please clarify if there's somithing I might have overlooked? ~ Oleksii ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v4 1/2] xen: asm-generic support 2023-09-06 11:37 ` Oleksii @ 2023-09-06 13:03 ` Bertrand Marquis 2023-09-06 15:37 ` Anthony PERARD 0 siblings, 1 reply; 22+ messages in thread From: Bertrand Marquis @ 2023-09-06 13:03 UTC (permalink / raw) To: Oleksii Cc: Xen-devel, Jan Beulich, Andrew Cooper, George Dunlap, Julien Grall, Stefano Stabellini, Wei Liu, Volodymyr Babchuk, Shawn Anastasio, Bob Eshleman, Alistair Francis, Connor Davis, Roger Pau Monné, Anthony PERARD Hi Oleksii, > On 6 Sep 2023, at 13:37, Oleksii <oleksii.kurochko@gmail.com> wrote: > > Hello Bertrand > > On Mon, 2023-09-04 at 13:39 +0000, Bertrand Marquis wrote: >>> diff --git a/xen/scripts/Makefile.asm-generic >>> b/xen/scripts/Makefile.asm-generic >>> new file mode 100644 >>> index 0000000000..0aac3f50b8 >>> --- /dev/null >>> +++ b/xen/scripts/Makefile.asm-generic >>> @@ -0,0 +1,23 @@ >>> +# SPDX-License-Identifier: GPL-2.0 >>> +# include/asm-generic contains a lot of files that are used >>> +# verbatim by several architectures. >>> +# >>> +# This Makefile reads the file arch/$(SRCARCH)/include/asm/Kbuild >>> +# and for each file listed in this file with generic-y creates >>> +# a small wrapper file in $(obj) >>> (arch/$(SRCARCH)/include/generated/asm) >>> + >>> +kbuild-file := $(srctree)/arch/$(SRCARCH)/include/asm/Kbuild >>> +include $(kbuild-file) >>> + >>> +include scripts/Kbuild.include >>> + >>> +# Create output directory if not already present >>> +_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj)) >>> + >>> +quiet_cmd_wrap = WRAP $@ >>> +cmd_wrap = echo "\#include <asm-generic/$*.h>" >$@ >>> + >>> +all: $(patsubst %, $(obj)/%, $(generic-y)) >>> + >>> +$(obj)/%.h: >>> + $(call cmd,wrap) >> >> In fact i think your files are not generated in the srctree so this >> will break if you use out of tree compilation. > I checked that and in both cases it generated in correct place. > > First case: > $ CONTAINER_NO_PULL=1 CONTAINER=riscv64 > ./automation/scripts/containerize make XEN_TARGET_ARCH=riscv64 -C xen > build > > $ ls -la xen/arch/riscv/include/generated/asm/vm_event.h > -rw-r--r--. 1 ok ok 34 вер 6 14:32 > xen/arch/riscv/include/generated/asm/vm_event.h > > Second case: ( out-of-tree ) > $ CONTAINER_NO_PULL=1 CONTAINER=riscv64 > ./automation/scripts/containerize make O=xen_build > XEN_TARGET_ARCH=riscv64 -C xen build V=1 > > $ ls -la xen/xen_build/arch/riscv/include/generated/asm/vm_event.h > -rw-r--r--. 1 ok ok 34 вер 6 14:34 > xen/xen_build/arch/riscv/include/generated/asm/vm_event.h > > Could you please clarify if there's somithing I might have overlooked? No I do not think you did. So obj is empty I would guess. Anyway you just need to make sure that CFLAGS is coherent with what you generate. So if you generate in $(obj) you need to make sure you use the same in CFLAGS i would say. @anthony: any advice here ? Cheers Bertrand > > ~ Oleksii > > > ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v4 1/2] xen: asm-generic support 2023-09-06 13:03 ` Bertrand Marquis @ 2023-09-06 15:37 ` Anthony PERARD 0 siblings, 0 replies; 22+ messages in thread From: Anthony PERARD @ 2023-09-06 15:37 UTC (permalink / raw) To: Bertrand Marquis Cc: Oleksii, Xen-devel, Jan Beulich, Andrew Cooper, George Dunlap, Julien Grall, Stefano Stabellini, Wei Liu, Volodymyr Babchuk, Shawn Anastasio, Bob Eshleman, Alistair Francis, Connor Davis, Roger Pau Monné On Wed, Sep 06, 2023 at 01:03:32PM +0000, Bertrand Marquis wrote: > > On 6 Sep 2023, at 13:37, Oleksii <oleksii.kurochko@gmail.com> wrote: > > On Mon, 2023-09-04 at 13:39 +0000, Bertrand Marquis wrote: > >>> diff --git a/xen/scripts/Makefile.asm-generic > >>> b/xen/scripts/Makefile.asm-generic > >>> new file mode 100644 > >>> index 0000000000..0aac3f50b8 > >>> --- /dev/null > >>> +++ b/xen/scripts/Makefile.asm-generic > >>> + > >>> +$(obj)/%.h: > >>> + $(call cmd,wrap) > >> > >> In fact i think your files are not generated in the srctree so this > >> will break if you use out of tree compilation. > > I checked that and in both cases it generated in correct place. > > > > First case: > > $ CONTAINER_NO_PULL=1 CONTAINER=riscv64 > > ./automation/scripts/containerize make XEN_TARGET_ARCH=riscv64 -C xen > > build > > > > $ ls -la xen/arch/riscv/include/generated/asm/vm_event.h > > -rw-r--r--. 1 ok ok 34 вер 6 14:32 > > xen/arch/riscv/include/generated/asm/vm_event.h > > > > Second case: ( out-of-tree ) > > $ CONTAINER_NO_PULL=1 CONTAINER=riscv64 > > ./automation/scripts/containerize make O=xen_build > > XEN_TARGET_ARCH=riscv64 -C xen build V=1 > > > > $ ls -la xen/xen_build/arch/riscv/include/generated/asm/vm_event.h > > -rw-r--r--. 1 ok ok 34 вер 6 14:34 > > xen/xen_build/arch/riscv/include/generated/asm/vm_event.h > > > > Could you please clarify if there's somithing I might have overlooked? > > No I do not think you did. > > So obj is empty I would guess. > Anyway you just need to make sure that CFLAGS is coherent with what you generate. > So if you generate in $(obj) you need to make sure you use the same in CFLAGS i would say. > > @anthony: any advice here ? The use of $(obj) looks fine here. $(obj) is temporary and set for a single subdirectory. $(obj) is set by whatever is calling "Makefile.asm-generic", or "Rules.mk" is other cases. In this patch, you can see $(obj) been set in "xen/Makefile": $(MAKE) -f $(srctree)/scripts/Makefile.asm-generic obj=arch/$(SRCARCH)/include/generated/asm Another thing to know, `make` runs from the build directory, so in Oleksii second case, `make` is running in "xen/xen_build", so $(obj) point to a directory within the build directory. For the CFLAGS, we can use $(objtree) (even if it is just "."), which always point to the top directory of the build tree. I hope that clarifies things. Cheers, -- Anthony PERARD ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v4 1/2] xen: asm-generic support 2023-09-01 16:02 ` [PATCH v4 1/2] xen: asm-generic support Oleksii Kurochko 2023-09-04 13:39 ` Bertrand Marquis @ 2023-09-06 12:16 ` Jan Beulich 2023-09-06 12:28 ` Oleksii 2023-09-06 15:57 ` Anthony PERARD 2 siblings, 1 reply; 22+ messages in thread From: Jan Beulich @ 2023-09-06 12:16 UTC (permalink / raw) To: Oleksii Kurochko Cc: Andrew Cooper, George Dunlap, Julien Grall, Stefano Stabellini, Wei Liu, Bertrand Marquis, Volodymyr Babchuk, Shawn Anastasio, Bob Eshleman, Alistair Francis, Connor Davis, Roger Pau Monné, xen-devel On 01.09.2023 18:02, Oleksii Kurochko wrote: > --- /dev/null > +++ b/xen/scripts/Makefile.asm-generic > @@ -0,0 +1,23 @@ > +# SPDX-License-Identifier: GPL-2.0 While this is what the Linux file presently says, you still want to add "-only", which is merely the newer name for the same thing. > +# include/asm-generic contains a lot of files that are used > +# verbatim by several architectures. > +# > +# This Makefile reads the file arch/$(SRCARCH)/include/asm/Kbuild > +# and for each file listed in this file with generic-y creates > +# a small wrapper file in $(obj) (arch/$(SRCARCH)/include/generated/asm) > + > +kbuild-file := $(srctree)/arch/$(SRCARCH)/include/asm/Kbuild > +include $(kbuild-file) > + > +include scripts/Kbuild.include > + > +# Create output directory if not already present > +_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj)) > + > +quiet_cmd_wrap = WRAP $@ > +cmd_wrap = echo "\#include <asm-generic/$*.h>" >$@ > + > +all: $(patsubst %, $(obj)/%, $(generic-y)) > + > +$(obj)/%.h: > + $(call cmd,wrap) You've removed quite a bit of functionality, comparing with the Linux original. May I ask why that is? What they have all makes sense to me, and looks to be useful down the road. Jan ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v4 1/2] xen: asm-generic support 2023-09-06 12:16 ` Jan Beulich @ 2023-09-06 12:28 ` Oleksii 2023-09-06 12:40 ` Jan Beulich 0 siblings, 1 reply; 22+ messages in thread From: Oleksii @ 2023-09-06 12:28 UTC (permalink / raw) To: Jan Beulich Cc: Andrew Cooper, George Dunlap, Julien Grall, Stefano Stabellini, Wei Liu, Bertrand Marquis, Volodymyr Babchuk, Shawn Anastasio, Bob Eshleman, Alistair Francis, Connor Davis, Roger Pau Monné, xen-devel On Wed, 2023-09-06 at 14:16 +0200, Jan Beulich wrote: > On 01.09.2023 18:02, Oleksii Kurochko wrote: > > --- /dev/null > > +++ b/xen/scripts/Makefile.asm-generic > > @@ -0,0 +1,23 @@ > > +# SPDX-License-Identifier: GPL-2.0 > > While this is what the Linux file presently says, you still want to > add > "-only", which is merely the newer name for the same thing. > > > +# include/asm-generic contains a lot of files that are used > > +# verbatim by several architectures. > > +# > > +# This Makefile reads the file arch/$(SRCARCH)/include/asm/Kbuild > > +# and for each file listed in this file with generic-y creates > > +# a small wrapper file in $(obj) > > (arch/$(SRCARCH)/include/generated/asm) > > + > > +kbuild-file := $(srctree)/arch/$(SRCARCH)/include/asm/Kbuild > > +include $(kbuild-file) > > + > > +include scripts/Kbuild.include > > + > > +# Create output directory if not already present > > +_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj)) > > + > > +quiet_cmd_wrap = WRAP $@ > > +cmd_wrap = echo "\#include <asm-generic/$*.h>" >$@ > > + > > +all: $(patsubst %, $(obj)/%, $(generic-y)) > > + > > +$(obj)/%.h: > > + $(call cmd,wrap) > > You've removed quite a bit of functionality, comparing with the Linux > original. May I ask why that is? What they have all makes sense to > me, > and looks to be useful down the road. I decided to take only minimum needed now but if you think it would be better to use the latest Linux's Makefile.asm-generic then I will update it in the next patch version. ~ Oleksii ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v4 1/2] xen: asm-generic support 2023-09-06 12:28 ` Oleksii @ 2023-09-06 12:40 ` Jan Beulich 2023-09-06 15:06 ` Anthony PERARD 0 siblings, 1 reply; 22+ messages in thread From: Jan Beulich @ 2023-09-06 12:40 UTC (permalink / raw) To: Oleksii Cc: Andrew Cooper, George Dunlap, Julien Grall, Stefano Stabellini, Wei Liu, Bertrand Marquis, Volodymyr Babchuk, Shawn Anastasio, Bob Eshleman, Alistair Francis, Connor Davis, Roger Pau Monné, xen-devel On 06.09.2023 14:28, Oleksii wrote: > On Wed, 2023-09-06 at 14:16 +0200, Jan Beulich wrote: >> On 01.09.2023 18:02, Oleksii Kurochko wrote: >>> --- /dev/null >>> +++ b/xen/scripts/Makefile.asm-generic >>> @@ -0,0 +1,23 @@ >>> +# SPDX-License-Identifier: GPL-2.0 >> >> While this is what the Linux file presently says, you still want to >> add >> "-only", which is merely the newer name for the same thing. >> >>> +# include/asm-generic contains a lot of files that are used >>> +# verbatim by several architectures. >>> +# >>> +# This Makefile reads the file arch/$(SRCARCH)/include/asm/Kbuild >>> +# and for each file listed in this file with generic-y creates >>> +# a small wrapper file in $(obj) >>> (arch/$(SRCARCH)/include/generated/asm) >>> + >>> +kbuild-file := $(srctree)/arch/$(SRCARCH)/include/asm/Kbuild >>> +include $(kbuild-file) >>> + >>> +include scripts/Kbuild.include >>> + >>> +# Create output directory if not already present >>> +_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj)) >>> + >>> +quiet_cmd_wrap = WRAP $@ >>> +cmd_wrap = echo "\#include <asm-generic/$*.h>" >$@ >>> + >>> +all: $(patsubst %, $(obj)/%, $(generic-y)) >>> + >>> +$(obj)/%.h: >>> + $(call cmd,wrap) >> >> You've removed quite a bit of functionality, comparing with the Linux >> original. May I ask why that is? What they have all makes sense to >> me, >> and looks to be useful down the road. > I decided to take only minimum needed now but if you think it would be > better to use the latest Linux's Makefile.asm-generic then I will > update it in the next patch version. Unless there are things getting in the way, I indeed think it would be better to take the whole thing largely verbatim (a few edits are unavoidable afaict). Jan ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v4 1/2] xen: asm-generic support 2023-09-06 12:40 ` Jan Beulich @ 2023-09-06 15:06 ` Anthony PERARD 2023-09-06 15:24 ` Oleksii 0 siblings, 1 reply; 22+ messages in thread From: Anthony PERARD @ 2023-09-06 15:06 UTC (permalink / raw) To: Oleksii Cc: Andrew Cooper, George Dunlap, Julien Grall, Stefano Stabellini, Wei Liu, Bertrand Marquis, Volodymyr Babchuk, Shawn Anastasio, Bob Eshleman, Alistair Francis, Connor Davis, Roger Pau Monné, xen-devel, Jan Beulich On Wed, Sep 06, 2023 at 02:40:29PM +0200, Jan Beulich wrote: > On 06.09.2023 14:28, Oleksii wrote: > > On Wed, 2023-09-06 at 14:16 +0200, Jan Beulich wrote: > >> You've removed quite a bit of functionality, comparing with the Linux > >> original. May I ask why that is? What they have all makes sense to > >> me, > >> and looks to be useful down the road. > > I decided to take only minimum needed now but if you think it would be > > better to use the latest Linux's Makefile.asm-generic then I will > > update it in the next patch version. > > Unless there are things getting in the way, I indeed think it would be > better to take the whole thing largely verbatim (a few edits are > unavoidable afaict). Yes, I think it would be useful as well to take most of the file from Linux. At least, this would include the "$(unwanted)" variable, which is used to remove old wrapper when an header is removed from "generic-y". But instead of the "-include $(kbuild-file)", could you include "$(src)/Makefile" instead like we do in "Rules.mk"? We don't have $(kbuild-file) macro anyway, and I don't see the point in using files name "Kbuild" when "Makefile" works and is enough. Thanks, -- Anthony PERARD ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v4 1/2] xen: asm-generic support 2023-09-06 15:06 ` Anthony PERARD @ 2023-09-06 15:24 ` Oleksii 0 siblings, 0 replies; 22+ messages in thread From: Oleksii @ 2023-09-06 15:24 UTC (permalink / raw) To: Anthony PERARD Cc: Andrew Cooper, George Dunlap, Julien Grall, Stefano Stabellini, Wei Liu, Bertrand Marquis, Volodymyr Babchuk, Shawn Anastasio, Bob Eshleman, Alistair Francis, Connor Davis, Roger Pau Monné, xen-devel, Jan Beulich On Wed, 2023-09-06 at 16:06 +0100, Anthony PERARD wrote: > On Wed, Sep 06, 2023 at 02:40:29PM +0200, Jan Beulich wrote: > > On 06.09.2023 14:28, Oleksii wrote: > > > On Wed, 2023-09-06 at 14:16 +0200, Jan Beulich wrote: > > > > You've removed quite a bit of functionality, comparing with the > > > > Linux > > > > original. May I ask why that is? What they have all makes sense > > > > to > > > > me, > > > > and looks to be useful down the road. > > > I decided to take only minimum needed now but if you think it > > > would be > > > better to use the latest Linux's Makefile.asm-generic then I will > > > update it in the next patch version. > > > > Unless there are things getting in the way, I indeed think it would > > be > > better to take the whole thing largely verbatim (a few edits are > > unavoidable afaict). > > Yes, I think it would be useful as well to take most of the file from > Linux. At least, this would include the "$(unwanted)" variable, which > is > used to remove old wrapper when an header is removed from "generic- > y". > But instead of the "-include $(kbuild-file)", could you include > "$(src)/Makefile" instead like we do in "Rules.mk"? We don't have > $(kbuild-file) macro anyway, and I don't see the point in using files > name "Kbuild" when "Makefile" works and is enough. > Thank you for your feedback. I'll take into account your suggestions in the next patch version. ~ Oleksii ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v4 1/2] xen: asm-generic support 2023-09-01 16:02 ` [PATCH v4 1/2] xen: asm-generic support Oleksii Kurochko 2023-09-04 13:39 ` Bertrand Marquis 2023-09-06 12:16 ` Jan Beulich @ 2023-09-06 15:57 ` Anthony PERARD 2023-09-06 19:46 ` Oleksii 2 siblings, 1 reply; 22+ messages in thread From: Anthony PERARD @ 2023-09-06 15:57 UTC (permalink / raw) To: Oleksii Kurochko Cc: xen-devel, Jan Beulich, Andrew Cooper, George Dunlap, Julien Grall, Stefano Stabellini, Wei Liu, Bertrand Marquis, Volodymyr Babchuk, Shawn Anastasio, Bob Eshleman, Alistair Francis, Connor Davis, Roger Pau Monné On Fri, Sep 01, 2023 at 07:02:14PM +0300, Oleksii Kurochko wrote: > diff --git a/xen/Makefile b/xen/Makefile > index f57e5a596c..698d6ddeb8 100644 > --- a/xen/Makefile > +++ b/xen/Makefile > @@ -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 Could you introduce a $(asm-generic) macro in Kbuild.include like we already have for $(build) and $(clean)? As I think it would be nicer to have $(Q)$(MAKE) $(asm-generic)=arch/$(SRCARCH)/include/generated/asm in the main makefile. Also, could you move the rule "asm-generic" within the "!config-build" part of the Makefile? Somewhere around the rule for $(TARGET), maybe just after the rule "_distclean". Cheers, -- Anthony PERARD ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v4 1/2] xen: asm-generic support 2023-09-06 15:57 ` Anthony PERARD @ 2023-09-06 19:46 ` Oleksii 0 siblings, 0 replies; 22+ messages in thread From: Oleksii @ 2023-09-06 19:46 UTC (permalink / raw) To: Anthony PERARD Cc: xen-devel, Jan Beulich, Andrew Cooper, George Dunlap, Julien Grall, Stefano Stabellini, Wei Liu, Bertrand Marquis, Volodymyr Babchuk, Shawn Anastasio, Bob Eshleman, Alistair Francis, Connor Davis, Roger Pau Monné On Wed, 2023-09-06 at 16:57 +0100, Anthony PERARD wrote: > On Fri, Sep 01, 2023 at 07:02:14PM +0300, Oleksii Kurochko wrote: > > diff --git a/xen/Makefile b/xen/Makefile > > index f57e5a596c..698d6ddeb8 100644 > > --- a/xen/Makefile > > +++ b/xen/Makefile > > @@ -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 > > Could you introduce a $(asm-generic) macro in Kbuild.include like we > already have for $(build) and $(clean)? As I think it would be nicer > to > have > $(Q)$(MAKE) $(asm- > generic)=arch/$(SRCARCH)/include/generated/asm > in the main makefile. > > Also, could you move the rule "asm-generic" within the "!config- > build" > part of the Makefile? Somewhere around the rule for $(TARGET), maybe > just after the rule "_distclean". > I pushed a new patch version tomorrow. I'll rework it based on your comments here. ~ Oleksii ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH v4 2/2] xen: move arm/include/asm/vm_event.h to asm-generic 2023-09-01 16:02 [PATCH v4 0/2] introduce stub directory to storing empty/stub headers Oleksii Kurochko 2023-09-01 16:02 ` [PATCH v4 1/2] xen: asm-generic support Oleksii Kurochko @ 2023-09-01 16:02 ` Oleksii Kurochko 2023-09-01 17:14 ` Oleksii Kurochko 2023-09-04 6:54 ` Jan Beulich 1 sibling, 2 replies; 22+ messages in thread From: Oleksii Kurochko @ 2023-09-01 16:02 UTC (permalink / raw) To: xen-devel Cc: Jan Beulich, Oleksii Kurochko, Tamas K Lengyel, Alexandru Isaila, Petre Pircalabu, Stefano Stabellini asm/vm_event.h is common for ARM and RISC-V so it will be moved to asm-generic 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. Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> Acked-by: Stefano Stabellini <sstabellini@kernel.org> --- 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 <sstabellini@kernel.org> 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/include/asm-generic/vm_event.h | 55 ++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 xen/include/asm-generic/vm_event.h diff --git a/xen/include/asm-generic/vm_event.h b/xen/include/asm-generic/vm_event.h new file mode 100644 index 0000000000..620c7b971c --- /dev/null +++ b/xen/include/asm-generic/vm_event.h @@ -0,0 +1,55 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * vm_event.h: stubs for architecture specific vm_event handling routines + * + * Copyright (c) 2015 Tamas K Lengyel (tamas@tklengyel.com) + */ + +#ifndef __ASM_GENERIC_VM_EVENT_H__ +#define __ASM_GENERIC_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_GENERIC_VM_EVENT_H__ */ -- 2.41.0 ^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH v4 2/2] xen: move arm/include/asm/vm_event.h to asm-generic 2023-09-01 16:02 ` [PATCH v4 2/2] xen: move arm/include/asm/vm_event.h to asm-generic Oleksii Kurochko @ 2023-09-01 17:14 ` Oleksii Kurochko 2023-09-04 6:53 ` Jan Beulich 2023-09-04 6:54 ` Jan Beulich 1 sibling, 1 reply; 22+ messages in thread From: Oleksii Kurochko @ 2023-09-01 17:14 UTC (permalink / raw) To: Xen-devel [-- Attachment #1: Type: text/plain, Size: 2865 bytes --] The change which adds generic-y += vm_event.h to ARM's Kbuild was lost during creation of the patch. Should be added in the next patch version On Fri, Sep 1, 2023, 18:02 Oleksii Kurochko <oleksii.kurochko@gmail.com> wrote: > asm/vm_event.h is common for ARM and RISC-V so it will be moved to > asm-generic 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. > > Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> > Acked-by: Stefano Stabellini <sstabellini@kernel.org> > --- > 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 <sstabellini@kernel.org> 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/include/asm-generic/vm_event.h | 55 ++++++++++++++++++++++++++++++ > 1 file changed, 55 insertions(+) > create mode 100644 xen/include/asm-generic/vm_event.h > > diff --git a/xen/include/asm-generic/vm_event.h > b/xen/include/asm-generic/vm_event.h > new file mode 100644 > index 0000000000..620c7b971c > --- /dev/null > +++ b/xen/include/asm-generic/vm_event.h > @@ -0,0 +1,55 @@ > +/* SPDX-License-Identifier: GPL-2.0-only */ > +/* > + * vm_event.h: stubs for architecture specific vm_event handling routines > + * > + * Copyright (c) 2015 Tamas K Lengyel (tamas@tklengyel.com) > + */ > + > +#ifndef __ASM_GENERIC_VM_EVENT_H__ > +#define __ASM_GENERIC_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_GENERIC_VM_EVENT_H__ */ > -- > 2.41.0 > > [-- Attachment #2: Type: text/html, Size: 3818 bytes --] ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v4 2/2] xen: move arm/include/asm/vm_event.h to asm-generic 2023-09-01 17:14 ` Oleksii Kurochko @ 2023-09-04 6:53 ` Jan Beulich 2023-09-04 11:27 ` Oleksii 0 siblings, 1 reply; 22+ messages in thread From: Jan Beulich @ 2023-09-04 6:53 UTC (permalink / raw) To: Oleksii Kurochko; +Cc: Xen-devel On 01.09.2023 19:14, Oleksii Kurochko wrote: > The change which adds generic-y += vm_event.h to ARM's Kbuild was lost > during creation of the patch. Should be added in the next patch version Which I guess is an indication that ... > On Fri, Sep 1, 2023, 18:02 Oleksii Kurochko <oleksii.kurochko@gmail.com> > wrote: > >> asm/vm_event.h is common for ARM and RISC-V so it will be moved to >> asm-generic 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. >> >> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> >> Acked-by: Stefano Stabellini <sstabellini@kernel.org> ... any earlier acks would better have been dropped. Jan ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v4 2/2] xen: move arm/include/asm/vm_event.h to asm-generic 2023-09-04 6:53 ` Jan Beulich @ 2023-09-04 11:27 ` Oleksii 0 siblings, 0 replies; 22+ messages in thread From: Oleksii @ 2023-09-04 11:27 UTC (permalink / raw) To: Jan Beulich; +Cc: Xen-devel On Mon, 2023-09-04 at 08:53 +0200, Jan Beulich wrote: > On 01.09.2023 19:14, Oleksii Kurochko wrote: > > The change which adds generic-y += vm_event.h to ARM's Kbuild was > > lost > > during creation of the patch. Should be added in the next patch > > version > > Which I guess is an indication that ... > > > On Fri, Sep 1, 2023, 18:02 Oleksii Kurochko > > <oleksii.kurochko@gmail.com> > > wrote: > > > > > asm/vm_event.h is common for ARM and RISC-V so it will be moved > > > to > > > asm-generic 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. > > > > > > Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> > > > Acked-by: Stefano Stabellini <sstabellini@kernel.org> > > ... any earlier acks would better have been dropped. You are right. I will remove acked-by in the next patch series version. ~ Oleksii ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v4 2/2] xen: move arm/include/asm/vm_event.h to asm-generic 2023-09-01 16:02 ` [PATCH v4 2/2] xen: move arm/include/asm/vm_event.h to asm-generic Oleksii Kurochko 2023-09-01 17:14 ` Oleksii Kurochko @ 2023-09-04 6:54 ` Jan Beulich 2023-09-04 11:29 ` Oleksii 1 sibling, 1 reply; 22+ messages in thread From: Jan Beulich @ 2023-09-04 6:54 UTC (permalink / raw) To: Oleksii Kurochko Cc: Tamas K Lengyel, Alexandru Isaila, Petre Pircalabu, Stefano Stabellini, xen-devel On 01.09.2023 18:02, Oleksii Kurochko wrote: > asm/vm_event.h is common for ARM and RISC-V so it will be moved to > asm-generic 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. > > Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> > Acked-by: Stefano Stabellini <sstabellini@kernel.org> > --- > 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 <sstabellini@kernel.org> 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/include/asm-generic/vm_event.h | 55 ++++++++++++++++++++++++++++++ > 1 file changed, 55 insertions(+) > create mode 100644 xen/include/asm-generic/vm_event.h But that's not "move" anymore, as the Arm header isn't being deleted. Jan ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v4 2/2] xen: move arm/include/asm/vm_event.h to asm-generic 2023-09-04 6:54 ` Jan Beulich @ 2023-09-04 11:29 ` Oleksii 0 siblings, 0 replies; 22+ messages in thread From: Oleksii @ 2023-09-04 11:29 UTC (permalink / raw) To: Jan Beulich Cc: Tamas K Lengyel, Alexandru Isaila, Petre Pircalabu, Stefano Stabellini, xen-devel On Mon, 2023-09-04 at 08:54 +0200, Jan Beulich wrote: > On 01.09.2023 18:02, Oleksii Kurochko wrote: > > asm/vm_event.h is common for ARM and RISC-V so it will be moved to > > asm-generic 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. > > > > Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> > > Acked-by: Stefano Stabellini <sstabellini@kernel.org> > > --- > > 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 <sstabellini@kernel.org> 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/include/asm-generic/vm_event.h | 55 > > ++++++++++++++++++++++++++++++ > > 1 file changed, 55 insertions(+) > > create mode 100644 xen/include/asm-generic/vm_event.h > > But that's not "move" anymore, as the Arm header isn't being deleted. Yes, it is correct. But I think we still have to remove it as this is not any sense to have the same file for ARM, PPC and RISC-V. ^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2023-09-06 19:46 UTC | newest] Thread overview: 22+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-09-01 16:02 [PATCH v4 0/2] introduce stub directory to storing empty/stub headers Oleksii Kurochko 2023-09-01 16:02 ` [PATCH v4 1/2] xen: asm-generic support Oleksii Kurochko 2023-09-04 13:39 ` Bertrand Marquis 2023-09-05 13:37 ` Oleksii 2023-09-05 14:10 ` Bertrand Marquis 2023-09-06 10:36 ` Oleksii 2023-09-06 11:37 ` Oleksii 2023-09-06 13:03 ` Bertrand Marquis 2023-09-06 15:37 ` Anthony PERARD 2023-09-06 12:16 ` Jan Beulich 2023-09-06 12:28 ` Oleksii 2023-09-06 12:40 ` Jan Beulich 2023-09-06 15:06 ` Anthony PERARD 2023-09-06 15:24 ` Oleksii 2023-09-06 15:57 ` Anthony PERARD 2023-09-06 19:46 ` Oleksii 2023-09-01 16:02 ` [PATCH v4 2/2] xen: move arm/include/asm/vm_event.h to asm-generic Oleksii Kurochko 2023-09-01 17:14 ` Oleksii Kurochko 2023-09-04 6:53 ` Jan Beulich 2023-09-04 11:27 ` Oleksii 2023-09-04 6:54 ` Jan Beulich 2023-09-04 11:29 ` Oleksii
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.