Thomas Meyer | 17 May 11:25 2015
Picon

[PATCH] um: Switch clocksource to hrtimers

Switch the UML clocksource from interval timers to posix interval timers
and move to a monotonic timer.

This fixes suspend&resume related timer issues and improves network
performance as TCP state machines are now fed with the correct time;
also correct QoS and traffic shaping.

Signed-off-by: Thomas Meyer <thomas <at> m3y3r.de>
---

diff --git a/arch/um/Makefile b/arch/um/Makefile
index e4b1a96..43ef190 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
 <at>  <at>  -130,7 +130,7  <at>  <at>  export LDS_ELF_FORMAT := $(ELF_FORMAT)
 # The wrappers will select whether using "malloc" or the kernel allocator.
 LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc

-LD_FLAGS_CMDLINE = $(foreach opt,$(LDFLAGS),-Wl,$(opt))
+LD_FLAGS_CMDLINE = $(foreach opt,$(LDFLAGS),-Wl,$(opt)) -lrt

 # Used by link-vmlinux.sh which has special support for um link
 export CFLAGS_vmlinux := $(LINK-y) $(LINK_WRAPS) $(LD_FLAGS_CMDLINE)
diff --git a/arch/um/include/shared/os.h b/arch/um/include/shared/os.h
index 08eec0b..5949cae 100644
--- a/arch/um/include/shared/os.h
+++ b/arch/um/include/shared/os.h
 <at>  <at>  -219,7 +219,7  <at>  <at>  extern int set_umid(char *name);
 extern char *get_umid(void);

(Continue reading)

Thomas Meyer | 10 May 01:14 2015
Picon

[PATCH v6] um: Add a high resolution timer subsystem

Hi,

Changes:
- also create posix timer in stub_clone_handler()
- incorporated antons remarks

diff --git a/arch/um/Makefile b/arch/um/Makefile
index 17d4460..a4a434f 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
 <at>  <at>  -130,7 +130,7  <at>  <at>  export LDS_ELF_FORMAT := $(ELF_FORMAT)
 # The wrappers will select whether using "malloc" or the kernel allocator.
 LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc

-LD_FLAGS_CMDLINE = $(foreach opt,$(LDFLAGS),-Wl,$(opt))
+LD_FLAGS_CMDLINE = $(foreach opt,$(LDFLAGS),-Wl,$(opt)) -lrt

 # Used by link-vmlinux.sh which has special support for um link
 export CFLAGS_vmlinux := $(LINK-y) $(LINK_WRAPS) $(LD_FLAGS_CMDLINE)
diff --git a/arch/um/include/asm/irq.h b/arch/um/include/asm/irq.h
index 4a2037f..0f2a5b1 100644
--- a/arch/um/include/asm/irq.h
+++ b/arch/um/include/asm/irq.h
 <at>  <at>  -16,8 +16,9  <at>  <at> 
 #define TELNETD_IRQ 		12
 #define XTERM_IRQ 		13
 #define RANDOM_IRQ 		14
+#define HRTIMER_IRQ		15

-#define LAST_IRQ RANDOM_IRQ
(Continue reading)

Thomas Meyer | 2 May 11:48 2015
Picon

[PATCH v5] um: Add a high resolution timer subsystem

Hi,

I did port Anton's v4 patch to v4.1-rc1-56-g3d99e3f and run it the last
two days.

Original v4 from Anton can be found here:
https://sourceforge.net/p/user-mode-linux/mailman/message/32856805/

Issues addressed in v5 version:
- Ported to v4.1-rc1-56-g3d99e3f
- Replaced IRQF_DISABLED with IRQF_TIMER in request_irq(). I'm not sure
if this is the right thing to do.
- Removed unused variable/function: bbev and sleep_time()

What I don't understand is:
- why is SIGVTALRM/itimer is still used? wouldn't be enough to only use
the timer created by timer_create and SIGUSR2? 
- why are still both IRQs are still registered in the uml kernel?
request_irq() for TIMER_IRQ and HRTIMER_IRQ?
- doesn't occur duplicate signals now? One by SIGUSR2 and one from
SIGVTALRM?

kind regards
thomas

 Makefile                        |    2 
 include/asm/irq.h               |    3 
 include/shared/kern_util.h      |    1 
 include/shared/os.h             |    5 
 include/shared/timer-internal.h |   19 +++
(Continue reading)

Toralf Förster | 18 Apr 15:31 2015
Picon
Picon

UML specific or just a generic 4.0.x glitch : kernel/time/Kconfig:157:warning: range is invalid ?

tfoerste <at> t44 ~/devel/linux $ make ARCH=um linux -j3           
scripts/kconfig/conf  --silentoldconfig arch/x86/um/Kconfig
kernel/time/Kconfig:157:warning: range is invalid

