* [uml-devel] [PATCH 0/5] Other important UML fixes for 2.6.14
@ 2005-09-29 19:02 Blaisorblade
2005-09-29 19:30 ` [uml-devel] [PATCH 1/5] Uml: fix build dependencies with KBUILD OUTPUT Paolo 'Blaisorblade' Giarrusso
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Blaisorblade @ 2005-09-29 19:02 UTC (permalink / raw)
To: Linus Torvalds, Andrew Morton; +Cc: Jeff Dike, user-mode-linux-devel, LKML
This is what I've currently in my tree for 2.6.14. It's not enough to fix all
regressions (there are still some problems on which Jeff is working right
now, namely UBD and x86-64 without frame pointers).
This includes the critical fixes for my UML fault handler breakage - this time
I ran a kernel compile under each UML running mode (last time I couldn't test
SKAS3) with these patches.
--
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
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* [uml-devel] [PATCH 1/5] Uml: fix build dependencies with KBUILD OUTPUT
2005-09-29 19:02 [uml-devel] [PATCH 0/5] Other important UML fixes for 2.6.14 Blaisorblade
@ 2005-09-29 19:30 ` Paolo 'Blaisorblade' Giarrusso
2005-09-29 19:30 ` [uml-devel] [PATCH 2/5] uml: fix page faults in SKAS3 mode Paolo 'Blaisorblade' Giarrusso
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Paolo 'Blaisorblade' Giarrusso @ 2005-09-29 19:30 UTC (permalink / raw)
To: Linus Torvalds, Andrew Morton
Cc: Jeff Dike, linux-kernel, user-mode-linux-devel
From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
When doing "make ARCH=um O=<path>", where <path> only contains .config, the
build failed, because <path>/include2 hadn't been created. It's not supposed to
work like this, at all. Since I never saw this (even with massively parallel
builds - I'm accustomed to test often -j50, given that I use ccache), I suppose
that after doing "make ARCH=um O=<path> *config" this wouldn't happen.
Turns out that the UML "archprepare" target failed - it depends on prepare1
which in turn would cause include2 to be created, but the failing target was
listed as dependency of archprepare. And there's no specific order among
dependencies, so add another dependency.
Btw, fix some clutter I found (duplicate assignments).
And add $(Q) to an ln invocation, since this patch (don't ask me why) causes
$(SYMLINK_HEADERS) to be rebuilt at each "make" call.
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
---
arch/um/Makefile | 6 +++++-
arch/um/Makefile-i386 | 2 --
arch/um/Makefile-x86_64 | 3 ---
3 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/arch/um/Makefile b/arch/um/Makefile
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -111,6 +111,10 @@ else
$(shell cd $(ARCH_DIR) && ln -sf Kconfig.$(SUBARCH) Kconfig.arch)
endif
+# archprepare depends on prepare1. But we need that all these are made *after* prepare1.
+# Otherwise, for instance, we may miss include2.
+$(ARCH_SYMLINKS) $(SYS_HEADERS) $(GEN_HEADERS): prepare1
+
archprepare: $(ARCH_SYMLINKS) $(SYS_HEADERS) $(GEN_HEADERS)
LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static
@@ -161,7 +165,7 @@ archclean:
$(SYMLINK_HEADERS):
@echo ' SYMLINK $@'
ifneq ($(KBUILD_SRC),)
- ln -fsn $(srctree)/include/asm-um/$(basename $(notdir $@))-$(SUBARCH)$(suffix $@) $@
+ $(Q)ln -fsn $(srctree)/include/asm-um/$(basename $(notdir $@))-$(SUBARCH)$(suffix $@) $@
else
$(Q)cd $(TOPDIR)/$(dir $@) ; \
ln -sf $(basename $(notdir $@))-$(SUBARCH)$(suffix $@) $(notdir $@)
diff --git a/arch/um/Makefile-i386 b/arch/um/Makefile-i386
--- a/arch/um/Makefile-i386
+++ b/arch/um/Makefile-i386
@@ -36,8 +36,6 @@ endif
SYS_UTIL_DIR := $(ARCH_DIR)/sys-i386/util
SYS_HEADERS := $(SYS_DIR)/sc.h $(SYS_DIR)/thread.h
-prepare: $(SYS_HEADERS)
-
$(SYS_DIR)/sc.h: $(SYS_UTIL_DIR)/mk_sc
$(call filechk,gen_header)
diff --git a/arch/um/Makefile-x86_64 b/arch/um/Makefile-x86_64
--- a/arch/um/Makefile-x86_64
+++ b/arch/um/Makefile-x86_64
@@ -14,12 +14,9 @@ ELF_ARCH := i386:x86-64
ELF_FORMAT := elf64-x86-64
SYS_UTIL_DIR := $(ARCH_DIR)/sys-x86_64/util
-SYS_DIR := $(ARCH_DIR)/include/sysdep-x86_64
SYS_HEADERS = $(SYS_DIR)/sc.h $(SYS_DIR)/thread.h
-prepare: $(SYS_HEADERS)
-
$(SYS_DIR)/sc.h: $(SYS_UTIL_DIR)/mk_sc
$(call filechk,gen_header)
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* [uml-devel] [PATCH 2/5] uml: fix page faults in SKAS3 mode.
2005-09-29 19:02 [uml-devel] [PATCH 0/5] Other important UML fixes for 2.6.14 Blaisorblade
2005-09-29 19:30 ` [uml-devel] [PATCH 1/5] Uml: fix build dependencies with KBUILD OUTPUT Paolo 'Blaisorblade' Giarrusso
@ 2005-09-29 19:30 ` Paolo 'Blaisorblade' Giarrusso
2005-09-29 19:30 ` [uml-devel] [PATCH 3/5] uml: clear SKAS0/3 flags when running in TT mode Paolo 'Blaisorblade' Giarrusso
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Paolo 'Blaisorblade' Giarrusso @ 2005-09-29 19:30 UTC (permalink / raw)
To: Linus Torvalds, Andrew Morton
Cc: Jeff Dike, linux-kernel, user-mode-linux-devel
From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
I hadn't been running a SKAS3 host when testing the "uml: fix hang in TT mode on
fault" patch (commit 546fe1cbf91d4d62e3849517c31a2327c992e5c5), and I didn't
think enough to the missing trap_no in SKAS3 mode.
In fact, the resulting kernel doesn't work at all in SKAS3 mode.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
---
arch/um/include/sysdep-i386/sigcontext.h | 10 +++++++++-
arch/um/include/sysdep-x86_64/sigcontext.h | 5 ++++-
arch/um/kernel/trap_kern.c | 5 ++++-
3 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/arch/um/include/sysdep-i386/sigcontext.h b/arch/um/include/sysdep-i386/sigcontext.h
--- a/arch/um/include/sysdep-i386/sigcontext.h
+++ b/arch/um/include/sysdep-i386/sigcontext.h
@@ -6,6 +6,7 @@
#ifndef __SYS_SIGCONTEXT_I386_H
#define __SYS_SIGCONTEXT_I386_H
+#include "uml-config.h"
#include <sysdep/sc.h>
#define IP_RESTART_SYSCALL(ip) ((ip) -= 2)
@@ -26,7 +27,14 @@
#define SC_START_SYSCALL(sc) do SC_EAX(sc) = -ENOSYS; while(0)
/* This is Page Fault */
-#define SEGV_IS_FIXABLE(fi) ((fi)->trap_no == 14)
+#define SEGV_IS_FIXABLE(fi) ((fi)->trap_no == 14)
+
+/* SKAS3 has no trap_no on i386, but get_skas_faultinfo() sets it to 0. */
+#ifdef UML_CONFIG_MODE_SKAS
+#define SEGV_MAYBE_FIXABLE(fi) ((fi)->trap_no == 0 && ptrace_faultinfo)
+#else
+#define SEGV_MAYBE_FIXABLE(fi) 0
+#endif
extern unsigned long *sc_sigmask(void *sc_ptr);
extern int sc_get_fpregs(unsigned long buf, void *sc_ptr);
diff --git a/arch/um/include/sysdep-x86_64/sigcontext.h b/arch/um/include/sysdep-x86_64/sigcontext.h
--- a/arch/um/include/sysdep-x86_64/sigcontext.h
+++ b/arch/um/include/sysdep-x86_64/sigcontext.h
@@ -31,7 +31,10 @@
#define SC_START_SYSCALL(sc) do SC_RAX(sc) = -ENOSYS; while(0)
/* This is Page Fault */
-#define SEGV_IS_FIXABLE(fi) ((fi)->trap_no == 14)
+#define SEGV_IS_FIXABLE(fi) ((fi)->trap_no == 14)
+
+/* No broken SKAS API, which doesn't pass trap_no, here. */
+#define SEGV_MAYBE_FIXABLE(fi) 0
extern unsigned long *sc_sigmask(void *sc_ptr);
diff --git a/arch/um/kernel/trap_kern.c b/arch/um/kernel/trap_kern.c
--- a/arch/um/kernel/trap_kern.c
+++ b/arch/um/kernel/trap_kern.c
@@ -26,6 +26,9 @@
#include "mconsole_kern.h"
#include "mem.h"
#include "mem_kern.h"
+#ifdef CONFIG_MODE_SKAS
+#include "skas.h"
+#endif
/* Note this is constrained to return 0, -EFAULT, -EACCESS, -ENOMEM by segv(). */
int handle_page_fault(unsigned long address, unsigned long ip,
@@ -134,7 +137,7 @@ unsigned long segv(struct faultinfo fi,
else if(current->mm == NULL)
panic("Segfault with no mm");
- if (SEGV_IS_FIXABLE(&fi))
+ if (SEGV_IS_FIXABLE(&fi) || SEGV_MAYBE_FIXABLE(&fi))
err = handle_page_fault(address, ip, is_write, is_user, &si.si_code);
else {
err = -EFAULT;
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* [uml-devel] [PATCH 3/5] uml: clear SKAS0/3 flags when running in TT mode
2005-09-29 19:02 [uml-devel] [PATCH 0/5] Other important UML fixes for 2.6.14 Blaisorblade
2005-09-29 19:30 ` [uml-devel] [PATCH 1/5] Uml: fix build dependencies with KBUILD OUTPUT Paolo 'Blaisorblade' Giarrusso
2005-09-29 19:30 ` [uml-devel] [PATCH 2/5] uml: fix page faults in SKAS3 mode Paolo 'Blaisorblade' Giarrusso
@ 2005-09-29 19:30 ` Paolo 'Blaisorblade' Giarrusso
2005-09-29 19:30 ` [uml-devel] [PATCH 4/5] uml: revert "run mconsole "sysrq" in process context" Paolo 'Blaisorblade' Giarrusso
2005-09-29 19:31 ` [uml-devel] [PATCH 5/5] uml: remove empty hostfs_truncate method Paolo 'Blaisorblade' Giarrusso
4 siblings, 0 replies; 6+ messages in thread
From: Paolo 'Blaisorblade' Giarrusso @ 2005-09-29 19:30 UTC (permalink / raw)
To: Linus Torvalds, Andrew Morton
Cc: Jeff Dike, linux-kernel, user-mode-linux-devel
From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
SEGV_MAYBE_FIXABLE tests ptrace_faultinfo, and depends on it being 1 only in
SKAS3 mode, while currently when running with mode=tt it will be 1 anyway. Fix
this, and do the same for proc_mm.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
---
arch/um/include/os.h | 4 ++++
arch/um/kernel/um_arch.c | 2 ++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/arch/um/include/os.h b/arch/um/include/os.h
--- a/arch/um/include/os.h
+++ b/arch/um/include/os.h
@@ -157,6 +157,10 @@ extern int os_lock_file(int fd, int excl
extern void os_early_checks(void);
extern int can_do_skas(void);
+/* Make sure they are clear when running in TT mode. Required by
+ * SEGV_MAYBE_FIXABLE */
+#define clear_can_do_skas() do { ptrace_faultinfo = proc_mm = 0; } while (0)
+
/* mem.c */
extern int create_mem_file(unsigned long len);
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c
--- a/arch/um/kernel/um_arch.c
+++ b/arch/um/kernel/um_arch.c
@@ -334,6 +334,8 @@ int linux_main(int argc, char **argv)
add_arg(DEFAULT_COMMAND_LINE);
os_early_checks();
+ if (force_tt)
+ clear_can_do_skas();
mode_tt = force_tt ? 1 : !can_do_skas();
#ifndef CONFIG_MODE_TT
if (mode_tt) {
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* [uml-devel] [PATCH 4/5] uml: revert "run mconsole "sysrq" in process context"
2005-09-29 19:02 [uml-devel] [PATCH 0/5] Other important UML fixes for 2.6.14 Blaisorblade
` (2 preceding siblings ...)
2005-09-29 19:30 ` [uml-devel] [PATCH 3/5] uml: clear SKAS0/3 flags when running in TT mode Paolo 'Blaisorblade' Giarrusso
@ 2005-09-29 19:30 ` Paolo 'Blaisorblade' Giarrusso
2005-09-29 19:31 ` [uml-devel] [PATCH 5/5] uml: remove empty hostfs_truncate method Paolo 'Blaisorblade' Giarrusso
4 siblings, 0 replies; 6+ messages in thread
From: Paolo 'Blaisorblade' Giarrusso @ 2005-09-29 19:30 UTC (permalink / raw)
To: Linus Torvalds, Andrew Morton
Cc: Jeff Dike, linux-kernel, user-mode-linux-devel
From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Revert commit 12ebcd73e40e09f0dfddf89e465cc0541e0ff8b1, i.e.
[PATCH] uml: run mconsole "sysrq" in process context
on request from Jeff Dike.
a) sysrq may be run when the scheduler is non-functioning
b) the warning I wanted to fix actually came from the fault handler run in
atomic context. But I fixed that not to take the semaphore in a separate patch.
c) the fault handler is run because of a fault, and that fault was unaffected by
this patch.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Cc: Jeff Dike <jdike@addtoit.com>
---
arch/um/drivers/mconsole_user.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/um/drivers/mconsole_user.c b/arch/um/drivers/mconsole_user.c
--- a/arch/um/drivers/mconsole_user.c
+++ b/arch/um/drivers/mconsole_user.c
@@ -23,7 +23,7 @@ static struct mconsole_command commands[
{ "reboot", mconsole_reboot, MCONSOLE_PROC },
{ "config", mconsole_config, MCONSOLE_PROC },
{ "remove", mconsole_remove, MCONSOLE_PROC },
- { "sysrq", mconsole_sysrq, MCONSOLE_PROC },
+ { "sysrq", mconsole_sysrq, MCONSOLE_INTR },
{ "help", mconsole_help, MCONSOLE_INTR },
{ "cad", mconsole_cad, MCONSOLE_INTR },
{ "stop", mconsole_stop, MCONSOLE_PROC },
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* [uml-devel] [PATCH 5/5] uml: remove empty hostfs_truncate method
2005-09-29 19:02 [uml-devel] [PATCH 0/5] Other important UML fixes for 2.6.14 Blaisorblade
` (3 preceding siblings ...)
2005-09-29 19:30 ` [uml-devel] [PATCH 4/5] uml: revert "run mconsole "sysrq" in process context" Paolo 'Blaisorblade' Giarrusso
@ 2005-09-29 19:31 ` Paolo 'Blaisorblade' Giarrusso
4 siblings, 0 replies; 6+ messages in thread
From: Paolo 'Blaisorblade' Giarrusso @ 2005-09-29 19:31 UTC (permalink / raw)
To: Linus Torvalds, Andrew Morton
Cc: Jeff Dike, linux-kernel, user-mode-linux-devel
From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
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() ->
set_attr() correctly detects ATTR_SIZE and calls truncate() on the host. So we
should be safe (using ftruncate() may be better, in case the file is unlinked on
the host, but we aren't sure to have the file open for writing, and reopening it
would cause the same races; plus nobody should expect UML to be so careful).
So, the warning is wrong, because the current implementation is working. Al, am
I correct, and can the warning be therefore dropped?
CC: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
---
fs/hostfs/hostfs_kern.c | 7 -------
1 files changed, 0 insertions(+), 7 deletions(-)
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
--- a/fs/hostfs/hostfs_kern.c
+++ b/fs/hostfs/hostfs_kern.c
@@ -793,11 +793,6 @@ int hostfs_rename(struct inode *from_ino
return(err);
}
-void hostfs_truncate(struct inode *ino)
-{
- not_implemented();
-}
-
int hostfs_permission(struct inode *ino, int desired, struct nameidata *nd)
{
char *name;
@@ -894,7 +889,6 @@ static struct inode_operations hostfs_io
.rmdir = hostfs_rmdir,
.mknod = hostfs_mknod,
.rename = hostfs_rename,
- .truncate = hostfs_truncate,
.permission = hostfs_permission,
.setattr = hostfs_setattr,
.getattr = hostfs_getattr,
@@ -910,7 +904,6 @@ static struct inode_operations hostfs_di
.rmdir = hostfs_rmdir,
.mknod = hostfs_mknod,
.rename = hostfs_rename,
- .truncate = hostfs_truncate,
.permission = hostfs_permission,
.setattr = hostfs_setattr,
.getattr = hostfs_getattr,
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-09-29 19:33 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-29 19:02 [uml-devel] [PATCH 0/5] Other important UML fixes for 2.6.14 Blaisorblade
2005-09-29 19:30 ` [uml-devel] [PATCH 1/5] Uml: fix build dependencies with KBUILD OUTPUT Paolo 'Blaisorblade' Giarrusso
2005-09-29 19:30 ` [uml-devel] [PATCH 2/5] uml: fix page faults in SKAS3 mode Paolo 'Blaisorblade' Giarrusso
2005-09-29 19:30 ` [uml-devel] [PATCH 3/5] uml: clear SKAS0/3 flags when running in TT mode Paolo 'Blaisorblade' Giarrusso
2005-09-29 19:30 ` [uml-devel] [PATCH 4/5] uml: revert "run mconsole "sysrq" in process context" Paolo 'Blaisorblade' Giarrusso
2005-09-29 19:31 ` [uml-devel] [PATCH 5/5] uml: remove empty hostfs_truncate method Paolo 'Blaisorblade' Giarrusso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox