Commit Graph

675 Commits

Author SHA1 Message Date
Daniel Martin 370dde2255 CPUID returns CPU Features in EDX and extended features in ECX
No functional changes

Change-Id: I98a9e5c9658a5464ba6fa71bc5d2c5d646a57ab1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7672
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2024-05-17 17:25:26 +00:00
milek7 6034ee94a2 arm64: Use WFI for idling
Change-Id: I00f17c1db7c032879da59d17c67c13c24e0b9ef8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7519
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: David Karoly <karolyd577@gmail.com>
2024-03-12 20:44:21 +00:00
milek7 51edf9322c arm64: Save/restore TPIDR_EL0 in _arch_context_swap
It's not used for anything by the OS but userspace might want
to use it for its own purposes.

Change-Id: Icda4bcd6de9d68596555e81293c8bd075f80a2a4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7511
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-03-07 15:53:37 +00:00
milek7 06fae14eb9 arm64: Save/restore FPU state when handling IRQ or syscall
Change-Id: I8b2a36d57f410c0d06ca5ce90d1b997494072c94
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7510
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-03-07 13:28:27 +00:00
X512 02463fb461 kernel/int: consolidate interrupt vector number to `int32`
This is no-op for 32 bit platforms because `int32` is defined as `long` there.

Change interrupt vector number from 64 bits to 32 bits for 64 bit platforms.

Change-Id: I52d1ad616cab16488804e9733c7afaf772a670ba
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7507
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2024-03-06 16:03:45 +00:00
X512 629f071bb9 pci: extend MSI interrupt vector number to 32 bits
Also increase MSI message data size to 32 bits according to PCIe spec.

Remove 0xff check for MSI interrupts because it is potentially valid
interrupt vector number. Reject 0xff only for legacy pin interrupts.

- MSI-X supports up to 2048 interrupts per device that do not fit to
`uint8`.

- Non-x86 systems may use separate interrupt vector ranges for
hard-wired interrupts and MSI interrupts so `uint8` is not enough to
represent all of them.

Change-Id: Iaf9ffb197ec23db0f97ffe3ea756d28d7bfc8705
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7433
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-02-28 23:17:42 +00:00
Jérôme Duval c7360f4b02 kernel/x86_64: on context switch, load defaults in fpu control and mxcsr
after a0131eaae2884fdced27158c3d34732d1656aca9 mxcsr was possibly also incorrect.
fpu control and mxcsr will be restored with fxrstor/xrstor.
no need to clear pending exceptions on #MF
fix #18656 (and #18624 after reverting).

Change-Id: I7dd5e2e4610747c5b82abd6c67e302d264b4be92
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7104
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-11-14 21:31:01 +00:00
Jérôme Duval 53e2dc0f85 kernel/x86_64: clear any pending exceptions on #MF
* also on x86 for simplicity.
* fixes #18624
* also makes x87 FPU data registers available for x87 floating instructions. EMMS is cheap.
see 25209d81f7

Change-Id: I5c1b399377102f3eb10bc6d7f7247afbaf6d8483
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7089
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-10-31 18:15:42 +00:00
Yn0ga cbb88108d5 Various PowerPC fixes
* Removed atomic operations placeholders for modern ones
* Fix chrpscript & hfsmaps location for CDBootImage (haiku-boot-cd target)
* add of_blocks & of_blocksize openfirmware call

Change-Id: Iaaddc2c566d108976ac5e5e08caea1fc59523e06
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6987
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-10-06 20:38:24 +00:00
Augustin Cavalier ef9e2f627b kernel/arch: Make arch_debug_get_caller() a macro implemented by a builtin.
Only the x86 and PPC implementations look like they would have worked,
while the builtin is available and will work across all architectures.
We already use it unconditionally in some parts of libroot.

Change-Id: I2dffb3b2c7cdd605092382b9d649151adb921bb4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6942
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-09-23 18:41:04 +00:00
David Karoly dc3b3e172d m68k: VMTranslationMap.h is not needed in arch_vm.h
Change-Id: Ica0efdeabaa73be0030e0522352c0c3bf311a9ad
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6913
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-09-17 19:12:33 +00:00
X512 1d9ad3fad7 mmu/riscv64: implement global page mapping support
ASID allocation is not supported yet, so always use ASID 0 for user pages for now.

