Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rv64ilp32: Running ILP32 on RV64 ISA #240

Closed
wants to merge 1 commit into from
Closed

Conversation

bjoto
Copy link

@bjoto bjoto commented Nov 12, 2023

Pull request for series with
subject: rv64ilp32: Running ILP32 on RV64 ISA
version: 2
url: https://patchwork.kernel.org/project/linux-riscv/list/?series=800464

@bjoto
Copy link
Author

bjoto commented Nov 12, 2023

Upstream branch: 3ca112b
series: https://patchwork.kernel.org/project/linux-riscv/list/?series=800464
version: 2

Pull request is NOT updated. Failed to apply https://patchwork.kernel.org/project/linux-riscv/list/?series=800464
error message:

Cmd('git') failed due to: exit code(128)
  cmdline: git am -s --3way
  stdout: 'Applying: riscv: u64ilp32: Unify vdso32 & compat_vdso into vdso/Makefile
Using index info to reconstruct a base tree...
M	arch/riscv/Kconfig
M	arch/riscv/Makefile
M	arch/riscv/kernel/Makefile
M	arch/riscv/kernel/vdso/Makefile
Falling back to patching base and 3-way merge...
Auto-merging arch/riscv/kernel/vdso/Makefile
CONFLICT (content): Merge conflict in arch/riscv/kernel/vdso/Makefile
Auto-merging arch/riscv/kernel/Makefile
Auto-merging arch/riscv/Makefile
CONFLICT (content): Merge conflict in arch/riscv/Makefile
Auto-merging arch/riscv/Kconfig
Patch failed at 0001 riscv: u64ilp32: Unify vdso32 & compat_vdso into vdso/Makefile
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".'
  stderr: 'error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch'

conflict:

diff --cc arch/riscv/Makefile
index a74be78678eb,3b7d5ebf3c78..000000000000
--- a/arch/riscv/Makefile
+++ b/arch/riscv/Makefile
@@@ -134,6 -134,13 +134,16 @@@ endi
  libs-y += arch/riscv/lib/
  libs-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a
  
