commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnumach] 01/03: Add upstream improvements


From: Samuel Thibault
Subject: [gnumach] 01/03: Add upstream improvements
Date: Wed, 01 Jan 2014 16:57:43 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch master
in repository gnumach.

commit 36b54ac2ab38fbbbb517a53bc98a6c530092099d
Author: Samuel Thibault <address@hidden>
Date:   Wed Jan 1 13:35:48 2014 +0000

    Add upstream improvements
    
      * patches/kentry_data_size.patch: New patch to increase KENTRY_DATA_SIZE.
      * patches/thread_terminate_release.patch: New patch to add
        thread_terminate_release RPC.
      * patches/xen_clock_overflow.patch: New patch to fix Xen clock 
computation.
---
 debian/changelog                              |   9 +++
 debian/patches/00_clean_gfdl.patch            |  15 ----
 debian/patches/kentry_data_size.patch         |  21 +++++
 debian/patches/series                         |   3 +
 debian/patches/thread_terminate_release.patch | 112 ++++++++++++++++++++++++++
 debian/patches/xen_clock_overflow.patch       |  33 ++++++++
 6 files changed, 178 insertions(+), 15 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 079438b..d5a158e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+gnumach (2:1.4-2) unstable; urgency=medium
+
+  * patches/kentry_data_size.patch: New patch to increase KENTRY_DATA_SIZE.
+  * patches/thread_terminate_release.patch: New patch to add
+    thread_terminate_release RPC.
+  * patches/xen_clock_overflow.patch: New patch to fix Xen clock computation.
+
+ -- Samuel Thibault <address@hidden>  Wed, 01 Jan 2014 13:34:07 +0000
+
 gnumach (2:1.4-1) unstable; urgency=low
 
   [ Samuel Thibault ]