Change-Id: I021e77dae692c22984bc625dd0588362bece45b7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6698
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2023-07-11 17:34:31 +00:00
David Karoly b799d160f2 kernel/arm/paging: implement Modified Flag
* Introduce SWDBM flag similarly to the arm64 port
* Reuse TEX[2] for SWDBM flag which should be availble
  to be used by the operating system if TEX remap
  is enabled.
* Introduce SetAndClearPageTableEntryFlags for updating
  accessed and modified flags atomically
* Startup sequence is handled similarly to accessed flag, i.e.
  set Modified flag in initially mapped pages in bootloader and early map.
* Once the kernel initialization has progressed enough,
  pages are mapped as read-only and modified flag handling is done
  in the page fault handler.

Change-Id: I8f761e2c6325d1b91481abd569d5e8befded0761
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6518
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-06-18 11:18:24 +00:00
Augustin Cavalier e223e8e94b kernel/x86: Initialize IO-APIC only after PCI enumeration is complete.
Before the PCI refactor, PCI initialization/enumeration occurred
immediately after the PCI module was loaded, and so by the time
we got to IOAPIC initialization, it was already complete.

After the refactor, PCI enumeration is deferred until slightly later,
and so we would try to initialize IO-APICs without knowing PCI
information. This would fail, as read_irq_routing_table needs to
have that available.

Hopefully fixes #18425, #18393, #18398.

Change-Id: I1e4b06367da26eeb10085a1c6322ed39885b632b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6476
Reviewed-by: X512 <danger_mail@list.ru>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-05-29 19:44:32 +00:00
David Karoly 84745ade1b kernel/arm/paging: use simplified permission model
Change-Id: Ie0ed357ee9ca5bee4c10c6cbf74eaba77acdd179
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6435
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: David Karoly <karolyd577@gmail.com>
2023-05-16 18:07:45 +00:00
X512 6550124ea0 riscv64: implement memory barriers
Change-Id: Ied9e6dad38968cee6e828dff6ec413e6281086cd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6436
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-05-10 20:55:18 +00:00
David Karoly 6c58b765f3 kernel/arm: use inline functions for accessing coproc registers
Change-Id: I626ef5722f4ae043de9e8b0c37dbde97ac0513be
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6422
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-05-09 20:50:42 +00:00
David Karoly 3d2b8a2045 remove unused header arm920t.h
Change-Id: I288e083857b6da30788be3f902dedd07e3e54d9d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6426
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2023-05-09 18:27:46 +00:00
David Karoly 19537d01d1 kernel/arm: adjust function names for getting/setting SCTLR
Change-Id: I28d6101c772a5065beec5af20f6d2a0c1855ae6c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6421
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: David Karoly <karolyd577@gmail.com>
2023-05-07 17:35:21 +00:00
X512 e942269a1f pci: generic MSI interrupts support
Change-Id: Ib4fd23f6bca867a2b428bf2651234d719ee08672
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6221
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-04-25 15:54:32 +00:00
David Karoly 60b19d7eac kernel/arm: implement signals, fork, restart syscall
Change-Id: I24219b83d90710ef719190183ba6f069f82dae61
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6198
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-03-20 17:28:20 +00:00
X512 6d13693a78 kernel/int: increase max interrupt vector count
Change-Id: Ia16e66a7bdac37019e6256405b9f10024909c69a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6215
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2023-03-20 14:23:54 +00:00
David Karoly 434aab5a4d headers/kernel: remove alpha folder
Change-Id: I057cb53ad68113e9dce2bb13f172d4c3eb1406af
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6196
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Tested-by: Automation <automation@haiku-os.org>
2023-03-12 10:36:01 +00:00
David Karoly 0aeb55c8ac arm: remove unused variables from arch_kernel_args
Change-Id: Ice2be644142b646205648f44fb5bce5e9848e69d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6192
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Tested-by: Automation <automation@haiku-os.org>
2023-03-11 21:05:49 +00:00
David Karoly f964790bcc headers/kernel: remove sh4 folder
Change-Id: I71e52b0f4e81c872b9bc14490bf7c38b261120b0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6194
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Tested-by: Automation <automation@haiku-os.org>
2023-03-11 21:05:20 +00:00
Jérôme Duval 37223744b7 kernel/x86: add a hybrid type per cpu, to be dumped when the feature exists.
for AlderLake CPUs