++<<<<<<< HEAD
++=======
+ PHONY += vdso_install
+ vdso_install:
+ 	$(if $(CONFIG_VDSO32),$(Q)$(MAKE) \
+ 		$(build)=arch/riscv/kernel/vdso vdso32_install
+ 	$(if $(CONFIG_VDSO64),$(Q)$(MAKE) \
+ 		$(build)=arch/riscv/kernel/vdso vdso64_install
+ 
++>>>>>>> riscv: u64ilp32: Unify vdso32 & compat_vdso into vdso/Makefile
  ifeq ($(KBUILD_EXTMOD),)
  ifeq ($(CONFIG_MMU),y)
  prepare: vdso_prepare
diff --cc arch/riscv/kernel/vdso/Makefile
index 9b517fe1b8a8,a9720e816e1f..000000000000
--- a/arch/riscv/kernel/vdso/Makefile
+++ b/arch/riscv/kernel/vdso/Makefile
@@@ -19,57 -15,142 +15,150 @@@ UBSAN_SANITIZE := 
  ccflags-y := -fno-stack-protector
  ccflags-y += -DDISABLE_BRANCH_PROFILING
  
- ifneq ($(c-gettimeofday-y),)
-   CFLAGS_vgettimeofday.o += -fPIC -include $(c-gettimeofday-y)
+ CPPFLAGS_vdso.lds += -P -C -U$(ARCH)
+ ifneq ($(filter vgettimeofday, $(vdso-cc-syms)),)
+ 	CPPFLAGS_vdso.lds += -DHAS_VGETTIMEOFDAY
  endif
  
- CFLAGS_hwprobe.o += -fPIC
+ # strip rule for the .so file
+ $(obj)/%.so: OBJCOPYFLAGS := -S
+ $(obj)/%.so: $(obj)/%.so.dbg FORCE
+ 	$(call if_changed,objcopy)
  
- # Build rules
- targets := $(obj-vdso) vdso.so vdso.so.dbg vdso.lds
- obj-vdso := $(addprefix $(obj)/, $(obj-vdso))
+ # install commands for the unstripped file
+ quiet_cmd_vdso_install = INSTALL $@
+       cmd_vdso_install = cp $(obj)/$@.dbg $(MODLIB)/vdso/$@
  
- obj-y += vdso.o
- CPPFLAGS_vdso.lds += -P -C -U$(ARCH)
- ifneq ($(filter vgettimeofday, $(vdso-syms)),)
- CPPFLAGS_vdso.lds += -DHAS_VGETTIMEOFDAY
- endif
+ # Symbols present in the vdso
+ ifdef CONFIG_VDSO64
+ vdso64-as-syms  = rt_sigreturn
+ vdso64-as-syms += getcpu
+ vdso64-as-syms += flush_icache
+ vdso64-as-syms += sys_hwprobe
  
++<<<<<<< HEAD
 +# Disable -pg to prevent insert call site
 +CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) $(CC_FLAGS_SCS)
++=======
+ vdso64-cc-syms  = vgettimeofday
+ vdso64-cc-syms += hwprobe
++>>>>>>> riscv: u64ilp32: Unify vdso32 & compat_vdso into vdso/Makefile
  
- # Disable profiling and instrumentation for VDSO code
- GCOV_PROFILE := n
- KCOV_INSTRUMENT := n
- KASAN_SANITIZE := n
- UBSAN_SANITIZE := n
+ obj-as-vdso64  = $(patsubst %, %-64.o, $(vdso64-as-syms)) note-64.o
+ obj-as-vdso64 := $(addprefix $(obj)/, $(obj-as-vdso64))
  
- # Force dependency
- $(obj)/vdso.o: $(obj)/vdso.so
+ obj-cc-vdso64  = $(patsubst %, %-64.o, $(vdso64-cc-syms))
+ obj-cc-vdso64 := $(addprefix $(obj)/, $(obj-cc-vdso64))
  
- # link rule for the .so file, .lds has to be first
- $(obj)/vdso.so.dbg: $(obj)/vdso.lds $(obj-vdso) FORCE
- 	$(call if_changed,vdsold)
- LDFLAGS_vdso.so.dbg = -shared -S -soname=linux-vdso.so.1 \
+ targets += $(obj-as-vdso64) $(obj-cc-vdso64) vdso64.so vdso64.so.dbg vdso64.lds
+ 
+ $(obj)/vdso64.so.dbg: $(obj)/vdso.lds $(obj-as-vdso64) $(obj-cc-vdso64) FORCE
+ 	$(call if_changed,vdso64ld)
+ LDFLAGS_vdso64.so.dbg = -shared -S -soname=linux-vdso64.so.1 \
  	--build-id=sha1 --hash-style=both --eh-frame-hdr
+ # The DSO images are built using a special linker script
+ # Make sure only to export the intended __vdso_xxx symbol offsets.
+ quiet_cmd_vdso64ld = VDSO64LD  $@
+       cmd_vdso64ld = $(VDSO_LD) $(ld_flags) $(VDSO64_LD_FLAGS) -T $(filter-out FORCE,$^) -o $@.tmp && \
+                    $(OBJCOPY) $(patsubst %, -G __vdso_%, $(vdso64-as-syms) $(vdso64-cc-syms)) $@.tmp $@ && \
+                    rm $@.tmp
  
- # strip rule for the .so file
- $(obj)/%.so: OBJCOPYFLAGS := -S
- $(obj)/%.so: $(obj)/%.so.dbg FORCE
- 	$(call if_changed,objcopy)
+ # actual build commands
+ quiet_cmd_vdso64as = VDSO64AS $@
+       cmd_vdso64as = $(VDSO_CC) $(a_flags) $(VDSO64_CC_FLAGS) -c -o $@ $<
+ quiet_cmd_vdso64cc = VDSO64CC $@
+       cmd_vdso64cc = $(VDSO_CC) $(c_flags) $(VDSO64_CC_FLAGS) -c -o $@ $<
+ 
+ # Force dependency
+ $(obj)/vdso64.o: $(obj)/vdso64.so
+ 
+ $(obj-as-vdso64): %-64.o: %.S FORCE
+ 	$(call if_changed_dep,vdso64as)
+ $(obj-cc-vdso64): %-64.o: %.c FORCE
+ 	$(call if_changed_dep,vdso64cc)
+ 
+ CFLAGS_vgettimeofday-64.o += -fPIC -include $(c-gettimeofday-y)
+ # Disable -pg to prevent insert call site
+ CFLAGS_REMOVE_vgettimeofday-64.o = $(CC_FLAGS_FTRACE)
+ 
+ CFLAGS_hwprobe-64.o += -fPIC
  
  # Generate VDSO offsets using helper script
- gen-vdsosym := $(srctree)/$(src)/gen_vdso_offsets.sh
- quiet_cmd_vdsosym = VDSOSYM $@
- 	cmd_vdsosym = $(NM) $< | $(gen-vdsosym) | LC_ALL=C sort > $@
+ gen-vdso64sym := $(srctree)/$(src)/gen_vdso64_offsets.sh
+ quiet_cmd_vdso64sym = VDSO64SYM $@
+ 	cmd_vdso64sym = $(NM) $< | $(gen-vdso64sym) | LC_ALL=C sort > $@
  
- include/generated/vdso-offsets.h: $(obj)/vdso.so.dbg FORCE
- 	$(call if_changed,vdsosym)
+ include/generated/vdso64-offsets.h: $(obj)/vdso64.so.dbg $(obj)/vdso64.so FORCE
+ 	$(call if_changed,vdso64sym)
+ 
+ vdso64.so: $(obj)/vdso64.so.dbg
+ 	@mkdir -p $(MODLIB)/vdso
+ 	$(call cmd,vdso_install)
+ 
+ vdso64_install: vdso64.so
+ endif
+ 
+ ifdef CONFIG_VDSO32
+ vdso32-as-syms  = rt_sigreturn
+ vdso32-as-syms += getcpu
+ vdso32-as-syms += flush_icache
+ vdso32-as-syms += sys_hwprobe
+ 
+ vdso32-cc-syms += hwprobe
+ 
+ VDSO32_CC_FLAGS := -march=rv32g -mabi=ilp32
+ VDSO32_LD_FLAGS := -melf32lriscv
+ 
+ obj-as-vdso32  = $(patsubst %, %-32.o, $(vdso32-as-syms)) note-32.o
+ obj-as-vdso32 := $(addprefix $(obj)/, $(obj-as-vdso32))
+ 
+ obj-cc-vdso32  = $(patsubst %, %-32.o, $(vdso32-cc-syms))
+ obj-cc-vdso32 := $(addprefix $(obj)/, $(obj-cc-vdso32))
+ 
+ targets += $(obj-as-vdso32) $(obj-cc-vdso32) vdso32.so vdso32.so.dbg vdso32.lds
+ 
+ $(obj)/vdso32.so.dbg: $(obj)/vdso.lds $(obj-as-vdso32) $(obj-cc-vdso32) FORCE
+ 	$(call if_changed,vdso32ld)
+ LDFLAGS_vdso32.so.dbg = -shared -S -soname=linux-vdso32.so.1 \
+ 	--build-id=sha1 --hash-style=both --eh-frame-hdr
  
- # actual build commands
  # The DSO images are built using a special linker script
  # Make sure only to export the intended __vdso_xxx symbol offsets.
- quiet_cmd_vdsold = VDSOLD  $@
-       cmd_vdsold = $(LD) $(ld_flags) -T $(filter-out FORCE,$^) -o $@.tmp && \
-                    $(OBJCOPY) $(patsubst %, -G __vdso_%, $(vdso-syms)) $@.tmp $@ && \
+ quiet_cmd_vdso32ld = VDSO32LD  $@
+       cmd_vdso32ld = $(VDSO_LD) $(ld_flags) $(VDSO32_LD_FLAGS) -T $(filter-out FORCE,$^) -o $@.tmp && \
+                    $(OBJCOPY) $(patsubst %, -G __vdso_%, $(vdso32-as-syms) $(vdso32-cc-syms)) $@.tmp $@ && \
                     rm $@.tmp
++<<<<<<< HEAD
++=======
+ 
+ # actual build commands
+ quiet_cmd_vdso32as = VDSO32AS $@
+       cmd_vdso32as = $(VDSO_CC) $(a_flags) $(VDSO32_CC_FLAGS) -c -o $@ $<
+ quiet_cmd_vdso32cc = VDSO32CC $@
+       cmd_vdso32cc = $(VDSO_CC) $(c_flags) $(VDSO32_CC_FLAGS) -c -o $@ $<
+ 
+ # Force dependency
+ $(obj)/vdso32.o: $(obj)/vdso32.so
+ 
+ $(obj-as-vdso32): %-32.o: %.S FORCE
+ 	$(call if_changed_dep,vdso32as)
+ $(obj-cc-vdso32): %-32.o: %.c FORCE
+ 	$(call if_changed_dep,vdso32cc)
+ 
+ CFLAGS_hwprobe-32.o += -fPIC
+ 
+ # Generate VDSO offsets using helper script
+ gen-vdso32sym := $(srctree)/$(src)/gen_vdso32_offsets.sh
+ quiet_cmd_vdso32sym = VDSO32SYM $@
+ 	cmd_vdso32sym = $(NM) $< | $(gen-vdso32sym) | LC_ALL=C sort > $@
+ 
+ include/generated/vdso32-offsets.h: $(obj)/vdso32.so.dbg $(obj)/vdso32.so FORCE
+ 	$(call if_changed,vdso32sym)
+ 
+ vdso32.so: $(obj)/vdso32.so.dbg
+ 	@mkdir -p $(MODLIB)/vdso
+ 	$(call cmd,vdso_install)
+ 
+ vdso32_install: vdso32.so
+ endif
++>>>>>>> riscv: u64ilp32: Unify vdso32 & compat_vdso into vdso/Makefile

@bjoto
Copy link
Author

bjoto commented Nov 14, 2023

At least one diff in series https://patchwork.kernel.org/project/linux-riscv/list/?series=800464 expired. Closing PR.

@bjoto bjoto closed this Nov 14, 2023
@bjoto bjoto deleted the series/800464=>fixes branch November 27, 2023 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant