From a93b981fcb25ea049cec1bf4dff3e99c707275a7 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Fri, 20 Jun 2014 13:04:25 +0200 Subject: add mach5 proposal --- microkernel/mach/gnumach/projects.mdwn | 2 + microkernel/mach/gnumach/projects/mach_5.mdwn | 75 +++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 microkernel/mach/gnumach/projects/mach_5.mdwn diff --git a/microkernel/mach/gnumach/projects.mdwn b/microkernel/mach/gnumach/projects.mdwn index f4ef192a..62903fbe 100644 --- a/microkernel/mach/gnumach/projects.mdwn +++ b/microkernel/mach/gnumach/projects.mdwn @@ -35,6 +35,8 @@ so that no duplicate efforts end up. * [[Open Issues|tag/open_issue_gnumach]] + * [[Mach_5]] + * Update the core architecture and drivers * Check what NetBSD, FreeBSD and Linux do with their host specific code diff --git a/microkernel/mach/gnumach/projects/mach_5.mdwn b/microkernel/mach/gnumach/projects/mach_5.mdwn new file mode 100644 index 00000000..4f43a879 --- /dev/null +++ b/microkernel/mach/gnumach/projects/mach_5.mdwn @@ -0,0 +1,75 @@ +[[!meta copyright="Copyright © 2014 +Free Software Foundation, Inc."]] + +[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled [[GNU Free Documentation +License|/fdl]]."]]"""]] + +[[!tag open_issue_gnumach]] + +# The Mach5 proposal + +The Mach IPC mechanism is known to have deficiencies. Some of these +could be addressed with a new message ABI. A transition to 64-bit +architectures requires a new ABI definition anyway, so while we are at +it, we could straighten out some of these problems. + +This page is a place to keep track of such changes. + +## Protected payloads + +Protected payloads are a way of optimizing the receiver object lookup +in servers. A server may associate a payload with a receive right, +and any incoming message is tagged with it. The payload is an +pointer-wide unsigned integer, so the address of the associated server +side state can be used as payload. This removes the need for a hash +table lookup. + +### Required change to the message format + +Add a new field for the payload to the message header. + +### Implementation within the bounds of the Mach4 message format + +The payload can be provided in the same location as the local port +using an union. The kernel indicates this using a distinct message +type. MIG-generated code will detect this, and do the receiver lookup +using a specialized translation function. + +An almost complete prototype is available. + +* +* + +## Type descriptor rework + +A Mach4 message body contains pairs of type descriptors and values. +Each type descriptor describes the kind and amount of data that +immediately follows in the message stream. As the kernel has to +rewrite rights and pointers to out-of-band memory, it has to parse the +message. As type information and values are interleaved, it has to +iterate over the whole message. + +Furthermore, there are two kinds of type descriptors, mach_msg_type_t +and mach_msg_type_long_t. The reason for this is that the amount of +data that can be described using mach_msg_type_t is just 131072 byte. +This is because msgt_size is an 8-bit value describing the size of one +element in bits, and msgt_number is an 12-bit value describing the +number of items. + +### Required change to the message format + +Group the type descriptors together at the beginning of the message to +provide an index into the data. Provide the element size in multiple +of the native word size avoiding the need for long type descriptors. + +### Implementation within the bounds of the Mach4 message format + +The Mach4 type descriptor contains one unused bit. This bit can be +used to indicate that this message uses a Mach5 style index. MIG can +be modified to handle both cases for a smooth transition to the new +ABI. -- cgit v1.2.3 From bc82ad88a23387089a87de10cb598fec8a59eecb Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Wed, 4 May 2016 19:11:31 +0200 Subject: PP have been implemented in 1.5 --- microkernel/mach/gnumach/projects/mach_5.mdwn | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/microkernel/mach/gnumach/projects/mach_5.mdwn b/microkernel/mach/gnumach/projects/mach_5.mdwn index 4f43a879..0dc63228 100644 --- a/microkernel/mach/gnumach/projects/mach_5.mdwn +++ b/microkernel/mach/gnumach/projects/mach_5.mdwn @@ -40,10 +40,7 @@ using an union. The kernel indicates this using a distinct message type. MIG-generated code will detect this, and do the receiver lookup using a specialized translation function. -An almost complete prototype is available. - -* -* +This change has been implemented in GNU Mach and MIG 1.5. ## Type descriptor rework -- cgit v1.2.3 From 8c4febf4adc6397fd379560921906aabd69ef5ec Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Wed, 4 May 2016 19:31:05 +0200 Subject: Add flexible syscall interface --- microkernel/mach/gnumach/projects/mach_5.mdwn | 62 +++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/microkernel/mach/gnumach/projects/mach_5.mdwn b/microkernel/mach/gnumach/projects/mach_5.mdwn index 0dc63228..bf678556 100644 --- a/microkernel/mach/gnumach/projects/mach_5.mdwn +++ b/microkernel/mach/gnumach/projects/mach_5.mdwn @@ -40,6 +40,8 @@ using an union. The kernel indicates this using a distinct message type. MIG-generated code will detect this, and do the receiver lookup using a specialized translation function. +### Status + This change has been implemented in GNU Mach and MIG 1.5. ## Type descriptor rework @@ -70,3 +72,63 @@ The Mach4 type descriptor contains one unused bit. This bit can be used to indicate that this message uses a Mach5 style index. MIG can be modified to handle both cases for a smooth transition to the new ABI. + +### Status + +Not started. + +## Flexible syscall interface + +Currently, the GNU Mach kernel uses trap gates to enter the kernel (on +i386). We always suspected this mechanism to be slow, but afaik noone +quantified that. + +Tl;dr: sysenter is twice as fast as a trap gate (on my system). + +I have a prototype that allows one to enter the kernel using sysenter. +Here are the numbers: + + start sysenter: mach_print using [trap gate] [sysenter]. + Running 268435456(1U<<28) times mach_print("")... + using trap gate: 45s960000us 171.214342ns 5840632.202 (1/s) + using sysenter: 20s600000us 76.740980ns 13030847.379 (1/s) + Running 268435456(1U<<28) times mach_msg (NULL, ...)... + using glibc stub: 46s050000us 171.549618ns 5829217.286 (1/s) + using trap gate: 44s820000us 166.967511ns 5989189.112 (1/s) + using sysenter: 20s050000us 74.692070ns 13388302.045 (1/s) + exiting. + +So using sysenter is roughly 95ns faster. To put this into +perspective, sending a simple (ie. no ports/external data in body) +message takes ~950ns on my system. That suggests that merely using +sysenter improves our IPC performance by ~10%. + +### Implementation + +I'd like to implement something similar: + +1. There is a platform dependent way to map a special page. +2. That page contains a function that executes a syscall. + +This way we do not hardcode the system call method into the ABI. The +kernel selects one appropriate for the processor, and we are free to +change this interface anytime we want. + +### Required ABI changes + +None. We merely provide another way to call the kernel on existing +platforms. + +On i386, the 'platform dependent way' to get the syscall wrapper is to +use the current syscall mechanism to map a special device (the +"syscall" device, or "/dev/syscall" on the Hurd) similar to how the +mapped time interface works. + +### Status + +A prototype exists. + +### Discussions + +* + -- cgit v1.2.3 From fcd2b8755f1910478f2be63c9339b4c815f046ba Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Wed, 4 May 2016 19:33:52 +0200 Subject: Add missing paragraph --- microkernel/mach/gnumach/projects/mach_5.mdwn | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/microkernel/mach/gnumach/projects/mach_5.mdwn b/microkernel/mach/gnumach/projects/mach_5.mdwn index bf678556..73aaef99 100644 --- a/microkernel/mach/gnumach/projects/mach_5.mdwn +++ b/microkernel/mach/gnumach/projects/mach_5.mdwn @@ -105,6 +105,10 @@ sysenter improves our IPC performance by ~10%. ### Implementation +One trouble with sysenter/sysexit (or the amd equivalent) isn't +available on all processors. Linux solves this using the VDSO +mechanism. + I'd like to implement something similar: 1. There is a platform dependent way to map a special page. -- cgit v1.2.3 From d2a6e841c0eb10f6c6b7495d5c4644ca74bc4b21 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Mon, 23 May 2016 00:52:44 +0200 Subject: Add EIEIO --- faq/eieio.mdwn | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 faq/eieio.mdwn diff --git a/faq/eieio.mdwn b/faq/eieio.mdwn new file mode 100644 index 00000000..aa42c333 --- /dev/null +++ b/faq/eieio.mdwn @@ -0,0 +1,23 @@ +[[!meta copyright="Copyright © 2013 Free Software Foundation, Inc."]] + +[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled [[GNU Free Documentation +License|/fdl]]."]]"""]] + +[[!tag faq/running]] + +[[!meta title="`Computer bought the farm'... ERr, what?!"]] + + +This is the error message for EIEIO (pronounce E-I-E-I-O). This error code is +used for a variety of "hopeless" error conditions. Most probably you will +encounter it when a translator crashes while you were trying to use a file +that it serves. + +You can thus think of it as an equivalent of the "blue screen of the death" or +"Oops"... except that it's just an error! It doesn't take your whole system +away with it, only the particular operations that was going on. -- cgit v1.2.3 From 067c2d28a4836e40690ff78f13a3204e04ff5265 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 28 May 2016 12:37:57 +0200 Subject: update debian-ports URL --- community/gsoc/2013/hacklu.mdwn | 4 ++-- grub.mdwn | 2 +- hurd/dde/guide.mdwn | 4 ++-- hurd/running/debian/patch_submission.mdwn | 2 +- news/2009-10-31.mdwn | 4 ++-- news/2013-05-debian_gnu_hurd_2013.mdwn | 2 +- open_issues/gcc.mdwn | 12 ++++++------ 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/community/gsoc/2013/hacklu.mdwn b/community/gsoc/2013/hacklu.mdwn index d3e43dd6..43b4b59e 100644 --- a/community/gsoc/2013/hacklu.mdwn +++ b/community/gsoc/2013/hacklu.mdwn @@ -1062,8 +1062,8 @@ In context of [[open_issues/libpthread/t/fix_have_kernel_resources]]: package for glibc hacklu: which deb-src lines do you have? and piece of my source_list : deb - http://ftp.debian-ports.org/debian unreleased main deb-src - http://ftp.debian-ports.org/debian unreleased main + http://ftp.ports.debian.org/debian-ports unreleased main deb-src + http://ftp.ports.debian.org/debian-ports unreleased main you also need a deb-src line with the main archive deb-src http://cdn.debian.net/debian unstable main hacklu: Oh, hmm. And you did run »apt-get update« before? diff --git a/grub.mdwn b/grub.mdwn index 0f7e968a..d57f6231 100644 --- a/grub.mdwn +++ b/grub.mdwn @@ -161,7 +161,7 @@ supports the multiboot standard, necessary to boot the Hurd. antrik: I wrote the syslinux mailing list this morning, with details about some simple ways to download "ext2fs.static gnumach.gz initrd.gz and ld.so.1" from - http://ftp.debian-ports.org/debian-cd/hurd-i386/current/ and package them + http://ftp.ports.debian.org/debian-ports-cd/hurd-i386/current/ and package them to boot with the syslinux "mboot.c32" from iso9660. And showed them the proper kernel and module configuration lines from the netinstall's "grub.cfg". So I am hoping to get a reponse soon from Peter Alvin or G diff --git a/hurd/dde/guide.mdwn b/hurd/dde/guide.mdwn index 132b36ae..ab7ed324 100644 --- a/hurd/dde/guide.mdwn +++ b/hurd/dde/guide.mdwn @@ -43,9 +43,9 @@ Prepare apt offline configuration so we can get necessary packages: $ cd /mnt/etc/apt - $ echo "deb http://ftp.debian-ports.org/debian unreleased main" >> sources.list # if you don't have sources.list set up yet on the Hurd system + $ echo "deb http://ftp.ports.debian.org/debian-ports unreleased main" >> sources.list # if you don't have sources.list set up yet on the Hurd system - $ echo "deb-src http://ftp.debian-ports.org/debian unreleased main" >> sources.list + $ echo "deb-src http://ftp.ports.debian.org/debian-ports unreleased main" >> sources.list $ echo "deb http://ftp.uk.debian.org/debian unstable main" >> sources.list diff --git a/hurd/running/debian/patch_submission.mdwn b/hurd/running/debian/patch_submission.mdwn index 1dd8a4db..3146b773 100644 --- a/hurd/running/debian/patch_submission.mdwn +++ b/hurd/running/debian/patch_submission.mdwn @@ -49,7 +49,7 @@ the specified tags for the current user, and *X-Debbugs-CC* so that the In the bug description, mention that the package fails to build on hurd-i386 and (if possible) quote the failure. If possible, point to the failing build -log from or elsewhere. +log from or elsewhere. Then, explain the failure (Debian maintainers usually do not know much about Hurd-specific failures), and attach the patch. diff --git a/news/2009-10-31.mdwn b/news/2009-10-31.mdwn index db3537d0..23344a61 100644 --- a/news/2009-10-31.mdwn +++ b/news/2009-10-31.mdwn @@ -18,8 +18,8 @@ else="[[!paste id=full_news]]"]] [[!cut id="full_news" text=""" > This month Philip Charles created a new [installation -> CD](http://ftp.debian-ports.org/debian-cd/current/), the [L -> series](http://ftp.debian-ports.org/debian-cd/current/README-L1-disc-set), +> CD](http://ftp.ports.debian.org/debian-ports-cd/current/), the [L +> series](http://ftp.ports.debian.org/debian-ports-cd/hurd-i386/L1/README-L1-disc-set), > for the Hurd, which brings us a big step towards installing the Hurd from the > Hurd (without the need of a Linux-based installer). If you enjoy testing > stuff, please give it a try. diff --git a/news/2013-05-debian_gnu_hurd_2013.mdwn b/news/2013-05-debian_gnu_hurd_2013.mdwn index eda1ef53..c2d55651 100644 --- a/news/2013-05-debian_gnu_hurd_2013.mdwn +++ b/news/2013-05-debian_gnu_hurd_2013.mdwn @@ -25,7 +25,7 @@ This is a snapshot of Debian "sid" at the time of the Debian official Debian release, but it is an official Debian GNU/Hurd port release. The installation ISO images can be downloaded from -[Debian Ports](http://ftp.debian-ports.org/debian-cd/hurd-i386/current/) +[Debian Ports](http://ftp.ports.debian.org/debian-ports-cd/hurd-i386/current/) in the usual three Debian flavors: NETINST, CD, DVD. Besides the friendly Debian installer, a pre-installed disk image is also available, making it even easier to try Debian GNU/Hurd. diff --git a/open_issues/gcc.mdwn b/open_issues/gcc.mdwn index 999a6153..83533527 100644 --- a/open_issues/gcc.mdwn +++ b/open_issues/gcc.mdwn @@ -1812,7 +1812,7 @@ This runs for [[6 h 30 min|performance#measure]] on kepler.SCHWINGE and [[14 h 500 http://ftp.de.debian.org/debian/ unstable/main hurd-i386 Packages 100 /var/lib/dpkg/status 2.19-16~3 0 - 500 http://ftp.debian-ports.org/debian/ unreleased/main hurd-i386 Packages + 500 http://ftp.ports.debian.org/debian-ports/ unreleased/main hurd-i386 Packages hurd-libs0.3: Installiert: 1:0.6.git20151012-1 Installationskandidat: 1:0.6.git20151012-1 @@ -2479,7 +2479,7 @@ This runs for [[6 h 30 min|performance#measure]] on kepler.SCHWINGE and [[14 h *** 2.19-22 0 100 /var/lib/dpkg/status 2.19-16~3 0 - 500 http://ftp.debian-ports.org/debian/ unreleased/main hurd-i386 Packages + 500 http://ftp.ports.debian.org/debian-ports/ unreleased/main hurd-i386 Packages hurd: Installiert: 1:0.6.git20150704-2 Installationskandidat: 1:0.7.git20160214-2 @@ -2538,7 +2538,7 @@ This runs for [[6 h 30 min|performance#measure]] on kepler.SCHWINGE and [[14 h 500 http://ftp.de.debian.org/debian unstable/main hurd-i386 Packages 100 /var/lib/dpkg/status 2.19-16~3 500 - 500 http://ftp.debian-ports.org/debian unreleased/main hurd-i386 Packages + 500 http://ftp.ports.debian.org/debian-ports unreleased/main hurd-i386 Packages hurd: Installiert: 1:0.6.git20150704-2 Installationskandidat: 1:0.7.git20160214-2 @@ -2597,7 +2597,7 @@ This runs for [[6 h 30 min|performance#measure]] on kepler.SCHWINGE and [[14 h 500 http://ftp.de.debian.org/debian unstable/main hurd-i386 Packages 100 /var/lib/dpkg/status 2.19-16~3 500 - 500 http://ftp.debian-ports.org/debian unreleased/main hurd-i386 Packages + 500 http://ftp.ports.debian.org/debian-ports unreleased/main hurd-i386 Packages hurd: Installed: 1:0.6.git20150704-2 Candidate: 1:0.7.git20160214-2 @@ -2655,7 +2655,7 @@ This runs for [[6 h 30 min|performance#measure]] on kepler.SCHWINGE and [[14 h 500 http://ftp.de.debian.org/debian unstable/main hurd-i386 Packages 100 /var/lib/dpkg/status 2.19-16~3 500 - 500 http://ftp.debian-ports.org/debian unreleased/main hurd-i386 Packages + 500 http://ftp.ports.debian.org/debian-ports unreleased/main hurd-i386 Packages hurd: Installiert: 1:0.7.git20160214-2 Installationskandidat: 1:0.7.git20160214-2 @@ -2716,7 +2716,7 @@ This runs for [[6 h 30 min|performance#measure]] on kepler.SCHWINGE and [[14 h 500 http://ftp.de.debian.org/debian unstable/main hurd-i386 Packages 100 /var/lib/dpkg/status 2.19-16~3 500 - 500 http://ftp.debian-ports.org/debian unreleased/main hurd-i386 Packages + 500 http://ftp.ports.debian.org/debian-ports unreleased/main hurd-i386 Packages hurd: Installed: 1:0.6.git20150704-2 Candidate: 1:0.7.git20160214-2 -- cgit v1.2.3 From 227767728a20496a7581b9e96c61684db0f808ae Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Mon, 30 May 2016 21:36:07 +0200 Subject: tips to avoid building the whole libc --- hurd/debugging/glibc.mdwn | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/hurd/debugging/glibc.mdwn b/hurd/debugging/glibc.mdwn index 14140fdb..69a3beda 100644 --- a/hurd/debugging/glibc.mdwn +++ b/hurd/debugging/glibc.mdwn @@ -35,6 +35,29 @@ There is a list of [[known failures|open_issues/glibc]]. --- +When building the debian glibc, to save yourself a double-compilation, use + + GLIBC_PASSES=libc DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage + +To save even more build, stop the build after configure has run, and then you +can restart the build of only libc.so with: + + cd build-tree/hurd-i386-libc + make lib + +or of the whole tree with: + + cd build-tree/hurd-i386-libc + make + +or of just one subdir with for instance: + + make subdir=libpthread -C libpthread ..=../ objdir=$PWD/build-tree/hurd-i386-libc + +(note that most subdirs need libc.so built) + +--- + If you've been doing simple changes to glibc functions that end up in `libc.so`, you may test them like this (like for a `strerror_l` implementation in this case): -- cgit v1.2.3 From cf7f797bcbfdd7b466153fe93cb3bb42facf3224 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Mon, 30 May 2016 22:07:53 +0200 Subject: GLIBC_PASSES doesn't actually work --- hurd/debugging/glibc.mdwn | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hurd/debugging/glibc.mdwn b/hurd/debugging/glibc.mdwn index 69a3beda..d3698256 100644 --- a/hurd/debugging/glibc.mdwn +++ b/hurd/debugging/glibc.mdwn @@ -35,9 +35,11 @@ There is a list of [[known failures|open_issues/glibc]]. --- -When building the debian glibc, to save yourself a double-compilation, use +When building the debian glibc, to save yourself a double-compilation, comment +in debian/sysdeps/hurd-i386.mk the lines about xen. Then to avoid the whole +testsuite, use: - GLIBC_PASSES=libc DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage + DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage To save even more build, stop the build after configure has run, and then you can restart the build of only libc.so with: -- cgit v1.2.3 From e25d4ea07b09e7e6df61777988c1fc104f0a538e Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 4 Jun 2016 20:45:18 +0200 Subject: trick to build only libc.so --- hurd/debugging/glibc.mdwn | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hurd/debugging/glibc.mdwn b/hurd/debugging/glibc.mdwn index d3698256..dfc4c1c6 100644 --- a/hurd/debugging/glibc.mdwn +++ b/hurd/debugging/glibc.mdwn @@ -42,11 +42,15 @@ testsuite, use: DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage To save even more build, stop the build after configure has run, and then you -can restart the build of only libc.so with: +can restart the build of only libc.so and libc.a with: cd build-tree/hurd-i386-libc make lib +or of only libc.so with: + + make objdir=$PWD/build-tree/hurd-i386-libc $PWD/build-tree/hurd-i386-libc/libc.so + or of the whole tree with: cd build-tree/hurd-i386-libc -- cgit v1.2.3