diff --git a/debian/patches/00_clean_gfdl.patch 
b/debian/patches/00_clean_gfdl.patch
deleted file mode 100644
index 05e2a87..0000000
--- a/debian/patches/00_clean_gfdl.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-Mach's GFDL documentation is not DFSG-free, we need to drop the build rules.
-
-Index: b/Makefile.am
-===================================================================
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -117,7 +117,7 @@ include Makefrag.am
- include tests/Makefrag.am
- 
- # Documentation.
--include doc/Makefrag.am
-+#include doc/Makefrag.am
- 
- #
- # Kernel Image
diff --git a/debian/patches/kentry_data_size.patch 
b/debian/patches/kentry_data_size.patch
new file mode 100644
index 0000000..a6138eb
--- /dev/null
+++ b/debian/patches/kentry_data_size.patch
@@ -0,0 +1,21 @@
+commit dd0989ad8e7526844fcbc2e26bbcc4cc37a010ac
+Author: Richard Braun <address@hidden>
+Date:   Thu Oct 10 20:21:17 2013 +0200
+
+    Increase kernel map entry pool size
+    
+    * vm/vm_map.h (KENTRY_DATA_SIZE): Set to 256 pages.
+
+diff --git a/vm/vm_map.h b/vm/vm_map.h
+index 5fdac4e..1caf9ae 100644
+--- a/vm/vm_map.h
++++ b/vm/vm_map.h
+@@ -55,7 +55,7 @@
+ #include <kern/macro_help.h>
+ 
+ /* TODO: make it dynamic */
+-#define KENTRY_DATA_SIZE (64*PAGE_SIZE)
++#define KENTRY_DATA_SIZE (256*PAGE_SIZE)
+ 
+ /*
+  *    Types defined:
diff --git a/debian/patches/series b/debian/patches/series
index 7ac3565..f96d3fa 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,6 @@
 60_bigmem.patch
 70_dde.patch
 80_missing_files.patch
+kentry_data_size.patch
+thread_terminate_release.patch
+xen_clock_overflow.patch
diff --git a/debian/patches/thread_terminate_release.patch 
b/debian/patches/thread_terminate_release.patch
new file mode 100644
index 0000000..bd76488
--- /dev/null
+++ b/debian/patches/thread_terminate_release.patch
@@ -0,0 +1,112 @@
+commit 22495036a354e209a7f2085bdd2e1fc82895208b
+Author: Richard Braun <address@hidden>
+Date:   Sun Nov 24 11:17:54 2013 +0100
+
+    New RPC for thread destruction
+    
+    A new call, thread_terminate_release, is added to support self
+    destruction in threading libraries.
+    
+    * include/mach/gnumach.defs (thread_terminate_release): New
+    simpleroutine declaration.
+    * kern/thread.c: Include vm/vm_user.h and ipc/mach_port.h.
+    (thread_terminate_release): New function.
+    * kern/thread.h (thread_terminate_release): New prototype.
+
+diff --git a/include/mach/gnumach.defs b/include/mach/gnumach.defs
+index 7331334..12c4e99 100644
+--- a/include/mach/gnumach.defs
++++ b/include/mach/gnumach.defs
+@@ -37,3 +37,29 @@ type vm_cache_statistics_data_t = struct[11] of integer_t;
+ routine vm_cache_statistics(
+               target_task     : vm_task_t;
+       out     vm_cache_stats  : vm_cache_statistics_data_t);
++
++/*
++ * Terminate a thread and release rights and memory.
++ *
++ * Intended to be used by threading libraries to provide a clean way for
++ * threads to terminate themselves. The resources a thread wouldn't be able
++ * to release without this call when terminating itself are its
++ * last reference to its kernel port, its reply port, and its stack.
++ *
++ * This call is semantically equivalent to :
++ *  - mach_port_deallocate(task, thread_name);
++ *  - if (reply_port != MACH_PORT_NULL)
++ *      mach_port_destroy(task, reply_port);
++ *  - if ((address != 0) || (size != 0))
++ *      vm_deallocate(task, address, size)
++ *  - thread_terminate(thread)
++ *
++ * Implemented as a simple routine so a reply port isn't required.
++ */
++simpleroutine thread_terminate_release(
++              thread          : thread_t;
++              task            : task_t;
++              thread_name     : mach_port_name_t;
++              reply_port      : mach_port_name_t;
++              address         : vm_address_t;
++              size            : vm_size_t);
+diff --git a/kern/thread.c b/kern/thread.c
+index eb8a8bb..67fd41e 100644
+--- a/kern/thread.c
++++ b/kern/thread.c
+@@ -57,9 +57,11 @@
+ #include <kern/slab.h>
+ #include <kern/mach_clock.h>
+ #include <vm/vm_kern.h>
++#include <vm/vm_user.h>
+ #include <ipc/ipc_kmsg.h>
+ #include <ipc/ipc_port.h>
+ #include <ipc/mach_msg.h>
++#include <ipc/mach_port.h>
+ #include <machine/machspl.h>          /* for splsched */
+ #include <machine/pcb.h>
+ #include <machine/thread.h>           /* for MACHINE_STACK */
+@@ -850,6 +852,28 @@ kern_return_t thread_terminate(
+       return KERN_SUCCESS;
+ }
+ 
++kern_return_t thread_terminate_release(
++      thread_t thread,
++      task_t task,
++      mach_port_t thread_name,
++      mach_port_t reply_port,
++      vm_offset_t address,
++      vm_size_t size)
++{
++      if (task == NULL)
++              return KERN_INVALID_ARGUMENT;
++
++      mach_port_deallocate(task->itk_space, thread_name);
++
++      if (reply_port != MACH_PORT_NULL)
++              mach_port_destroy(task->itk_space, reply_port);
++
++      if ((address != 0) || (size != 0))
++              vm_deallocate(task->map, address, size);
++
++      return thread_terminate(thread);
++}
++
+ /*
+  *    thread_force_terminate:
+  *
+diff --git a/kern/thread.h b/kern/thread.h
+index 3959dfc..beb2dbc 100644
+--- a/kern/thread.h
++++ b/kern/thread.h
+@@ -259,6 +259,13 @@ extern kern_return_t      thread_create(
+       thread_t        *child_thread);
+ extern kern_return_t  thread_terminate(
+       thread_t        thread);
++extern kern_return_t  thread_terminate_release(
++      thread_t        thread,
++      task_t          task,
++      mach_port_t     thread_name,
++      mach_port_t     reply_port,
++      vm_offset_t     address,
++      vm_size_t       size);
+ extern kern_return_t  thread_suspend(
+       thread_t        thread);
+ extern kern_return_t  thread_resume(
diff --git a/debian/patches/xen_clock_overflow.patch 
b/debian/patches/xen_clock_overflow.patch
new file mode 100644
index 0000000..ce83da5
--- /dev/null
+++ b/debian/patches/xen_clock_overflow.patch
@@ -0,0 +1,33 @@
+commit e2dde67c3f46f5bbe7deb90e52b61977df30a52c
+Author: Vladimir 'φ-coder/phcoder' Serbinenko <address@hidden>
+Date:   Sat Nov 9 18:52:21 2013 +0100
+
+    Fix overflow in Xen clock computation
+    
+    * xen/time.c (hyp_get_stime): Split `delta` into `delta_high` and
+    `delta_low`, as it may overflow 4 second timing nowadays.
+
+diff --git a/xen/time.c b/xen/time.c
+index a11e7eb..93d87d4 100644
+--- a/xen/time.c
++++ b/xen/time.c
+@@ -34,6 +34,7 @@ static unsigned64_t lastnsec;
+ static unsigned64_t hyp_get_stime(void) {
+       unsigned32_t version;
+       unsigned64_t cpu_clock, last_cpu_clock, delta, system_time;
++      unsigned64_t delta_high, delta_low;
+       unsigned32_t mul;
+       signed8_t shift;
+       volatile struct vcpu_time_info *time = 
&hyp_shared_info.vcpu_info[0].time;
+@@ -54,7 +55,10 @@ static unsigned64_t hyp_get_stime(void) {
+               delta >>= -shift;
+       else
+               delta <<= shift;
+-      return system_time + ((delta * (unsigned64_t) mul) >> 32);
++      delta_high = delta >> 32;
++      delta_low = (unsigned32_t) delta;
++      return system_time + ((delta_low * (unsigned64_t) mul) >> 32)
++        + (delta_high * (unsigned64_t) mul);
+ }
+ 
+ unsigned64_t hyp_get_time(void) {

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-hurd/gnumach.git



reply via email to

[Prev in Thread] Current Thread [Next in Thread]