| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Message-Id: <20230319151017.531737-2-bugaevc@gmail.com>
|
|
|
|
|
|
|
|
| |
hz variable is the number of mach ticks in 1 second.
We want to know how many lapic ticks in 1 mach tick.
Therefore, we set a timer for 10 mach ticks and divide
the lapic stopwatch counter value by 10.
Message-Id: <20230311072937.450161-1-damien@zamaudio.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
TESTED:
- by setting MACH_LOCK_MON to 1 in configfrag.ac
and running "show all slocks" in kdb
- does not break default configured kernel
Message-Id: <20230306070512.292715-1-damien@zamaudio.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Previously the lapic timer was calibrated by one-shot PIT timer2.
This method can be buggy and generally unused in emulation environments.
This patch reworks the timer calibration to use a mach timer based
on regular PIT interrupts to remapped IOAPIC pin.
This also changes the primary clock source to use PIT timer0 remapped
to an IOAPIC pin when APIC mode is enabled, instead of a periodic lapic
timer.
Message-Id: <20230306070452.292697-1-damien@zamaudio.com>
|
|
|
|
|
|
|
| |
* i386/i386/locore.h: user vm_offset_t in the recovery_table
* x86_64/locore.S: fix RECOVERY() location and keep user regs in %rbx,
as it seems the convention. This only applies to 32-bit userspace.
Message-Id: <20230227204501.2492152-5-luca@orpolo.org>
|
|
|
|
|
|
| |
* i386/intel/pmap.c: remove #error and allow compilation, keeping a
reminder to fix the pmap module.
Message-Id: <20230227204501.2492152-2-luca@orpolo.org>
|
|
|
|
|
|
| |
NB: This relies on a fix for QEMU as one-shot PIT mode
is currently broken in qemu.
Message-Id: <20230226013110.50606-1-damien@zamaudio.com>
|
|
|
|
|
|
| |
All PC compatibles operate the PIT at a clock rate of (105/88) MHz
Message-Id: <20230226063555.66284-1-damien@zamaudio.com>
|
|
|
|
| |
Message-Id: <20230226013052.50577-1-damien@zamaudio.com>
|
|
|
|
|
|
| |
TESTED: With and without apic/smp
Message-Id: <20230225061420.16985-1-damien@zamaudio.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes boot --enable-ncpus=1 with --enable-apic configuration
albeit the keyboard is stuck and network cannot be accessed.
Error messages:
Timeout reached while wating for return value
/bin/console: Could not receive return value from daemon process: Connection timed out
Message-Id: <20230219022351.25767-1-damien@zamaudio.com>
|
|
|
|
|
| |
* i386/i386/ldt.c: set the L bit if user-space is 64-bit
Message-Id: <20230216213318.2048699-4-luca@orpolo.org>
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
| |
* i386/include/mach/i386/vm_param.h: extend the vm constants to ULL on
x86_64 to avoid a shift overflow warning
* i386/intel/pmap.c: fix cast and unused variables
Message-Id: <20230216213318.2048699-1-luca@orpolo.org>
|
|
|
|
| |
Message-Id: <20230216070205.1243532-1-damien@zamaudio.com>
|
|
|
|
| |
Message-Id: <Y+xwZ63X1PHDJwTX@jupiter.tail36e24.ts.net>
|
|
|
|
|
|
| |
They are used temporarily without CPU exchanges, and may need to be used
concurrently so 2 slots only would not be enough anyway. This also saves
having to lock for them.
|
|
|
|
| |
Message-Id: <20230215095706.1213703-2-damien@zamaudio.com>
|
|
|
|
|
| |
We need to avoid the kernel optimizing away the reads from
memory. Use a standard relaxing instruction for that.
|
|
|
|
|
|
| |
These are used only temporarily by the current processor only, so we don't
need to notify other processors about them. We however then should flush TLB
at allocation, to make sure we don't have some remnant.
|
|
|
|
|
| |
We need to avoid the kernel optimizing away the read from
pmap->cpus_using. Use a standard relaxing instruction for that.
|
|
|
|
|
|
|
| |
MARK_CPU_ACTIVE already knows to flush TLB when a cpu comes out of idle.
However, add memory barriers to be sure that setting cpu_update_needed is
seen before testing for cpus_idle.
|
| |
|
|
|
|
| |
Message-Id: <20230213084919.1157074-5-damien@zamaudio.com>
|
| |
|
|
|
|
| |
Message-Id: <20230213084919.1157074-3-damien@zamaudio.com>
|
|
|
|
| |
Message-Id: <20230213084919.1157074-2-damien@zamaudio.com>
|
|
|
|
|
|
|
| |
This depends on serialised AP init patch.
Fixes warnings spewing at boot with APIC and SMP
Message-Id: <20230204101529.877846-1-damien@zamaudio.com>
|
| |
|
|
|
|
|
|
|
| |
This also serialises the AP bringup, so paging can be enabled per cpu
one by one.
Also-by: Almudena Garcia <liberamenso10000@gmail.com>
|
|
|
|
|
| |
This is required to implement ptrace.
Message-Id: <Y+kvVSoC+5bvsazl@jupiter.tail36e24.ts.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* i386/i386/vm_param.h: adjust constants to the new kernel map
- the boothdr.S code already sets up a temporary map to higher
addresses, so we can use INIT_VM_MIN_KERNEL_ADDRESS as in xen
- increase the kernel map size to accomodate for bigger structures
and more memory
- adjust kernel max address and directmap limit
* i386/i386at/biosmem.c: enable directmap check also on x86_64
* i386/include/mach/i386/vm_param.h: increase user virtual memory
limit as it's not conflicting with the kernel's anymore
* i386/intel/pmap.h: adjust lin2pdenum_cont() and INTEL_PTE_PFN to the
new kernel map
* x86_64/Makefrag.am: change KERNEL_MAP_BASE to be above 4G, and
according to mcmodel=kernel. This will allow to use the full memory
address space.
Message-Id: <20230212172818.1511405-10-luca@orpolo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* i386/i386/vm_param.h: temporariliy fix kernel upper address
* i386/intel/pmap.c: split kernel and user L3 map initialization. For
simplicity in handling the different configurations, on 32-bit
(+PAE) the name PDPNUM_KERNEL is used in place of PDPNUM, while only
on x86_64 the PDPNUM_USER and PDPNUM_KERNEL are treated differently.
Also, change iterating over PTP tables in case the kernel map is not
right after the user map.
* i386/intel/pmap.h: define PDPNUM_USER and PDPNUM_KERNEL and move
PDPSHIFT to simplify ifdefs.
Message-Id: <20230212172818.1511405-9-luca@orpolo.org>
|
|
|
|
|
|
|
| |
* i386/i386/trap.c: change from int to a proper type to hold a
register value
* x86_64/locore.S: use 64-bit register to avoid address truncation
Message-Id: <20230212172818.1511405-8-luca@orpolo.org>
|
|
|
|
|
|
|
|
|
|
| |
* i386/i386/vm_param.h: add VM_MAX/MIN_USER_ADDRESS to kernel headers.
* i386/i386/db_interface.c
* i386/i386/ldt.c
* i386/i386/pcb.c
* i386/intel/pmap.c
* kern/task.c: replace VM_MAX/MIN_ADDRESS with VM_MAX/MIN_USER_ADDRESS
Message-Id: <20230212172818.1511405-7-luca@orpolo.org>
|
|
|
|
|
|
|
|
|
|
|
| |
This is a preparation to run the kernel on high addresses, where the
user vm region and the kernel vm region will use different L3 page
tables.
* i386/intel/pmap.c: on x86_64, retrieve the value of pdpbase from the
L4 table, and add the pmap_pdp() helper (useful also for PAE).
* i386/intel/pmap.h: remove pdpbase on x86_64.
Message-Id: <20230212172818.1511405-6-luca@orpolo.org>
|
|
|
|
|
| |
* i386/intel/pmap.c: move it to pmap_bootstrap_pae()
Message-Id: <20230212172818.1511405-5-luca@orpolo.org>
|
|
|
|
|
| |
* i386/intel/pmap.c: move it to pmap_bootstrap_xen()
Message-Id: <20230212172818.1511405-4-luca@orpolo.org>
|
| |
|
|
|
|
|
|
|
| |
* i386/intel/pmap.c: start walking the page table tree from the L4
table instead of the PDP table in pmap_pte() and pmap_pde(),
preparing for the kernel to run on high addresses.
Message-Id: <20230212172818.1511405-2-luca@orpolo.org>
|
|
|
|
|
|
|
| |
* i386/intel/pmap.c: allocate the L4 page table from a dedicate kmem
cache instead of the generic kernel map.
Also improve readability of nested ifdef's.
Message-Id: <20230212170313.1501404-4-luca@orpolo.org>
|
|
|
|
|
|
| |
* i386/i386at/com.c use proper helper to convert physical to virtual
address.
Message-Id: <20230212170313.1501404-3-luca@orpolo.org>
|
|
|
|
|
| |
* i386/i386/pcb.c: always set esp to 0, it seems unused.
Message-Id: <20230212170313.1501404-2-luca@orpolo.org>
|
|
|
|
|
|
| |
We haven't built gnumach using a.out for a very long time.
Message-Id: <Y+SgsQ3y8pPqfxRV@jupiter.tail36e24.ts.net>
|
|
|
|
| |
(this is actually a no-op for i386)
|
| |
|
| |
|