summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-08-09memory_object_proxy: Deliver no-sender notifications on a separate portv1.8+git202108091.8+git20210809Samuel Thibault
Otherwise userland can send spurious notifications.
2021-08-09memory_object_proxy: Explicit that creation wants a send rightSamuel Thibault
This is required anyway, and allows the caller to pass on MAKE_SEND.
2021-08-09memory_object_proxy: Fix send port right leakSamuel Thibault
On success we'd have to clean the port right. Just consume it.
2021-08-09memory_object_proxy: Fix checking proxy lengthSamuel Thibault
We want to prevent subproxies from requesting larger sizes than what a proxy initially allowed.
2021-08-09Memory object proxy: add support for ranges and nestingJoan Lledó
2021-08-09memory_object_proxy: release resources on no-send notificationSamuel Thibault
2021-06-06vm_map: Allow exagerated max_prot for nowSamuel Thibault
glibc's mmap implementation assumes that gnumach will cap the prot for it, so for now let's revert back to capping rather than rejecting. That fixes mmap(SHARED|READ) for read-only objects.
2021-05-24Revert "vm_map: Allow passing the name of a memory object"Samuel Thibault
This reverts commit af9f471b500bcd0c1023259c7577e074fe6d3ee5.
2021-05-24vm_map: Fix proxy object protection checkSergey Bugaev
* If not making a copy, don't cap protection to the limit enforced by the proxy, and only require read access. This fixes mapping parts of read-only files MAP_ANON + PROT_READ|PROT_WRITE. * Instead of silently capping protection, return KERN_PROTECTION_FAILURE to the caller like the other vm_*() routines do.
2021-04-05rtc: Add read/write messagesSamuel Thibault
We are still having issues with bogus dates. This adds prints at boot and time set, to make sure what we actually read and write. * i386/i386at/rtc.c: Include <kern/printf.h> (readtodc): Warning about reaching CENTURY_START. Print the time read from RTC. (writetodc): Record in RTC remainder of division of year by 100 rather than subtracting 1900. Print the time written to RTC.
2021-04-05kd: Do not read the CMOS ramSamuel Thibault
This could conflict with read/writing the RTC. * i386/i386at/kd.c (kd_xga_init): Do not read the CRAM. We were always assuming VGA anyway.
2021-04-05apic: Also unmask irq 3 and 4 earlySamuel Thibault
We unmasked by hand kd's irq 1, but com0/1 also need unmasking. More generally we should unmask irqs as appropriate. * i386/i386at/model_dep.c (machine_init): Unmask irq 3 and 4.
2021-04-05ioapic: Fix arg passing of redirection entryDamien Zammit
Message-Id: <20210405115921.184572-3-damien@zamaudio.com>
2021-04-05ioapic: Refactor EOIDamien Zammit
Message-Id: <20210405115921.184572-2-damien@zamaudio.com>
2021-04-05thread_info: Fix crash when requesting for thread that never ranSamuel Thibault
* kern/thread.c (thread_info): Set last_processor to 0 when the thread never ran.
2021-04-05thread_info: Fix returning last_processorSamuel Thibault
thread->last_processor is a processor_t, not a slot number. * kern/thread.c (thread_info): Set sched_info->last_processor to thread->last_processor->slot_num rather than thread->last_processor.
2021-04-05ioapic: Use irq specific EOI properly when detectedDamien Zammit
Message-Id: <20210405052916.174771-5-damien@zamaudio.com>
2021-04-05Don't call EOI on spurious interruptsDamien Zammit
Message-Id: <20210405052916.174771-4-damien@zamaudio.com>
2021-04-05ioapic: target first processor for interruptsDamien Zammit
Message-Id: <20210405052916.174771-3-damien@zamaudio.com>
2021-04-05ioapic: Enable processor focus to BSPDamien Zammit
Message-Id: <20210405052916.174771-2-damien@zamaudio.com>
2021-04-04SMP: Fix warningsSamuel Thibault
2021-04-04SMP: fix getting the interrupt stack address and sizeSamuel Thibault
* i386/i386at/boothdr.S (_eintstack): Add missing common. * i386/xen/xen_boothdr.S (_eintstack): Add missing common. * x86_64/xen/xen_boothdr.S (_eintstack): Add missing common. * i386/i386/mp_desc.c (intstack, eintstack): Add missing underscore.
2021-04-04Add ioapic support disabled by defaultDamien Zammit
Use --enable-ncpus=x --enable-apic where x > 1 for SMP+APIC support. Use neither for no SMP and old PIC support. Message-Id: <20210404050812.145483-1-damien@zamaudio.com>
2021-04-03pit: Add more macrosSamuel Thibault
* i386/i386/pit.h (PITAUX_VAL, PIT_C2): New macros. (PIT_RATEMODE): Fix macro value.
2021-03-31linux: Add option to disable Linux groupsSamuel Thibault
* linux/configfrag.ac (--disable-linux-groups): New option. (AC_OPTION_Linux_group): Default to $enable_linux_groups.
2021-03-31intr: Always share irqsSamuel Thibault
We currently already always assume that irqs user handlers can be shared * device/intr.c (install_user_intr_handler): Add SA_SHIRQ to flags.
2021-03-31intr: Add user interrupt handling code for non-Linux caseDamien Zammit
* device/intr.c: Include <kern/assert.h> (struct intr_list): New structure. (user_intr_handlers): New array. (user_irq_handler): New function. (install_user_intr_handler): New function. Message-Id: <20210330025830.63528-2-damien@zamaudio.com>
2021-03-31Keep BIOS mapped even without LinuxSamuel Thibault
Not only Linux drivers need BIOS mapped. * i386/i386at/model_dep.c (i386at_init) [!LINUX_DEV]: Map the low memory. * i386/intel/pmap.c (pmap_create) [!LINUX_DEV]: Likewise.
2021-03-29apic: Reorder definesDamien Zammit
2021-03-28linux irq: Avoid hardcoding the number of interrupts.Damien Zammit
* linux/dev/arch/i386/kernel/irq.c: Include <i386/irq.h> instead of <i386/pic.h>. (irq_action): Use NINTR instead of 16, do not bother expliciting the initialization. (install_user_intr_handler, request_irq, free_irq, probe_irq_on, probe_irq_off, reserve_mach_irqs): Use NINTR instead of 16.
2021-03-28pic: Move to interrupts 0x20-0x2fDamien Zammit
* i386/i386/pic.h (PICM_VECTBASE): Set to 0x20. * i386/i386at/idt.h (IDTSZ): Set to 0x20 + 0x10. (PIC_INT_BASE): Set to 0x20.
2021-03-28Existing SMP apic code improvementsDamien Zammit
* i386/i386/apic.c (acpi_get_irq_override): New function. (apic_get_ioapic): Make it return IoApicData* rather than IoApicData. (apic_print_info): Manage IoApicData* rather than IoApicData. * i386/i386/apic.h (struct ApicReg): Use uint32_t instead of unsigned. (struct ioapic_route_entry): New structure. (union ioapic_route_entry_union): New union. (ApicLocalUnit): Rename base to gsi_base. Add ioapic field. (APIC_IRQ_OVERRIDE_POLARITY_MASK, APIC_IRQ_OVERRIDE_TRIGGER_MASK): New macros. (acpi_get_irq_override, ): New prototype. (apic_get_ioapic): Update prototype. (lapic): New declaration. (IMCR_SELECT, IMCR_DATA, MODE_IMCR, IMCR_USE_PIC, IMCR_USE_APIC, LAPIC_ENABLE, LAPIC_NMI, LAPIC_DISABLE, LAPIC_TIMER_PERIODIC, LAPIC_TIMER_DIVIDE_2, LAPIC_TIMER_DIVIDE_4, LAPIC_TIMER_DIVIDE_8, LAPIC_TIMER_DIVIDE_16, LAPIC_TIMER_BASEDIV, NINTR, IOAPIC_FIXED, IOAPIC_PHYSICAL, IOAPIC_LOGICAL, IOAPIC_NMI, IOAPIC_EXTINT, IOAPIC_ACTIVE_HIGH, IOAPIC_ACTIVE_LOW, IOAPIC_EDGE_TRIGGERED, IOAPIC_LEVEL_TRIGGERED, IOAPIC_MASK_ENABLED, IOAPIC_MASK_DISABLED): New macros. * i386/i386at/acpi_parse_apic.h (struct acpi_apic_ioapic): Rename base field to gsi_base. * i386/i386at/acpi_parse_apic.c (acpi_apic_add_ioapic): Update to gsi_base new name. Set ioapic field. (acpi_apic_setup): Rename lapic to lapic_unit. Message-Id: <20210328060320.36194-5-damien@zamaudio.com>
2021-03-28Don't allow writing to acpi table in memoryDamien Zammit
* i386/i386at/acpi_parse_apic.c (acpi_get_apic): Map rsdt entries read-only. Message-Id: <20210328060320.36194-4-damien@zamaudio.com>
2021-03-28fixup acpi base table searchDamien Zammit
* i386/i386at/acpi_parse_apic.c (acpi_check_rsdp_align): Make it take a void* instead of uint32_t. (acpi_get_rsdp): Apply phystokv on the EBDA base and 0xE0000. (acpi_apic_setup): Drop spurious negation. Message-Id: <20210328060320.36194-3-damien@zamaudio.com>
2021-03-28configure: Add block groupDamien Zammit
This is the last group needed to easily disable the Linux glue. * linux/configfrag.ac (block): New group. (floppy): Set group to block. (ide): Set group to block. Message-Id: <20210328060320.36194-2-damien@zamaudio.com>
2021-03-27fix EISA check in init_IRQDamien Zammit
Message-Id: <20210326094850.2606-5-damien@zamaudio.com>
2021-03-27clock: Let timer proceed even before we have set threadsDamien Zammit
Message-Id: <20210326094850.2606-4-damien@zamaudio.com>
2021-02-21ahci: Fix variable nameAndrea G. Monaco
* linux/dev/drivers/block/ahci.c (ahci_probe_dev): Rename spd to det.
2021-02-11i386 fpu: fix bogus checkAndrea G. Monaco
Avoid panicing on all CPUs that do not support xsaves. * i386/i386/fpu.c (init_fpu): Panic on CPUs that do not support xsaves only if the cpu-reported xsave size is smaller than expected.
2021-02-09Default MIG to mig when not found.Samuel Thibault
bash: no: command not found seems to be confusing for users. Revert to setting back to mig, but after printing the warning. * configure.ac (MIG): Default to mig when not found.
2021-02-09Warn about missing migSamuel Thibault
* configure.ac (MIG): Do not default to mig, and warn when this is missing. Advertise the MIG variable.
2021-02-07Advise to simply use a cross-toolchainSamuel Thibault
* README: Advise to use i686-linux-gnu-* tools.
2021-02-03com: Fix bogus NCOM testAndrea G. Monaco
* i386/i386at/com.c (comprobe_general): Reject unit being equal to NCOM.
2021-01-20doc: Add a missing field for 'struct thread_sched_info'.Guy-Fleury Iteriteka
* doc/mach.texi(struct thread_sched_info): Add 'int last_processor' item. Message-Id: <20210120185809.2429-1-gfleury@disroot.org>
2021-01-09add a missing include header guard.guy fleury iteriteka
* i386/i386at/comreg.h: Add header guard angaist multiple inclusion. Message-Id: <20210109180149.11861-1-gfleury@disroot.org>
2021-01-04vm_map: Avoid linking gaps for vm_copy_tSamuel Thibault
This does not make sense, and produces incorrect results (since vme_end is 0, etc.) * vm/vm_map.h (_vm_map_clip_start, _vm_map_clip_end): Add link_gap parameter. * vm/vm_map.c (_vm_map_entry_link): Add link_gap parameter, do not call vm_map_gap_insert if it is 0. (vm_map_entry_link): Set link_gap to 1 in _vm_map_entry_link call. (_vm_map_clip_start): Add link_gap parameter, pass it to _vm_map_entry_link call.. (vm_map_clip_start): Set link_gap_to 1 in _vm_map_clip_start call. (vm_map_copy_entry_link): Set link_gap to 0 in _vm_map_entry_link call. (vm_map_copy_clip_start): Set link_gap_to 0 in _vm_map_clip_start call. (_vm_map_entry_unlink): Add unlink_gap parameter, do not call vm_map_gap_remove if it is 0. (vm_map_entry_unlink): Set unlink_gap to 1 in _vm_map_entry_unlink call. (_vm_map_clip_end): Add link_gap parameter, pass it to _vm_map_entry_link call.. (vm_map_clip_end): Set link_gap_to 1 in _vm_map_clip_end call. (vm_map_copy_entry_unlink): Set unlink_gap to 0 in _vm_map_entry_unlink call. (vm_map_copy_clip_end): Set link_gap_to 0 in _vm_map_clip_end call. * vm/vm_kern.c (projected_buffer_deallocate): set link_gap to 1 in _vm_map_clip_start and _vm_map_clip_end calls.
2021-01-04vm_map: print warning when max_size gets smaller than sizeSamuel Thibault
* vm/vm_map.c (vm_map_find_entry_anywhere): Print warning when max_size gets smaller than size.
2020-12-23Fix _Static_assert callSamuel Thibault
Before C2X, _Static_assert requires a second parameter Reported by Andrea G. Monaco <andrea.monaco@autistici.org> * i386/i386/fpu.c: Add second parameter to _Static_assert calls.
2020-12-20vm_map: Fix taking into account high bits in maskSamuel Thibault
glibc's sysdeps/mach/hurd/dl-sysdep.c has been wanting to use this for decades. * include/string.h (ffs): New declaration. * vm/vm_map.c: Include <string.h>. (vm_map_find_entry_anywhere): Separate out high bits from mask, to compute the maximum offset instead of map->max_offset. * doc/mach.texi (vm_map): Update documentation accordingly.
2020-12-07i386at: Really disable com and lpr above NCOM and NLPRSamuel Thibault
commmodem and lprinfo arrays would otherwise overflow. * i386/i386at/com.c (comattach): Return early when unit is beyond NCOM. * i386/i386at/lpr.c (lprattach): Return early when unit is beyond NLPR.