aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* vm_pages_phys: Avoid faults while we keep vm locksSamuel Thibault2024-02-041-2/+3
| | | | | In principle we are actually writing to the allocated area outside of the vm lock, but better be safe in case somebody changes things.
* ACPI: Support XSDT (ACPI >= v2.0)Damien Zammit2024-02-013-89/+195
| | | | | | | | | This enables gnumach to additionally parse the XSDT table if the revision of ACPI is 2. TESTED: Still works on qemu (ACPI v1.0) TESTED: Works on a x86 board with XSDT (ACPI v2.0) Message-ID: <20240131021218.1335821-1-damien@zamaudio.com>
* model_dep: Fix serial console with APIC enabledDamien Zammit2024-02-011-5/+5
| | | | | | | Move cninit() further down so that IOAPIC has a chance to initialize before the com port interrupt is unmasked in the IOAPIC, fixing a fault and reboot. Message-ID: <20240131100210.1354522-1-damien@zamaudio.com>
* fix doc buildSamuel Thibault2024-01-311-0/+1
|
* Add vm_pages_physSamuel Thibault2024-01-305-0/+129
| | | | | | | | For rumpdisk to efficiently determine the physical address, both for checking whether it is below 4GiB, and for giving it to the disk driver, we need a gnumach primitive (and that is not conditioned by MACH_VM_DEBUG like mach_vm_region_info and mach_vm_object_pages_phys are).
* apic: Set up LAPICs in xAPIC modeDamien Zammit2024-01-303-4/+6
| | | | | | Clear flag in msr for xAPIC mode. Message-ID: <20240130080405.1304381-1-damien@zamaudio.com>
* Support up to two IOAPICs with up to 32 GSIs on eachDamien Zammit2024-01-296-7/+153
| | | | | | | Previously, only IOAPIC[0] was supported. Now this supports up to two IOAPICs. Message-ID: <20240129100652.1262126-1-damien@zamaudio.com>
* fpu: Fix cpuid feature detectionOlivier Valentin2024-01-271-25/+15
| | | | | | Make sure to fetch capabilities from cpuid(0xd,0x1) and max structure sizes from cpuid(0xd,0x0). Message-ID: <20240124080019.8136-1-valentio@free.fr>
* ioapic: Remove IMCR toggleDamien Zammit2024-01-271-6/+0
| | | | | | | | Since we are not using legacy MP tables but intending to use ACPI to configure interrupt routing, we can assume all boards have virtual wire mode, thus do not require setting of IMCR register. (This may fix crashes on machines that do not have IMCR registers). Message-ID: <20240124035138.1044855-2-damien@zamaudio.com>
* linux: Add noide and noahci kernel optionsSamuel Thibault2024-01-232-2/+8
| | | | | They were meant to be temporary, but that got longer, and people seem to expect them to be there now.
* Resurrect x86-linux build.Janneke Nieuwenhuizen2024-01-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | This avoids using system headers, which may result in kern/strings.c: In function 'strchr': kern/strings.c:188:32: error: 'NULL' undeclared (first use in this function) In file included from util/atoi.c:77: ./util/atoi.h:65:29: error: unknown type name 'u_char' device/net_io.c: In function 'bpf_do_filter': device/net_io.c:1636:34: error: 'u_int' undeclared (first use in this function); did you mean 'int'? In file included from device/subrs.c:36: ./device/if_ether.h:43:9: error: unknown type name 'u_char' 43 | u_char ether_dhost[6]; ./linux/dev/include/linux/fs.h:304:5: error: unknown type name 'loff_t' 304 | loff_t f_pos; This is a follow-up to commit d5e5dd3401ea0d0475aa830c2171be5b8a72f4fa Update configure.ac so that we don't need glibc when running ./configure. Message-ID: <20240122075549.26207-1-janneke@gnu.org>
* console: Fix baud rate on com ports, use 115200 default baud, 8 data bitsDamien Zammit2024-01-203-18/+7
| | | | | | | | TESTED: By booting gnumach off an HP T620 with console=com0 and receiving 115200 8N1 console on another machine connected via the serial port in minicom. Without this patch, part of the console is garbled by mismatching com params (9600 7N1). Message-ID: <20240119031214.691086-1-damien@zamaudio.com>
* tests: clean test-installed mach headersSamuel Thibault2024-01-131-0/+1
| | | | | We are for now lacking proper dependencies between the source headers and the test-installed headers, but we can at least clean them out.
* add basic thread testsLuca Dariz2024-01-132-1/+106
| | | | Message-ID: <20240111210907.419689-11-luca@orpolo.org>
* add basic task testsLuca Dariz2024-01-132-1/+173
| | | | Message-ID: <20240111210907.419689-10-luca@orpolo.org>
* add raw mach_msg testsLuca Dariz2024-01-132-1/+407
| | | | Message-ID: <20240111210907.419689-9-luca@orpolo.org>
* add syscall testsLuca Dariz2024-01-132-1/+168
| | | | Message-ID: <20240111210907.419689-8-luca@orpolo.org>
* add thread creation helper to testsLuca Dariz2024-01-133-0/+88
| | | | Message-ID: <20240111210907.419689-7-luca@orpolo.org>
* add basic vm testsLuca Dariz2024-01-132-1/+87
| | | | Message-ID: <20240111210907.419689-6-luca@orpolo.org>
* adjust range when changing memory pageabilityLuca Dariz2024-01-131-5/+26
| | | | | | | | | * vm/vm_map.c: use actual limits instead of min/max boundaries to change pageability of the currently mapped memory. This caused the initial vm_wire_all(host, task VM_WIRE_ALL) in glibc startup to fail with KERN_NO_SPACE. Message-ID: <20240111210907.419689-5-luca@orpolo.org>
* add mach_port testsLuca Dariz2024-01-132-1/+123
| | | | Message-ID: <20240111210907.419689-4-luca@orpolo.org>
* add gsync testsLuca Dariz2024-01-132-1/+124
| | | | Message-ID: <20240111210907.419689-3-luca@orpolo.org>
* add mach_host testsLuca Dariz2024-01-132-1/+83
| | | | Message-ID: <20240111210907.419689-2-luca@orpolo.org>
* add basic user-space tests with qemuLuca Dariz2024-01-1317-5/+748
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac: move test fragment to have USER32 * tests/Makefrag.am: add user tests * tests/README: add basic info on how to run and debug user tests * tests/configfrag.ac: allow the test compiler/flags to be autoconfigured or customized * tests/grub.cfg.single.template: add minimal grub config to boot a module * tests/include/device/cons.h: add a simplified version of device/cons.h usable for tests * tests/include/kern/printf.h: symlink to kern/printf.h * tests/include/mach/mig_support.h: add basic version for user-space tests * tests/include/syscalls.h: add prototypes for syscalls used in tests. * tests/include/testlib.h: add definitions for common test functionalities * tests/include/util/atoi.h: symlink to util/atoi.h * tests/run-qemu.sh.template: add a simple qemu test runner * tests/start.S: add arch-specific entry point * tests/syscalls.S: generate syscalls entry points * tests/test-hello.c: add basic smoke test * tests/testlib.c: add the minimal functionality to run a user-space executable and reboot the system, and some test helpers. * tests/user-qemu.mk: add rules to build simple user-space test modules, including generating mig stubs. The tests reuse some kernel code (like printf(), mach_atoi(), mem*(), str*() functions) so we can use the freestanding environment and not depend on glibc. Message-ID: <20240111210907.419689-1-luca@orpolo.org>
* expose MACH_MSG_USER_ALIGNMENT for manually-built messagesLuca Dariz2023-12-291-9/+10
| | | | Message-ID: <20231228194301.745811-11-luca@orpolo.org>
* USER32: change default to disabled and make it a general optionLuca Dariz2023-12-292-10/+14
| | | | | | | | | | | | * configfrag.ac: add the global option USER32; although it makes sense for 64-bit versions only, it can be used by future 64-bit architectiures and not only x86_64. Also, change the default setting to be disabled; now that we have a working full 64-bit system, it makes sense to consider it the common choice. * x86_64/configfrag.ac: define the correct 32-bit cpu if USER32 is enabled. Message-ID: <20231228194301.745811-2-luca@orpolo.org>
* Reorder mach_msg_type_t fields to ensure msgt_name and msgt_size are byte ↵Flavio Cruz2023-12-171-10/+10
| | | | | | | | aligned msgt_unused appears right after msgt_size since msgt_size can be reduced to only 8 bits in the future, so we leave the door opened to make msgt_unused 13 bits long.
* x86_64: Support 8 byte inlined port rights to avoid message resizing.Flavio Cruz2023-12-173-14/+83
| | | | | | | | | | If a port is inlined in a message, the user has to use mach_port_name_inlined_t to define each port. Out of line memory continues to use mach_port_name_t since that memory has to be copied to the kernel anyway. Both copyinmsg and copyoutmsg can be reduced to nothing (if we ignore USER32) as a follow up but kept this patch simple for ease of review.
* Revert "Reorder mach_msg_type_t fields to ensure msgt_name and msgt_size are ↵Samuel Thibault2023-12-031-10/+10
| | | | | | byte aligned" This reverts commit 2db6b9b7b23b3bab944665b3b6012d24dd425d97.
* Revert "x86_64: Support 8 byte inlined port rights to avoid message resizing."Samuel Thibault2023-12-033-83/+14
| | | | This reverts commit 29d4bcaafc4c2040df27a6247603c68e7757205c.
* Xen: fix buildSamuel Thibault2023-12-034-4/+8
|
* Fix 32-on-64: Fix missing es pushSamuel Thibault2023-12-031-1/+2
| | | | push %es actually cannot be compiled
* x86_64: Support 8 byte inlined port rights to avoid message resizing.Flavio Cruz2023-12-033-14/+83
| | | | | | | | | | | If a port is inlined in a message, the user has to use mach_port_name_inlined_t to define each port. Out of line memory continues to use mach_port_name_t since that memory has to be copied to the kernel anyway. Both copyinmsg and copyoutmsg can be reduced to nothing (if we ignore USER32) as a follow up but kept this patch simple for ease of review. Message-ID: <ZWg00XzFPqqL1yF-@jupiter.tail36e24.ts.net>
* Reorder mach_msg_type_t fields to ensure msgt_name and msgt_size are byte ↵Flavio Cruz2023-12-031-10/+10
| | | | | | | | | aligned msgt_unused appears right after msgt_size since msgt_size can be reduced to only 8 bits in the future, so we leave the door opened to make msgt_unused 13 bits long. Message-ID: <ZWGT6a6GeqFAtOUn@jupiter.tail36e24.ts.net>
* Use MACH_PORT_NAME_NULL and MACH_PORT_NAME_DEAD when checking for null or ↵Flavio Cruz2023-11-291-1/+1
| | | | | | | | dead rights Comparing mach_port_name_t that is MACH_PORT_NAME_DEAD against MACH_PORT_DEAD will always return false. Message-ID: <ZWbMBrk7qrl15sKL@jupiter.tail36e24.ts.net>
* vm: Coalesce map entriesSergey Bugaev2023-11-271-2/+27
| | | | | | | | When - extending an existing entry, - changing protection or inheritance of a range of entries, we can get several entries that could be coalesced. Attempt to do that. Message-ID: <20230705141639.85792-4-bugaevc@gmail.com>
* vm: Add vm_map_coalesce_entrySergey Bugaev2023-11-272-2/+78
| | | | | | This function attempts to coalesce a VM map entry with its preceeding entry. It wraps vm_object_coalesce. Message-ID: <20230705141639.85792-3-bugaevc@gmail.com>
* ipc_entry_lookup_failed: Also write message id in bogus port warningSamuel Thibault2023-11-193-16/+16
| | | | | It may be enough to get an idea of the origin of the port without having to produce a stack trace.
* ipc_entry_lookup: Generalize warnings about bogus port namesSamuel Thibault2023-11-184-4/+54
| | | | | Looking up a bogus port name is generally a sign of a real bug, such as a spurious mach port deallocation.
* Fix indentSamuel Thibault2023-11-121-4/+4
|
* mach/message.h: Fix C++98 buildSamuel Thibault2023-11-071-0/+2
| | | | static_assert was introduced in C++11.
* Fix assertion for i686 since mach_port_name_t and mach_port_t have the same sizeFlavio Cruz2023-11-071-1/+2
| | | | Message-ID: <ZUlwWGgc2kXNH5dN@jupiter.tail36e24.ts.net>
* mach/message.h: Fix C++ buildSamuel Thibault2023-11-031-0/+5
|
* 64bit: Fix user memory leaks on non-inline port arraysSamuel Thibault2023-11-011-1/+5
| | | | | The userland allocation is for port names, not ports (as translated below), so we need to allocate less.
* locore: Homogeneize 32bit and 64bitSamuel Thibault2023-10-282-1/+3
|
* 64bit: Fix locore buildSamuel Thibault2023-10-282-6/+27
| | | | | | | | | To allow references to int_stack_base to be quite unconstrained, we need to use 64bit register indexing. CPU_NUMBER_NO_GS was missing a 64bit variant. CPU_NUMBER_NO_STACK assumes being passed a 32bit register.
* 64bit: Fix types in lock.hSamuel Thibault2023-10-281-8/+8
| | | | simple locks use natural_t, and indexes for bt/bts/btr have to be 32bit.
* x86_64/locore.S: Fix int stack checks when NCPUS > 1Damien Zammit2023-10-281-5/+8
| | | | Message-ID: <20231028001347.448826-1-damien@zamaudio.com>
* Factorize more push/pop codeSamuel Thibault2023-10-272-46/+59
|
* locore: Also factorize segment management on i386Samuel Thibault2023-10-272-94/+74
| | | | | | and harmonize i386/x86_64. This btw fixes not using dx in 32-on-64's alltraps.