From: Blaisorblade <bla...@ya...> - 2005-10-02 21:31:11
Attachments:
uml-fix-alviros-mess
|
The patch in Al Viro's: ecba97d4aacf4e80c56eb73e39af0369cb8539a4 messed up UML (in particular skas0, which doesn't boot any more - or maybe it boots one out of 10 times). Btw: did Al CC you on it, at least? The reason is that he messed up HOST_FRAME_SIZE on i386 (by using DEFINE_LONGS). I.e. HOST_FRAME_SIZE, which was 17, became 17/sizeof(long). Uh, nice. A fix is attached (at least it boots with it), together with a lenghty comment about how stability-friendly such a big unreviewable patch can be. Also, he did the same to arch/um/sys-x86_64/user-offsets.c, but apparently this is justified in that case because in the original sources (arch/um/kernel/skas/util/mk_ptregs-x86_64.c) #define SHOW(name) \ printf("#define %s (%d / sizeof(unsigned long))\n", #name, name) which is not done on i386. So, Jeff, as said in the email, since we are in the "stable" phase, I suggest dropping for now Al's nice* cleanup and moving it to 2.6.15 cycle (and to the current -mm). Actually, the patch size can be reduced effectively; changes such as: - OFFSET(SC_RBX, sigcontext, rbx); + OFFSET(HOST_SC_RBX, sigcontext, rbx); are pointless, given that you can turn put HOST_ in OFFSET(), since it is done for every call to OFFSET. * I'm not joking, I too feel this must be done, but not *now*, quietly, without boot testing. Jeff, also, what about my last five patches, which weren't merged yet? The first one conflicts with this Viro's patch, but the rest should really be applied (especially to fix SKAS3). -- Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!". Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894) http://www.user-mode-linux.org/~blaisorblade |
From: Blaisorblade <bla...@ya...> - 2005-10-02 18:02:23
|
On Sunday 02 October 2005 17:51, Jeff Dike wrote: > On Sun, Oct 02, 2005 at 12:13:39PM +0200, Blaisorblade wrote: > He did, and I found the same problem and sent him back the fix. I guess > he sent in the original patch. Ok, he just said he sent a mismerged patch, but it's ok. > I was planning on sending it in after 2.6.14 because of its size. Al, is that ok for you if we follow this original plan? In this case, I'll post the dropping patch and re-send the Kbuild fix of my last batch (conflicted with Al's patch, but now it's needed again). -- Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!". Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894) http://www.user-mode-linux.org/~blaisorblade ___________________________________ Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB http://mail.yahoo.it |
From: Al V. <vi...@ft...> - 2005-10-02 18:38:04
|
On Sun, Oct 02, 2005 at 08:01:21PM +0200, Blaisorblade wrote: > On Sunday 02 October 2005 17:51, Jeff Dike wrote: > > On Sun, Oct 02, 2005 at 12:13:39PM +0200, Blaisorblade wrote: > > > He did, and I found the same problem and sent him back the fix. I guess > > he sent in the original patch. > Ok, he just said he sent a mismerged patch, but it's ok. > > I was planning on sending it in after 2.6.14 because of its size. > Al, is that ok for you if we follow this original plan? > > In this case, I'll post the dropping patch and re-send the Kbuild fix of my > last batch (conflicted with Al's patch, but now it's needed again). Up to Jeff; IMO it's easier to restore the variant past his review (with incremental replacing that DEFINE_LONGS), but maintainer gets to decide; that was the reason for Cc when patch got sent to Linus, after all... diff -urN RC14-rc2-git6-base/arch/um/sys-i386/user-offsets.c current/arch/um/sys-i386/user-offsets.c --- RC14-rc2-git6-base/arch/um/sys-i386/user-offsets.c 2005-09-25 23:28:27.000000000 -0400 +++ current/arch/um/sys-i386/user-offsets.c 2005-10-02 14:08:15.000000000 -0400 @@ -46,7 +46,7 @@ OFFSET(HOST_SC_FP_ST, _fpstate, _st); OFFSET(HOST_SC_FXSR_ENV, _fpstate, _fxsr_env); - DEFINE_LONGS(HOST_FRAME_SIZE, FRAME_SIZE); + DEFINE(HOST_FRAME_SIZE, FRAME_SIZE); DEFINE_LONGS(HOST_FP_SIZE, sizeof(struct user_i387_struct)); DEFINE_LONGS(HOST_XFP_SIZE, sizeof(struct user_fxsr_struct)); |
From: Al V. <vi...@ft...> - 2005-10-02 20:54:58
|
BTW, speaking of Kbuild cleanups (and that one is definitely 2.6.15 fodder): patch below * kills messing with lib vs. core for uml-amd64 (we don't need that anymore) * kills symlinks in arch/um/sys-*/ * kills foo.c-dir - we simply give HOST_OBJS=<list of pathnames under arch/$(SUBARCH)> and that's it (no SYMLINKS either) Price: use of make feature I really, really hate - $(eval ...). I'm using it to generate and process bar-y := ../../$(SUBARCH)/foo/bar.o ... for all HOST_OBJS elements. If there are better suggestions, I'd be glad to hear them... diff -urN RC14-rc2-git6-base/arch/um/Makefile-x86_64 current/arch/um/Makefile-x86_64 --- RC14-rc2-git6-base/arch/um/Makefile-x86_64 2005-09-12 14:33:28.000000000 -0400 +++ current/arch/um/Makefile-x86_64 2005-10-02 16:15:19.000000000 -0400 @@ -1,7 +1,7 @@ # Copyright 2003 - 2004 Pathscale, Inc # Released under the GPL -libs-y += arch/um/sys-x86_64/ +core-y += arch/um/sys-x86_64/ START := 0x60000000 #We #undef __x86_64__ for kernelspace, not for userspace where diff -urN RC14-rc2-git6-base/arch/um/scripts/Makefile.rules current/arch/um/scripts/Makefile.rules --- RC14-rc2-git6-base/arch/um/scripts/Makefile.rules 2005-09-05 08:35:08.000000000 -0400 +++ current/arch/um/scripts/Makefile.rules 2005-10-02 16:16:27.000000000 -0400 @@ -26,19 +26,9 @@ $(patsubst -pg,,$(patsubst -fprofile-arcs -ftest-coverage,,$(1))) endef -quiet_cmd_make_link = SYMLINK $@ -cmd_make_link = ln -sf $(srctree)/arch/$(SUBARCH)/$($(notdir $@)-dir)/$(notdir $@) $@ +# for each object in the HOST_OBJS (say it foo/bar.o) generate +# bar-y := ../../$(SUBARCH)/foo/bar.o +# and have it evaluated +$(foreach obj,$(HOST_OBJS),$(eval \ + $(basename $(notdir $(obj)))-y := $(addprefix ../../$(SUBARCH)/,$(obj)))) -# this needs to be before the foreach, because targets does not accept -# complete paths like $(obj)/$(f). To make sure this works, use a := assignment -# or we will get $(obj)/$(f) in the "targets" value. -# Also, this forces you to use the := syntax when assigning to targets. -# Otherwise the line below will cause an infinite loop (if you don't know why, -# just do it). - -targets := $(targets) $(SYMLINKS) - -SYMLINKS := $(foreach f,$(SYMLINKS),$(obj)/$(f)) - -$(SYMLINKS): FORCE - $(call if_changed,make_link) diff -urN RC14-rc2-git6-base/arch/um/sys-i386/Makefile current/arch/um/sys-i386/Makefile --- RC14-rc2-git6-base/arch/um/sys-i386/Makefile 2005-09-12 14:33:28.000000000 -0400 +++ current/arch/um/sys-i386/Makefile 2005-10-02 16:16:27.000000000 -0400 @@ -7,15 +7,10 @@ USER_OBJS := bugs.o ptrace_user.o sigcontext.o fault.o -SYMLINKS = bitops.c semaphore.c highmem.c module.c +HOST_OBJS = lib/bitops.o kernel/semaphore.o mm/highmem.o kernel/module.o include arch/um/scripts/Makefile.rules -bitops.c-dir = lib -semaphore.c-dir = kernel -highmem.c-dir = mm -module.c-dir = kernel - $(obj)/stub_segv.o : _c_flags = $(call unprofile,$(CFLAGS)) include arch/um/scripts/Makefile.unmap diff -urN RC14-rc2-git6-base/arch/um/sys-x86_64/Makefile current/arch/um/sys-x86_64/Makefile --- RC14-rc2-git6-base/arch/um/sys-x86_64/Makefile 2005-09-12 14:33:28.000000000 -0400 +++ current/arch/um/sys-x86_64/Makefile 2005-10-02 16:18:12.000000000 -0400 @@ -4,29 +4,19 @@ # Licensed under the GPL # -#XXX: why into lib-y? -lib-y = bitops.o bugs.o csum-partial.o delay.o fault.o mem.o memcpy.o \ +obj-y = bitops.o bugs.o csum-partial.o delay.o fault.o mem.o memcpy.o \ ptrace.o ptrace_user.o sigcontext.o signal.o stub.o \ - stub_segv.o syscalls.o syscall_table.o sysrq.o thunk.o + stub_segv.o syscalls.o syscall_table.o sysrq.o thunk.o ksyms.o -obj-y := ksyms.o obj-$(CONFIG_MODULES) += module.o um_module.o USER_OBJS := ptrace_user.o sigcontext.o -SYMLINKS = bitops.c csum-copy.S csum-partial.c csum-wrappers.c memcpy.S \ - thunk.S module.c +HOST_OBJS = lib/bitops.o lib/csum-copy.o lib/csum-partial.o \ + lib/csum-wrappers.o lib/memcpy.o lib/thunk.o kernel/module.o include arch/um/scripts/Makefile.rules -bitops.c-dir = lib -csum-copy.S-dir = lib -csum-partial.c-dir = lib -csum-wrappers.c-dir = lib -memcpy.S-dir = lib -thunk.S-dir = lib -module.c-dir = kernel - $(obj)/stub_segv.o: _c_flags = $(call unprofile,$(CFLAGS)) include arch/um/scripts/Makefile.unmap |
From: Blaisorblade <bla...@ya...> - 2005-10-03 18:48:39
|
On Sunday 02 October 2005 22:54, Al Viro wrote: > BTW, speaking of Kbuild cleanups (and that one is definitely 2.6.15 > fodder): patch below > * kills messing with lib vs. core for uml-amd64 (we don't need that > anymore) I'm even curious why we needed that in first place. > * kills symlinks in arch/um/sys-*/ > * kills foo.c-dir - we simply give HOST_OBJS=<list of pathnames > under arch/$(SUBARCH)> and that's it (no SYMLINKS either) > Price: use of make feature I really, really hate - $(eval ...). I looked at make Changelog, time ago, and this feature was added in make 3.80, so you'd need to update Documentation/Changes. Make 3.80 was released in 2002-10-03, so I hope it's not a problem (should check on Debian Woody though, maybe). > I'm using > it to generate and process > > bar-y := ../../$(SUBARCH)/foo/bar.o > ... > for all HOST_OBJS elements. If there are better suggestions, I'd be glad > to hear them... The first thing is that HOST_OBJS is totally confusing... SUBARCH_OBJS or something else is better. The second is that, even if x86_64 uses things such as (from arch/x86_64/mm/Makefile): obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o hugetlbpage-y = ../../i386/mm/hugetlbpage.o (because hugetlbpage.o is conditional) we could as well do subarch-y := ../../$(SUBARCH)/name (even with foreach) for most things (see arch/x86_64/oprofile/Makefile), and for highmem and module I'd just do that by hand: highmem-y := $(SUBARCH_DIR)/mm/highmem.o module-y := $(SUBARCH_DIR)/kernel/module.o with SUBARCH_DIR defined in arch/um/Makefile. -- Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!". Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894) http://www.user-mode-linux.org/~blaisorblade ___________________________________ Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB http://mail.yahoo.it |
From: Al V. <vi...@ft...> - 2005-10-03 23:38:43
|
On Mon, Oct 03, 2005 at 08:30:23PM +0200, Blaisorblade wrote: > The second is that, even if x86_64 uses things such as (from > arch/x86_64/mm/Makefile): > > obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o > hugetlbpage-y = ../../i386/mm/hugetlbpage.o > (because hugetlbpage.o is conditional) > > we could as well do > > subarch-y := ../../$(SUBARCH)/name > (even with foreach) Err... Kbuild won't know what to do with your subarch-y. The way it works is simple - we are saying that e.g. bitops.o is a multi-part object with only one part, namely ../../i386/lib/bitops.o. Said part is built by the normal Kbuild logics and then we get (dummy) linking, creating bitops.o. > for most things (see arch/x86_64/oprofile/Makefile), and for highmem and > module I'd just do that by hand: > > highmem-y := $(SUBARCH_DIR)/mm/highmem.o > module-y := $(SUBARCH_DIR)/kernel/module.o > > with SUBARCH_DIR defined in arch/um/Makefile. Hrm... That just might be usable, _if_ we never run into modular suckers; in that case we can do the following: ifneq ($(subarch-objs-y),) obj-y += subarch.o subarch-y = $(addprefix ../../$(SUBARCH),$(subarch-objs-y)) endif in arch/um/scripts/Makefile.rules with subarch-y = ..... subarch-$(CONFIG_MODULE) += kernel/module.o etc. in arch/um/sys-.../Makefile The thing is, if we _ever_ need a potentially modular object pulled from the underlying architecture that trick will break. So far we do not and since $(eval...) *is* a vile mess straight from the GNU intestine... |
From: Al V. <vi...@ft...> - 2005-10-04 17:10:28
|
On Mon, Oct 03, 2005 at 08:30:23PM +0200, Blaisorblade wrote: > On Sunday 02 October 2005 22:54, Al Viro wrote: > > BTW, speaking of Kbuild cleanups (and that one is definitely 2.6.15 > > fodder): patch below > > * kills messing with lib vs. core for uml-amd64 (we don't need that > > anymore) > I'm even curious why we needed that in first place. > > > * kills symlinks in arch/um/sys-*/ > > * kills foo.c-dir - we simply give HOST_OBJS=<list of pathnames > > under arch/$(SUBARCH)> and that's it (no SYMLINKS either) > > > Price: use of make feature I really, really hate - $(eval ...). ... not anymore [that's post-2.6.14 stuff, IMO] diff -urN RC14-rc3-git4-base/arch/um/Makefile-x86_64 RC14-rc3-git4-foo/arch/um/Makefile-x86_64 --- RC14-rc3-git4-base/arch/um/Makefile-x86_64 2005-09-12 14:33:28.000000000 -0400 +++ RC14-rc3-git4-foo/arch/um/Makefile-x86_64 2005-10-04 13:04:59.000000000 -0400 @@ -1,7 +1,7 @@ # Copyright 2003 - 2004 Pathscale, Inc # Released under the GPL -libs-y += arch/um/sys-x86_64/ +core-y += arch/um/sys-x86_64/ START := 0x60000000 #We #undef __x86_64__ for kernelspace, not for userspace where diff -urN RC14-rc3-git4-base/arch/um/scripts/Makefile.rules RC14-rc3-git4-foo/arch/um/scripts/Makefile.rules --- RC14-rc3-git4-base/arch/um/scripts/Makefile.rules 2005-09-05 08:35:08.000000000 -0400 +++ RC14-rc3-git4-foo/arch/um/scripts/Makefile.rules 2005-10-04 13:04:59.000000000 -0400 @@ -26,19 +26,7 @@ $(patsubst -pg,,$(patsubst -fprofile-arcs -ftest-coverage,,$(1))) endef -quiet_cmd_make_link = SYMLINK $@ -cmd_make_link = ln -sf $(srctree)/arch/$(SUBARCH)/$($(notdir $@)-dir)/$(notdir $@) $@ - -# this needs to be before the foreach, because targets does not accept -# complete paths like $(obj)/$(f). To make sure this works, use a := assignment -# or we will get $(obj)/$(f) in the "targets" value. -# Also, this forces you to use the := syntax when assigning to targets. -# Otherwise the line below will cause an infinite loop (if you don't know why, -# just do it). - -targets := $(targets) $(SYMLINKS) - -SYMLINKS := $(foreach f,$(SYMLINKS),$(obj)/$(f)) - -$(SYMLINKS): FORCE - $(call if_changed,make_link) +ifdef subarch-obj-y +obj-y += subarch.o +subarch-y = $(addprefix ../../$(SUBARCH)/,$(subarch-obj-y)) +endif diff -urN RC14-rc3-git4-base/arch/um/sys-i386/Makefile RC14-rc3-git4-foo/arch/um/sys-i386/Makefile --- RC14-rc3-git4-base/arch/um/sys-i386/Makefile 2005-09-12 14:33:28.000000000 -0400 +++ RC14-rc3-git4-foo/arch/um/sys-i386/Makefile 2005-10-04 13:04:59.000000000 -0400 @@ -1,21 +1,16 @@ -obj-y = bitops.o bugs.o checksum.o delay.o fault.o ksyms.o ldt.o ptrace.o \ - ptrace_user.o semaphore.o signal.o sigcontext.o stub.o stub_segv.o \ +obj-y = bugs.o checksum.o delay.o fault.o ksyms.o ldt.o ptrace.o \ + ptrace_user.o signal.o sigcontext.o stub.o stub_segv.o \ syscalls.o sysrq.o sys_call_table.o -obj-$(CONFIG_HIGHMEM) += highmem.o -obj-$(CONFIG_MODULES) += module.o +subarch-obj-y = lib/bitops.o kernel/semaphore.o +subarch-obj-$(CONFIG_HIGHMEM) += mm/highmem.o +subarch-obj-$(CONFIG_MODULES) += kernel/module.o -USER_OBJS := bugs.o ptrace_user.o sigcontext.o fault.o -SYMLINKS = bitops.c semaphore.c highmem.c module.c +USER_OBJS := bugs.o ptrace_user.o sigcontext.o fault.o include arch/um/scripts/Makefile.rules -bitops.c-dir = lib -semaphore.c-dir = kernel -highmem.c-dir = mm -module.c-dir = kernel - $(obj)/stub_segv.o : _c_flags = $(call unprofile,$(CFLAGS)) include arch/um/scripts/Makefile.unmap diff -urN RC14-rc3-git4-base/arch/um/sys-x86_64/Makefile RC14-rc3-git4-foo/arch/um/sys-x86_64/Makefile --- RC14-rc3-git4-base/arch/um/sys-x86_64/Makefile 2005-09-12 14:33:28.000000000 -0400 +++ RC14-rc3-git4-foo/arch/um/sys-x86_64/Makefile 2005-10-04 13:04:59.000000000 -0400 @@ -4,29 +4,19 @@ # Licensed under the GPL # -#XXX: why into lib-y? -lib-y = bitops.o bugs.o csum-partial.o delay.o fault.o mem.o memcpy.o \ - ptrace.o ptrace_user.o sigcontext.o signal.o stub.o \ - stub_segv.o syscalls.o syscall_table.o sysrq.o thunk.o +obj-y = bugs.o delay.o fault.o mem.o ptrace.o ptrace_user.o sigcontext.o \ + signal.o stub.o stub_segv.o syscalls.o syscall_table.o sysrq.o ksyms.o -obj-y := ksyms.o -obj-$(CONFIG_MODULES) += module.o um_module.o +obj-$(CONFIG_MODULES) += um_module.o +obj-$(CONFIG_MODE_SKAS) += clone.o -USER_OBJS := ptrace_user.o sigcontext.o +subarch-obj-y = lib/bitops.o lib/csum-partial.o lib/memcpy.o lib/thunk.o +subarch-obj-$(CONFIG_MODULES) += kernel/module.o -SYMLINKS = bitops.c csum-copy.S csum-partial.c csum-wrappers.c memcpy.S \ - thunk.S module.c +USER_OBJS := ptrace_user.o sigcontext.o include arch/um/scripts/Makefile.rules -bitops.c-dir = lib -csum-copy.S-dir = lib -csum-partial.c-dir = lib -csum-wrappers.c-dir = lib -memcpy.S-dir = lib -thunk.S-dir = lib -module.c-dir = kernel - $(obj)/stub_segv.o: _c_flags = $(call unprofile,$(CFLAGS)) include arch/um/scripts/Makefile.unmap |
From: Al V. <vi...@ft...> - 2005-10-04 17:14:28
|
Sorry - a line had leaked from later patch; correct variant follows diff -urN RC14-rc3-git4-base/arch/um/Makefile-x86_64 RC14-rc3-git4-foo/arch/um/Makefile-x86_64 --- RC14-rc3-git4-base/arch/um/Makefile-x86_64 2005-09-12 14:33:28.000000000 -0400 +++ RC14-rc3-git4-foo/arch/um/Makefile-x86_64 2005-10-04 13:04:59.000000000 -0400 @@ -1,7 +1,7 @@ # Copyright 2003 - 2004 Pathscale, Inc # Released under the GPL -libs-y += arch/um/sys-x86_64/ +core-y += arch/um/sys-x86_64/ START := 0x60000000 #We #undef __x86_64__ for kernelspace, not for userspace where diff -urN RC14-rc3-git4-base/arch/um/scripts/Makefile.rules RC14-rc3-git4-foo/arch/um/scripts/Makefile.rules --- RC14-rc3-git4-base/arch/um/scripts/Makefile.rules 2005-09-05 08:35:08.000000000 -0400 +++ RC14-rc3-git4-foo/arch/um/scripts/Makefile.rules 2005-10-04 13:04:59.000000000 -0400 @@ -26,19 +26,7 @@ $(patsubst -pg,,$(patsubst -fprofile-arcs -ftest-coverage,,$(1))) endef -quiet_cmd_make_link = SYMLINK $@ -cmd_make_link = ln -sf $(srctree)/arch/$(SUBARCH)/$($(notdir $@)-dir)/$(notdir $@) $@ - -# this needs to be before the foreach, because targets does not accept -# complete paths like $(obj)/$(f). To make sure this works, use a := assignment -# or we will get $(obj)/$(f) in the "targets" value. -# Also, this forces you to use the := syntax when assigning to targets. -# Otherwise the line below will cause an infinite loop (if you don't know why, -# just do it). - -targets := $(targets) $(SYMLINKS) - -SYMLINKS := $(foreach f,$(SYMLINKS),$(obj)/$(f)) - -$(SYMLINKS): FORCE - $(call if_changed,make_link) +ifdef subarch-obj-y +obj-y += subarch.o +subarch-y = $(addprefix ../../$(SUBARCH)/,$(subarch-obj-y)) +endif diff -urN RC14-rc3-git4-base/arch/um/sys-i386/Makefile RC14-rc3-git4-foo/arch/um/sys-i386/Makefile --- RC14-rc3-git4-base/arch/um/sys-i386/Makefile 2005-09-12 14:33:28.000000000 -0400 +++ RC14-rc3-git4-foo/arch/um/sys-i386/Makefile 2005-10-04 13:04:59.000000000 -0400 @@ -1,21 +1,16 @@ -obj-y = bitops.o bugs.o checksum.o delay.o fault.o ksyms.o ldt.o ptrace.o \ - ptrace_user.o semaphore.o signal.o sigcontext.o stub.o stub_segv.o \ +obj-y = bugs.o checksum.o delay.o fault.o ksyms.o ldt.o ptrace.o \ + ptrace_user.o signal.o sigcontext.o stub.o stub_segv.o \ syscalls.o sysrq.o sys_call_table.o -obj-$(CONFIG_HIGHMEM) += highmem.o -obj-$(CONFIG_MODULES) += module.o +subarch-obj-y = lib/bitops.o kernel/semaphore.o +subarch-obj-$(CONFIG_HIGHMEM) += mm/highmem.o +subarch-obj-$(CONFIG_MODULES) += kernel/module.o -USER_OBJS := bugs.o ptrace_user.o sigcontext.o fault.o -SYMLINKS = bitops.c semaphore.c highmem.c module.c +USER_OBJS := bugs.o ptrace_user.o sigcontext.o fault.o include arch/um/scripts/Makefile.rules -bitops.c-dir = lib -semaphore.c-dir = kernel -highmem.c-dir = mm -module.c-dir = kernel - $(obj)/stub_segv.o : _c_flags = $(call unprofile,$(CFLAGS)) include arch/um/scripts/Makefile.unmap diff -urN RC14-rc3-git4-base/arch/um/sys-x86_64/Makefile RC14-rc3-git4-foo/arch/um/sys-x86_64/Makefile --- RC14-rc3-git4-base/arch/um/sys-x86_64/Makefile 2005-09-12 14:33:28.000000000 -0400 +++ RC14-rc3-git4-foo/arch/um/sys-x86_64/Makefile 2005-10-04 13:04:59.000000000 -0400 @@ -4,29 +4,18 @@ # Licensed under the GPL # -#XXX: why into lib-y? -lib-y = bitops.o bugs.o csum-partial.o delay.o fault.o mem.o memcpy.o \ - ptrace.o ptrace_user.o sigcontext.o signal.o stub.o \ - stub_segv.o syscalls.o syscall_table.o sysrq.o thunk.o +obj-y = bugs.o delay.o fault.o mem.o ptrace.o ptrace_user.o sigcontext.o \ + signal.o stub.o stub_segv.o syscalls.o syscall_table.o sysrq.o ksyms.o -obj-y := ksyms.o -obj-$(CONFIG_MODULES) += module.o um_module.o +obj-$(CONFIG_MODULES) += um_module.o -USER_OBJS := ptrace_user.o sigcontext.o +subarch-obj-y = lib/bitops.o lib/csum-partial.o lib/memcpy.o lib/thunk.o +subarch-obj-$(CONFIG_MODULES) += kernel/module.o -SYMLINKS = bitops.c csum-copy.S csum-partial.c csum-wrappers.c memcpy.S \ - thunk.S module.c +USER_OBJS := ptrace_user.o sigcontext.o include arch/um/scripts/Makefile.rules -bitops.c-dir = lib -csum-copy.S-dir = lib -csum-partial.c-dir = lib -csum-wrappers.c-dir = lib -memcpy.S-dir = lib -thunk.S-dir = lib -module.c-dir = kernel - $(obj)/stub_segv.o: _c_flags = $(call unprofile,$(CFLAGS)) include arch/um/scripts/Makefile.unmap |
From: Blaisorblade <bla...@ya...> - 2005-10-03 18:56:34
|
On Sunday 02 October 2005 20:37, Al Viro wrote: > On Sun, Oct 02, 2005 at 08:01:21PM +0200, Blaisorblade wrote: > > On Sunday 02 October 2005 17:51, Jeff Dike wrote: > > Al, is that ok for you if we follow this original plan? > > > > In this case, I'll post the dropping patch and re-send the Kbuild fix of > > my last batch (conflicted with Al's patch, but now it's needed again). > Up to Jeff; IMO it's easier to restore the variant past his review (with > incremental replacing that DEFINE_LONGS), but maintainer gets to decide; > that was the reason for Cc when patch got sent to Linus, after all... My only worry is that some other bug may have slipped through - it's not the case that we are perfect, nor we have a real test-suite to catch this sort of thing (especially, there are sections of FPU handling which are buggy anyway - there is a really big patch which copies whole sections of i386 low level messing up with FPU, which I requested Jeff to hold some time ago). -- Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!". Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894) http://www.user-mode-linux.org/~blaisorblade ___________________________________ Yahoo! Messenger: chiamate gratuite in tutto il mondo http://it.messenger.yahoo.com |
From: Al V. <vi...@ft...> - 2005-10-02 20:26:27
|
On Sun, Oct 02, 2005 at 12:13:39PM +0200, Blaisorblade wrote: > The patch in Al Viro's: > > ecba97d4aacf4e80c56eb73e39af0369cb8539a4 > > messed up UML (in particular skas0, which doesn't boot any more - or maybe it > boots one out of 10 times). > > Btw: did Al CC you on it, at least? Yes. Moreover, that had also been done two weeks ago when original version of patch had been sent for review to Jeff. Who'd caught that one and other bugs and sent the fixed variant back. At which point I'd fscked up the merge. |
From: Blaisorblade <bla...@ya...> - 2005-10-02 22:41:02
|
On Sunday 02 October 2005 13:38, Al Viro wrote: > On Sun, Oct 02, 2005 at 12:13:39PM +0200, Blaisorblade wrote: > > The patch in Al Viro's: > > ecba97d4aacf4e80c56eb73e39af0369cb8539a4 > > messed up UML (in particular skas0, which doesn't boot any more - or > > maybe it boots one out of 10 times). > > Btw: did Al CC you on it, at least? > Yes. Moreover, that had also been done two weeks ago when original version > of patch had been sent for review to Jeff. Who'd caught that one and other > bugs and sent the fixed variant back. At which point I'd fscked up the > merge. Ok, you're excused... now, however, I still think that this should be postponed to 2.6.15, since it's a (very nice, indeed) cleanup and we're nearing completion. Al, did you receive my "[PATCH 5/5] uml: remove empty hostfs_truncate method"? What about that? I'm nervous because the whole batch was lost somewhere without merging, it seems (and it has a couple of other critical fixes). -- Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!". Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894) http://www.user-mode-linux.org/~blaisorblade ___________________________________ Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB http://mail.yahoo.it |
From: Al V. <vi...@ft...> - 2005-10-02 17:32:15
|
On Sun, Oct 02, 2005 at 01:50:28PM +0200, Blaisorblade wrote: > On Sunday 02 October 2005 13:38, Al Viro wrote: > > On Sun, Oct 02, 2005 at 12:13:39PM +0200, Blaisorblade wrote: > > > The patch in Al Viro's: > > > > ecba97d4aacf4e80c56eb73e39af0369cb8539a4 > > > > messed up UML (in particular skas0, which doesn't boot any more - or > > > maybe it boots one out of 10 times). > > > > Btw: did Al CC you on it, at least? > > > Yes. Moreover, that had also been done two weeks ago when original version > > of patch had been sent for review to Jeff. Who'd caught that one and other > > bugs and sent the fixed variant back. At which point I'd fscked up the > > merge. > > Ok, you're excused... now, however, I still think that this should be > postponed to 2.6.15, since it's a (very nice, indeed) cleanup and we're > nearing completion. > > Al, did you receive my "[PATCH 5/5] uml: remove empty hostfs_truncate method"? > What about that? What about that? Obvious patch that got no objections from anybody and AFAICS got in -rc3: ; git-whatchanged fs/hostfs/hostfs_kern.c|head diff-tree daa35edc0a967d1f77c2e2c1346f57d04371487a (from bd948057357db5febfe64cf7a9ef11d7e347ffec) Author: Paolo 'Blaisorblade' Giarrusso <bla...@ya...> Date: Fri Sep 30 11:59:01 2005 -0700 [PATCH] uml: remove empty hostfs_truncate method Calling truncate() on hostfs spits a kernel warning "Something isn't implemented here", but it still works fine. Indeed, hostfs i_op->truncate doesn't do anything. But hostfs_setattr() -> ; Judging by Signed-off-by it looks like a -mm -> Linus merge... |
From: Blaisorblade <bla...@ya...> - 2005-10-02 17:46:28
|
On Sunday 02 October 2005 19:32, Al Viro wrote: > On Sun, Oct 02, 2005 at 01:50:28PM +0200, Blaisorblade wrote: > > On Sunday 02 October 2005 13:38, Al Viro wrote: > > Al, did you receive my "[PATCH 5/5] uml: remove empty hostfs_truncate > > method"? What about that? > What about that? Obvious patch Ok, that's nice. > that got no objections from anybody and > AFAICS got in -rc3: Ok, sorry - overlooked and missed it. I saw "Hey, it's not been merged yet" and just after I saw -rc3, and didn't notice my last batch going in between the two ones. -- Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!". Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894) http://www.user-mode-linux.org/~blaisorblade ___________________________________ Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB http://mail.yahoo.it |
From: Jeff D. <jd...@ad...> - 2005-10-02 23:16:49
|
On Sun, Oct 02, 2005 at 12:13:39PM +0200, Blaisorblade wrote: > The patch in Al Viro's: > > ecba97d4aacf4e80c56eb73e39af0369cb8539a4 > > messed up UML (in particular skas0, which doesn't boot any more - or maybe it > boots one out of 10 times). > > Btw: did Al CC you on it, at least? > > The reason is that he messed up HOST_FRAME_SIZE on i386 (by using > DEFINE_LONGS). I.e. HOST_FRAME_SIZE, which was 17, became 17/sizeof(long). > Uh, nice. He did, and I found the same problem and sent him back the fix. I guess he sent in the original patch. I was planning on sending it in after 2.6.14 because of its size. Jeff |
From: Al V. <vi...@ft...> - 2005-10-02 16:55:51
|
On Sun, Oct 02, 2005 at 11:51:34AM -0400, Jeff Dike wrote: > On Sun, Oct 02, 2005 at 12:13:39PM +0200, Blaisorblade wrote: > > The patch in Al Viro's: > > > > ecba97d4aacf4e80c56eb73e39af0369cb8539a4 > > > > messed up UML (in particular skas0, which doesn't boot any more - or maybe it > > boots one out of 10 times). > > > > Btw: did Al CC you on it, at least? > > > > The reason is that he messed up HOST_FRAME_SIZE on i386 (by using > > DEFINE_LONGS). I.e. HOST_FRAME_SIZE, which was 17, became 17/sizeof(long). > > Uh, nice. > > He did, and I found the same problem and sent him back the fix. I guess > he sent in the original patch. s/original/mismerged/ (note that original had more breakage in the same file). AFAICS, s/DEFINE_LONGS/DEFINE/ in that place is all that got lost. |
From: Blaisorblade <bla...@ya...> - 2005-10-04 10:26:48
|
On Tuesday 04 October 2005 01:38, Al Viro wrote: > On Mon, Oct 03, 2005 at 08:30:23PM +0200, Blaisorblade wrote: > > The second is that, even if x86_64 uses things such as (from > > arch/x86_64/mm/Makefile): > > > Err... Kbuild won't know what to do with your subarch-y. The way it works > is simple - we are saying that e.g. bitops.o is a multi-part object with > only one part, namely ../../i386/lib/bitops.o. Said part is built by the > normal Kbuild logics and then we get (dummy) linking, creating bitops.o. I know about kbuild, I just forgot to mention adding: obj-y += subarch.o (which you add below). I've been cleaning up the UML Makefiles for almost a year, when I was even more of a kernel newbie than I am now ;-)... > > for most things (see arch/x86_64/oprofile/Makefile), and for highmem and > > module I'd just do that by hand: > > > > highmem-y := $(SUBARCH_DIR)/mm/highmem.o > > module-y := $(SUBARCH_DIR)/kernel/module.o > > > > with SUBARCH_DIR defined in arch/um/Makefile. > Hrm... That just might be usable, _if_ we never run into modular suckers; > in that case we can do the following: > ifneq ($(subarch-objs-y),) > obj-y += subarch.o > subarch-y = $(addprefix ../../$(SUBARCH),$(subarch-objs-y)) > endif > in arch/um/scripts/Makefile.rules with > > subarch-y = ..... > subarch-$(CONFIG_MODULE) += kernel/module.o > etc. in arch/um/sys-.../Makefile Hmm, yes, nice. > The thing is, if we _ever_ need a potentially modular object pulled from > the underlying architecture that trick will break. We would just do them by hand, in this case. And say "don't use subarch-objs-y for modular things". In the existing case, I've pulled in the whole directory, since it had only one module (aes-586.o). Ah, I must add aes-x86_64 too, now it exists. > So far we do not and > since $(eval...) *is* a vile mess straight from the GNU intestine... I do not fully agree about eval being evil, but I'm not gonna flame on this issue... -- Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!". Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894) http://www.user-mode-linux.org/~blaisorblade ___________________________________ Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB http://mail.yahoo.it |
From: Al V. <vi...@ft...> - 2005-10-04 11:11:08
|
On Tue, Oct 04, 2005 at 12:26:36PM +0200, Blaisorblade wrote: > On Tuesday 04 October 2005 01:38, Al Viro wrote: > > On Mon, Oct 03, 2005 at 08:30:23PM +0200, Blaisorblade wrote: > > > The second is that, even if x86_64 uses things such as (from > > > arch/x86_64/mm/Makefile): > > > > > > Err... Kbuild won't know what to do with your subarch-y. The way it works > > is simple - we are saying that e.g. bitops.o is a multi-part object with > > only one part, namely ../../i386/lib/bitops.o. Said part is built by the > > normal Kbuild logics and then we get (dummy) linking, creating bitops.o. > > I know about kbuild, I just forgot to mention adding: > > obj-y += subarch.o > > (which you add below). > > I've been cleaning up the UML Makefiles for almost a year, when I was even > more of a kernel newbie than I am now ;-)... Speaking of cleaning these makefiles: in my tree Makefile.unmap is simply extra-$(CONFIG_MODE_TT) += unmap.o $(obj)/unmap.o: _c_flags = $(call unprofile,$(CFLAGS)) now. At which point it's about to disappear - no sense to bother with including two lines, especially since one of them folds into $(obj)/stub_segv.o $(obj)/unmap.o: _c_flags = $(call unprofile,$(CFLAGS)) Post-2.6.14 fodder, obviously. |
From: Blaisorblade <bla...@ya...> - 2005-10-04 11:19:50
|
On Tuesday 04 October 2005 13:09, Al Viro wrote: > On Tue, Oct 04, 2005 at 12:26:36PM +0200, Blaisorblade wrote: > > On Tuesday 04 October 2005 01:38, Al Viro wrote: > > > On Mon, Oct 03, 2005 at 08:30:23PM +0200, Blaisorblade wrote: > > > > The second is that, even if x86_64 uses things such as (from > > > > arch/x86_64/mm/Makefile): > Speaking of cleaning these makefiles: in my tree Makefile.unmap is > simply > > extra-$(CONFIG_MODE_TT) += unmap.o > $(obj)/unmap.o: _c_flags = $(call unprofile,$(CFLAGS)) Where went objcopy -G switcheroo? Possibly (it doesn't link into glibc) it's trivially ok, but please make sure as the original fixed bug was environment-dependant (it happened only on some Gentoo NPTL-only systems, and maybe the problem disappeared in later glibc versions), so you wouldn't see the breakage. > now. At which point it's about to disappear - no sense to bother with > including two lines, especially since one of them folds into > > $(obj)/stub_segv.o $(obj)/unmap.o: _c_flags = $(call unprofile,$(CFLAGS)) > > Post-2.6.14 fodder, obviously. About folding it in, Acked-by: Paolo 'Blaisorblade' Giarrusso <bla...@ya...> Bye -- Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!". Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894) http://www.user-mode-linux.org/~blaisorblade ___________________________________ Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB http://mail.yahoo.it |
From: Al V. <vi...@ft...> - 2005-10-04 11:55:34
|
On Tue, Oct 04, 2005 at 01:19:33PM +0200, Blaisorblade wrote: > > extra-$(CONFIG_MODE_TT) += unmap.o > > $(obj)/unmap.o: _c_flags = $(call unprofile,$(CFLAGS)) > Where went objcopy -G switcheroo? > > Possibly (it doesn't link into glibc) it's trivially ok, but please make sure > as the original fixed bug was environment-dependant (it happened only on some > Gentoo NPTL-only systems, and maybe the problem disappeared in later glibc > versions), so you wouldn't see the breakage. For one thing, it doesn't link into anything; for another, NPTL or not, it won't generate any non-trivial sections - it's one static variable (*not* per-thread, etc.) and one function with a bunch of inline assembler in it. Built as kernel object. IOW, this sucker is as self-contained as it get - .text, .bss, the only relocation being reference to static variable from code (i.e. offset relative to wherever .bss ends up) and the only non-local symbol being switcheroo. |
From: Blaisorblade <bla...@ya...> - 2005-10-04 12:09:17
|
On Tuesday 04 October 2005 13:55, Al Viro wrote: > On Tue, Oct 04, 2005 at 01:19:33PM +0200, Blaisorblade wrote: > For one thing, it doesn't link into anything; for another, NPTL or not, it > won't generate any non-trivial sections - it's one static variable (*not* > per-thread, etc.) and one function with a bunch of inline assembler in > it. Built as kernel object. > IOW, this sucker is as self-contained as it get - .text, .bss, the only > relocation being reference to static variable from code (i.e. offset > relative to wherever .bss ends up) and the only non-local symbol being > switcheroo. Ok, fine - the old problem was due to linking it with libc, so it's fixed. Nice and ACK. -- Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!". Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894) http://www.user-mode-linux.org/~blaisorblade ___________________________________ Yahoo! Messenger: chiamate gratuite in tutto il mondo http://it.messenger.yahoo.com |
From: Al V. <vi...@ft...> - 2005-10-04 17:18:55
|
Killing unmap magic Signed-off-by: Al Viro <vi...@ze...> ---- diff -urN RC14-rc3-git4-base/arch/um/Makefile RC14-rc3-git4-foo/arch/um/Makefile --- RC14-rc3-git4-base/arch/um/Makefile 2005-09-25 23:28:27.000000000 -0400 +++ RC14-rc3-git4-foo/arch/um/Makefile 2005-10-04 13:16:14.000000000 -0400 @@ -121,7 +121,7 @@ -DSTART=$(START) -DELF_ARCH=$(ELF_ARCH) \ -DELF_FORMAT="$(ELF_FORMAT)" $(CPP_MODE-y) \ -DKERNEL_STACK_SIZE=$(STACK_SIZE) \ - -DUNMAP_PATH=arch/um/sys-$(SUBARCH)/unmap_fin.o + -DUNMAP_PATH=arch/um/sys-$(SUBARCH)/unmap.o #The wrappers will select whether using "malloc" or the kernel allocator. LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc diff -urN RC14-rc3-git4-base/arch/um/scripts/Makefile.unmap RC14-rc3-git4-foo/arch/um/scripts/Makefile.unmap --- RC14-rc3-git4-base/arch/um/scripts/Makefile.unmap 2005-09-05 07:05:14.000000000 -0400 +++ RC14-rc3-git4-foo/arch/um/scripts/Makefile.unmap 1969-12-31 19:00:00.000000000 -0500 @@ -1,22 +0,0 @@ -clean-files += unmap_tmp.o unmap_fin.o unmap.o - -ifdef CONFIG_MODE_TT - -#Always build unmap_fin.o -extra-y += unmap_fin.o -#Do dependency tracking for unmap.o (it will be always built, but won't get the tracking unless we use this). -targets += unmap.o - -#XXX: partially copied from arch/um/scripts/Makefile.rules -$(obj)/unmap.o: _c_flags = $(call unprofile,$(CFLAGS)) - -quiet_cmd_wrapld = LD $@ -define cmd_wrapld - $(LD) $(LDFLAGS) -r -o $(obj)/unmap_tmp.o $< ; \ - $(OBJCOPY) $(UML_OBJCOPYFLAGS) $(obj)/unmap_tmp.o $@ -G switcheroo -endef - -$(obj)/unmap_fin.o : $(obj)/unmap.o FORCE - $(call if_changed,wrapld) - -endif diff -urN RC14-rc3-git4-base/arch/um/sys-i386/Makefile RC14-rc3-git4-foo/arch/um/sys-i386/Makefile --- RC14-rc3-git4-base/arch/um/sys-i386/Makefile 2005-10-04 13:15:51.000000000 -0400 +++ RC14-rc3-git4-foo/arch/um/sys-i386/Makefile 2005-10-04 13:16:14.000000000 -0400 @@ -11,6 +11,7 @@ include arch/um/scripts/Makefile.rules -$(obj)/stub_segv.o : _c_flags = $(call unprofile,$(CFLAGS)) +extra-$(CONFIG_MODE_TT) += unmap.o -include arch/um/scripts/Makefile.unmap +$(obj)/stub_segv.o $(obj)/unmap.o: \ + _c_flags = $(call unprofile,$(CFLAGS)) diff -urN RC14-rc3-git4-base/arch/um/sys-x86_64/Makefile RC14-rc3-git4-foo/arch/um/sys-x86_64/Makefile --- RC14-rc3-git4-base/arch/um/sys-x86_64/Makefile 2005-10-04 13:15:51.000000000 -0400 +++ RC14-rc3-git4-foo/arch/um/sys-x86_64/Makefile 2005-10-04 13:16:14.000000000 -0400 @@ -16,6 +16,7 @@ include arch/um/scripts/Makefile.rules -$(obj)/stub_segv.o: _c_flags = $(call unprofile,$(CFLAGS)) +extra-$(CONFIG_MODE_TT) += unmap.o -include arch/um/scripts/Makefile.unmap +$(obj)/stub_segv.o $(obj)/unmap.o: \ + _c_flags = $(call unprofile,$(CFLAGS)) |
From: Al V. <vi...@ft...> - 2005-10-04 17:25:09
|
Taking clone.c to sys-*, making it a normal kernel object, trimming stub.h Signed-off-by: Al Viro <vi...@ze...> ---- diff -urN RC14-rc3-git4-base/arch/um/include/sysdep-i386/stub.h current/arch/um/include/sysdep-i386/stub.h --- RC14-rc3-git4-base/arch/um/include/sysdep-i386/stub.h 2005-08-28 23:09:40.000000000 -0400 +++ current/arch/um/include/sysdep-i386/stub.h 2005-10-03 23:31:59.000000000 -0400 @@ -12,54 +12,7 @@ extern void stub_segv_handler(int sig); extern void stub_clone_handler(void); -#define STUB_SYSCALL_RET EAX #define STUB_MMAP_NR __NR_mmap2 #define MMAP_OFFSET(o) ((o) >> PAGE_SHIFT) -static inline long stub_syscall2(long syscall, long arg1, long arg2) -{ - long ret; - - __asm__("movl %0, %%ecx; " : : "g" (arg2) : "%ecx"); - __asm__("movl %0, %%ebx; " : : "g" (arg1) : "%ebx"); - __asm__("movl %0, %%eax; " : : "g" (syscall) : "%eax"); - __asm__("int $0x80;" : : : "%eax"); - __asm__ __volatile__("movl %%eax, %0; " : "=g" (ret) :); - return(ret); -} - -static inline long stub_syscall3(long syscall, long arg1, long arg2, long arg3) -{ - __asm__("movl %0, %%edx; " : : "g" (arg3) : "%edx"); - return(stub_syscall2(syscall, arg1, arg2)); -} - -static inline long stub_syscall4(long syscall, long arg1, long arg2, long arg3, - long arg4) -{ - __asm__("movl %0, %%esi; " : : "g" (arg4) : "%esi"); - return(stub_syscall3(syscall, arg1, arg2, arg3)); -} - -static inline long stub_syscall6(long syscall, long arg1, long arg2, long arg3, - long arg4, long arg5, long arg6) -{ - long ret; - __asm__("movl %0, %%eax; " : : "g" (syscall) : "%eax"); - __asm__("movl %0, %%ebx; " : : "g" (arg1) : "%ebx"); - __asm__("movl %0, %%ecx; " : : "g" (arg2) : "%ecx"); - __asm__("movl %0, %%edx; " : : "g" (arg3) : "%edx"); - __asm__("movl %0, %%esi; " : : "g" (arg4) : "%esi"); - __asm__("movl %0, %%edi; " : : "g" (arg5) : "%edi"); - __asm__ __volatile__("pushl %%ebp ; movl %1, %%ebp; " - "int $0x80; popl %%ebp ; " - "movl %%eax, %0; " : "=g" (ret) : "g" (arg6) : "%eax"); - return(ret); -} - -static inline void trap_myself(void) -{ - __asm("int3"); -} - #endif diff -urN RC14-rc3-git4-base/arch/um/include/sysdep-x86_64/stub.h current/arch/um/include/sysdep-x86_64/stub.h --- RC14-rc3-git4-base/arch/um/include/sysdep-x86_64/stub.h 2005-08-28 23:09:40.000000000 -0400 +++ current/arch/um/include/sysdep-x86_64/stub.h 2005-10-02 23:04:09.000000000 -0400 @@ -13,46 +13,7 @@ extern void stub_segv_handler(int sig); extern void stub_clone_handler(void); -#define STUB_SYSCALL_RET PT_INDEX(RAX) #define STUB_MMAP_NR __NR_mmap #define MMAP_OFFSET(o) (o) -static inline long stub_syscall2(long syscall, long arg1, long arg2) -{ - long ret; - - __asm__("movq %0, %%rsi; " : : "g" (arg2) : "%rsi"); - __asm__("movq %0, %%rdi; " : : "g" (arg1) : "%rdi"); - __asm__("movq %0, %%rax; " : : "g" (syscall) : "%rax"); - __asm__("syscall;" : : : "%rax", "%r11", "%rcx"); - __asm__ __volatile__("movq %%rax, %0; " : "=g" (ret) :); - return(ret); -} - -static inline long stub_syscall3(long syscall, long arg1, long arg2, long arg3) -{ - __asm__("movq %0, %%rdx; " : : "g" (arg3) : "%rdx"); - return(stub_syscall2(syscall, arg1, arg2)); -} - -static inline long stub_syscall4(long syscall, long arg1, long arg2, long arg3, - long arg4) -{ - __asm__("movq %0, %%r10; " : : "g" (arg4) : "%r10"); - return(stub_syscall3(syscall, arg1, arg2, arg3)); -} - -static inline long stub_syscall6(long syscall, long arg1, long arg2, long arg3, - long arg4, long arg5, long arg6) -{ - __asm__("movq %0, %%r9; " : : "g" (arg6) : "%r9"); - __asm__("movq %0, %%r8; " : : "g" (arg5) : "%r8"); - return(stub_syscall4(syscall, arg1, arg2, arg3, arg4)); -} - -static inline void trap_myself(void) -{ - __asm("int3"); -} - #endif diff -urN RC14-rc3-git4-base/arch/um/kernel/skas/Makefile current/arch/um/kernel/skas/Makefile --- RC14-rc3-git4-base/arch/um/kernel/skas/Makefile 2005-09-12 14:33:28.000000000 -0400 +++ current/arch/um/kernel/skas/Makefile 2005-10-02 22:54:22.000000000 -0400 @@ -3,12 +3,9 @@ # Licensed under the GPL # -obj-y := clone.o exec_kern.o mem.o mem_user.o mmu.o process.o process_kern.o \ +obj-y := exec_kern.o mem.o mem_user.o mmu.o process.o process_kern.o \ syscall.o tlb.o trap_user.o uaccess.o -USER_OBJS := process.o clone.o +USER_OBJS := process.o include arch/um/scripts/Makefile.rules - -# clone.o is in the stub, so it can't be built with profiling -$(obj)/clone.o : c_flags = -Wp,-MD,$(depfile) $(call unprofile,$(USER_CFLAGS)) diff -urN RC14-rc3-git4-base/arch/um/kernel/skas/include/stub-data.h current/arch/um/kernel/skas/include/stub-data.h --- RC14-rc3-git4-base/arch/um/kernel/skas/include/stub-data.h 2005-08-28 23:09:40.000000000 -0400 +++ current/arch/um/kernel/skas/include/stub-data.h 2005-10-02 22:44:11.000000000 -0400 @@ -6,7 +6,11 @@ #ifndef __STUB_DATA_H #define __STUB_DATA_H +#ifdef __KERNEL__ +#include <linux/time.h> +#else #include <sys/time.h> +#endif struct stub_data { long offset; diff -urN RC14-rc3-git4-base/arch/um/sys-i386/Makefile current/arch/um/sys-i386/Makefile --- RC14-rc3-git4-base/arch/um/sys-i386/Makefile 2005-10-04 13:19:47.000000000 -0400 +++ current/arch/um/sys-i386/Makefile 2005-10-04 07:35:43.000000000 -0400 @@ -6,6 +6,7 @@ subarch-obj-$(CONFIG_HIGHMEM) += mm/highmem.o subarch-obj-$(CONFIG_MODULES) += kernel/module.o +obj-$(CONFIG_MODE_SKAS) += clone.o USER_OBJS := bugs.o ptrace_user.o sigcontext.o fault.o @@ -13,5 +14,5 @@ extra-$(CONFIG_MODE_TT) += unmap.o -$(obj)/stub_segv.o $(obj)/unmap.o: \ +$(obj)/stub_segv.o $(obj)/clone.o $(obj)/unmap.o: \ _c_flags = $(call unprofile,$(CFLAGS)) diff -urN RC14-rc3-git4-base/arch/um/sys-i386/clone.c current/arch/um/sys-i386/clone.c --- RC14-rc3-git4-base/arch/um/sys-i386/clone.c 1969-12-31 19:00:00.000000000 -0500 +++ current/arch/um/sys-i386/clone.c 2005-10-02 22:54:52.000000000 -0400 @@ -0,0 +1,47 @@ +#include <linux/config.h> +#include <asm/unistd.h> +#include <linux/mman.h> +#include <linux/ptrace.h> +#include "stub-data.h" + +static int errno; + +static inline _syscall2(int,clone,unsigned long,flags,unsigned long,newsp) +static inline _syscall4(long,ptrace,long,request, + pid_t,pid,void *,addr,void *,data); +static inline _syscall3(int,setitimer,int,which, const struct itimerval *,value, + struct itimerval *,ovalue); +static inline _syscall6(void *,mmap2,void *,addr,size_t,len,int,prot,int,flags,int,fd,off_t,offset) + +static inline void trap_myself(void) +{ + __asm("int3"); +} + +void __attribute__ ((__section__ (".__syscall_stub"))) +stub_clone_handler(void) +{ + long err; + struct stub_data *from = (struct stub_data *) CONFIG_STUB_DATA; + + err = clone(CLONE_PARENT | CLONE_FILES | SIGCHLD, + CONFIG_STUB_DATA + PAGE_SIZE / 2 - sizeof(void *)); + if (err) + goto out; + + err = ptrace(PTRACE_TRACEME, 0, NULL, NULL); + if (err) + goto out; + + err = setitimer(ITIMER_VIRTUAL, &from->timer, NULL); + if (err) + goto out; + + err = (long)mmap2((void *)CONFIG_STUB_DATA, PAGE_SIZE, + PROT_READ | PROT_WRITE, MAP_FIXED | MAP_SHARED, + from->fd, from->offset); +out: + /* save current result. Parent: pid; child: retcode of mmap */ + from->err = err == -1 ? errno : err; + trap_myself(); +} diff -urN RC14-rc3-git4-base/arch/um/sys-x86_64/Makefile current/arch/um/sys-x86_64/Makefile --- RC14-rc3-git4-base/arch/um/sys-x86_64/Makefile 2005-10-04 13:19:47.000000000 -0400 +++ current/arch/um/sys-x86_64/Makefile 2005-10-04 07:37:19.000000000 -0400 @@ -8,6 +8,7 @@ signal.o stub.o stub_segv.o syscalls.o syscall_table.o sysrq.o ksyms.o obj-$(CONFIG_MODULES) += um_module.o +obj-$(CONFIG_MODE_SKAS) += clone.o subarch-obj-y = lib/bitops.o lib/csum-partial.o lib/memcpy.o lib/thunk.o subarch-obj-$(CONFIG_MODULES) += kernel/module.o @@ -18,5 +19,5 @@ extra-$(CONFIG_MODE_TT) += unmap.o -$(obj)/stub_segv.o $(obj)/unmap.o: \ +$(obj)/stub_segv.o $(obj)/clone.o $(obj)/unmap.o: \ _c_flags = $(call unprofile,$(CFLAGS)) diff -urN RC14-rc3-git4-base/arch/um/sys-x86_64/clone.c current/arch/um/sys-x86_64/clone.c --- RC14-rc3-git4-base/arch/um/sys-x86_64/clone.c 1969-12-31 19:00:00.000000000 -0500 +++ current/arch/um/sys-x86_64/clone.c 2005-10-02 22:57:53.000000000 -0400 @@ -0,0 +1,47 @@ +#include <linux/config.h> +#include <asm/unistd.h> +#include <linux/mman.h> +#include <linux/ptrace.h> +#include "stub-data.h" + +static int errno; + +static inline _syscall2(int,clone,unsigned long,flags,unsigned long,newsp) +static inline _syscall4(long,ptrace,long,request, + pid_t,pid,void *,addr,void *,data); +static inline _syscall3(int,setitimer,int,which, const struct itimerval *,value, + struct itimerval *,ovalue); +static inline _syscall6(void *,mmap,void *,addr,size_t,len,int,prot,int,flags,int,fd,off_t,offset) + +static inline void trap_myself(void) +{ + __asm("int3"); +} + +void __attribute__ ((__section__ (".__syscall_stub"))) +stub_clone_handler(void) +{ + long err; + struct stub_data *from = (struct stub_data *) CONFIG_STUB_DATA; + + err = clone(CLONE_PARENT | CLONE_FILES | SIGCHLD, + CONFIG_STUB_DATA + PAGE_SIZE / 2 - sizeof(void *)); + if (err) + goto out; + + err = ptrace(PTRACE_TRACEME, 0, NULL, NULL); + if (err) + goto out; + + err = setitimer(ITIMER_VIRTUAL, &from->timer, NULL); + if (err) + goto out; + + err = (long)mmap((void *)CONFIG_STUB_DATA, PAGE_SIZE, + PROT_READ | PROT_WRITE, MAP_FIXED | MAP_SHARED, + from->fd, from->offset); +out: + /* save current result. Parent: pid; child: retcode of mmap */ + from->err = err == -1 ? errno : err; + trap_myself(); +} |
From: Al V. <vi...@ft...> - 2005-10-04 17:28:38
|
KERN_SYMLINKS doesn't exist; the rest are already in ARCH_SYMLINKS and don't need to be included into MRPROPER_FILES twice Signed-off-by: Al Viro <vi...@ze...> ---- diff -urN RC14-rc3-git4-base/arch/um/Makefile current/arch/um/Makefile --- RC14-rc3-git4-base/arch/um/Makefile 2005-10-04 13:19:47.000000000 -0400 +++ current/arch/um/Makefile 2005-10-02 21:13:10.000000000 -0400 @@ -142,8 +142,7 @@ $(ARCH_DIR)/include/user_constants.h \ $(ARCH_DIR)/include/kern_constants.h $(ARCH_DIR)/Kconfig.arch -MRPROPER_FILES += $(SYMLINK_HEADERS) $(ARCH_SYMLINKS) \ - $(addprefix $(ARCH_DIR)/kernel/,$(KERN_SYMLINKS)) $(ARCH_DIR)/os +MRPROPER_FILES += $(ARCH_SYMLINKS) archclean: @find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \ |
From: Blaisorblade <bla...@ya...> - 2005-10-09 19:16:26
|
On Tuesday 04 October 2005 19:24, Al Viro wrote: > Taking clone.c to sys-*, making it a normal kernel object, trimming > stub.h This deserves a bit more attention. In fact, it is a possible fix to a misassembling problem - the current code loads registers in one asm() statement and expects them to be left unaltered in subsequent ones, which sometimes breaks. But currently it breaks things, as this clone.c must be totally self-contained (it doesn't run in the kernel address space - think of vsyscall.S). Btw, do you ever try booting UML? Seems not always, at least... And "static int errno" isn't enough - it must be placed in the data section of the stub, but I don't want to address this for 2.6.14 (even because we are creating a new address space and I don't want to deal with stack lifecycles right now). In fact, I've put together another patch for this, partly copying unistd.h macros. For your patch, we must resolve the errno problem first. Also, making clone.c a kernel object is not conceptually right, because it is actually host-kernel specific (yes, we haven't ports to other host kernels, for now). -- Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!". Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894) http://www.user-mode-linux.org/~blaisorblade ___________________________________ Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB http://mail.yahoo.it |