Change-Id: I4beba04e3ac95d7564684ee86de99c894b57a15c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5988
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-01-10 20:40:11 +00:00
X512 fa557843f2 riscv: use atomic CSR bit set/clear operations, refactor
Fix race conditions that cause broken timer interrupts.

Change-Id: I78e13a18d394b1566977e894a1def16a66c9ca5f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5883
Reviewed-by: X512 <danger_mail@list.ru>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-12-11 18:43:15 +00:00
Jérôme Duval fb69e06195 kernel: load cpu amd microcode update if loaded by the bootloader
we detect basically the cpu info before loading the microcode,
to be able to detect the vendor, and avoid any update on hypervisor.

I couldn't test because my cpu doesn't have any update available.

Change-Id: I6aea830158423b3ee13b640be8a788fc9041e23c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5859
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-11-30 08:50:59 +00:00
Jérôme Duval 739d4da07b amd_pstates: introduce a AMD P-states driver for Ryzen with the CPPC feature
tested on Zen2 (Ryzen 3 5300U)
This support was submitted in October for inclusion in Linux.
Haiku supports only two profiles. We could probably add some more, and let the driver says which it supports.

Change-Id: Id7754b445bc32a691d58a1e4af630351562abc22
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5826
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-11-24 06:26:13 +00:00
Jérôme Duval cedd85556c kernel/x86: init the tsc frequency and clock speed from MSR when available
only for AMD newer CPUs. tested on R5300U

Change-Id: I44be2efca37b1738a759a15140e5fd8d3b5ac7b0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5804
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-11-07 09:03:52 +00:00
Jérôme Duval fbca1c4088 kernel/x86_64: configure LFENCE as a serializing instruction on AMD
Change-Id: I152bf41c3479f81fc458abdf8d89874ffa3a08d7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5691
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-09-25 08:15:15 +00:00
David Karoly cec78ae332 kernel/arm64: introduce virtual_ranges_to_keep
Change-Id: I6de950cb18892ebf2dd2aefa34b65b90a17e3f2c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5682
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: David Karoly <karolyd577@gmail.com>
2022-09-23 13:57:43 +00:00
David Karoly a0c8f15f33 kernel/arm64: implement iframe stack and unwinding
Change-Id: I1587c1f57bd73777a188bb8f1bc58263de82fcb9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5684
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: David Karoly <karolyd577@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-09-23 13:56:16 +00:00
David Karoly ef89435316 boot/x86: unify KERNEL_LOAD_ADDRESS for BIOS and EFI
Change-Id: Ia3157c7c0908698da94c1aa85cb6366fb00fb7f1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5670
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2022-09-19 14:51:58 +00:00
David Karoly 303283fb7a kernel/arm64: implement stack trace
Change-Id: If5627fb4d37bdb7260d7e14c0c3e8cf7bcbee53d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5672
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: David Karoly <karolyd577@gmail.com>
2022-09-19 14:51:18 +00:00
David Karoly f9be2680d9 x86: use elif defined(__x86_64__) in arch_kernel.h
Change-Id: Ibad5f34d73d48c5d1af870131f20ae9b52d88eb8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5664
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-09-15 04:33:47 +00:00
David Karoly 17569c02ff kernel/arm: clean up arch-specific defines
* align fault syndrome and fault address register naming with
  ARM Architecture Reference Manual (i.e. IFSR, DFSR, IFAR, DFAR)
* move PSR bitfield defines to arch_cpu_defs.h

Change-Id: I813045eec335ffbdd75270ad5a1afb2f222f73c8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5618
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-09-04 19:11:05 +00:00
David Karoly 67406e5145 kernel/arm: save FPU registers on context switch
Change-Id: Icb62688338d3a3083f8f6d1874cae3218ba042e0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5614
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-09-04 17:33:49 +00:00
David Karoly 3d79cd3332 kernel/arm: set PXN for user memory
* set PXN for all page tables below KERNEL_BASE
* also set PXN for physical page mapper

