| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Message-Id: <Y35PHuUNCFb6sQO0@viriathus>
|
|
|
|
|
| |
214866d58ac2 ("Add ioapic support disabled by default") missed adding
them for x86_64.
|
|
|
|
| |
Message-Id: <Y23fab31RM6HcCyb@viriathus>
|
|
|
|
|
|
|
| |
e2fcf261076b (""interrupt: Fix saving irq/ipl when linux drivers are
disabled") broke booting under some conditions, because the parameters were
erroneously written 4 bytes too far for splx_cli and ioapic_irq_eoi to
read them.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* include/mach/mach_types.defs: host_basic_info_data_t,
host_sched_info_data_t,
host_load_info_data_t,
processor_basic_info_data_t,
processor_set_basic_info_data_t,
processor_set_sched_info_data_t,
hread_basic_info_data_t,
thread_sched_info_data_t,
task_basic_info_data_t,
task_events_info,
task_thread_times_info_data_t,
machine_info_data_t,
machine_slot_data_t
* include/mach_debug/mach_debug_types.defs: ipc_info_name_t,
ipc_info_name_array_t
Tested by bootstrapping a Hurd system from scratch.
Message-Id: <Y2dD7Z60Bwybg4jF@viriathus>
|
|
|
|
|
|
|
| |
- Add half a clock tick for more accuracy
- Start the pit countdown during pit_sleep
- Add pit_mdelay and pit_udelay functions
Message-Id: <20221025105502.222708-8-damien@zamaudio.com>
|
|
|
|
| |
Message-Id: <20221025105502.222708-7-damien@zamaudio.com>
|
|
|
|
|
|
| |
Message-Id: <20221025105502.222708-5-damien@zamaudio.com>
Co-authored-by: Almudena Garcia <liberamenso10000@gmail.com>
|
|
|
|
| |
Message-Id: <20221025105502.222708-4-damien@zamaudio.com>
|
| |
|
|
|
|
| |
Message-Id: <20221025105502.222708-2-damien@zamaudio.com>
|
|
|
|
|
|
| |
When we want to enable APIC, we must initialize the structure or
otherwise, it will try to access to a not initialized memory addresses.
Message-Id: <20220924163145.39894-1-etienne.brateau@gmail.com>
|
|
|
|
|
| |
These are provided by mig since ecf59842e472 ("Make MIG recognize the
basic C integral types."), released in snapshot v1.8+git20200618.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When Linux drivers are disabled, in hardclock() the linux_timer_intr()
call is dropped, and gcc can tail-recursion-optimize the call to
clock_interrupt(). To do so, it overwrites the hardclock() parameters to
suit the clock_interrupt parameters layout. This however means it thrashes
the backups that the interrupt() function had made of irq/ipl, leading to
mayhem.
interrupt should thus really properly separate its irq/ipl backups from the
interrupt function parameters.
Thanks a lot to Etienne Brateau for the tricky investigation!
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* vm/memory_object_proxy.c: truncate vm array types as if they were
the rpc_ version because MIG can't handle that. This rpc can't
handle more than one element anyway.
Note that the same issue with vm arrays is present at least with
syscall emulation, but that functionality seems unused for now.
A better fix could be to add a vm descriptor type in include/mach/message.h,
but then probably we don't need to use the rpc_ types in MIG anymore,
they would be needed only for the syscall definitions.
Signed-off-by: Luca Dariz <luca@orpolo.org>
Message-Id: <20220628101054.446126-15-luca@orpolo.org>
|
|
|
|
|
| |
In the 32/64 conversion case it is copyinmsg that will know the
eventual size.
|
|
|
|
|
| |
and restore the checks for offset alignment in the message, even if
currently it is trivially always alright.
|
|
|
|
|
|
|
| |
* ipc/ipc_kmsg.c: align msg body to 4 bytes as done in mig
Signed-off-by: Luca Dariz <luca@orpolo.org>
Message-Id: <20220628101054.446126-7-luca@orpolo.org>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* ipc/mach_port.c: use mach_port_name_t instead of mach_port_t, since
they could have different size. Fortunately we can keep the same
optimization about allocationg memory, since mach_port_type_t has
the same size as a name.
Signed-off-by: Luca Dariz <luca@orpolo.org>
Message-Id: <20220628101054.446126-9-luca@orpolo.org>
|
|
|
|
|
|
|
|
|
| |
* include/mach/host_info.h: replace vm_size_t with rpc_ version for 64
bit compatibility. Ideally it should use phys_addr_t or another unit
like KB or MB
Signed-off-by: Luca Dariz <luca@orpolo.org>
Message-Id: <20220628101054.446126-8-luca@orpolo.org>
|
|
|
|
|
|
|
| |
* vm/vm_user.c: sign-extend mask with USER32
Signed-off-by: Luca Dariz <luca@orpolo.org>
Message-Id: <20220628101054.446126-6-luca@orpolo.org>
|
|
|
|
|
|
|
|
| |
* ipc/ipc_machdep.h: re-define PORT_T_SIZE_IN_BITS to be computed from
mach_port_t instead of being hardcoded.
Signed-off-by: Luca Dariz <luca@orpolo.org>
Message-Id: <20220628101054.446126-5-luca@orpolo.org>
|
|
|
|
| |
We cannot assume that the processor is little-endian.
|
|
|
|
|
|
|
|
| |
* kern/bootstrap.c: use rpc_ vm types to put the bootstrap module
arguments on the stack, make it consistent with user-space types.
Signed-off-by: Luca Dariz <luca@orpolo.org>
Message-Id: <20220628101054.446126-4-luca@orpolo.org>
|
|
|
|
|
|
|
|
|
|
| |
* ipc/ipc_kmsg.h: change prototype of ipc_kmsg_copyout_body()
* ipc/ipc_kmsg.c: change prototype and usage of
ipc_kmsg_copyout_body() by incorporating common code
* ipc/mach_msg.c: change usage of ipc_kmsg_copyout_body()
Signed-off-by: Luca Dariz <luca@orpolo.org>
Message-Id: <20220628101054.446126-3-luca@orpolo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* include/mach/mach_types.defs: use rpc_ vm types for KERNEL_USER stubs.
This change fixes two use cases:
* internal rpc, e.g. when a memory object is initialized as a
consequence of vm_map(); for example, the bootstrap modules use the
"time" kernel device and memory-map it during startup. This
triggers a kernel-side rpc to initialize the memory object and
install the map, which is completely transparent form user-space.
* notifications from kernel to user-space
Signed-off-by: Luca Dariz <luca@orpolo.org>
Message-Id: <20220628101054.446126-2-luca@orpolo.org>
|
| |
|
|
|
|
|
| |
Now that mach/machine/vm_types.h uses stdint types, we have to ship a
header that defines them.
|
|
|
|
|
| |
On Xen we do not have a separate boot section, we directly start at the
kernel map address. We thus do not have a map shift.
|
|
|
|
|
|
|
|
|
| |
* kern/printf.c: remove unnecessary #include and reorder
This allows the file to be reused for minimal user-space tests.
Signed-off-by: Luca Dariz <luca@orpolo.org>
Message-Id: <20220628101054.446126-14-luca@orpolo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* vm_types.h: add new types and conversion functions
* mach_types.defs: adapt vm types depending on kernel user/server
* vm_info.h: adapt rpc structure to have uniformly-sized members also
on 64-bit
* x86_64/configfrag.c: add new option to select the user-space variant.
Note that with this change the user-space interface is somehow fixed,
i.e. it can't support 32-bit and 64-bit tasks at the same time.
If this would be needed at some point, this change needs to be reworked.
Signed-off-by: Luca Dariz <luca@orpolo.org>
Message-Id: <20220403145955.120742-3-luca@orpolo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* include/mach/mach_port.defs
- use C type mach_port_name_array_t
* include/mach/port.h:
- add new types mach_port_name_t and mach_port_name_array_t
- refine mach_port_t type for user and kernel space
- use port names in mach_port_status to allow compilation of 64-bit
- use port name to have uniform sizes and remove the
old_mach_port_status_t as it's unused
* include/mach/std_types.defs
- use C type mach_port_name_array_t
* kern/thread.{h,c}
- fix prototype to use port names. So far it seems the only rpc to
cause a conflict between the mig-generated header and the regular
header, so compilation fails.
Signed-off-by: Luca Dariz <luca@orpolo.org>
Message-Id: <20220403145955.120742-2-luca@orpolo.org>
|
|
|
|
|
| |
Signed-off-by: Luca Dariz <luca@orpolo.org>
Message-Id: <20220628101054.446126-13-luca@orpolo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* i386/i386/pcb.c:
- increase alignment of pcb cache to 16
- ensure the stack is properly aligned when switching ktss
* i386/i386/thread.h:
- add padding tomake iss field end aligned to 16 bytes
* i386/i386/trap.c:
- ensure the state we get after the trap points to the correct place
in the pcb structure
When handling exceptions from IA-32e compatibility mode in user space,
on a 64-bit kernel, the exception stack where error info is pushed
needs to be aligned to 16 bytes (see Intel System Programming guide,
$6.14.2)
The exception stack frame is set in the middle of pcb->iss, but it's not always
16-byte aligned; to make sure it is, we increase the alignment of the
pcb cache and add a padding field in the pcb structure.
This issue resulted in a general protection failure due to CS being
corrupted after a page fault. The corruption was happening when the
exception stack frame was not properly aligned and a page fault
happened; the error info was then pushed after re-aligning the stack,
so the value of eflags was actually written in CS place and other
fields were shifted too.
It also makes sense to ensure this by adding two assertions, although
these were primarly useful during debug.
Signed-off-by: Luca Dariz <luca@orpolo.org>
Message-Id: <20220628101054.446126-10-luca@orpolo.org>
|
|
|
|
|
| |
Signed-off-by: Luca Dariz <luca@orpolo.org>
Message-Id: <20220205175129.309469-7-luca@orpolo.org>
|
|
|
|
|
|
|
|
| |
The pmap module is a bit limited on 64 bit paging, so this should be
refined when we'll be able to use addresses over 4G.
Signed-off-by: Luca Dariz <luca@orpolo.org>
Message-Id: <20220205175129.309469-6-luca@orpolo.org>
|
|
|
|
|
|
|
|
| |
The leading space prevents it working if console=comX is the only
argument, so handle this case separately.
Signed-off-by: Luca Dariz <luca@orpolo.org>
Message-Id: <20220205175129.309469-5-luca@orpolo.org>
|
|
|
|
|
|
|
|
|
| |
rbx was used to compute the irq index in iunit and ivect arrays,
however it should be preserved by pushing it in to the stack. As a
solution, we use rax instead, which is caller-saved.
Signed-off-by: Luca Dariz <luca@orpolo.org>
Message-Id: <20220205175129.309469-4-luca@orpolo.org>
|
|
|
|
|
|
|
|
|
| |
* use _raw_ structs where we refer to the bootloader-provided data
* remove unused structures
* fix 64 bit boot
Signed-off-by: Luca Dariz <luca@orpolo.org>
Message-Id: <20220205175129.309469-3-luca@orpolo.org>
|
|
|
|
|
|
| |
We shouldn't be needing that since we won't use a.out for 64bit, but using
address override in the multiboot header could be useful at least for
testing.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure: compile for native x86_64 by default instead of xen
* x86_64/Makefrag.am: introduce KERNEL_MAP_BASE to reuse the constant
in both code and linker script
* x86_64/ldscript: use a .boot section for the very first operations,
until we reach long mode. This section is not really allocated, so
it doesn't need to be freed later. The vm system is later
initialized starting from .text and not including .boot
* link kernel at 0x4000000 as the xen version, higher values causes
linker errors
* we can't use full segmentation in long mode, so we need to create a
temporary mapping during early boot to be able to jump to high
addresses
* build direct map for first 4G in boothdr, it seems required by Linux
drivers
* add INTEL_PTE_PS bit definition to enable 2MB pages during bootstrap
* ensure write bit is set in PDP entry access rights. This only
applies to PAE-enabled kernels, mandatory for x86_64. On xen
platform it seems to be handled differently
Signed-off-by: Luca Dariz <luca@orpolo.org>
Message-Id: <20220205175129.309469-2-luca@orpolo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PCI CONF2 access method was deprecated in PCI v2.0
Also, the conf2 ioport range is only activated for use
as pci configuration space when conf1 registers are accessed
in a particular sequence.
Since the pci-arbiter does not access the conf1 forwarding register,
we are safe to remove this completely from gnumach to allow
normal I/O use of the conf2 range as modern hardware expects.
Message-Id: <20220823032638.292813-1-damien@zamaudio.com>
|
|
|
|
|
|
|
|
|
|
| |
This allows contiguous allocations aligned to values
smaller than one page, but still a power of 2,
by forcing the alignment to be to the nearest page.
This works because PAGE_SIZE is a power of two.
Message-Id: <20220821065732.269573-1-damien@zamaudio.com>
|
|
|
|
|
|
|
| |
* device/dev_pager.c:
* dev_pager_hash_delete() and dev_device_hash_delete():
* Fix condition to call kmem_cache_free(), it was being called always.
* https://lists.gnu.org/archive/html/bug-hurd/2022-08/msg00002.html
|