Timo Kreuzer
e5c5efe2ad
[NTOS:KE/x64] Set the idle thread's IdealProcessor for application processors
2023-12-08 20:16:51 +02:00
Timo Kreuzer
b1a9e72e92
[NTOS:KE/x64] Do not call HalInitSystem from application processors
2023-12-08 20:16:51 +02:00
Timo Kreuzer
d0f6874d92
[NTOS:KE/x64] Factor out KiIntializeProcessorBootStructures
2023-12-08 20:16:51 +02:00
Timo Kreuzer
8c466c3e36
[NTOS:KE/x64] Improve KiInitializePcr
2023-12-08 20:16:51 +02:00
Timo Kreuzer
d2a3b1c791
[NTOS:KE/x64] Factor out KiInitializeP0BootStructures
2023-12-08 20:16:51 +02:00
Timo Kreuzer
e655594609
[NTOS:KE/x64] (Re)move initialization of IRQL and TR
2023-12-08 20:16:51 +02:00
Timo Kreuzer
0a7255e4bf
[NTOS:KE/x64] Move Initialization of TSS
2023-12-08 20:16:51 +02:00
Timo Kreuzer
160980aba1
[NTOS:KE/x64] Move initialization of PCR
2023-12-08 20:16:51 +02:00
Timo Kreuzer
ba62dd0aaa
[NTOS:KE/x64] Move initialization of KeLoaderBlock
2023-12-08 20:16:51 +02:00
Timo Kreuzer
e1497d43d7
[NTOS:KE/x64] Improve KiInitializeTss
2023-12-08 20:16:51 +02:00
Timo Kreuzer
bbe16859b5
[NTOS:KE/x64] Rename P0 boot stacks
2023-12-08 20:16:51 +02:00
Timo Kreuzer
6c5b3f203d
[NTOS:KE/x64] Add back a stubs.c file
2023-12-08 19:38:59 +02:00
Timo Kreuzer
57c7f06004
[NTOS:KE/x64] Rename stubs.c to traphandler.c
2023-12-08 19:38:59 +02:00
Hermès Bélusca-Maïto
2f0a5e546f
[NTOS:KE] Don't hardcode pool tag and TSS flag values ( #6051 )
...
Co-authored-by: Serge Gautherie <32623169+SergeGautherie@users.noreply.github.com>
2023-12-03 17:33:10 +01:00
Timo Kreuzer
f92c44b217
[NTOS:KE] Remove KiMask32Array
...
It's useless and also broken in the way it is used. Replace it with a simple shift and make it correct for 64 bit.
2023-11-30 13:03:52 +02:00
Justin Miller
516ccad340
[NTOS:KE][HALX86] Implement AP startup code ( #5879 )
...
Co-authored-by: Victor Perevertkin <victor.perevertkin@reactos.org>
Introduce the initial changes needed to get other processors up and into kernel mode.
This only supports x86 as of now but is the first real step towards using other system processors.
2023-11-19 15:51:33 -08:00
Timo Kreuzer
410b1030c0
[NTOS:KE/x64] Implement detection of more KF_* feature flags
...
- Detect KF_SSSE3, KF_SSE4_1, KF_SSE4_2, KF_RDRAND, KF_BRANCH, KF_SLAT, KF_GENUINE_INTEL, KF_AUTHENTICAMD, KF_ACNT2, KF_SMEP, KF_SMAP, KF_RDWRFSGSBASE, KF_XSAVEOPT, KF_XSAVES, KF_HUGEPAGE, KF_RDTSCP
2023-10-03 19:45:44 +03:00
Timo Kreuzer
1a7ab2fe68
[NTOS:KE/x64] Use structures for CPUID
2023-10-03 19:45:44 +03:00
Timo Kreuzer
70f6ed8ee3
[NTOS:KE/x64] Improve CPU feature detection
...
- Use 64 bit feature flags (with a hack in the PRCB)
- Improve setting up SharedUserData->ProcessorFeatures
2023-10-03 19:45:44 +03:00
Timo Kreuzer
47c1dcd023
[NDK] Update kernel feature bits constants
...
- Move them into architecture specific headers.
- Add missing constants based on https://www.geoffchappell.com/studies/windows/km/ntoskrnl/structs/kprcb/featurebits.htm
- Yes, they are 64 bits
2023-10-03 19:45:44 +03:00
Timo Kreuzer
26a64324e7
[NTOSKRNL/x64] Fix a bug in KeSwitchKernelStack
...
Don't safe anything in the callee's home space, because the callee can overwrite it. Use the functions home space instead.
2023-09-17 10:37:50 +03:00
Timo Kreuzer
583be404dd
[NTOSKRNL/x64] Fix bug in KiInitializeContextThread
...
The function set CtxSwitchFrame->ApcBypass to FALSE, preventing APCs (like when user mode sets the context while the thread is suspended) from being delivered as soon as the thread lowers IRQL to PASSIVE_LEVEL. This resulted in the SetContext APC to be delivered only after the user mode APC was initialized, overwriting the user mode APC context in the trap frame. This caused kernel32_winetest process to break.
2023-09-07 01:16:14 +03:00
Stanislav Motylkov
e2a587c2ef
[NTOS:KE/x64] Calculate the CPU frequency on AMD64
...
This should be performed early enough before CM initialization,
but after the TSC has been initialized and calibrated by HAL.
Based on existing i386 kiinit code. CORE-17971 CORE-14922
2023-07-15 20:50:12 +03:00
Stanislav Motylkov
5ae65ab7a7
[NTOS:KE] Add x86 CPU features reporting to AMD64
...
CORE-18023 CORE-14922
2023-07-02 21:00:32 +03:00
Stanislav Motylkov
6a6b383abd
[NTOS:KE] Report x86 CPU features in a separate function
...
KiGetFeatureBits() is now being called in the early boot phase 0
when the Kernel Debugger is not yet initialized, so debug prints
are not available here. Move the debug prints into a new function
and call it at the right time. CORE-18023
2023-07-02 21:00:31 +03:00
Stanislav Motylkov
00715ccf8b
[NTOS:KE] Fix magic constants for x86 CPU features
...
Do it the same way as in amd64 ke.h/cpu.c. CORE-18023
2023-07-02 21:00:31 +03:00
Hermès Bélusca-Maïto
6db0d24fb6
Fix typo "managment" -> "management" in our codebase...
...
... except for 3rd-party code or "official" names.
2023-06-04 21:39:56 +02:00
Timo Kreuzer
15fbcc19b9
[NTOS:KE/x64] Fix KiConvertToGuiThread
...
- Do not allocate a new stack, if the thread already has a large one. This prevents the function from freeing a large stack as a normal stack and subsequently leaking system PTEs.
- Fix the check for failure of PsConvertToGuiThread (test eax, not rax, for being negative, because by default rax is zero extended from eax, not sign extended). This fixes an infinite loop on failure.
2023-05-16 22:03:13 +03:00
Hermès Bélusca-Maïto
579eab8a31
[NTOS] Include kdbg/kdb.h only in the files that really need it.
2023-04-11 00:44:10 +02:00
Hermès Bélusca-Maïto
30369b8005
[NTOS] "Bugzilla" --> "Jira"
2023-04-05 03:33:41 +02:00
Timo Kreuzer
12ed9f30a7
[NTOS] Fix interrupt flag handling in KiPageFault
...
This fixes a crash in kmtest:ZwAllocateVirtualMemory
2023-01-04 10:32:28 +01:00
Timo Kreuzer
5b6e7eceda
[NTOS] Fix KiGeneralProtectionFault
2023-01-04 10:32:28 +01:00
Justin Miller
24d124f99f
[NTOS] Set SwapBusy properly for i386
...
Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
2022-12-28 21:09:41 +01:00
Justin Miller
2a33aed7cf
[NTOS] Increment ActiveProcessors accurately
2022-12-28 21:09:41 +01:00
Justin Miller
fbd033df0a
[NTOS] fix timer lock data and hardcod
2022-12-28 21:09:41 +01:00
Timo Kreuzer
2e3fe5de90
[NTOS] Fix saving of XMM registers on some trap handlers
2022-12-13 07:18:24 +01:00
Timo Kreuzer
9658c6a220
[NTOSKRNL] Print boot cycles on x64 just like on x86
2022-11-24 21:17:58 +02:00
Timo Kreuzer
225e0c89d9
[NTOS] Fix a bug in KiPrepareUserDebugData
2022-11-24 21:17:58 +02:00
Timo Kreuzer
e923912f94
[NTOS] Fix unwinding through KiThreadStartup
2022-11-24 21:17:58 +02:00
Timo Kreuzer
a007f5e490
[NTOS] Fix NtContinue for x64
2022-11-24 21:17:58 +02:00
Marcin Jabłoński
edb7575faa
[NTOS:KE/x64] Implement KeDisconnectInterrupt() for amd64 ( #4883 )
...
Choose the correct element of the KiUnexpectedRange array,
depending on the interrupt vector, the same way as here:
a2c6af0da4/ntoskrnl/ke/amd64/except.c (L77)
And guard KeConnectInterrupt() execution with dispatcher lock.
CORE-14922
2022-11-22 23:52:18 +03:00
Timo Kreuzer
620f9ee71a
[NTOS] Add MxCsr handling to trap handlers
2022-08-22 11:22:08 +02:00
Timo Kreuzer
92c798c657
[NTOSKRNL] Implement KiXmmExceptionHandler
2022-08-22 11:22:08 +02:00
Timo Kreuzer
39f11249ff
[NTOS][RTL] Initialize MxCsr where missing
2022-08-22 11:22:08 +02:00
Timo Kreuzer
786017c5b6
[NTOS] Don't assert, when dispatching an exception to user mode fails
...
Instead continue with second chance handling.
2022-08-04 16:15:24 +02:00
Timo Kreuzer
b3a8f8611d
[NTOS] Treat page faults with interrupts disabled as access violation
2022-08-04 16:15:24 +02:00
Timo Kreuzer
e45af60560
[NTOS:KE/X64] Enable interrupts when accessing user mode memory
2022-08-04 16:15:24 +02:00
Timo Kreuzer
902c6eee1e
[NTOS:KE] Restore interrupts in KiSwitchKernelStack
2022-08-04 16:15:24 +02:00
Timo Kreuzer
ae39ad4d10
[NTOS] Add a hack for VBox
2022-08-04 16:15:24 +02:00
Timo Kreuzer
45f75d5d32
[NTOS:KE/x64] Handle user faults in KiGeneralProtectionFaultHandler
2022-07-14 18:35:28 +02:00