--

-- 
Toralf
pgp key: 7B1A 07F4 EC82 0F90 D4C2  8936 872A E508 0076 E94E
--
"; the past is all dirty and cruel in the modern popular imagination, with the exception of the Romans, who
are just cruel"
Ian Mortimer, 2008, "The Time Traveller's Guide to Medieval England"

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
Thomas Meyer | 3 Apr 16:51 2015
Picon

[PATCH v3] um: Print minimum physical memory requirement

Print a more sensible message about the minimum physical memory
requirement.

Signed-off-by: Thomas Meyer <thomas <at> m3y3r.de>
---
diff --git a/arch/um/kernel/physmem.c b/arch/um/kernel/physmem.c
index 549ecf3..6f20626 100644
--- a/arch/um/kernel/physmem.c
+++ b/arch/um/kernel/physmem.c
 <at>  <at>  -57,22 +57,51  <at>  <at>  void map_memory(unsigned long virt, unsigned long phys, unsigned long len,

 extern int __syscall_stub_start;

+/**
+ * setup_physmem() - Setup physical memory for UML
+ *  <at> start:	Start address of the physical kernel memory,
+ *		i.e start address of the executable image.
+ *  <at> reserve_end:	end address of the physical kernel memory.
+ *  <at> len:	Length of total physical memory that should be mapped/made
+ *		available, in bytes.
+ *  <at> highmem:	Number of highmem bytes that should be mapped/made available.
+ *
+ * Creates an unlinked temporary file of size (len + highmem) and memory maps
+ * it on the last executable image address (uml_reserved).
+ *
+ * The offset is needed as the length of the total physical memory
+ * (len + highmem) includes the size of the memory used be the executable image,
+ * but the mapped-to address is the last address of the executable image
+ * (uml_reserved == end address of executable image).
+ *
(Continue reading)

Thomas Meyer | 3 Apr 13:59 2015
Picon

[PATCH v2] um: Print minimum physical memory requirement

Print a more sensible message about the minimum physical memory
requirement.

Signed-off-by: Thomas Meyer <thomas <at> m3y3r.de>
---
diff --git a/arch/um/kernel/physmem.c b/arch/um/kernel/physmem.c
index 549ecf3..f7af5e6 100644
--- a/arch/um/kernel/physmem.c
+++ b/arch/um/kernel/physmem.c
 <at>  <at>  -61,18 +61,26  <at>  <at>  void __init setup_physmem(unsigned long start, unsigned long reserve_end,
 			  unsigned long len, unsigned long long highmem)
 {
 	unsigned long reserve = reserve_end - start;
-	int pfn = PFN_UP(__pa(reserve_end));
-	int delta = (len - reserve) >> PAGE_SHIFT;
-	int err, offset, bootmap_size;
+	unsigned long pfn = PFN_UP(__pa(reserve_end));
+	unsigned long delta = (len - reserve) >> PAGE_SHIFT;
+	unsigned long offset, bootmap_size;
+	int err, map_size;
+
+	offset = uml_reserved - uml_physmem;
+	map_size = len - offset;
+	if(map_size <= 0) {
+		printf("Too few physical memory! Needed=%d, given=%d\n",
+		       offset, len);
+		exit(1);
+	}

 	physmem_fd = create_mem_file(len + highmem);
(Continue reading)

madhusudan r | 30 Mar 10:11 2015
Picon

UML Interfaces

Hi,

I would like to know if the User Mode linux creates (and initialises) 'struct uml_net_private' for every interface device on it? To be specific, if there are multiple l2tpv3 tunnels on the UML, does it warrant the creation of as many 'dev's, and consequently associate it with a corresponding 'uml_net_private'?

Thanks,
Madhu
 
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Thomas Meyer | 28 Mar 10:49 2015
Picon

[PATCH] um: Print minimum physical memory requirement


Print a more sensible message about the minimum physical memory
requirement.

Signed-off-by: Thomas Meyer <thomas <at> m3y3r.de>
---
diff --git a/arch/um/kernel/physmem.c b/arch/um/kernel/physmem.c
index 549ecf3..a91cf05 100644
--- a/arch/um/kernel/physmem.c
+++ b/arch/um/kernel/physmem.c
 <at>  <at>  -63,16 +63,23  <at>  <at>  void __init setup_physmem(unsigned long start, unsigned long reserve_end,
 	unsigned long reserve = reserve_end - start;
 	int pfn = PFN_UP(__pa(reserve_end));
 	int delta = (len - reserve) >> PAGE_SHIFT;
-	int err, offset, bootmap_size;
+	int err, offset, bootmap_size, map_size;
+
+	offset = uml_reserved - uml_physmem;
+	map_size = len - offset;
+	if(map_size <= 0) {
+		printf("Too few physical memory! Needed=%d, given=%d\n",
+		       offset, len);
+		exit(1);
+	}

 	physmem_fd = create_mem_file(len + highmem);

-	offset = uml_reserved - uml_physmem;
 	err = os_map_memory((void *) uml_reserved, physmem_fd, offset,
-			    len - offset, 1, 1, 1);
+			    map_size, 1, 1, 1);
 	if (err < 0) {
 		printf("setup_physmem - mapping %ld bytes of memory at 0x%p "
-		       "failed - errno = %d\n", len - offset,
+		       "failed - errno = %d\n", map_size,
 		       (void *) uml_reserved, err);
 		exit(1);
 	}

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
Thomas Meyer | 28 Mar 10:07 2015
Picon

[PATCH v4 2/2] um: add a kmsg_dumper


Add a kmsg_dumper, that dumps the kmsg buffer to stdout, when no console
is available. This an enables the printing of early panic() calls
triggered in uml_postsetup().
When a panic() call happens so early in the UML kernel no
earlyprintk/console is available yet, but with a kmsg_dumper in place
the kernel message buffer will be outputted to the user, to give a
better hint, of what the failure was.

Signed-off-by: Thomas Meyer <thomas <at> m3y3r.de>
---
 arch/um/kernel/Makefile    |  2 +-
 arch/um/kernel/kmsg_dump.c | 43 +++++++++++++++++++++++++++++++++++++++++++
 arch/um/kernel/um_arch.c   |  2 ++
 3 files changed, 46 insertions(+), 1 deletion(-)
 create mode 100644 arch/um/kernel/kmsg_dump.c

diff --git a/arch/um/kernel/Makefile b/arch/um/kernel/Makefile
index 2d840a0..3345e71 100644
--- a/arch/um/kernel/Makefile
+++ b/arch/um/kernel/Makefile
 <at>  <at>  -13,7 +13,7  <at>  <at>  clean-files :=
 obj-y = config.o exec.o exitcode.o irq.o ksyms.o mem.o \
 	physmem.o process.o ptrace.o reboot.o sigio.o \
 	signal.o smp.o syscall.o sysrq.o time.o tlb.o trap.o \
-	um_arch.o umid.o maccess.o skas/
+	um_arch.o umid.o maccess.o kmsg_dump.o skas/

 obj-$(CONFIG_BLK_DEV_INITRD) += initrd.o
 obj-$(CONFIG_GPROF)	+= gprof_syms.o
diff --git a/arch/um/kernel/kmsg_dump.c b/arch/um/kernel/kmsg_dump.c
new file mode 100644
index 0000000..407d492
--- /dev/null
+++ b/arch/um/kernel/kmsg_dump.c
 <at>  <at>  -0,0 +1,43  <at>  <at> 
+#include <linux/kmsg_dump.h>
+#include <linux/console.h>
+#include <shared/init.h>
+#include <shared/kern.h>
+#include <os.h>
+
+static void kmsg_dumper_stdout(struct kmsg_dumper *dumper,
+				enum kmsg_dump_reason reason)
+{
+	static char line[1024];
+
+	size_t len = 0;
+	bool con_available = false;
+
+	/* only dump kmsg when no console is available */
+	if (!console_trylock())
+		return;
+
+	if (console_drivers != NULL)
+		con_available = true;
+
+	console_unlock();
+
+	if (con_available == true)
+		return;
+
+	printf("kmsg_dump:\n");
+	while (kmsg_dump_get_line(dumper, true, line, sizeof(line), &len)) {
+		line[len] = '\0';
+		printf("%s", line);
+	}
+}
+
+static struct kmsg_dumper kmsg_dumper = {
+	.dump = kmsg_dumper_stdout
+};
+
+int __init kmsg_dumper_stdout_init(void)
+{
+	return kmsg_dump_register(&kmsg_dumper);
+}
+
+__uml_postsetup(kmsg_dumper_stdout_init);
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c
index ea92aa1..f1efeee 100644
--- a/arch/um/kernel/um_arch.c
+++ b/arch/um/kernel/um_arch.c
 <at>  <at>  -11,6 +11,7  <at>  <at> 
 #include <linux/string.h>
 #include <linux/utsname.h>
 #include <linux/sched.h>
