[Top][All Lists]

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

Re: [PATCH mig] Make MIG work for pure 64 bit kernel and userland.

From: Flávio Cruz
Subject: Re: [PATCH mig] Make MIG work for pure 64 bit kernel and userland.
Date: Sun, 12 Feb 2023 12:29:28 -0500

On Sun, Feb 12, 2023 at 11:34 AM Luca <luca@orpolo.org> wrote:
Il 12/02/23 17:05, Sergey Bugaev ha scritto:
> On Sun, Feb 12, 2023 at 7:01 PM Luca <luca@orpolo.org> wrote:
>> It seems XNU's mig [0] always sets the alignment to natural_t (=4) with
>> a #pragma... I still have to understand how they handle these issues.
> Please note that XNU uses "untyped messaging", and Apple's version of
> MIG is "untyped MIG". They don't have the kernel parse the message
> body, it just passes it to the receiver task as a blob, where it's up
> to MIG again to make sense of it.

It seems the body is parsed more or less in the same way as in gnumach,
at least to translate ports. Other fields seems just forwarded to the
mig stubs, also as in gnumach. Could you be more specific about the
"untyped messaging"?

From a cursory look at their code, they copy the arguments into the stack, which allows the compiler to ensure the correct alignment (plus using memcpy for arrays). Note that they also ensure all the message structs (including mach_msg_header_t) are defined as 4-byte aligned which ensures that the kernel sees the correct layout. I think this could work here too but not sure what would give us the best performance.


reply via email to

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