| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Not only on x86_64.
Message-ID: <20240327161841.95685-5-bugaevc@gmail.com>
|
|
|
|
| |
Message-ID: <20240327161841.95685-4-bugaevc@gmail.com>
|
|
|
|
|
| |
It's not only x86_64, none of new architectures are going to have it.
Message-ID: <20240327161841.95685-3-bugaevc@gmail.com>
|
|
|
|
|
|
|
|
| |
Is _IO{,R,W,WR} macros conflict with the glibc-provided macros and bring
confusion as to what is supposed to be the right definition.
There is currently no user of it anyway, the Hurd console driver has its
own copy.
|
|
|
|
|
|
|
| |
Like task_set_name, we use the same size as the task name and will
inherit the task name, whenever it exists. This will be used to
implement pthread_setname_np.
Message-ID: <20240212062634.1082207-2-flaviocruz@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
declarations.
I was trying to reuse TASK_NAME_SIZE in kern/thread.h but it was
impossible because files included from kern/task.h end up requiring
kern/thread.h (through percpu.h), creating a recursive dependency.
With this change, mach_types.h only defines forward declarations and
modules have to explicitly include the appropriate header file if they
want to be able touch those structures. Most of the other includes are
required because we no longer grab many different includes through
mach_types.h.
Message-ID: <20240212062634.1082207-1-flaviocruz@gmail.com>
|
|
|
|
|
|
|
|
| |
For rumpdisk to efficiently determine the physical address, both
for checking whether it is below 4GiB, and for giving it to the disk
driver, we need a gnumach primitive (and that is not conditioned by
MACH_VM_DEBUG like mach_vm_region_info and mach_vm_object_pages_phys
are).
|
|
|
|
| |
Message-ID: <20231228194301.745811-11-luca@orpolo.org>
|
|
|
|
|
|
|
|
| |
aligned
msgt_unused appears right after msgt_size since msgt_size can be reduced
to only 8 bits in the future, so we leave the door opened to make
msgt_unused 13 bits long.
|
|
|
|
|
|
|
|
|
|
| |
If a port is inlined in a message, the user has to use
mach_port_name_inlined_t to define each port. Out of line memory
continues to use mach_port_name_t since that memory has to be copied to
the kernel anyway.
Both copyinmsg and copyoutmsg can be reduced to nothing (if we ignore
USER32) as a follow up but kept this patch simple for ease of review.
|
|
|
|
|
|
| |
byte aligned"
This reverts commit 2db6b9b7b23b3bab944665b3b6012d24dd425d97.
|
|
|
|
| |
This reverts commit 29d4bcaafc4c2040df27a6247603c68e7757205c.
|
|
|
|
|
|
|
|
|
|
|
| |
If a port is inlined in a message, the user has to use
mach_port_name_inlined_t to define each port. Out of line memory
continues to use mach_port_name_t since that memory has to be copied to
the kernel anyway.
Both copyinmsg and copyoutmsg can be reduced to nothing (if we ignore
USER32) as a follow up but kept this patch simple for ease of review.
Message-ID: <ZWg00XzFPqqL1yF-@jupiter.tail36e24.ts.net>
|
|
|
|
|
|
|
|
|
| |
aligned
msgt_unused appears right after msgt_size since msgt_size can be reduced
to only 8 bits in the future, so we leave the door opened to make
msgt_unused 13 bits long.
Message-ID: <ZWGT6a6GeqFAtOUn@jupiter.tail36e24.ts.net>
|
| |
|
|
|
|
| |
static_assert was introduced in C++11.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Make full use of the 8 bytes available in mach_msg_type_t by moving
into the unused 4 bytes. This allows us to use 32bits for
mach_msg_type_number_t whether we use the longform or not.
* Make mach_msg_type_long_t exactly the same as mach_msg_type_t.
Updating MiG is strongly encouraged since it will generate better code
to handle this new format.
After this change, any compatibility with compiled binaries for Hurd x86_64
will break since the message format is different. However, the new
schema simplifies the overall ABI, without having "holes" and also
avoids the need to have a 16 byte mach_msg_type_long_t.
Was able to boot a basic system up to a bash shell.
Message-Id: <ZIfqFe5bPNPeH4xg@jupiter.lan>
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Apparently the ELF world changed their mind on the naming of integers,
let's get coherent with it.
Elf64_Quarter (16b) disappeared, replaced by Elf64_Half (now 16b instead of
Elf64_32b). And previous Elf64_Half (16b) thus now need to be Elf64_Word
(16b).
|
|
|
|
|
|
| |
We are checking for the existence of time_value64_t but we didn't add
that to the task_thread_times_info structure.
Message-Id: <ZGRDbS0XIm1fJwkG@jupiter.tail36e24.ts.net>
|
| |
|
|
|
|
|
|
|
| |
We can fast track the simplification of the RPC ABI for x86_64 if we don't have
MACH_MSG_TYPE_STRING used in RPCs which forces msgt_size to use more than 8
bits.
Message-Id: <ZFht+/9cVPHuV90D@jupiter.tail36e24.ts.net>
|
|
|
|
|
| |
File is unused.
Message-Id: <ZFSSbAzZ+7KYKtOF@jupiter.tail36e24.ts.net>
|
| |
|
|
|
|
|
|
|
|
|
| |
* include/mach/mig_support.h: Drop the ifndef because this file is only
used internally to compile gnumach. We export mig_support.h from glibc
already.
* kern/ipc_mig.c: len should be vm_size_t.
* kern/ipc_mig.h: Drop duplicate prototypes.
Message-Id: <ZFBjEk07CaQgx9Ru@jupiter.tail36e24.ts.net>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Added device_open_new and device_open_new_request and reused the old MiG
ID for xxx_device_set_status which has not been in used in the past
decade.
Note that device_open_new is gated on defining
DEVICE_ENABLE_DEVICE_OPEN_NEW because otherwise some hurd servers
wouldn't compile anymore unless patched. This macro allows us to control
the rollout.
Message-Id: <ZEi1LV+9ShuXqtcr@jupiter.tail36e24.ts.net>
|
|
|
|
|
|
| |
RPCs remain compatible with existing clients but if they know about the
new size then we will populate the new fields.
Message-Id: <ZDzPLCJccKeRB5Pd@mars.tail36e24.ts.net>
|
|
|
|
|
| |
Not used.
Message-Id: <ZDN13tll1jYc1jYh@jupiter.tail36e24.ts.net>
|
|
|
|
|
|
| |
host_get_kernel_boot_info was added recently to fix the use of
MACH_MSG_TYPE_STRING.
Message-Id: <ZC5Sz8a4FCT6IjCY@jupiter.tail36e24.ts.net>
|
|
|
|
|
|
|
|
|
| |
On EXC_BAD_ACCESS, exception subcode is used to pass the faulting memory
address, so it needs to be (at least) pointer-sized. Thus, make it into
a long.
This requires matching changes in glibc and the Hurd.
Message-Id: <20230319151017.531737-4-bugaevc@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
As far as I can see, this file was imported in the very beginning of GNU Mach
history, and unused since then. Nobody implements or uses this interface. GNU
Mach uses a different way to pass the privileged ports to the bootstrap tasks:
instead of the task(s) actively asking for the ports in an RPC, the ports are
preemptively inserted into the IPC space(s) of the task(s), as configured by
the boot script.
Remove bootstrap.defs so as to not confuse anyone into thinking it works.
Message-Id: <20230319151017.531737-3-bugaevc@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
As mentioned in 5447f965, the c_string type correctly uses
msgt_size/msgt_number, resulting in a more compact ABI that doesn't
require mach_msg_type_long_t.
I redefined host_load_symbol_table with a new Id since this is just a
debug RPC and is not used anywhere.
Message-Id: <ZBFgyJp+Pcb7zFhf@mars.tail36e24.ts.net>
|
| |
|
|
|
|
|
|
|
|
| |
Changed kern/timer.c to use the higher precision time_value64_t.
Of course, this won't suffer from the 2038 overflow but it does provide
nanosecond precision (if gnumach ever uses a better timer) and
moves us closer to only having time_value64_t.
Message-Id: <ZA63tGcv3bETUJFJ@jupiter.tail36e24.ts.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The existing definitions for kernel_version_t and kernel_boot_info_t use
(MACH_MSG_TYPE_STRING, length*8) which result in message types that have
a single element of 512 or 4096 bytes (set as msgt_size). This results
in MiG generating mach_msg_type_long_t. Using c_string has the benefit
of moving this size to be defined as msgt_number which doesn't overflow.
This will allow us to simplify the 64 bit RPC ABI since all msgt_size can
be defined with just 8 bits (as it should be expected).
The resulting implementation is the same but we still need to define new
RPCs since server and user expect different mach_msg_type_t.
Message-Id: <ZA63pS8j9J6NwuXY@jupiter.tail36e24.ts.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
uintptr_t.
With this change, any 64 bit code using the IPC subsystem without relying on
MiG will work without any changes. We have a few examples of this inside gnumach but
also in the Hurd servers. For example, in hurd/console/display.c
typedef struct
{
mach_msg_header_t Head;
mach_msg_type_t ticknoType;
natural_t tickno;
mach_msg_type_t changeType;
file_changed_type_t change;
mach_msg_type_t startType;
loff_t start;
mach_msg_type_t endType;
loff_t end;
} Request;
This will now work correctly in 64 bits, without requiring any explicit padding.
As a follow up, we can simplify mach_msg_type_long_t so that we
only need an 8 byte structure where the second field will include the
number of elements for the long form. This is already included in
mach_msg_type_t as unused_msgtl_number.
Message-Id: <ZAbhOfOzsb8qPFs6@jupiter.tail36e24.ts.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We introduce both a user alignment and a kernel alignment. These are
separate requirements since for 64 bit with a 32 bit kernel we need to
ensure the kernel can consume messages that are 8-byte aligned. This
change removes any possibility of undefined behavior and also allows the
kernel to support 64 bit RPCs for the userland.
A lot of the code that performs alignment was simplified under the
assumption that the message headers are well aligned. To enforce that
going forward, a few static assertions were added.
Message-Id: <Y/KrixiC9Njmu7ef@jupiter.tail36e24.ts.net>
|
|
|
|
|
| |
We can use these in userland with the new time_value64_t struct.
Message-Id: <Y/RRck2JffqNenif@jupiter.tail36e24.ts.net>
|
|
|
|
|
| |
File is not included anywhere.
Message-Id: <Y/K1haNulJ63eDBd@jupiter.tail36e24.ts.net>
|
|
|
|
|
|
|
|
|
| |
* i386/include/mach/i386/exec/elf.h: add Elf64 definitions and define
common Elf structures, corresponding to 32/64 bit variants at
compile time.
* include/mach/exec/elf.h: add Elf64 definitions
* kern/elf-load.c: use common Elf structures
Message-Id: <20230216213318.2048699-2-luca@orpolo.org>
|
|
|
|
|
|
|
|
| |
This has several advantages:
1) We don't need to resize mach_msg_header_t, it is just a copy.
2) Mig won't require any changes because it statically computes the size
of mach_msg_header_t, otherwise we would need two sizes (28 vs 32 bytes).
Message-Id: <Y+l8UhXXX9Qo9tVA@jupiter.tail36e24.ts.net>
|
|
|
|
|
|
|
| |
5fdc928d3d29 ("fix rpc time value for 64 bit") broke hurd build because
structures are never compatible in C. For userland we however know
that rpc_time_value is the same as time_value, so we can just typedef
rpc_time_value_t to struct time_value as userland is used to.
|
|
|
|
|
|
|
|
|
|
| |
Protected payloads will be 8-byte longs which are the same size as
kernel ports.
Also aligned all the structures to be 4-byte aligned since it makes it
easier to parse them as padding won't be added to mach_msg_user_header_t
before the protected payload.
Message-Id: <Y+krwRFIUeyRszl9@jupiter.tail36e24.ts.net>
|
|
|
|
|
|
|
|
|
|
|
|
| |
* include/mach/task_info.h: use rpc variant of time_value_t
* include/mach/thread_info.h: Likewise
* kern/mach_clock.c: use rpc variant of time_value_t in
read_time_stamp()
* kern/mach_clock.h: Likewise
* kern/thread.c: use rpc variant of thread_read_times()
* kern/timer.h_ add thread_read_times_rpc() by converting time_value_t
to the corresponding rpc structures inline.
Message-Id: <20230212170313.1501404-5-luca@orpolo.org>
|
|
|
|
|
|
|
|
|
|
| |
When generating stubs, Mig will will take the vm_size_array_t and define the
input request struct using rpc_vm_size_t since the size is variable. This will turn cause a mismatch
between types (vm_size_t* vs rpc_vm_size_t*). We could also ask Mig to produce
a prototype by using rpc_vm_size_t*, however we would need to change the implementation
of the RPC to use rpc_* types anyway since we want to avoid another allocation
of the array.
Message-Id: <Y9iwScHpmsgY3V0N@jupiter.tail36e24.ts.net>
|
|
|
|
|
|
| |
Same existing logic, just with 64 bits. Old RPCs are implemented by
calling into the new RPCs.
Message-Id: <Y9TJAmL2byOWup5x@jupiter.tail36e24.ts.net>
|
|
|
|
|
|
|
|
|
|
| |
--enable-platform=xen won't compile because u_char is not included from
sys/types.h. Also, we are forcing users of include/device/input.h to
include glibc headers that export such types which should not be
necessary.
For i386/i386at/kd.h we include input.h to get Scancode.
Message-Id: <Y9S7oIyVFazVAOqb@jupiter.tail36e24.ts.net>
|
|
|
|
| |
message.h is installed so we need to hide these behind a mach_ prefix
|