+#include <linux/kmsg_dump.h>
 #include <asm/pgtable.h>
 #include <asm/processor.h>
 #include <asm/sections.h>
 <at>  <at>  -234,6 +235,7  <at>  <at>  static void __init uml_postsetup(void)
 static int panic_exit(struct notifier_block *self, unsigned long unused1,
 		      void *unused2)
 {
+	kmsg_dump(KMSG_DUMP_PANIC);
 	bust_spinlocks(1);
 	bust_spinlocks(0);
 	uml_exitcode = 1;
--

-- 
2.1.0

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
Thomas Meyer | 28 Mar 09:59 2015
Picon

[PATCH v4 1/2] um: Move uml_postsetup in the init_thread stack


atomic_notifier_chain_register() and uml_postsetup() do call kernel code
that rely on the "current" kernel macro and a valid task_struct resp.
thread_info struct. Give those functions a valid stack by moving
uml_postsetup() in the init_thread stack. This moves enables a panic()
call in this early code to generate a valid stacktrace, instead of
crashing.
E.g. when an UML kernel is started with an initrd but too few physical
memory the panic() call get's actually processed.

Signed-off-by: Thomas Meyer <thomas <at> m3y3r.de>
---
 arch/um/include/shared/as-layout.h |  1 +
 arch/um/kernel/um_arch.c           | 15 ++++++++++-----
 arch/um/os-Linux/skas/process.c    |  2 +-
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/arch/um/include/shared/as-layout.h b/arch/um/include/shared/as-layout.h
index 41c8c77..ca1843e 100644
--- a/arch/um/include/shared/as-layout.h
+++ b/arch/um/include/shared/as-layout.h
 <at>  <at>  -56,6 +56,7  <at>  <at>  extern unsigned long brk_start;
 extern unsigned long host_task_size;

 extern int linux_main(int argc, char **argv);
+extern void uml_finishsetup(void);

 struct siginfo;
 extern void (*sig_info[])(int, struct siginfo *si, struct uml_pt_regs *);
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c
index 9274eae..ea92aa1 100644
--- a/arch/um/kernel/um_arch.c
+++ b/arch/um/kernel/um_arch.c
 <at>  <at>  -247,6 +247,16  <at>  <at>  static struct notifier_block panic_exit_notifier = {
 	.priority 		= 0
 };

+void uml_finishsetup(void)
+{
+	atomic_notifier_chain_register(&panic_notifier_list,
+				       &panic_exit_notifier);
+
+	uml_postsetup();
+
+	new_thread_handler();
+}
+
 /* Set during early boot */
 unsigned long task_size;
 EXPORT_SYMBOL(task_size);
 <at>  <at>  -362,11 +372,6  <at>  <at>  int __init linux_main(int argc, char **argv)
 		printf("Kernel virtual memory size shrunk to %lu bytes\n",
 		       virtmem_size);

-	atomic_notifier_chain_register(&panic_notifier_list,
-				       &panic_exit_notifier);
-
-	uml_postsetup();
-
 	stack_protections((unsigned long) &init_thread_info);
 	os_flush_stdout();

diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c
index 908579f..8666cb6 100644
--- a/arch/um/os-Linux/skas/process.c
+++ b/arch/um/os-Linux/skas/process.c
 <at>  <at>  -674,7 +674,7  <at>  <at>  int start_idle_thread(void *stack, jmp_buf *switch_buf)
 	n = setjmp(initial_jmpbuf);
 	switch (n) {
 	case INIT_JMP_NEW_THREAD:
-		(*switch_buf)[0].JB_IP = (unsigned long) new_thread_handler;
+		(*switch_buf)[0].JB_IP = (unsigned long) uml_finishsetup;
 		(*switch_buf)[0].JB_SP = (unsigned long) stack +
 			UM_THREAD_SIZE - sizeof(void *);
 		break;
--

-- 
2.1.0

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
Richard Weinberger | 16 Mar 12:41 2015
Picon

Hostfs updates

Host got a visit from the janitor.

[PATCH 01/15] hostfs: hostfs_file_open: Switch to data locking model
[PATCH 02/15] hostfs: hostfs_file_open: Fix a fd leak in
[PATCH 03/15] hostfs: Allow fsync on directories
[PATCH 04/15] hostfs: Handle bogus st.mode
[PATCH 05/15] hostfs: Make hostfs_readpage more readable
[PATCH 06/15] hostfs: Add a BUG_ON to detect behavior changes of
[PATCH 07/15] hostfs: Remove open coded strcpy()
[PATCH 08/15] hostfs: Use __getname() in follow_link
[PATCH 09/15] hostfs: Report append flag in ->show_options()
[PATCH 10/15] hostfs: Remove superfluous test in hostfs_open()
[PATCH 11/15] hostfs: hostfs_open: Reset open flags upon each retry
[PATCH 12/15] hostfs: Remove superfluous initializations in
[PATCH 13/15] hostfs: Set page flags in hostfs_readpage() correctly
[PATCH 14/15] hostfs: Use page_offset()
[PATCH 15/15] hostfs: No need to box and later unbox the file mode

Thanks,
//richard

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/

Gmane