PXN, Privileged execute-never

When the PXN bit is 1, a Permission fault is generated if the processor
is executing at PL1 and attempts to execute an instruction fetched from
the corresponding memory region.

Change-Id: I3056cbed151004ac9edfbc81ebeada328aeb603c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5607
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-09-02 16:24:08 +00:00
David Karoly c0a7601219 kernel/arm: store current thread pointer in TPIDRPRW register
Use the Privileged Only Thread ID Register aka TPIDRPRW to store
the current thread pointer.

The Privileged Only Thread ID Register is only accessible
in privileged modes, and is read/write.

see: ARMv7 Architecture Reference Manual,
section B3.12.46 CP15 c13 Software Thread ID registers

Change-Id: I5273bee8a80b78cdc547b2f6c96632d120eb3d55
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5608
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-09-02 16:23:53 +00:00
David Karoly c34046ba70 arm: increase number of io vectors to 1024
GICv2 can use interrupt numbers up to 1019:
* 0-15 are SGIs aka ICIs
* 16-31 are PPIs
* 32-1019 are SPIs

Change-Id: I1c19be77105683da3f6988a5607b14dc10a899db
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5565
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-08-25 00:46:31 +00:00
David Karoly fe2b6d7706 arm: detect SoC timer from FDT for OMAP3 and PXA
Change-Id: Ib03a11f016cb937d748d2696a17158e17c86e317
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5522
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: David Karoly <karolyd577@gmail.com>
2022-08-09 18:15:55 +00:00
David Karoly 91ee0332c3 move acpi headers from x86 to non-arch
Change-Id: Ida6186af7a40fb7d91b4da92c36d25db30dadb33
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5484
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-07-20 08:28:53 +00:00
David Karoly 2e0a9b9554 kernel/arm: use generic/user_memory.h
Change-Id: I890bdd7d6f64162416a1a80c7d8280618aaa8fb8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5429
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-07-04 16:43:39 +00:00
milek7 d5f2742d1f arm64: Preserve FPU registers in setjmp/longjmp and arch_context_swap.
Change-Id: If0ca2ecbfa45b663dab39d1e9cb2562f071c3b27
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5268
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: David Karoly <karolyd577@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-05-29 18:51:32 +00:00
milek7 d1c3213a6d arm64: Add exception handling, handle pagetables access and dirty flags.
Change-Id: I751d78eb458da16098d236f3829d0c26540fbc17
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5264
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-05-29 18:51:32 +00:00
milek7 78ea9ffc9b arm64: Implement kernel thread switching.
Change-Id: I87cca66ad89cfa85ba98a9ec828c5e357d7406b2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5263
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-05-29 18:51:32 +00:00
milek7 088321c119 arm64: Fix typos in arm_registers, add define for nGnRE.
Change-Id: I43aa971f2ead3a171af3c707539cbe08ff60cae5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5262
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: David Karoly <karolyd577@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-05-19 09:42:42 +00:00
milek7 7c69ebda17 arm64: Add mapping of all memory in kernel virtual space at KERNEL_PMAP_BASE.
Change-Id: I828b1ba8c0add614e9df6bba1e14c5e514ec1bad
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5258
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-05-03 20:27:18 +00:00
David Karoly 83f755b5d8 kernel/arm: add memory barriers for page table ops
Introduce memory barriers according to ARMARM,
section G.5.3 TLB maintenance operations and barriers

Sequence for mapping memory in (both L1 and L2):
* DSB
* Invalidate i-cache (TODO)
* Insert new entry in page directory / page table
* DSB
* ISB

Sequence for mapping memory out:
* Remove page table entry
* DSB
* Invalidate TLB entry
* DSB
* ISB

Sequence for updating a page table entry:
* Update page table entry
* DSB
* Invalidate TLB entry
* Invalidate branch predictor (TODO)
* DSB
* ISB

Note: i-cache invalidation and branch predictor invalidation is
not implemented yet as this commit focuses on implementing memory
barriers.

Change-Id: I192fa80f6b43117236a4be6fa8c988afca90e015
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5241
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2022-04-28 19:57:49 +00:00