| Age | Commit message (Collapse) | Author |
|
* 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>
|
|
|
|
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>
|
|
to avoid partial ticks.
|
|
|
|
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.
|
|
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!
|
|
|
|
So we enable APIC by default.
|
|
We need to automatically disable linux groups before automatically
enabling apic.
|
|
|
|
Otherwise we get
(.text+0x4014c): relocation truncated to fit: R_X86_64_32 against symbol `irqinfo' defined in .bss section in gnumach.o
|
|
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>
|
|
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>
|
|
|
|
enabled
In practice this enables APIC by default for x86_64.
|
|
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.
|
|
Message-ID: <20250712123404.20826-1-damien@zamaudio.com>
|
|
|
|
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>
|
|
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>
|
|
|
|
include the missing header, fix the warning.
Message-ID: <20250625014727.40695-1-nikic.milos@gmail.com>
|
|
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>
|
|
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>
|
|
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.
|
|
Compiler warns about it, and its only invoked from this file.
Message-ID: <20250623190708.742-1-nikic.milos@gmail.com>
|
|
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>
|
|
Similarly to Makefile.am, otherwise when the host compiler enables it by
default, we get undefined reference to `__stack_chk_fail_local'
|
|
|
|
|
|
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>
|
|
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>
|
|
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>
|
|
|
|
It was dropping the .c file when building inside the source tree
|
|
notably when the external page list is not empty but vm_page_can_move
returns false.
|
|
So it can be swapped in.
|
|
glibc and hurd servers cope fine, and this allows to have more userland
memory for very large builds.
|
|
Similarly to 360d54234f76 ("kd: Discard unsupported ansi sequences"), we
should discard unsupported ansi sequences in db input, notably the
bracketed paste sequences.
|
|
The full range between @ and ~ is defined to be potential ANSI
sequences, so ignore them all.
|
|
|
|
|
|
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.
|
|
So that e.g. all rumpdisk threads get vm_privilege
|
|
|
|
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.
|
|
The code further down depends on object being NULL if we goto out.
|
|
|
|
|