[PATCH 23/23] XXX i broke rpctrace

2013-11-28 Thread Justus Winter
If we cannot get this to work with protected payloads, we can always add a switch to libports to disable the optimization. --- utils/rpctrace.c | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/utils/rpctrace.c b/utils/rpctrace.c index ef7ab53..035a3fd 1006

[PATCH 20/23] libports: use protected payloads to optimize the object lookup

2013-11-28 Thread Justus Winter
* libports/create-internal.c (_ports_create_port_internal): Set the protected payload to the objects address. * libports/import-port.c (ports_import_port): Likewise. * libports/reallocate-from-external.c (ports_reallocate_from_external): Likewise. * libports/reallocate-port.c (ports_reallocate_

[PATCH 15/23] proc: add a payload-aware intrans function

2013-11-28 Thread Justus Winter
* proc/mig-decls.h (begin_using_exc_payload): New function. * proc/proc_exc.defs (exception_t): Add payload-aware in-translator function. --- proc/mig-decls.h |6 ++ proc/proc_exc.defs |1 + 2 files changed, 7 insertions(+) diff --git a/proc/mig-decls.h b/proc/mig-decls.h index 0d

[PATCH 21/23] XXX libports: clear payload prior to port destruction

2013-11-28 Thread Justus Winter
It is unclear if this is really necessary. --- libports/complete-deallocate.c |1 + libports/destroy-right.c |3 +++ 2 files changed, 4 insertions(+) diff --git a/libports/complete-deallocate.c b/libports/complete-deallocate.c index 8ce095b..6de97e3 100644 --- a/libports/complete-de

[PATCH 14/23] trans: add a payload-aware intrans function to password

2013-11-28 Thread Justus Winter
* trans/Makefile (password-MIGSFLAGS): Add mutator. --- trans/Makefile |1 + 1 file changed, 1 insertion(+) diff --git a/trans/Makefile b/trans/Makefile index c0386d0..fa2 100644 --- a/trans/Makefile +++ b/trans/Makefile @@ -34,6 +34,7 @@ LDLIBS += -lpthread password-LDLIBS = $(LIBCRYPT)

[PATCH 16/23] init: disable default payload to port mapping

2013-11-28 Thread Justus Winter
init does not use libports. Therefor, it is not necessary to use the default payload to port translation function. * init/Makefile (MIGSFLAGS): Disable the default payload to port translation function. --- init/Makefile |4 1 file changed, 4 insertions(+) diff --git a/init/Makefile b/

[PATCH 18/23] libports: add ports_payload_get_name

2013-11-28 Thread Justus Winter
This function maps payloads back to port names. This can be used as intranspayload functions in situations where the server function expects a port name. * libports/ports.h: Add function ports_payload_get_name. --- libports/ports.h | 12 1 file changed, 12 insertions(+) diff --git

[PATCH 19/23] hurd: add intranpayload functions to all hurd types

2013-11-28 Thread Justus Winter
For each hurd type defined in hurd_types.h, add a intranpayload function. If an X_INTRAN mutation is defined for a type, a corresponding X_INTRAN_PAYLOAD has to be defined. If no X_INTRAN mutation is defined, use ports_payload_get_name as intranpayload function, turning the payload back into an p

[PATCH 11/23] pfinet: add a payload-aware intrans functions

2013-11-28 Thread Justus Winter
* pfinet/mutations.h: Add mutators. * pfinet/misc.c (begin_using_socket_payload): New function. (begin_using_sockaddr_payload): Likewise. * pfinet/pfinet.h (begin_using_socket_payload): New declaration. (begin_using_sockaddr_payload): Likewise. --- pfinet/misc.c | 12 pfinet/mu

[PATCH 17/23] trans: disable default payload to port mapping in fsysServer.c

2013-11-28 Thread Justus Winter
fsysServer.o is only used by the symlink translator which does not use libports. Therefor, it is not necessary to use the default payload to port translation function. * trans/Makefile (fsys-MIGSFLAGS): Disable the default payload to port translation function. --- trans/Makefile |4 1

[PATCH 22/23] Fix build

2013-11-28 Thread Justus Winter
--- libports/Makefile |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libports/Makefile b/libports/Makefile index 934b151..7055901 100644 --- a/libports/Makefile +++ b/libports/Makefile @@ -42,7 +42,7 @@ installhdrs = ports.h HURDLIBS= ihash LDLIBS += -lpthread -OBJS = $

[PATCH 12/23] pflocal: add a payload-aware intrans functions

2013-11-28 Thread Justus Winter
* pflocal/mig-mutate.h: Add mutators. * pflocal/mig-decls.c (begin_using_sock_user_payload): New function. (begin_using_addr_payload): Likewise. --- pflocal/mig-decls.h | 12 pflocal/mig-mutate.h |3 +++ 2 files changed, 15 insertions(+) diff --git a/pflocal/mig-decls.h b/pflo

[PATCH 13/23] auth: add a payload-aware intrans function

2013-11-28 Thread Justus Winter
* auth/authmutations.h: Add mutator. * auth/auth_mig.h (auth_payload_to_handle): New declaration. * auth/auth.c (auth_payload_to_handle): New function. * utils/fakeauth.c (auth_payload_to_handle): Likewise. --- auth/auth.c |6 ++ auth/auth_mig.h |1 + auth/authmutations.h

[PATCH 04/23] proc: add a payload-aware intrans function

2013-11-28 Thread Justus Winter
* proc/Makefile (MIGSFLAGS): Add mutator. * proc/hash.c (reqport_find_payload): New function. * proc/proc.h (reqport_find_payload): New declaration. --- proc/Makefile |1 + proc/hash.c | 10 ++ proc/proc.h |1 + 3 files changed, 12 insertions(+) diff --git a/proc/Makefile b/

[PATCH 09/23] libcons: add a payload-aware intrans function

2013-11-28 Thread Justus Winter
* libcons/mutations.h: Add mutator. * libcons/priv.h (begin_using_notify_payload): New function. --- libcons/mutations.h |1 + libcons/priv.h |6 ++ 2 files changed, 7 insertions(+) diff --git a/libcons/mutations.h b/libcons/mutations.h index c895447..4751340 100644 --- a/libcons

[PATCH 06/23] libdiskfs: add a payload-aware intrans function

2013-11-28 Thread Justus Winter
* libdiskfs/diskfs.h (diskfs_begin_using_protid_payload): New function. * libdiskfs/fsmutations.h: Add mutator. --- libdiskfs/diskfs.h |9 + libdiskfs/fsmutations.h |2 ++ 2 files changed, 11 insertions(+) diff --git a/libdiskfs/diskfs.h b/libdiskfs/diskfs.h index 22262aa..6b

[PATCH 08/23] libtrivfs: add a payload-aware intrans functions

2013-11-28 Thread Justus Winter
* libtrivfs/fsmutations.h: Add mutators. * libtrivfs/migsupport.c (trivfs_begin_using_protid_payload): New function. (trivfs_begin_using_control_payload): Likewise. * libtrivfs/trivfs.h (trivfs_begin_using_protid_payload): New declaration. (trivfs_begin_using_control_payload): Likewise. --- libtri

[PATCH 10/23] exec: add intranspayload

2013-11-28 Thread Justus Winter
* exec/execmutations.h: Add FILE_INTRAN_PAYLOAD mutation. --- exec/execmutations.h |1 + 1 file changed, 1 insertion(+) diff --git a/exec/execmutations.h b/exec/execmutations.h index 96b4772..52a36c6 100644 --- a/exec/execmutations.h +++ b/exec/execmutations.h @@ -1,6 +1,7 @@ /* CPP definiti

[PATCH 03/23] libports: add ports_lookup_payload

2013-11-28 Thread Justus Winter
* libports/lookup-payload.c: New file. * libports/ports.h (ports_lookup_payload): Add declaration. * libports/Makefile (SRCS): Add lookup-payload.c. --- libports/Makefile |2 +- libports/lookup-payload.c | 44 libports/ports.h |

[PATCH 02/23] proc: fix the receiver lookup in S_proc_exception_raise

2013-11-28 Thread Justus Winter
* proc/mgt.c (S_proc_exception_raise): Update accordingly. * proc/mig-decls.h: New file. * proc/proc_exc.defs: Add translation functions. --- proc/mgt.c |7 ++- proc/mig-decls.h | 42 ++ proc/proc_exc.defs |8 +++- 3 files changed

[PATCH 05/23] console: add a payload-aware intrans function

2013-11-28 Thread Justus Winter
* console/priv.h (begin_using_protid_payload): New function. * console/mutations.h: Add mutator. --- console/mutations.h |1 + console/priv.h |6 ++ 2 files changed, 7 insertions(+) diff --git a/console/mutations.h b/console/mutations.h index 5f26672..26f9dc2 100644 --- a/console

[PATCH 07/23] libnetfs: add a payload-aware intrans function

2013-11-28 Thread Justus Winter
* libnetfs/priv.h (begin_using_protid_payload): New function. * libnetfs/mutations.h: Add mutator. --- libnetfs/mutations.h |2 ++ libnetfs/priv.h |6 ++ 2 files changed, 8 insertions(+) diff --git a/libnetfs/mutations.h b/libnetfs/mutations.h index e6700f5..f3e7209 100644 --- a/

[PATCH 01/23] trans: fix the receiver lookup in password

2013-11-28 Thread Justus Winter
Use translation functions instead of doing the lookup manually. * trans/Makefile (password-MIGSFLAGS): Add mutators. * trans/password.c (S_password_check_user): Update accordingly. (S_password_check_group): Likewise. --- trans/Makefile |6 +- trans/password.c | 30 ++--

[PATCH 5/5] Use inTransPayload

2013-11-28 Thread Justus Winter
An inTransPayload function maps payloads to objects, like an inTrans function maps from port names to objects. Generate code in the server routine to optimize lookups to the receiver of the message. Additionally, if no intran function is provided, but an intranpayload function is, it is expected

[PATCH] Drop the auto keyword

2013-11-28 Thread Justus Winter
Drop the auto keyword from the generated source code. auto is the default storage type for variables anyway and it is customary to omit it. * utils.c (WriteCheckDecl): Drop auto from generated source. (WriteStaticLongDecl): Likewise. (WriteStaticShortDecl): Likewise. --- utils.c |6 +++--- 1

[PATCH 1/5] Advise flex not to generate the input function

2013-11-28 Thread Justus Winter
This avoids a warning about input being unused. * lexxer.l: Define YY_NO_INPUT. --- lexxer.l |3 +++ 1 file changed, 3 insertions(+) diff --git a/lexxer.l b/lexxer.l index 6686b55..5f2f61e 100644 --- a/lexxer.l +++ b/lexxer.l @@ -50,6 +50,9 @@ FileName ({QString}|{AString}) #include "l

[PATCH 2/5] Avoid a compiler warning in WriteDefines

2013-11-28 Thread Justus Winter
* header.c (WriteDefines): Avoid warning about unused parameter. --- header.c |1 + 1 file changed, 1 insertion(+) diff --git a/header.c b/header.c index 150412a..1bc570f 100644 --- a/header.c +++ b/header.c @@ -41,6 +41,7 @@ WriteIncludes(FILE *file) static void WriteDefines(FILE *file) {

[PATCH 4/5] Clean up generated sources

2013-11-28 Thread Justus Winter
* Makefile (CLEANFILES): Add generated source files lexxer.c and parser.c. --- Makefile.am |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 33bc768..3e6dfcf 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,7 +5,7 @@ bin_SCRIPTS = mig EXTRA_D

[PATCH 3/5] Add inTransPayload

2013-11-28 Thread Justus Winter
--- lexxer.l |1 + parser.h |1 + parser.y | 17 + type.c | 10 +- type.h |2 ++ 5 files changed, 30 insertions(+), 1 deletion(-) diff --git a/lexxer.l b/lexxer.l index 5f2f61e..7ff5677 100644 --- a/lexxer.l +++ b/lexxer.l @@ -138,6 +138,7 @@ static voi

[PATCH 6/8] ipc: provide the protected payload in ipc_kmsg_copyout_header

2013-11-28 Thread Justus Winter
* ipc/ipc_kmsg.c (ipc_kmsg_copyout_header): If a protected payload is set for the destination port, provide it in msgh_protected_payload. --- ipc/ipc_kmsg.c | 58 +++- 1 file changed, 45 insertions(+), 13 deletions(-) diff --git a/ipc/ipc_km

[PATCH 8/8] XXX fix the size of ipc_port structs

2013-11-28 Thread Justus Winter
I do not know why this is happening, but w/o this, some kernel pointers leak into the ip_protected_payload field. So it looks like sizeof(struct ipc_tree_entry) is wrong here, not sure why though. Maybe the global header is imported? But the compiler flags should prevent this... --- ipc/ipc_init.c

[PATCH 5/8] include: define MACH_MSG_TYPE_PROTECTED_PAYLOAD

2013-11-28 Thread Justus Winter
* include/mach/message.h: Define MACH_MSG_TYPE_PROTECTED_PAYLOAD. (MACH_MSG_TYPE_LAST): Adjust accordingly. --- include/mach/message.h |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/mach/message.h b/include/mach/message.h index 7464a57..0a7297e 100644 --- a/inclu

[PATCH 7/8] ipc: clear the payload when moving a receive port

2013-11-28 Thread Justus Winter
Clear the protected payload when a receive port is moved from one ipc space to another. This is done to retain the old behavior of mach_msg, so that a port name is sent in the msgh_local_port field. If the new owner of that receive right wishes to use the protected payload mechanism, it has to be

[PATCH 2/8] ipc: add protected payload

2013-11-28 Thread Justus Winter
* ipc/ipc_port.c (ipc_port_init): Initialize protected_payload. (ipc_port_print): Print protected_payload. (ipc_port_set_protected_payload): New function. * ipc/ipc_port.h (struct ipc_port): Add field protected_payload. (ipc_port_set_protected_payload): Add function declaration. --- ipc/ipc_port.c

[PATCH 1/8] include: skip routines related to migrating threads

2013-11-28 Thread Justus Winter
* include/mach/mach_port.defs: Skip the routines mach_port_set_rpcinfo and mach_port_create_act if MIGRATING_THREADS is not defined. --- include/mach/mach_port.defs |5 + 1 file changed, 5 insertions(+) diff --git a/include/mach/mach_port.defs b/include/mach/mach_port.defs index e1f45e3

[PATCH 3/8] ipc: implement mach_port_set_protected_payload

2013-11-28 Thread Justus Winter
* include/mach/mach_port.defs: Add mach_port_set_protected_payload. * ipc/mach_port.c: Implement mach_port_set_protected_payload. --- include/mach/mach_port.defs |9 + ipc/mach_port.c | 37 + 2 files changed, 46 insertions(+) diff --gi

[PATCH 4/8] include: add msgh_protected_payload to mach_msg_header_t

2013-11-28 Thread Justus Winter
* include/mach/message.h (mach_msg_header_t): Add msgh_protected_payload as a union with msgh_local_port. --- include/mach/message.h |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/mach/message.h b/include/mach/message.h index f78e978..7464a57 100644 --- a/incl

Re: [PATCH] libfshelp: improve error handling in fshelp_start_translator_long

2013-11-28 Thread Samuel Thibault
Justus Winter, le Thu 28 Nov 2013 13:11:44 +0100, a écrit : > Properly deallocate all ports and terminate the started translator if > an error occurs. > > * libfshelp/start-translator-long.c (fshelp_start_translator_long): > Improve error handling. Ack. > --- > libfshelp/start-translator-long

[PATCH] libfshelp: improve error handling in fshelp_start_translator_long

2013-11-28 Thread Justus Winter
Properly deallocate all ports and terminate the started translator if an error occurs. * libfshelp/start-translator-long.c (fshelp_start_translator_long): Improve error handling. --- libfshelp/start-translator-long.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --gi