aboutsummaryrefslogtreecommitdiff
path: root/x86_64
Commit message (Collapse)AuthorAgeFilesLines
* x86_64: Add missing int_entry_table entries for APICSamuel Thibault2022-11-151-0/+15
| | | | | 214866d58ac2 ("Add ioapic support disabled by default") missed adding them for x86_64.
* interrupt: Fix saving irq/ipl when linux drivers are disabledSamuel Thibault2022-09-171-13/+31
| | | | | | | | | | | | | | When Linux drivers are disabled, in hardclock() the linux_timer_intr() call is dropped, and gcc can tail-recursion-optimize the call to clock_interrupt(). To do so, it overwrites the hardclock() parameters to suit the clock_interrupt parameters layout. This however means it thrashes the backups that the interrupt() function had made of irq/ipl, leading to mayhem. interrupt should thus really properly separate its irq/ipl backups from the interrupt function parameters. Thanks a lot to Etienne Brateau for the tricky investigation!
* x86_64: fix buildSamuel Thibault2022-09-171-1/+1
|
* copyinmsg: Set msgh_size inside copyinmsg rather than the callerSamuel Thibault2022-08-281-2/+4
| | | | | In the 32/64 conversion case it is copyinmsg that will know the eventual size.
* x86_64: fix installing x86_64-specific headersSamuel Thibault2022-08-281-17/+17
|
* Fix inclusability of <mach/mach_types.h>Samuel Thibault2022-08-281-0/+1
| | | | | Now that mach/machine/vm_types.h uses stdint types, we have to ship a header that defines them.
* Fix building x86_64 xen platformSamuel Thibault2022-08-273-46/+38
| | | | | On Xen we do not have a separate boot section, we directly start at the kernel map address. We thus do not have a map shift.
* add rpc_versions for vm typesLuca Dariz2022-08-271-1/+11
| | | | | | | | | | | | | | | * vm_types.h: add new types and conversion functions * mach_types.defs: adapt vm types depending on kernel user/server * vm_info.h: adapt rpc structure to have uniformly-sized members also on 64-bit * x86_64/configfrag.c: add new option to select the user-space variant. Note that with this change the user-space interface is somehow fixed, i.e. it can't support 32-bit and 64-bit tasks at the same time. If this would be needed at some point, this change needs to be reworked. Signed-off-by: Luca Dariz <luca@orpolo.org> Message-Id: <20220403145955.120742-3-luca@orpolo.org>
* fix register corruption in irq on qemuLuca Dariz2022-08-271-6/+6
| | | | | | | | | rbx was used to compute the irq index in iunit and ivect arrays, however it should be preserved by pushing it in to the stack. As a solution, we use rax instead, which is caller-saved. Signed-off-by: Luca Dariz <luca@orpolo.org> Message-Id: <20220205175129.309469-4-luca@orpolo.org>
* x86_64 boothdr: Fix _start symbol for multiboot address overridesSamuel Thibault2022-08-271-7/+5
| | | | | | We shouldn't be needing that since we won't use a.out for 64bit, but using address override in the multiboot header could be useful at least for testing.
* add support for booting from grub with x86_64Luca Dariz2022-08-273-11/+272
| | | | | | | | | | | | | | | | | | | | | | | | * configure: compile for native x86_64 by default instead of xen * x86_64/Makefrag.am: introduce KERNEL_MAP_BASE to reuse the constant in both code and linker script * x86_64/ldscript: use a .boot section for the very first operations, until we reach long mode. This section is not really allocated, so it doesn't need to be freed later. The vm system is later initialized starting from .text and not including .boot * link kernel at 0x4000000 as the xen version, higher values causes linker errors * we can't use full segmentation in long mode, so we need to create a temporary mapping during early boot to be able to jump to high addresses * build direct map for first 4G in boothdr, it seems required by Linux drivers * add INTEL_PTE_PS bit definition to enable 2MB pages during bootstrap * ensure write bit is set in PDP entry access rights. This only applies to PAE-enabled kernels, mandatory for x86_64. On xen platform it seems to be handled differently Signed-off-by: Luca Dariz <luca@orpolo.org> Message-Id: <20220205175129.309469-2-luca@orpolo.org>
* Ship x86_64/x86_64 and x86_64/include/mach/x86_64Samuel Thibault2022-02-061-1/+3
| | | | | * Makefrag.am (EXTRA_DIST): Ship the x86_64/x86_64 and x86_64/include/mach/x86_64 symlinks.
* Makefrag.am: Move architecture condition inside architecture Makefrag.amSamuel Thibault2022-02-061-17/+10
| | | | | Otherwise we cannot use _DIST there and have them all taken into account. As a consequence, we can drop duplicate _DIST between i386 and x86_64.
* x86_64: Fix installation target of headersSamuel Thibault2021-09-181-2/+2
| | | | | | | * x86_64/Makefrag.am (include_mach_i386dir): Rename to include_mach_x86_64dir, set to $(includedir)/mach/x86_64. (include_mach_i386_HEADERS): Rename to include_mach_x86_64_HEADERS. Reported-by: Andrea Monaco <andrea.monaco@autistici.org>
* ioapic: Refactor EOIDamien Zammit2021-04-051-1/+0
| | | | Message-Id: <20210405115921.184572-2-damien@zamaudio.com>
* Don't call EOI on spurious interruptsDamien Zammit2021-04-051-6/+3
| | | | Message-Id: <20210405052916.174771-4-damien@zamaudio.com>
* SMP: fix getting the interrupt stack address and sizeSamuel Thibault2021-04-041-0/+1
| | | | | | | * 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.
* Add ioapic support disabled by defaultDamien Zammit2021-04-041-1/+23
| | | | | | | 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>
* x86: Pave the way for xsave/xrstor supportSamuel Thibault2020-11-281-1/+5
| | | | | | | | | | | | | * i386/i386/fpu.h (xgetbv, get_xcr0, xsetbv, set_xcr0): New inline functions. (xsave, xrstor): New macros. * i386/i386/locore.S (cpu_features): Extend to two words. (cpu_features_edx, cpu_features_ecx): New labels. (discover_x86_cpu_type): Also save ecx cpuid(1) report. * x86_64/locore.S: Likewise. * i386/i386/locore.h (cpu_features): Extend to two words. (CPU_FEATURE_XSAVE): New macro. * i386/i386/proc_reg.h (CR4_OSXSAVE): New macro.
* Disable com3 and com4Samuel Thibault2020-11-221-1/+2
| | | | | | | | We do not support shared IRQs for these, so avoid boot issues when running on a system with more than 2 com ports. * i386/configfrag.ac (ncom) [at:i?86]: Set to 2. * x86_64/configfrag.ac (ncom) [at:x86_64]: Set to 2.
* 64bit: fix buildSamuel Thibault2020-07-181-0/+2
| | | | | | | * device/ds_routines.c (ds_device_intr_register, ds_device_intr_ack) [__x86_64__]: Disable. * x86_64/Makefrag.am (libkernel_a_SOURCES): Add i386/i386/irq.c and i386/i386/irq.h.
* mach_trap_table: Fix 64bit versionSamuel Thibault2020-04-061-1/+1
| | | | | | | The addition of the mach_trap_name field made the 64bit unused field spurious. * kern/syscall_sw.h (mach_trap_t): Remove `unused' field.
* Share ncom, lpr, PAE definitions between i386 and x86_64Samuel Thibault2020-03-291-12/+3
| | | | | | | | | | | | Otherwise the x86_64 configfrag would overwrite i386's. * i386/configfrag.ac: Remove ncom, nlpr, pae, NCOM, NLPR, PAE definitions. * i386/configfrag.ac: Remove ncom, nlpr, NCOM, NLPR, PAE definitions. Enable PAE. * configfrag-first.ac: New file, defines ncom, nlpr, pae. * configure.ac: Include configfrag-first.ac * configfrag.ac: Define NCOM, NLPR, PAE.
* x86_64: drop unused functionsSamuel Thibault2020-03-291-122/+0
| | | | | * x86_64/locore.S (dr6, dr0, dr1, dr2, dr3): Remove functions. (dr_msk, dr_addr): Remove variables.
* x86_64: Fix map address given to linkerSamuel Thibault2020-03-291-1/+1
| | | | | | | See VM_MIN_KERNEL_ADDRESS. * x86_64/Makefrag.am (gnumach_LINKFLAGS): Set _START to _START_MAP+0x40000000 instead of +0xC0000000.
* Enable x86_64 build for atEtienne Brateau2020-03-291-0/+6
| | | | * x86_64/Makefrag.am: Add instructions to build
* spl: Fix assembly filesEtienne Brateau2020-03-291-4/+4
| | | | * x86_64/spl.S: fix instruction length
* Enable at x86_64 buildSamuel Thibault2020-03-281-0/+19
| | | | | | | | | | * x86_64/configfrag.ac (ncom, nplr) [!at:x86_64]: Set to 0. (ncom) [at:x86_64]: Set to 4. (nlpr) [at:x86_64]: Set to 1. (ATX86_64): Define to 1. (NCOM): Define. (NLPR): Define. * configure.ac [at:x86_64]: Accept combination.
* kdasm: Fix 64bit buildSamuel Thibault2020-03-281-3/+3
| | | | | * x86_64/kdasm.S (count): Fix type to 32bit. (kd_slmscu, kd_slmscd): Fix getting count as 32bit.
* IDT: fix entries formatSamuel Thibault2020-03-281-2/+2
| | | | | * i386/i386/idt.c (idt_init_entry): Set entrypoint type to unsigned long. * x86_64/idt_inittab.S (IDT_ENTRY): Fix entry format accordingly.
* interrupt: Add 64bit variantSamuel Thibault2020-03-281-0/+84
| | | | * x86_64/interrupt.S: New file.
* kdasm: Add 64bit variantSamuel Thibault2020-03-281-0/+133
| | | | | | * i386/i386at/kdasm.S (start, count, value, from, to): Use B_ARG* instead of reimplementing them. * x86_64/kdasm.S: New file.
* build system: Add 64bit variantSamuel Thibault2020-03-282-0/+319
| | | | | | | | | Only Xen platform for now. * Makefrag.am [HOST_x86_64]: Include x86_64/Makefrag.am. * configure.ac: Include x86_64/configfrag.ac. [default:x86_64] (host_platform): Set platform to xen. * x86_64/Makefrag.am, x86_64/configfrag.ac: New files.
* Add 64bit/32bit compatibility symlinksSamuel Thibault2020-03-282-0/+2
| | | | | | This makes inclusions easier. * x86_64/include/mach/x86_64, x86_64/x86_64: New symlinks.
* xen: Add 64bit variantSamuel Thibault2020-03-282-0/+335
| | | | * x86_64/xen_boothdr.S, x86_64/xen_locore.S: New files.
* spl: Add 64bit variantSamuel Thibault2020-03-281-0/+255
| | | | * x86_64/spl.S: New file.
* locore: Add 64bit variantSamuel Thibault2020-03-281-0/+1580
| | | | * x86_64/locore.S: New file.
* ldscript: Add 64bit variantSamuel Thibault2020-03-281-0/+219
| | | | * x86_64/ldscript: New file.
* idt_inittab: Add 64bit variantSamuel Thibault2020-03-281-0/+146
| | | | * x86_64/idt_inittab.S: New file.
* debug_trace: Add 64bit variantSamuel Thibault2020-03-281-0/+56
| | | | * x86_64/debug_trace.S: New file.
* cswitch: Add 64bit variantSamuel Thibault2020-03-281-0/+150
| | | | * x86_64/cswitch.S: New file.
* setjmp: Add 64bit variantSamuel Thibault2020-03-281-0/+65
* x86_64/_setjmp.S: New file * i386/i386/setjmp.h (jmp_buf): Add 64bit variant.