[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 (V2)
From: |
Samuel Thibault |
Subject: |
Re: [PATCH mig] Make MIG work for pure 64 bit kernel and userland (V2) |
Date: |
Sun, 12 Feb 2023 19:31:11 +0100 |
User-agent: |
NeoMutt/20170609 (1.8.3) |
Flavio Cruz, le dim. 12 févr. 2023 12:49:44 -0500, a ecrit:
> For the 64 bit / 32 bit configuration, we can pass --enable-user32 when
> targeting x86_64, and MIG will generate stubs as before. I am unsure
> whether there exists undefined behavior in that particular configuration
> since most of the structures used by the kernel do not seem to use 8
> byte scalars so potentially we should be OK there.
>
> diff --git a/parser.y b/parser.y
> index 03c5ec8..3aa18c2 100644
> --- a/parser.y
> +++ b/parser.y
> @@ -212,6 +212,16 @@ Subsystem : SubsystemStart
> SubsystemMods
> IsKernelUser ? ", KernelUser" : "",
> IsKernelServer ? ", KernelServer" : "");
> }
> + if (IsKernelUser || IsKernelServer) {
> + port_size = vm_offset_size;
> + port_size_in_bits = vm_offset_size_in_bits;
> +#ifdef USER32
> + /* Since we are using MIG to generate stubs for a 64 bit kernel that
> operates
> + with a 32 bit userland, then we need to consider that
> `max_alignof` is 4 byte aligned.
> + */
> + max_alignof = sizeof(uint32_t);
> +#endif
> + }
> init_type();
> }
As I mentioned in another mail: I thought Luca's work inside gnumach was
already handling conversion?
At the very least I'd rather see a runtime option to set max_alignof,
rather than having a mig32, a mig64, and a mig32/64.
Samuel