| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
The instruction set decoding needs an update, avoid showing bogus output.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Message-Id: <20230811083424.2154350-3-damien@zamaudio.com>
|
| |
|
|
|
|
| |
by using simple_lock_irq.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
by using simple_lock_irq.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
And pave the way for making the non-_irq variants check that they are
never used within interrupts.
We do have a few places which were missing it, as the following commits will
show.
|
|
|
|
|
|
| |
222020cff440 ("pmap: dynamically allocate the whole user page tree map")
made the pde array sparse, but missed updating pmap_protect accordingly:
we have to re-lookup for the pde on each PDE_MAPPED_SIZE section.
|
|
|
|
| |
They are in registers, and most probably very quickly overwritten.
|
| |
|
|
|
|
|
|
| |
On x86_64 we have no segmentation, and thus kernel's NULL is at linear
address zero, while LINEAR_MIN_KERNEL_ADDRESS is not zero. We thus have
to special-case it in otder to catch NULL dereferences.
|
| |
|
|
|
|
|
|
|
|
|
| |
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).
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
With the kernel gone to -2GB, the base+index addressing needs to use a 64bit
register index.
|
|
|
|
| |
For coherency with the rest of the implementations
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
5da1aea7ab3c ("Acknoledge interrupt after handler call") moved the IRQ ack
to after calling the handler because of overflows. But that was because the
interrupts were getting enabled at some point. Now that all spl levels
above 0 just disable interrupts, once we have called spl7 we are safe
until splx_cli is called (and even that doesn't release interrupts, only
the eventual iret will).
And if the handler triggers another IRQ, it will be lost, so we do want
to ack the IRQ before handling it.
|
| |
|
|
|
|
|
| |
In case interrupts were already disabled before TIME_TRAP_[US]ENTRY are
called, we don't want to execute sti.
|
|
|
|
|
|
|
|
|
|
|
| |
Rumpdisk needs to allocate dma32 memory areas, so we do always need this
limit.
The non-Xen x86_64 case had a typo, and the 32bit PAE case didn't have
the DMA32 limit.
Also, we have to cope with VM_PAGE_DMA32_LIMIT being either above or below
VM_PAGE_DIRECTMAP_LIMIT depending on the cases.
|
|
|
|
| |
In network terms, long is 32bit, i.e. an int for us.
|
|
|
|
| |
Message-Id: <20230805154913.2003121-1-damien@zamaudio.com>
|
|
|
|
| |
Message-Id: <20230805154859.2003109-1-damien@zamaudio.com>
|
|
|
|
| |
Message-Id: <20230805154843.2003098-1-damien@zamaudio.com>
|
|
|
|
|
|
|
|
|
|
| |
This speeds up smp slightly by reducing the cpu_number()
complexity to have no branching, just a look up table.
It also addresses the problem that CPU_NUMBER was only using
raw apic_id as an approximation of the kernel_id.
Other improvements were to remove unnecessary checks now that
the lookup table always resolves to a valid value.
Message-Id: <20230805074945.1983707-1-damien@zamaudio.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Booting to beginning of bootstrap with different number of cpus
and checking the lock statistics where TIME is in milliseconds:
Set MACH_LOCK_MON to 1 in configfrag.ac, then
Configure options
--enable-ncpus=8 --enable-kdb --enable-apic --disable-linux-groups
-smp 1
db{0}> show all slocks
SUCCESS FAIL MASKED STACK TIME LOCK/CALLER
4208 0/0 4208/100 2/0 7890/1 0xc1098f54(c11847c8)
1 0/0 1/100 0/0 7890/7890 0x315(c11966e0)
30742 0/0 0/0 2106/0 160/0 0xf52a9e2c(f5a07958)
30742 0/0 0/0 0/0 140/0 0xf52a5e2c(f5a07b10)
149649 0/0 3372/2 1/0 120/0 0xc118a590(c118a9d4)
16428 0/0 0/0 1/0 90/0 0xf52a5dd0(f5a07ab8)
14345 0/0 0/0 18/0 80/0 0xf64afe2c(f64aa488)
1791 0/0 0/0 1/0 80/0 0xf52a3e70(f5e57f70)
17331 total locks, 0 empty buckets
2320150 0/0 455490/19 11570533/4 17860/0 0xc10a4580(c10a4580)
-smp 2
(could not wait until booted)
db{0}> show all slocks
SUCCESS FAIL MASKED STACK TIME LOCK/CALLER
47082 0/0 47082/100 0/0 413940/8 0xc1098f54(c11847c8)
2 0/0 2/100 0/0 413940/206970 0x6ede(c11966e0)
47139 0/0 0/0 2106/0 4670/0 0xc119edec(f5e409b0)
132895 3/0 3372/2 1/0 4580/0 0xc118a590(c118a9d4)
118313 0/0 2/0 0/0 3660/0 0xc1098ec4(c1189f80)
183233 1/0 1714/0 2/0 2290/0 0xc1098e54(c118aa8c)
14357 0/0 0/0 1878/0 1200/0 0xf52a4de0(f5e40a60)
14345 0/0 0/0 18/0 1200/0 0xf52a4dec(f528f488)
16910 total locks, 0 empty buckets
2220850 455/0 485391/21 11549793/5 879030/0 0xc10a4580(c10a4580)
Message-Id: <20230722045043.1579134-1-damien@zamaudio.com>
|
|
|
|
|
| |
Allows building of gnumach with --disable-kdb and --enable-ncpus > 1
Message-Id: <20230722045019.1579102-1-damien@zamaudio.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* i386/i386/db_interface.c: don't set unused segment selectors on full
64-bit
* i386/i386/db_trace.c: likewise.
* i386/i386/i386asm.sym: likewise.
* i386/i386/pcb.c:: likewise.
* i386/i386/thread.h: remove ES/DS/FS/GS from thread state on !USER32,
as they are unused in this configuration. Only SS and CS are kept.
* x86_64/locore.S: convert segment handling macros to no-op on full
64-bit
Message-Id: <20230729174753.1145878-5-luca@orpolo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The actual values are not saved together with the rest of the thread
state, both because it would be quite espensive (reading MSR, unless
rdfsbase instructions are supported, but that's optional) and not
really needed. The only way the user has to change its value is with a
specific RPC, so we can intercept the change easily. Furthermore,
Leaving the values there exposes them to being corrupted in case of a
double interruption, e.g. an irq is handled just before iretq but
after starting to restore the thread state. This solution was
suggested by Sergey Bugaev.
* i386/i386/db_trace.c: remove fsbase/gsbase from the registers
available
* i386/i386/debug_i386.c: remove fsbase/gsbase from the printed thread
state
* i386/i386/i386asm.sym: remove fsbase/gsbase as it's not needed in
asm anymore
* i386/i386/pcb.c: point fsbase/gsbase to the new location
* i386/i386/thread.h: move fsbase/gsbase to the machine state
* x86_64/locore.S: generalize segment-handling including es/ds/gs/fs
and remove fsbase/gsbase handling. Also, factor out kernel segment
selector setting to a macro.
Message-Id: <20230729174753.1145878-4-luca@orpolo.org>
|
|
|
|
| |
Message-Id: <20230729174753.1145878-3-luca@orpolo.org>
|
|
|
|
|
|
|
|
| |
* i386/i386/pcb.c: simplify exception stack location and adapt thread
gettrs/setters
* i386/i386/thread.h: don't include V86 fields on full 64-bit
* x86_64/locore.S: don't include checks for V86 mode on full 64-bit
Message-Id: <20230729174753.1145878-2-luca@orpolo.org>
|
|
|
|
|
|
|
|
| |
* x86_64/locore.S: ensure the thread state is filled completely even
on recursive interrups. The value of the segment selectors is not
very important in this case, but we still need to align the stack to
the bottom of i386_interrupt_state.
Message-Id: <20230729174753.1145878-1-luca@orpolo.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
* i386/i386/idt.c: add selector for the interrupt-specific stack
* i386/i386/ktss.c: configure ist1 to use a dedicated stack
* i386/i386/trap.c: add double fault handler, which just prints the
state and panics. There is not much else to do in this case but it's
useful for troubleshooting
* x86_64/idt_inittab.S: allow to specify an interrupt stack for custom
handlers
* x86_64/locore.S: add double fault handler
Message-Id: <20230729174514.1145656-1-luca@orpolo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
vm_object_coalesce() callers used to rely on the fact that it always
merged the next_object into prev_object, potentially destroying
next_object and leaving prev_object the result of the whole operation.
After ee65849bec5da261be90f565bee096abb4117bdd
"vm: Allow coalescing null object with an internal object", this is no
longer true, since in case of prev_object == VM_OBJECT_NULL and
next_object != VM_OBJECT_NULL, the overall result is next_object, not
prev_object. The current callers are prepared to deal with this since
they handle this case seprately anyway, but the following commit will
introduce another caller that handles both cases in the same code path.
So, declare the way vm_object_coalesce() coalesces the two objects its
implementation detail, and make it return the resulting object and the
offset into it explicitly. This simplifies the callers, too.
Message-Id: <20230705141639.85792-2-bugaevc@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a deallocated VM map entry refers to an object that only has a single
reference and doesn't have a pager port, we can eagerly release any
physical pages that were contained in the deallocated range.
This is not a 100% solution: it is still possible to "leak" physical
pages that can never appear in virtual memory again by creating several
references to a memory object (perhaps by forking a VM map with
VM_INHERIT_SHARE) and deallocating the pages from all the maps referring
to the object. That being said, it should help to release the pages in
the common case sooner.
Message-Id: <20230626112656.435622-6-bugaevc@gmail.com>
|
|
|
|
|
|
|
| |
When entering an object into a map, try to extend the next entry
backward, in addition to the previously existing attempt to extend the
previous entry forward.
Message-Id: <20230626112656.435622-5-bugaevc@gmail.com>
|