diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2015-08-17 16:23:35 +0200 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2015-08-17 16:23:35 +0200 |
commit | 614bdbf121888c390a4e9b4291d5e30a4932bf75 (patch) | |
tree | 555860bf366a7b1294d0a9ce73c028763f502cbc /debian | |
parent | 93f232006cd76ad482bda6d2bc77945594ccbd3d (diff) |
drop old patch series
Diffstat (limited to 'debian')
13 files changed, 0 insertions, 1107 deletions
diff --git a/debian/patches/fix-locking0001-vm-fix-locking-issues.patch b/debian/patches/fix-locking0001-vm-fix-locking-issues.patch deleted file mode 100644 index 73f7107..0000000 --- a/debian/patches/fix-locking0001-vm-fix-locking-issues.patch +++ /dev/null @@ -1,178 +0,0 @@ -From 18b1b1acf3cd85050c5305831f5cb6ff678273f9 Mon Sep 17 00:00:00 2001 -From: Justus Winter <4winter@informatik.uni-hamburg.de> -Date: Sun, 16 Aug 2015 12:54:41 +0200 -Subject: [PATCH gnumach 01/12] vm: fix locking issues - -* vm/vm_map.c (vm_map_submap): Properly lock object. -* vm/vm_object.c (_vm_object_setup): Likewise. -(vm_object_allocate): Likewise. -(vm_object_enter): Likewise. ---- - vm/vm_map.c | 24 ++++++++++++++---------- - vm/vm_object.c | 44 ++++++++++++++++++++++++++++++++------------ - 2 files changed, 46 insertions(+), 22 deletions(-) - -diff --git a/vm/vm_map.c b/vm/vm_map.c -index ae3ce21..a26eaff 100644 ---- a/vm/vm_map.c -+++ b/vm/vm_map.c -@@ -1182,16 +1182,20 @@ kern_return_t vm_map_submap( - - if ((entry->vme_start == start) && (entry->vme_end == end) && - (!entry->is_sub_map) && -- ((object = entry->object.vm_object) == vm_submap_object) && -- (object->resident_page_count == 0) && -- (object->copy == VM_OBJECT_NULL) && -- (object->shadow == VM_OBJECT_NULL) && -- (!object->pager_created)) { -- entry->object.vm_object = VM_OBJECT_NULL; -- vm_object_deallocate(object); -- entry->is_sub_map = TRUE; -- vm_map_reference(entry->object.sub_map = submap); -- result = KERN_SUCCESS; -+ ((object = entry->object.vm_object) == vm_submap_object)) { -+ vm_object_lock(object); -+ if ((object->resident_page_count == 0) && -+ (object->copy == VM_OBJECT_NULL) && -+ (object->shadow == VM_OBJECT_NULL) && -+ (!object->pager_created)) { -+ vm_object_unlock(object); -+ entry->object.vm_object = VM_OBJECT_NULL; -+ vm_object_deallocate(object); -+ entry->is_sub_map = TRUE; -+ vm_map_reference(entry->object.sub_map = submap); -+ result = KERN_SUCCESS; -+ } else -+ vm_object_unlock(object); - } - vm_map_unlock(map); - -diff --git a/vm/vm_object.c b/vm/vm_object.c -index deac0c2..94fa48f 100644 ---- a/vm/vm_object.c -+++ b/vm/vm_object.c -@@ -217,9 +217,11 @@ static void _vm_object_setup( - vm_size_t size) - { - *object = vm_object_template; -- queue_init(&object->memq); - vm_object_lock_init(object); -+ vm_object_lock(object); -+ queue_init(&object->memq); - object->size = size; -+ vm_object_unlock(object); - } - - vm_object_t _vm_object_allocate( -@@ -244,8 +246,11 @@ vm_object_t vm_object_allocate( - port = ipc_port_alloc_kernel(); - if (port == IP_NULL) - panic("vm_object_allocate"); -+ -+ vm_object_lock(object); - object->pager_name = port; - ipc_kobject_set(port, (ipc_kobject_t) object, IKOT_PAGING_NAME); -+ vm_object_unlock(object); - - return object; - } -@@ -2053,8 +2058,10 @@ restart: - object = (po == IKOT_PAGER) ? (vm_object_t) pager->ip_kobject - : VM_OBJECT_NULL; - -- if ((object != VM_OBJECT_NULL) && !must_init) { -+ if (object != VM_OBJECT_NULL) - vm_object_lock(object); -+ -+ if ((object != VM_OBJECT_NULL) && !must_init) { - if (object->ref_count == 0) { - queue_remove(&vm_object_cached_list, object, - vm_object_t, cached_list); -@@ -2062,10 +2069,9 @@ restart: - vm_object_cached_pages_update(-object->resident_page_count); - } - object->ref_count++; -- vm_object_unlock(object); -- - vm_stat.hits++; - } -+ - assert((object == VM_OBJECT_NULL) || (object->ref_count > 0) || - ((object->paging_in_progress != 0) && internal)); - -@@ -2085,6 +2091,10 @@ restart: - return(object); - - if (must_init) { -+ vm_size_t pager_size; -+ memory_object_control_t pager_request; -+ memory_object_name_t pager_name; -+ - /* - * Copy the naked send right we were given. - */ -@@ -2112,6 +2122,11 @@ restart: - * Let the pager know we're using it. - */ - -+ /* Store attributes while we're holding the lock. */ -+ pager_size = object->size; -+ pager_request = object->pager_request; -+ pager_name = object->pager_name; -+ - if (internal) { - /* acquire a naked send right for the DMM */ - ipc_port_t DMM = memory_manager_default_reference(); -@@ -2123,12 +2138,15 @@ restart: - /* default-pager objects are ready immediately */ - object->pager_ready = TRUE; - -+ /* Unlock object across call to memory manager. */ -+ vm_object_unlock(object); -+ - /* consumes the naked send right for DMM */ - (void) memory_object_create(DMM, - pager, -- object->size, -- object->pager_request, -- object->pager_name, -+ pager_size, -+ pager_request, -+ pager_name, - PAGE_SIZE); - } else { - /* the object is external and not temporary */ -@@ -2138,13 +2156,16 @@ restart: - /* user pager objects are not ready until marked so */ - object->pager_ready = FALSE; - -+ /* Unlock object across call to memory manager. */ -+ vm_object_unlock(object); -+ - (void) memory_object_init(pager, -- object->pager_request, -- object->pager_name, -+ pager_request, -+ pager_name, - PAGE_SIZE); -- - } - -+ /* Object was unlocked across call to memory manager. */ - vm_object_lock(object); - object->pager_initialized = TRUE; - -@@ -2152,9 +2173,8 @@ restart: - object->pager_ready = TRUE; - - vm_object_wakeup(object, VM_OBJECT_EVENT_INITIALIZED); -- } else { -- vm_object_lock(object); - } -+ - /* - * [At this point, the object must be locked] - */ --- -2.1.4 - diff --git a/debian/patches/fix-locking0002-kern-disable-the-simple-lock-checks-while-debugging.patch b/debian/patches/fix-locking0002-kern-disable-the-simple-lock-checks-while-debugging.patch deleted file mode 100644 index ec4748a..0000000 --- a/debian/patches/fix-locking0002-kern-disable-the-simple-lock-checks-while-debugging.patch +++ /dev/null @@ -1,107 +0,0 @@ -From ac1b5f83b088408f65669830589ab81d3b51ddbd Mon Sep 17 00:00:00 2001 -From: Justus Winter <4winter@informatik.uni-hamburg.de> -Date: Sat, 15 Aug 2015 16:43:24 +0200 -Subject: [PATCH gnumach 02/12] kern: disable the simple lock checks while - debugging - -* kern/lock.c (do_check_simple_locks): New variable. -(check_simple_locks): Make check conditional. -(check_simple_locks_{en,dis}able): New functions. -* kern/lock.h (check_simple_locks_{en,dis}able): New declarations. -* ddb/db_trap.c (db_task_trap): Disable simple lock checks. ---- - ddb/db_trap.c | 4 ++++ - kern/lock.c | 14 +++++++++++++- - kern/lock.h | 6 ++++++ - 3 files changed, 23 insertions(+), 1 deletion(-) - -diff --git a/ddb/db_trap.c b/ddb/db_trap.c -index 7e10731..cbb6bde 100644 ---- a/ddb/db_trap.c -+++ b/ddb/db_trap.c -@@ -45,6 +45,7 @@ - #include <ddb/db_trap.h> - #include <ddb/db_run.h> - #include <machine/db_interface.h> -+#include <kern/lock.h> - - - extern jmp_buf_t *db_recover; -@@ -65,6 +66,8 @@ db_task_trap( - boolean_t watchpt; - task_t task_space; - -+ check_simple_locks_disable(); -+ - task_space = db_target_space(current_thread(), user_space); - bkpt = IS_BREAKPOINT_TRAP(type, code); - watchpt = IS_WATCHPOINT_TRAP(type, code); -@@ -97,6 +100,7 @@ db_task_trap( - db_command_loop(); - } - -+ check_simple_locks_enable(); - db_restart_at_pc(watchpt, task_space); - } - -diff --git a/kern/lock.c b/kern/lock.c -index 3c74fec..d894b06 100644 ---- a/kern/lock.c -+++ b/kern/lock.c -@@ -136,9 +136,21 @@ struct simple_locks_info { - void *ra; - } simple_locks_info[NSLINFO]; - -+int do_check_simple_locks = 1; -+ - void check_simple_locks(void) - { -- assert(simple_locks_taken == 0); -+ assert(! do_check_simple_locks || simple_locks_taken == 0); -+} -+ -+void check_simple_locks_enable(void) -+{ -+ do_check_simple_locks = 1; -+} -+ -+void check_simple_locks_disable(void) -+{ -+ do_check_simple_locks = 0; - } - - /* Need simple lock sanity checking code if simple locks are being -diff --git a/kern/lock.h b/kern/lock.h -index 435ee1d..0eba0ad 100644 ---- a/kern/lock.h -+++ b/kern/lock.h -@@ -81,6 +81,8 @@ class simple_lock_data_t name; - #define simple_lock_taken(lock) (simple_lock_assert(lock), \ - 1) /* always succeeds */ - #define check_simple_locks() -+#define check_simple_locks_enable() -+#define check_simple_locks_disable() - - #else /* NCPUS > 1 */ - /* -@@ -97,6 +99,8 @@ extern boolean_t simple_lock_try(simple_lock_t); - (lock)->lock_data) - - extern void check_simple_locks(void); -+extern void check_simple_locks_enable(void); -+extern void check_simple_locks_disable(void); - - #endif /* NCPUS > 1 */ - -@@ -121,6 +125,8 @@ class struct simple_lock_data_empty name; - #define simple_lock_taken(l) (simple_lock_assert(l), \ - 1) /* always succeeds */ - #define check_simple_locks() -+#define check_simple_locks_enable() -+#define check_simple_locks_disable() - #define simple_lock_pause() - - #endif /* MACH_SLOCKS */ --- -2.1.4 - diff --git a/debian/patches/fix-locking0003-yyy-kern-improve-simple-lock-debugging.patch b/debian/patches/fix-locking0003-yyy-kern-improve-simple-lock-debugging.patch deleted file mode 100644 index 34e68a2..0000000 --- a/debian/patches/fix-locking0003-yyy-kern-improve-simple-lock-debugging.patch +++ /dev/null @@ -1,123 +0,0 @@ -From 5234d0abfa3cb0cc62a1b797a26b8c250d8441e2 Mon Sep 17 00:00:00 2001 -From: Justus Winter <4winter@informatik.uni-hamburg.de> -Date: Sat, 15 Aug 2015 17:04:08 +0200 -Subject: [PATCH gnumach 03/12] yyy kern: improve simple lock debugging - -* kern/lock.c -* kern/lock.h ---- - kern/lock.c | 32 +++++++++++++++++--------------- - kern/lock.h | 15 +++++++++++++-- - 2 files changed, 30 insertions(+), 17 deletions(-) - -diff --git a/kern/lock.c b/kern/lock.c -index d894b06..de22795 100644 ---- a/kern/lock.c -+++ b/kern/lock.c -@@ -133,7 +133,8 @@ unsigned int simple_locks_taken = 0; - - struct simple_locks_info { - simple_lock_t l; -- void *ra; -+ const char *expr; -+ const char *loc; - } simple_locks_info[NSLINFO]; - - int do_check_simple_locks = 1; -@@ -162,8 +163,10 @@ void simple_lock_init( - l->lock_data = 0; - } - --void simple_lock( -- simple_lock_t l) -+void _simple_lock( -+ simple_lock_t l, -+ const char *expression, -+ const char *location) - { - struct simple_locks_info *info; - -@@ -173,12 +176,14 @@ void simple_lock( - - info = &simple_locks_info[simple_locks_taken++]; - info->l = l; -- info->ra = -- __builtin_extract_return_addr (__builtin_return_address (0)); -+ info->expr = expression; -+ info->loc = location; - } - --boolean_t simple_lock_try( -- simple_lock_t l) -+boolean_t _simple_lock_try( -+ simple_lock_t l, -+ const char *expression, -+ const char *location) - { - struct simple_locks_info *info; - -@@ -189,8 +194,8 @@ boolean_t simple_lock_try( - - info = &simple_locks_info[simple_locks_taken++]; - info->l = l; -- info->ra = -- __builtin_extract_return_addr (__builtin_return_address (0)); -+ info->expr = expression; -+ info->loc = location; - - return TRUE; - } -@@ -214,6 +219,7 @@ void simple_unlock( - - simple_locks_info[i] = simple_locks_info[simple_locks_taken-1]; - } -+ simple_locks_info[simple_locks_taken] = (struct simple_locks_info) {0}; - simple_locks_taken--; - } - -@@ -628,13 +634,9 @@ void db_show_all_slocks(void) - - for (i = 0; i < simple_locks_taken; i++) { - info = &simple_locks_info[i]; -- db_printf("%d: ", i); -+ db_printf("%d: %s (", i, info->expr); - db_printsym(info->l, DB_STGY_ANY); --#if defined(__i386__) -- db_printf(" locked by "); -- db_printsym(info->ra, DB_STGY_PROC); --#endif -- db_printf("\n"); -+ db_printf(") locked by %s\n", info->loc); - } - } - #else /* MACH_SLOCKS && NCPUS == 1 */ -diff --git a/kern/lock.h b/kern/lock.h -index 0eba0ad..e88e182 100644 ---- a/kern/lock.h -+++ b/kern/lock.h -@@ -90,9 +90,20 @@ class simple_lock_data_t name; - */ - - extern void simple_lock_init(simple_lock_t); --extern void simple_lock(simple_lock_t); -+extern void _simple_lock(simple_lock_t, -+ const char *, const char *); - extern void simple_unlock(simple_lock_t); --extern boolean_t simple_lock_try(simple_lock_t); -+extern boolean_t _simple_lock_try(simple_lock_t, -+ const char *, const char *); -+ -+/* We provide simple_lock and simple_lock_try so that we can save the -+ location. */ -+#define XSTR(x) #x -+#define STR(x) XSTR(x) -+#define LOCATION __FILE__ ":" STR(__LINE__) -+ -+#define simple_lock(lock) _simple_lock((lock), #lock, LOCATION) -+#define simple_lock_try(lock) _simple_lock_try((lock), #lock, LOCATION) - - #define simple_lock_pause() - #define simple_lock_taken(lock) (simple_lock_assert(lock), \ --- -2.1.4 - diff --git a/debian/patches/fix-locking0004-yyy-kern-keep-track-of-the-writer-when-debugging-loc.patch b/debian/patches/fix-locking0004-yyy-kern-keep-track-of-the-writer-when-debugging-loc.patch deleted file mode 100644 index 8d93a6c..0000000 --- a/debian/patches/fix-locking0004-yyy-kern-keep-track-of-the-writer-when-debugging-loc.patch +++ /dev/null @@ -1,136 +0,0 @@ -From 527997b2efdb6bd14cc051dd85a0d4940bc453dc Mon Sep 17 00:00:00 2001 -From: Justus Winter <4winter@informatik.uni-hamburg.de> -Date: Sat, 15 Aug 2015 18:30:28 +0200 -Subject: [PATCH gnumach 04/12] yyy kern: keep track of the writer when - debugging locks - -* kern/lock.c -* kern/lock.h ---- - kern/lock.c | 28 +++++++++++++++++++++++++++- - kern/lock.h | 13 +++++++++++++ - 2 files changed, 40 insertions(+), 1 deletion(-) - -diff --git a/kern/lock.c b/kern/lock.c -index de22795..46c78da 100644 ---- a/kern/lock.c -+++ b/kern/lock.c -@@ -318,6 +318,9 @@ void lock_write( - simple_lock(&l->interlock); - } - } -+#if MACH_LDEBUG -+ l->writer = current_thread(); -+#endif /* MACH_LDEBUG */ - simple_unlock(&l->interlock); - } - -@@ -334,8 +337,12 @@ void lock_done( - else - if (l->want_upgrade) - l->want_upgrade = FALSE; -- else -+ else { - l->want_write = FALSE; -+#if MACH_LDEBUG -+ l->writer = THREAD_NULL; -+#endif /* MACH_LDEBUG */ -+ } - - /* - * There is no reason to wakeup a waiting thread -@@ -452,6 +459,9 @@ boolean_t lock_read_to_write( - } - } - -+#if MACH_LDEBUG -+ l->writer = current_thread(); -+#endif /* MACH_LDEBUG */ - simple_unlock(&l->interlock); - return FALSE; - } -@@ -460,6 +470,9 @@ void lock_write_to_read( - lock_t l) - { - simple_lock(&l->interlock); -+#if MACH_LDEBUG -+ assert(l->writer == current_thread()); -+#endif /* MACH_LDEBUG */ - - l->read_count++; - if (l->recursion_depth != 0) -@@ -475,6 +488,9 @@ void lock_write_to_read( - thread_wakeup(l); - } - -+#if MACH_LDEBUG -+ l->writer = THREAD_NULL; -+#endif /* MACH_LDEBUG */ - simple_unlock(&l->interlock); - } - -@@ -514,6 +530,9 @@ boolean_t lock_try_write( - */ - - l->want_write = TRUE; -+#if MACH_LDEBUG -+ l->writer = current_thread(); -+#endif /* MACH_LDEBUG */ - simple_unlock(&l->interlock); - return TRUE; - } -@@ -590,6 +609,9 @@ boolean_t lock_try_read_to_write( - simple_lock(&l->interlock); - } - -+#if MACH_LDEBUG -+ l->writer = current_thread(); -+#endif /* MACH_LDEBUG */ - simple_unlock(&l->interlock); - return TRUE; - } -@@ -602,6 +624,10 @@ void lock_set_recursive( - lock_t l) - { - simple_lock(&l->interlock); -+#if MACH_LDEBUG -+ assert(l->writer == current_thread()); -+#endif /* MACH_LDEBUG */ -+ - if (!l->want_write) { - panic("lock_set_recursive: don't have write lock"); - } -diff --git a/kern/lock.h b/kern/lock.h -index e88e182..b237a94 100644 ---- a/kern/lock.h -+++ b/kern/lock.h -@@ -174,6 +174,9 @@ struct lock { - /* boolean_t */ can_sleep:1, /* Can attempts to lock go to sleep? */ - recursion_depth:12, /* Depth of recursion */ - :0; -+#if MACH_LDEBUG -+ struct thread *writer; -+#endif /* MACH_LDEBUG */ - decl_simple_lock_data(,interlock) - /* Hardware interlock field. - Last in the structure so that -@@ -203,6 +206,16 @@ extern boolean_t lock_try_read_to_write(lock_t); - extern void lock_set_recursive(lock_t); - extern void lock_clear_recursive(lock_t); - -+/* Lock debugging support. */ -+#if ! MACH_LDEBUG -+#define have_read_lock(l) 1 -+#define have_write_lock(l) 1 -+#else /* MACH_LDEBUG */ -+#define have_read_lock(l) ((l)->read_count > 0) -+#define have_write_lock(l) ((l)->writer == current_thread()) -+#endif /* MACH_LDEBUG */ -+#define have_lock(l) (have_read_lock(l) || have_write_lock(l)) -+ - void db_show_all_slocks(void); - - #endif /* _KERN_LOCK_H_ */ --- -2.1.4 - diff --git a/debian/patches/fix-locking0005-fu_locking-issues.patch b/debian/patches/fix-locking0005-fu_locking-issues.patch deleted file mode 100644 index 7d925fb..0000000 --- a/debian/patches/fix-locking0005-fu_locking-issues.patch +++ /dev/null @@ -1,63 +0,0 @@ -From dff4e90c797f2225e4403b63067d62f546346f4a Mon Sep 17 00:00:00 2001 -From: Justus Winter <4winter@informatik.uni-hamburg.de> -Date: Sun, 16 Aug 2015 14:07:00 +0200 -Subject: [PATCH gnumach 05/12] fu_locking issues - ---- - vm/vm_object.c | 26 +++++++++++++++++++------- - 1 file changed, 19 insertions(+), 7 deletions(-) - -diff --git a/vm/vm_object.c b/vm/vm_object.c -index 94fa48f..02f0ade 100644 ---- a/vm/vm_object.c -+++ b/vm/vm_object.c -@@ -545,6 +545,12 @@ void vm_object_terminate( - { - vm_page_t p; - vm_object_t shadow_object; -+ memory_object_t pager; -+ memory_object_control_t pager_request; -+ memory_object_name_t pager_name; -+#if MACH_PAGEMAP -+ vm_external_t existence_info; -+#endif /* MACH_PAGEMAP */ - - /* - * Make sure the object isn't already being terminated -@@ -642,20 +648,26 @@ void vm_object_terminate( - * using memory_object_terminate. - */ - -+ /* Copy attributes while object is locked. */ -+ pager = object->pager; -+ pager_request = object->pager_request; -+ pager_name = object->pager_name; -+#if MACH_PAGEMAP -+ existence_info = object->existence_info; -+#endif /* MACH_PAGEMAP */ -+ - vm_object_unlock(object); - -- if (object->pager != IP_NULL) { -+ if (pager != IP_NULL) { - /* consumes our rights for pager, pager_request, pager_name */ -- memory_object_release(object->pager, -- object->pager_request, -- object->pager_name); -- } else if (object->pager_name != IP_NULL) { -+ memory_object_release(pager, pager_request, pager_name); -+ } else if (pager_name != IP_NULL) { - /* consumes our right for pager_name */ -- ipc_port_dealloc_kernel(object->pager_name); -+ ipc_port_dealloc_kernel(pager_name); - } - - #if MACH_PAGEMAP -- vm_external_destroy(object->existence_info); -+ vm_external_destroy(existence_info); - #endif /* MACH_PAGEMAP */ - - /* --- -2.1.4 - diff --git a/debian/patches/fix-locking0006-fu_locking_issues.patch b/debian/patches/fix-locking0006-fu_locking_issues.patch deleted file mode 100644 index 062ab87..0000000 --- a/debian/patches/fix-locking0006-fu_locking_issues.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 58e71f34d3550fab33e51deab18fc3f8b4a170cc Mon Sep 17 00:00:00 2001 -From: Justus Winter <4winter@informatik.uni-hamburg.de> -Date: Sun, 16 Aug 2015 14:21:50 +0200 -Subject: [PATCH gnumach 06/12] fu_locking_issues - ---- - vm/memory_object.c | 10 ++++++---- - 1 file changed, 6 insertions(+), 4 deletions(-) - -diff --git a/vm/memory_object.c b/vm/memory_object.c -index 097ed23..5ea5a8a 100644 ---- a/vm/memory_object.c -+++ b/vm/memory_object.c -@@ -788,7 +788,9 @@ MACRO_END - continue; - - case MEMORY_OBJECT_LOCK_RESULT_MUST_CLEAN: -- case MEMORY_OBJECT_LOCK_RESULT_MUST_RETURN: -+ case MEMORY_OBJECT_LOCK_RESULT_MUST_RETURN:; -+ vm_offset_t object_paging_offset; -+ - /* - * The clean and return cases are similar. - * -@@ -811,6 +813,7 @@ MACRO_END - PAGEOUT_PAGES; - } - -+ object_paging_offset = object->paging_offset; - vm_object_unlock(object); - - /* -@@ -821,8 +824,7 @@ MACRO_END - if (new_object == VM_OBJECT_NULL) { - new_object = vm_object_allocate(original_size); - new_offset = 0; -- paging_offset = m->offset + -- object->paging_offset; -+ paging_offset = m->offset + object_paging_offset; - pageout_action = page_lock_result; - } - -@@ -831,7 +833,7 @@ MACRO_END - * new object. - */ - m = vm_pageout_setup(m, -- m->offset + object->paging_offset, -+ m->offset + object_paging_offset, - new_object, - new_offset, - should_flush); --- -2.1.4 - diff --git a/debian/patches/fix-locking0007-fu_locking_issues.patch b/debian/patches/fix-locking0007-fu_locking_issues.patch deleted file mode 100644 index 3086ab3..0000000 --- a/debian/patches/fix-locking0007-fu_locking_issues.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 7b53ead64d86f4c09d02d0b83f96ce91bd431c4f Mon Sep 17 00:00:00 2001 -From: Justus Winter <4winter@informatik.uni-hamburg.de> -Date: Sun, 16 Aug 2015 14:35:02 +0200 -Subject: [PATCH gnumach 07/12] fu_locking_issues - ---- - vm/vm_pageout.c | 9 +++------ - 1 file changed, 3 insertions(+), 6 deletions(-) - -diff --git a/vm/vm_pageout.c b/vm/vm_pageout.c -index 51a6a0d..b676c7b 100644 ---- a/vm/vm_pageout.c -+++ b/vm/vm_pageout.c -@@ -252,6 +252,8 @@ vm_pageout_setup( - vm_object_unlock(new_object); - } - -+ vm_object_lock(old_object); -+ - if (flush) { - /* - * Create a place-holder page where the old one was, -@@ -262,7 +264,6 @@ vm_pageout_setup( - == VM_PAGE_NULL) - vm_page_more_fictitious(); - -- vm_object_lock(old_object); - vm_page_lock_queues(); - vm_page_remove(m); - vm_page_unlock_queues(); -@@ -281,8 +282,6 @@ vm_pageout_setup( - VM_EXTERNAL_STATE_EXISTS); - #endif /* MACH_PAGEMAP */ - -- vm_object_unlock(old_object); -- - vm_object_lock(new_object); - - /* -@@ -305,7 +304,6 @@ vm_pageout_setup( - */ - vm_page_copy(m, new_m); - -- vm_object_lock(old_object); - m->dirty = FALSE; - pmap_clear_modify(m->phys_addr); - -@@ -328,8 +326,6 @@ vm_pageout_setup( - VM_EXTERNAL_STATE_EXISTS); - #endif /* MACH_PAGEMAP */ - -- vm_object_unlock(old_object); -- - vm_object_lock(new_object); - - /* -@@ -383,6 +379,7 @@ vm_pageout_setup( - */ - - vm_object_unlock(new_object); -+ vm_object_unlock(old_object); - - /* - * Return the placeholder page to simplify cleanup. --- -2.1.4 - diff --git a/debian/patches/fix-locking0008-fu_locking_issues.patch b/debian/patches/fix-locking0008-fu_locking_issues.patch deleted file mode 100644 index d76e678..0000000 --- a/debian/patches/fix-locking0008-fu_locking_issues.patch +++ /dev/null @@ -1,31 +0,0 @@ -From cfbf825f178cdeb2ca760332ee4d9dcc8b52494f Mon Sep 17 00:00:00 2001 -From: Justus Winter <4winter@informatik.uni-hamburg.de> -Date: Sun, 16 Aug 2015 14:37:46 +0200 -Subject: [PATCH gnumach 08/12] fu_locking_issues - ---- - vm/memory_object.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/vm/memory_object.c b/vm/memory_object.c -index 5ea5a8a..2f1cb1c 100644 ---- a/vm/memory_object.c -+++ b/vm/memory_object.c -@@ -861,11 +861,13 @@ MACRO_END - } - - if (IP_VALID(reply_to)) { -+ memory_object_control_t pager_request = -+ object->pager_request; - vm_object_unlock(object); - - /* consumes our naked send-once/send right for reply_to */ - (void) memory_object_lock_completed(reply_to, reply_to_type, -- object->pager_request, original_offset, original_size); -+ pager_request, original_offset, original_size); - - vm_object_lock(object); - } --- -2.1.4 - diff --git a/debian/patches/fix-locking0009-fu_locking_issues.patch b/debian/patches/fix-locking0009-fu_locking_issues.patch deleted file mode 100644 index 8ec6a0c..0000000 --- a/debian/patches/fix-locking0009-fu_locking_issues.patch +++ /dev/null @@ -1,68 +0,0 @@ -From bf621bf5c983a1ebcd127488617adad1c05c763f Mon Sep 17 00:00:00 2001 -From: Justus Winter <4winter@informatik.uni-hamburg.de> -Date: Sun, 16 Aug 2015 15:08:06 +0200 -Subject: [PATCH gnumach 09/12] fu_locking_issues - ---- - vm/vm_object.c | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/vm/vm_object.c b/vm/vm_object.c -index 02f0ade..59e4959 100644 ---- a/vm/vm_object.c -+++ b/vm/vm_object.c -@@ -1491,14 +1491,11 @@ vm_object_t vm_object_copy_delayed( - * must be done carefully, to avoid deadlock. - */ - -- /* -- * Allocate a new copy object before locking, even -- * though we may not need it later. -- */ -+ vm_object_lock(src_object); - - new_copy = vm_object_allocate(src_object->size); - -- vm_object_lock(src_object); -+ vm_object_lock(new_copy); - - /* - * See whether we can reuse the result of a previous -@@ -1536,7 +1533,7 @@ vm_object_t vm_object_copy_delayed( - old_copy->ref_count++; - vm_object_unlock(old_copy); - vm_object_unlock(src_object); -- -+ vm_object_unlock(new_copy); - vm_object_deallocate(new_copy); - - return old_copy; -@@ -1591,7 +1588,7 @@ vm_object_t vm_object_copy_delayed( - } - - vm_object_unlock(src_object); -- -+ vm_object_unlock(new_copy); - return new_copy; - } - -@@ -1728,6 +1725,8 @@ void vm_object_shadow( - if ((result = vm_object_allocate(length)) == VM_OBJECT_NULL) - panic("vm_object_shadow: no object for shadowing"); - -+ vm_object_lock(result); -+ - /* - * The new object shadows the source object, adding - * a reference to it. Our caller changes his reference -@@ -1750,6 +1749,7 @@ void vm_object_shadow( - - *offset = 0; - *object = result; -+ vm_object_unlock(result); - } - - /* --- -2.1.4 - diff --git a/debian/patches/fix-locking0010-fu_locking_issues.patch b/debian/patches/fix-locking0010-fu_locking_issues.patch deleted file mode 100644 index d7e41c3..0000000 --- a/debian/patches/fix-locking0010-fu_locking_issues.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 567df96ae1f966f3edc02f5296fcb250b6b0a841 Mon Sep 17 00:00:00 2001 -From: Justus Winter <4winter@informatik.uni-hamburg.de> -Date: Sun, 16 Aug 2015 15:16:57 +0200 -Subject: [PATCH gnumach 10/12] fu_locking_issues - ---- - vm/vm_map.c | 22 +++++++++++++++++----- - 1 file changed, 17 insertions(+), 5 deletions(-) - -diff --git a/vm/vm_map.c b/vm/vm_map.c -index a26eaff..d4ae0f1 100644 ---- a/vm/vm_map.c -+++ b/vm/vm_map.c -@@ -2126,6 +2126,7 @@ start_pass_1: - for (entry = tmp_entry;;) { - vm_size_t sub_size = (entry->vme_end - entry->vme_start); - vm_map_entry_t next = entry->vme_next; -+ vm_object_t object; - - if ( ! (entry->protection & VM_PROT_WRITE)) { - vm_map_unlock(dst_map); -@@ -2161,10 +2162,13 @@ start_pass_1: - /* - * Check for permanent objects in the destination. - */ -- -- if ((entry->object.vm_object != VM_OBJECT_NULL) && -- !entry->object.vm_object->temporary) -- contains_permanent_objects = TRUE; -+ object = entry->object.vm_object; -+ if ((object != VM_OBJECT_NULL) -+ && ! contains_permanent_objects) { -+ vm_object_lock(object); -+ contains_permanent_objects = object->temporary; -+ vm_object_unlock(object); -+ } - - size -= sub_size; - entry = next; -@@ -2224,6 +2228,7 @@ start_pass_1: - vm_map_entry_t copy_entry = vm_map_copy_first_entry(copy); - vm_size_t copy_size = (copy_entry->vme_end - copy_entry->vme_start); - vm_object_t object; -+ int temporary; - - entry = tmp_entry; - size = (entry->vme_end - entry->vme_start); -@@ -2279,8 +2284,15 @@ start_pass_1: - */ - - object = entry->object.vm_object; -+ temporary = 0; -+ if (object != VM_OBJECT_NULL) { -+ vm_object_lock(object); -+ temporary = object->temporary; -+ vm_object_unlock(object); -+ } -+ - if (!entry->is_shared && -- ((object == VM_OBJECT_NULL) || object->temporary)) { -+ ((object == VM_OBJECT_NULL) || temporary)) { - vm_object_t old_object = entry->object.vm_object; - vm_offset_t old_offset = entry->offset; - --- -2.1.4 - diff --git a/debian/patches/fix-locking0011-fu_locking_issues.patch b/debian/patches/fix-locking0011-fu_locking_issues.patch deleted file mode 100644 index 94a3bbe..0000000 --- a/debian/patches/fix-locking0011-fu_locking_issues.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 3fb2fbdd20840b8b4c4d96fdd8946283ec33d73d Mon Sep 17 00:00:00 2001 -From: Justus Winter <4winter@informatik.uni-hamburg.de> -Date: Mon, 17 Aug 2015 14:04:51 +0200 -Subject: [PATCH gnumach 11/12] fu_locking_issues - ---- - vm/vm_map.c | 9 ++++++++- - 1 file changed, 8 insertions(+), 1 deletion(-) - -diff --git a/vm/vm_map.c b/vm/vm_map.c -index d4ae0f1..9098dfd 100644 ---- a/vm/vm_map.c -+++ b/vm/vm_map.c -@@ -3235,11 +3235,15 @@ kern_return_t vm_map_copyin( - /* - * Attempt non-blocking copy-on-write optimizations. - */ -- -+ if (src_object) -+ vm_object_lock(src_object); - if (src_destroy && - (src_object == VM_OBJECT_NULL || - (src_object->temporary && !src_object->use_shared_copy))) - { -+ if (src_object) -+ vm_object_unlock(src_object); -+ - /* - * If we are destroying the source, and the object - * is temporary, and not shared writable, -@@ -3259,6 +3263,9 @@ kern_return_t vm_map_copyin( - goto CopySuccessful; - } - -+ if (src_object) -+ vm_object_unlock(src_object); -+ - if (!was_wired && - vm_object_copy_temporary( - &new_entry->object.vm_object, --- -2.1.4 - diff --git a/debian/patches/fix-locking0012-fu_locking_issues.patch b/debian/patches/fix-locking0012-fu_locking_issues.patch deleted file mode 100644 index aa4b544..0000000 --- a/debian/patches/fix-locking0012-fu_locking_issues.patch +++ /dev/null @@ -1,158 +0,0 @@ -From 1ab69421a5da2ce82763244456ffc6ce102fac4d Mon Sep 17 00:00:00 2001 -From: Justus Winter <4winter@informatik.uni-hamburg.de> -Date: Mon, 17 Aug 2015 15:00:28 +0200 -Subject: [PATCH gnumach 12/12] fu_locking_issues - ---- - vm/memory_object.c | 7 ++++--- - vm/vm_fault.c | 39 ++++++++++++++++++++++++++++++--------- - vm/vm_object.c | 10 +++++----- - 3 files changed, 39 insertions(+), 17 deletions(-) - -diff --git a/vm/memory_object.c b/vm/memory_object.c -index 2f1cb1c..0a07429 100644 ---- a/vm/memory_object.c -+++ b/vm/memory_object.c -@@ -101,6 +101,7 @@ kern_return_t memory_object_data_supply( - vm_page_t *page_list; - boolean_t was_absent; - vm_map_copy_t orig_copy = data_copy; -+ pager_request_t pager_request; - - /* - * Look for bogus arguments -@@ -270,6 +271,7 @@ retry_lookup: - /* - * Send reply if one was requested. - */ -+ pager_request = object->pager_request; - vm_object_paging_end(object); - vm_object_unlock(object); - -@@ -279,7 +281,7 @@ retry_lookup: - if (IP_VALID(reply_to)) { - memory_object_supply_completed( - reply_to, reply_to_type, -- object->pager_request, -+ pager_request, - original_offset, - original_length, - result, -@@ -861,8 +863,7 @@ MACRO_END - } - - if (IP_VALID(reply_to)) { -- memory_object_control_t pager_request = -- object->pager_request; -+ pager_request_t pager_request = object->pager_request; - vm_object_unlock(object); - - /* consumes our naked send-once/send right for reply_to */ -diff --git a/vm/vm_fault.c b/vm/vm_fault.c -index 46779f6..101ebce 100644 ---- a/vm/vm_fault.c -+++ b/vm/vm_fault.c -@@ -229,6 +229,17 @@ vm_fault_return_t vm_fault_page( - boolean_t look_for_page; - vm_prot_t access_required; - -+ /* We need to unlock an object before making requests to a -+ memory manager. We use this object to temporarily store -+ object attributes needed for the request to avoid accessing -+ the object while it is unlocked. */ -+ struct -+ { -+ struct ipc_port * pager; -+ pager_request_t pager_request; -+ vm_offset_t paging_offset; -+ } obj; -+ - if (resume) { - vm_fault_state_t *state = - (vm_fault_state_t *) current_thread()->ith_other; -@@ -510,11 +521,16 @@ vm_fault_return_t vm_fault_page( - - new_unlock_request = m->unlock_request = - (access_required | m->unlock_request); -+ obj.pager = object->pager; -+ obj.pager_request = -+ object->pager_request; -+ obj.paging_offset = -+ object->paging_offset; - vm_object_unlock(object); - if ((rc = memory_object_data_unlock( -- object->pager, -- object->pager_request, -- offset + object->paging_offset, -+ obj.pager, -+ obj.pager_request, -+ offset + obj.paging_offset, - PAGE_SIZE, - new_unlock_request)) - != KERN_SUCCESS) { -@@ -633,6 +649,11 @@ vm_fault_return_t vm_fault_page( - m->absent = TRUE; - object->absent_count++; - -+ /* Save attributes for the request. */ -+ obj.pager = object->pager; -+ obj.pager_request = object->pager_request; -+ obj.paging_offset = object->paging_offset; -+ - /* - * We have a busy page, so we can - * release the object lock. -@@ -647,16 +668,16 @@ vm_fault_return_t vm_fault_page( - vm_stat_sample(SAMPLED_PC_VM_PAGEIN_FAULTS); - current_task()->pageins++; - -- if ((rc = memory_object_data_request(object->pager, -- object->pager_request, -- m->offset + object->paging_offset, -+ if ((rc = memory_object_data_request(obj.pager, -+ obj.pager_request, -+ m->offset + obj.paging_offset, - PAGE_SIZE, access_required)) != KERN_SUCCESS) { - if (rc != MACH_SEND_INTERRUPTED) - printf("%s(0x%p, 0x%p, 0x%lx, 0x%x, 0x%x) failed, %x\n", - "memory_object_data_request", -- object->pager, -- object->pager_request, -- m->offset + object->paging_offset, -+ obj.pager, -+ obj.pager_request, -+ m->offset + obj.paging_offset, - PAGE_SIZE, access_required, rc); - /* - * Don't want to leave a busy page around, -diff --git a/vm/vm_object.c b/vm/vm_object.c -index 59e4959..1d3e727 100644 ---- a/vm/vm_object.c -+++ b/vm/vm_object.c -@@ -545,9 +545,9 @@ void vm_object_terminate( - { - vm_page_t p; - vm_object_t shadow_object; -- memory_object_t pager; -- memory_object_control_t pager_request; -- memory_object_name_t pager_name; -+ struct ipc_port *pager; -+ pager_request_t pager_request; -+ struct ipc_port *pager_name; - #if MACH_PAGEMAP - vm_external_t existence_info; - #endif /* MACH_PAGEMAP */ -@@ -2104,8 +2104,8 @@ restart: - - if (must_init) { - vm_size_t pager_size; -- memory_object_control_t pager_request; -- memory_object_name_t pager_name; -+ pager_request_t pager_request; -+ struct ipc_port *pager_name; - - /* - * Copy the naked send right we were given. --- -2.1.4 - diff --git a/debian/patches/series b/debian/patches/series index e65e70f..029e46a 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -10,18 +10,6 @@ task-load.patch reorder-ipc_port.patch sysenter0001-yyy-sysenter-prototype.patch -fix-locking0001-vm-fix-locking-issues.patch -fix-locking0002-kern-disable-the-simple-lock-checks-while-debugging.patch -fix-locking0003-yyy-kern-improve-simple-lock-debugging.patch -fix-locking0004-yyy-kern-keep-track-of-the-writer-when-debugging-loc.patch -fix-locking0005-fu_locking-issues.patch -fix-locking0006-fu_locking_issues.patch -fix-locking0007-fu_locking_issues.patch -fix-locking0008-fu_locking_issues.patch -fix-locking0009-fu_locking_issues.patch -fix-locking0010-fu_locking_issues.patch -fix-locking0011-fu_locking_issues.patch -fix-locking0012-fu_locking_issues.patch 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 |