summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
3 daysImplement per-task virtual memory limitHEADmasterDiego Nieto Cid
* doc/mach.texi: add a "Memory Limitations" section to document the new interfaces. * include/mach/gnumach.defs: (vm_set_size_limit) new routine (vm_get_size_limit) likewise * kern/task.c: (task_create_kernel) if parent_task is not null copy virtual memory limit * tests/test-vm.c: (test_vm_limit) add test for the new routines * vm/vm_map.h: (struct vm_map) new fields size_none, size_cur_limit and size_max_limit (vm_map_find_entry) add new parameters cur_protection and max_protection * vm/vm_map.c: (vm_map_setup) initialize new fields (vm_map_enforce_limit) new function (vm_map_copy_limits) new function (vm_map_find_entry) add protection and max_protection parameters. call limit enforcer function (vm_map_enter) likewise (vm_map_copyout) likewise (vm_map_copyout_page_list) likewise (vm_map_fork) copy parent limit to the new map and compute and set size_none of the new map * vm/vm_user.c: (vm_set_size_limit) new function (vm_get_size_limit) likewise * xen/grant.c: update call to vm_map_find_entry to pass protection parameters Message-ID: <0b71f4f89b7cc2b159893a805480d7493d522d60.1758485757.git.dnietoc@gmail.com>
3 daysclock: Note that the hpc support is not smp safe yetSamuel Thibault
3 daysmach_clock: Fix monotonic clock sometimes going backwardsDamien Zammit
Between reading mtime and reading hpclock_read_counter, there may be an interrupt that updates mtime, therefore we need a check to perform the clock read process again in this case. TESTED: on UP using: ``` \#include <stdio.h> \#include <time.h> int main() { struct timespec ts, now; int i; int cnt = 0; clock_gettime(CLOCK_MONOTONIC, &ts); for (i = 0; i < 10000000; i++) { clock_gettime(CLOCK_MONOTONIC, &now); if ((now.tv_nsec < ts.tv_nsec) && (now.tv_sec <= ts.tv_sec)) { printf("BACKWARDS\n"); cnt++; printf(" %u %09lu\n %u %09lu\n\n", ts.tv_sec, ts.tv_nsec, now.tv_sec, now.tv_nsec ); } ts = now; } printf("went backwards %d out of %d times\n", cnt, i); return 0; } ``` Before the change, some backward transitions were detected. After this change, none were detected. Message-ID: <20250921091345.2183347-1-damien@zamaudio.com>
2025-09-03mach_clock (set_timeout): Start counting after next tickSamuel Thibault
to avoid partial ticks.
2025-08-31Document mach_port_set_ktypeSamuel Thibault
2025-08-31Add mach_port_set_ktype RPC to set ktype of a user portMichael Kelly
For now, we only allow a newly-introduced MACH_PORT_KTYPE_USER_DEVICE type that makes ipc_kmsg_copyin_body use page lists, which keep them in a busy state that prevents them from being paged out.
2025-08-27idt_inittab: Fix terminator entrySamuel Thibault
Better fill a complete entry, which is always two pointers, both in MACH_PV_DESCRIPTORS and !MACH_PV_DESCRIPTORS case. For the x86_64 case, only half a pointer was actually recorded, leaving to garbage getting registered in the idt. This was noticed by division by zero getting double-faults. Thanks Pellescours for the initial investigation!
2025-08-01xen: Disable apicSamuel Thibault
2025-08-01x86_64: disable linux groups earlySamuel Thibault
So we enable APIC by default.
2025-08-01smp: Fix build with default parametersSamuel Thibault
We need to automatically disable linux groups before automatically enabling apic.
2025-07-19interrupt: simplify offsetting with irq numberv1.8+git20250731Samuel Thibault
2025-07-19x86_64: Fix interrupt buildSamuel Thibault
Otherwise we get (.text+0x4014c): relocation truncated to fit: R_X86_64_32 against symbol `irqinfo' defined in .bss section in gnumach.o
2025-07-19interrupt.S: Change interrupt EOI strategyDamien Zammit
We now have a different strategy for EOI depending on trigger mode: For edge triggered, the behaviour is unchanged; the eoi comes before the handler so we don't miss interrupts. For level triggered, the eoi comes after the handler since the high interrupt line will trigger the interrupt again and stack up, before we mask it in queue_intr (and we don't risk missing interrupts). Message-ID: <20250719074547.288203-1-damien@zamaudio.com>
2025-07-19ioapic: Introduce irqinfo helper structDamien Zammit
Avoid reading the ioapic registers for vector and trigger mode, by introducing an O(1) memory lookup for these properties. Message-ID: <20250719064116.285288-2-damien@zamaudio.com>
2025-07-16irq: Print process name on irq handler setupSamuel Thibault
2025-07-13i386/configfrag: Make --enable-apic the default when linux groups are not ↵Samuel Thibault
enabled In practice this enables APIC by default for x86_64.
2025-07-12ioapic: Add conditional TMR bit in EOI (no-op)Damien Zammit
This code may be needed in the future, so add it in now but keep it disabled. The special EOI handling for interrupts may only need to be done for one kind of trigger mode.
2025-07-12ioapic: Make it clear that multiple ioapics don't quite work yetDamien Zammit
Message-ID: <20250712123404.20826-1-damien@zamaudio.com>
2025-07-12irq: make it clear what irq_lock protectsSamuel Thibault
2025-07-12i386/irq.c: Make irq nesting smp safeDamien Zammit
This avoids race condition with multiple devices raising interrupts simultaneously on the same IRQ and causing mask to fail. TESTED: on SMP and UP+apic gnumach, boots to console and receives a large file over rumpnet on debian hurd-i386. Message-ID: <20250711065607.208734-1-damien@zamaudio.com>
2025-07-10i386/smp.c: Change order of waiting for pending ICRDamien Zammit
We need to wait first for pending to clear before sending the IPI assert signal. Likewise, if we always do it this way, we don't need to wait for pending to clear afterward because next time we will wait again anyway. Deassert does not seem necessary according to Intel SDM Vol 3, which says an IPI is sent when ICR low is written. NB: This is not the same code as for STARTUP or INIT IPIs. Message-ID: <20250710101341.178343-2-damien@zamaudio.com>
2025-06-30trap: Fix printf formatv1.8+git20250702Samuel Thibault
2025-06-27i386 intel read fault fixMilos Nikic
include the missing header, fix the warning. Message-ID: <20250625014727.40695-1-nikic.milos@gmail.com>
2025-06-24i386 kern: fix overflow in vm_object_print_part callMilos Nikic
The call to vm_object_print_part was passing 0ULL and ~0ULL for offset and size, respectively. These values are 64-bit (unsigned long long), which causes compiler warnings when building for 32-bit platforms where vm_offset_t and vm_size_t are typedefs of uintptr_t (i.e., unsigned int). This patch replaces those constants with 0 and UINTPTR_MAX, which match the expected types and avoid implicit conversion or overflow warnings. No functional change. Message-ID: <20250623235844.763-1-nikic.milos@gmail.com>
2025-06-24kdb: Fix printf format warning for phys_addr_tMilos Nikic
When building without PAE support, phys_addr_t is defined as unsigned long, but the kdb printf call uses %llx, which expects an unsigned long long. This triggers a -Wformat warning due to a type mismatch. Fix this by explicitly casting the phys_addr_t value to unsigned long long, ensuring the format string and argument type always match. This avoids build warnings while preserving existing type definitions. Message-ID: <20250624013544.842-1-nikic.milos@gmail.com>
2025-06-23i386: trap.c add prototype for handle_double_faultMilos Nikic
The handle_double_fault function is defined in trap.c and called from x86_64/locore.S, but lacked a prototype, triggering a compiler warning: 'no previous prototype for handle_double_fault'. This change adds a forward declaration at the top of trap.c to satisfy the compiler and clarify the function's external linkage. No functional changes.
2025-06-23i386 ldt.c make ldt_fill staticMilos Nikic
Compiler warns about it, and its only invoked from this file. Message-ID: <20250623190708.742-1-nikic.milos@gmail.com>
2025-06-22ioapic.c: Fix default polarity and trigger mode for irqsDamien Zammit
0-13 are on rising edge (legacy) 14-N are active-low level triggered. This allows for PIIX3 chipset to have working IDE, if we patch hurd/acpi to ignore buggy irq 9 response. Message-ID: <20250622073329.188167-1-damien@zamaudio.com>
2025-06-22tests: also disable stack protectorSamuel Thibault
Similarly to Makefile.am, otherwise when the host compiler enables it by default, we get undefined reference to `__stack_chk_fail_local'
2025-06-22Fix syntaxSamuel Thibault
2025-06-22tests: Also try to use mig as USER_MIG when not cross-buildingSamuel Thibault
2025-06-21smp: fix warningMilos Nikic
Reading lapic->error_status.r may have side effects, and we must preserve it. To avoid a compiler warning about err being unused, cast it to (void). This keeps the behavior intact while eliminating the warning. Message-ID: <20250619155105.8940-1-nikic.milos@gmail.com>
2025-06-21ktss: fix compiler warningsMilos Nikic
Fixing compiler warnings on ktss c-file. Some that only appear when building on 32 bit arch, some that happen regardless of architecture. Changes tested on the 32 bit build. Message-ID: <20250620212343.9385-1-nikic.milos@gmail.com>
2025-06-21lock_mon: clean lip/lis functionsMilos Nikic
The function lock_info_sort was defined as static and aliased via a macro to lis, requiring a forward declaration to be callable from lip(). This indirection served no functional purpose and made the code less readable and emitting a compiler (declared 'static' but never defined) warning. This change: - Removes the macro aliasing lock_info_sort to lis - Moves lock_info_sort before lip() to eliminate the need for a forward declaration - Updates the call in lip() to refer to lock_info_sort directly The result is a cleaner and more straightforward structure without changing behavior which also fixes a compiler warning. Message-ID: <20250620171458.8394-1-nikic.milos@gmail.com>
2025-06-17tests: Fix missing file cleanSamuel Thibault
2025-06-17tests: Fix make cleanSamuel Thibault
It was dropping the .c file when building inside the source tree
2025-06-16vm_page: Make sure to inspect internal page listMichael Kelly
notably when the external page list is not empty but vm_page_can_move returns false.
2025-06-12Make the swapin thread vm-privileged tooMichael Kelly
So it can be swapped in.
2025-06-09user32: Extend userland address space to 4GSamuel Thibault
glibc and hurd servers cope fine, and this allows to have more userland memory for very large builds.
2025-06-09db: Discard unsupported ansi sequencesSamuel Thibault
Similarly to 360d54234f76 ("kd: Discard unsupported ansi sequences"), we should discard unsupported ansi sequences in db input, notably the bracketed paste sequences.
2025-06-09kd: Discard more ansi sequencesSamuel Thibault
The full range between @ and ~ is defined to be potential ANSI sequences, so ignore them all.
2025-06-09test-mach_host.c: Add time testsSamuel Thibault
2025-06-09vm_allocate_contiguous: Avoid 64bit addresses for 32bit userlandSamuel Thibault
2025-06-08vm_object_pmap_remove: Also remove in the shadow objectMichael Kelly
Otherwise, when e.g. terminating tasks with shared mappings, some references remain within the pv_head_table to pmap_t objects that had already been destroyed.
2025-06-03thread_create: Inherit vm_privilege between threads of the same taskSamuel Thibault
So that e.g. all rumpdisk threads get vm_privilege
2025-06-03ddb: Print vm_privilege in thread stateSamuel Thibault
2025-05-29vm_page_seg_evict: Fix creating a pager for internal objects with DMMSamuel Thibault
fd63a4bbf6f2 ("vm_page: Avoid creating a pager in DMM when not double-paging") avoided crashes when we do not have a DMM and wish to evict an internal opbject. But the double_paging condition was too restrictive and prevented normal internal objects from paging out when we do have a DMM. This re-enables creating a pager when we do have a DMM, so internal objects can be paged out.
2025-05-29vm_page_seg_evict: Fix object pointer on restartMichael Kelly
The code further down depends on object being NULL if we goto out.
2025-05-12vm_page: Explain which we clear modify on migration of a non-dirty pageSamuel Thibault
2025-05-07vm: Add missing lockSamuel Thibault