summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2015-07-18 17:01:40 +0200
committerJustus Winter <4winter@informatik.uni-hamburg.de>2015-07-18 17:01:40 +0200
commit7eb46797a3a2ac21615978c5b6947fc593e2f83c (patch)
tree2cff0f18607156dace132db98be1c9e9a2f1dca9 /debian
parent5f85a950bf57aea596e6e4c4aea69d0dbe585e25 (diff)
add patch series
Diffstat (limited to 'debian')
-rw-r--r--debian/patches/series2
-rw-r--r--debian/patches/upstreamme0001-kern-slab-fix-locking.patch26
-rw-r--r--debian/patches/upstreamme0002-kern-do-not-serialize-printf-and-co.patch112
3 files changed, 140 insertions, 0 deletions
diff --git a/debian/patches/series b/debian/patches/series
index e532dda..7cff58f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -13,3 +13,5 @@ vm-cache-policy0001-VM-cache-policy-change.patch
vm-cache-policy0002-vm-keep-track-of-clean-pages.patch
vm-cache-policy0003-vm-evict-clean-pages-first.patch
+upstreamme0001-kern-slab-fix-locking.patch
+upstreamme0002-kern-do-not-serialize-printf-and-co.patch
diff --git a/debian/patches/upstreamme0001-kern-slab-fix-locking.patch b/debian/patches/upstreamme0001-kern-slab-fix-locking.patch
new file mode 100644
index 0000000..f8f38f4
--- /dev/null
+++ b/debian/patches/upstreamme0001-kern-slab-fix-locking.patch
@@ -0,0 +1,26 @@
+From 63e97b694c2f9eefe33d5ac84c18df0dc102759a Mon Sep 17 00:00:00 2001
+From: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Sat, 18 Jul 2015 13:33:33 +0200
+Subject: [PATCH gnumach 1/2] kern/slab: fix locking
+
+* kern/slab.c (host_slab_info): Fix locking.
+---
+ kern/slab.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/kern/slab.c b/kern/slab.c
+index 60378b5..1114cfa 100644
+--- a/kern/slab.c
++++ b/kern/slab.c
+@@ -1503,7 +1503,7 @@ kern_return_t host_slab_info(host_t host, cache_info_array_t *infop,
+ i = 0;
+
+ list_for_each_entry(&kmem_cache_list, cache, node) {
+- simple_lock(&cache_lock);
++ simple_lock(&cache->lock);
+ info[i].flags = ((cache->flags & KMEM_CF_NO_CPU_POOL)
+ ? CACHE_FLAGS_NO_CPU_POOL : 0)
+ | ((cache->flags & KMEM_CF_SLAB_EXTERNAL)
+--
+2.1.4
+
diff --git a/debian/patches/upstreamme0002-kern-do-not-serialize-printf-and-co.patch b/debian/patches/upstreamme0002-kern-do-not-serialize-printf-and-co.patch
new file mode 100644
index 0000000..0a8cc91
--- /dev/null
+++ b/debian/patches/upstreamme0002-kern-do-not-serialize-printf-and-co.patch
@@ -0,0 +1,112 @@
+From 0e96db3d6cb5e2131dc35059387e96c15ef06844 Mon Sep 17 00:00:00 2001
+From: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Sat, 18 Jul 2015 16:17:50 +0200
+Subject: [PATCH gnumach 2/2] kern: do not serialize printf and co
+
+A lot of code assumes that printf is re-entrant, e.g. the debuggers
+pagination code, or any use of assert inside the console driver.
+
+* kern/printf.c: Drop the lock serializing calls to `_doprnt'.
+(printf_init): Remove function.
+* kern/printf.h (printf_init): Remove declaration.
+* kern/startup.c (setup_main): Remove call to `printf_init'.
+---
+ kern/printf.c | 33 ---------------------------------
+ kern/printf.h | 2 --
+ kern/startup.c | 2 --
+ 3 files changed, 37 deletions(-)
+
+diff --git a/kern/printf.c b/kern/printf.c
+index 13f2dc0..50f2362 100644
+--- a/kern/printf.c
++++ b/kern/printf.c
+@@ -151,21 +151,6 @@ void printnum(
+
+ boolean_t _doprnt_truncates = FALSE;
+
+-/* printf could be called at _any_ point during system initialization,
+- including before printf_init() gets called from the "normal" place
+- in kern/startup.c. */
+-boolean_t _doprnt_lock_initialized = FALSE;
+-decl_simple_lock_data(,_doprnt_lock)
+-
+-void printf_init(void)
+-{
+- if (!_doprnt_lock_initialized)
+- {
+- _doprnt_lock_initialized = TRUE;
+- simple_lock_init(&_doprnt_lock);
+- }
+-}
+-
+ void _doprnt(
+ const char *fmt,
+ va_list argp,
+@@ -187,22 +172,6 @@ void _doprnt(
+ int base;
+ char c;
+
+- printf_init();
+-
+-#if 0
+- /* Make sure that we get *some* printout, no matter what */
+- simple_lock(&_doprnt_lock);
+-#else
+- {
+- int i = 0;
+- while (i < 1*1024*1024) {
+- if (simple_lock_try(&_doprnt_lock))
+- break;
+- i++;
+- }
+- }
+-#endif
+-
+ while ((c = *fmt) != '\0') {
+ if (c != '%') {
+ (*putc)(c, putc_arg);
+@@ -522,8 +491,6 @@ void _doprnt(
+ }
+ fmt++;
+ }
+-
+- simple_unlock(&_doprnt_lock);
+ }
+
+ /*
+diff --git a/kern/printf.h b/kern/printf.h
+index 76047f0..b72640a 100644
+--- a/kern/printf.h
++++ b/kern/printf.h
+@@ -27,8 +27,6 @@
+ #include <sys/types.h>
+ #include <stdarg.h>
+
+-extern void printf_init (void);
+-
+ extern void _doprnt (const char *fmt,
+ va_list argp,
+ void (*putc)(char, vm_offset_t),
+diff --git a/kern/startup.c b/kern/startup.c
+index f9f0c34..30cff5c 100644
+--- a/kern/startup.c
++++ b/kern/startup.c
+@@ -39,7 +39,6 @@
+ #include <kern/machine.h>
+ #include <kern/mach_factor.h>
+ #include <kern/mach_clock.h>
+-#include <kern/printf.h>
+ #include <kern/processor.h>
+ #include <kern/rdxtree.h>
+ #include <kern/sched_prim.h>
+@@ -109,7 +108,6 @@ void setup_main(void)
+ #endif /* MACH_KDB */
+
+ panic_init();
+- printf_init();
+
+ sched_init();
+ vm_mem_bootstrap();
+--
+2.1.4
+