Commit graph

30 commits

Author SHA1 Message Date
Joachim Henze 121db03936 [0.4.13] Revert 3 [NTOS:KE] commits to avoid regression CORE-16448
Symptom: stacklog via 'bt' command in gcc+kdbg regressed in certain cases.

This reverts the guilty commit 0.4.13-dev-514-g
3c8f19eb21.

But also reverts 2 tightly related follow-up commits
0.4.13-dev-515-g
04906f2abb
and
0.4.13-dev-516-g
4d5a2dd0f3

We revert only in RC, but master remains affected for now,
the developers aim to fix master by WIP PR#2003 later.

I considered following the bleeding-edge-development being
too risky here. Many unrelated changes in master since then.
2019-11-03 17:36:40 +01:00
Serge Gautherie 0339245859 [NTOS:KE] Fix 'Sert' typo, in a comment (#1929) 2019-09-23 01:13:07 +02:00
Serge Gautherie 66bf74d228 [NTOSKRNL] Move DPRINT1("Thread wants too much stack\n") around
To KiUserModeCallout() from MmGrowKernelStackEx().

As suggested by Thomas Faber:
"MmGrowKernelStackEx really shouldn't be DPRINT'ing."

CORE-14494
2019-08-15 18:18:59 +02:00
Timo Kreuzer adcae016c5 [NTOS:KE:I386] Fix parameter description for KiSwapContext 2019-08-15 18:04:57 +02:00
Hermès Bélusca-Maïto f694d12f0c
[NTOS:KE/MM] Some bug-fixes in the bugcheck code.
- Introduce the MmMakeKernelResourceSectionWritable() helper for
  making the kernel resource memory section writable, and use it
  in KeGetBugMessageText(). Indeed, this latter function patches
  in place the bugcheck resource message to trim any trailing
  newlines before displaying the message on screen.

  See also https://github.com/osresearch/uxen/blob/83bad53/dm/introspection-win7.c#L286
  that mentions it too.

  This fixes bugcheck text display (e.g. the MANUALLY_INITIATED_CRASH one)
  when using (at least) MSVC-built ReactOS, avoiding a Page-Fault
  exception during the bugcheck.

- Cover KeGetBugMessageText() in SEH since we are accessing kernel
  resources that could also be corrupted in bugcheck scenarii, and we
  don't want to further bugcheck.

- Fix newline trimming loop.

- KiDoBugCheckCallbacks():
  * Wrap the bugcheck CallbackRoutine call in SEH.
  * Add a FIXME concerning the need of further memory validation of CurrentRecord.

- Add a FIXME concerning the need to run the bugcheck-reason callbacks
  with the KbCallbackReserved1 reason, in KeBugCheckWithTf().
  Mentioned in http://blog.ptsecurity.com/2012/06/customizing-blue-screen-of-death.html
2019-06-25 21:01:49 +02:00
Hermès Bélusca-Maïto 35f800c6e2
[NTOS] Minor formatting enhancements only + typo fixes. 2019-06-25 21:01:48 +02:00
Hermès Bélusca-Maïto 4d5a2dd0f3
[NTOS:KE] Use multi-processor-aware KeGetPcr() instead of the legacy PCR. 2019-06-20 19:39:49 +02:00
Hermès Bélusca-Maïto 04906f2abb
[NTOS:KE] Fixup for the NMI task handler: handle NMI recursion. -- Code was lost in commit 2efed8ef (r45040). 2019-06-20 19:39:44 +02:00
Hermès Bélusca-Maïto 3c8f19eb21
[NTOS:KE] Improvements for the Trap02 (NMI) and Trap08 (double-fault) exception handlers.
- Add FRAME_TSS FPO debug information for Trap02 and Trap08.
- Switch the active TSS in Trap08 in the very same way as is done in Trap02.

This allows to correctly debug NMI and double-fault exceptions with WinDbg,
by following the different TSS contexts, as described in:
https://blogs.msdn.microsoft.com/debuggingtoolbox/2008/02/22/special-command-analyzing-and-reconstructing-the-stack-using-the-k-command-and-its-variations/
https://blogs.msdn.microsoft.com/ntdebugging/2009/11/25/part-1-got-stack-no-we-ran-out-of-kernel-mode-stack-and-kv-wont-tell-me-why/
http://www.osronline.com/article.cfm?article=254 and http://www.osronline.com/article.cfm?article=328
2019-06-20 19:38:56 +02:00
Hermès Bélusca-Maïto d15e36a1f1
[NTOS:KE][SDK:ASM] Code formatting/styling only.
- Un-hardcode the RPL_MASK value.
- s/KiUnexpectedInterrupt&Number/KiUnexpectedInterrupt&Vector/
- Use C-style comments in traphdlr.c as everywhere else in the file.
- Update the URLs for the MSDN "FPO" macro documentation.
2019-06-20 18:07:59 +02:00
Hervé Poussineau f7ec84eea0 [NTOS:KD] Remove some _WINDK_ usages
- Always include kd64.h
- Change KdpPrompt() prototype to be compatible between KDBG and _WINDK_
- Rename KdComponentTable to KdpComponentTable to prevent a conflict
- Add some functions stubs and global variables
2019-05-23 11:04:40 +02:00
Bernhard Feichtinger f5471b7b4b
[NTOS][USERSRV] Silence noisy debug output. 2019-04-22 17:41:17 +02:00
Timo Kreuzer addc01d90b [NTOS:KE] Add function comments 2019-03-06 00:39:25 +01:00
Jérôme Gardou 5d6c286981 [NTOS/KE] Add diagnosis DPRINT for CORE-15642 2019-01-21 09:38:29 +01:00
Thomas Faber 21ea19c40f
[NTOS:KE] Remove unnecessary breakpoint in KiRaiseException. CORE-15640 2019-01-20 09:57:03 +01:00
Timo Kreuzer 71fefa32db
[NDK][NTOS] Add global definition of INIT_FUNCTION/INIT_SECTION (#779)
* Add an NDK header to define INIT_FUNCTION/INIT_SECTION globally
* Use _declspec(allocate(x)) and _declspec(code_seg(x)) on MSVC versions that support it
* Use INIT_FUNCTION on functions only and INIT_SECTION on data only (required by MSVC)
* Place INIT_FUNCTION before the return type (required by MSVC)
* Make sure declarations and implementations share the same modifiers (required by MSVC)
* Add a global linker option to suppress warnings about defined but unused INIT section
* Merge INIT section into .text in freeldr
2018-12-30 12:19:11 +01:00
Denis Malikov 0cf5efc14c [NTOS:KE] Fix stub for KeAcquireInStackQueuedSpinLockForDpc (#814)
Error was found when building as 0x600+.
CORE-12596
2018-08-26 15:19:26 +02:00
Timo Kreuzer de1b195837 [NDK] Fix the type of KPROCESS::ActiveProcessors
Also fix related logic in KiSwapProcess
2018-07-01 14:45:21 +02:00
Pierre Schweitzer f15afdbc43
[NTOSKRNL] Implement KeQueryValuesProcess().
And make use of it.
2018-05-25 21:40:39 +02:00
Jason Johnson 054c11a02c Correctly bugcheck if we aren't returning a usermode thread (#506)
Cause a corresponding bug check to occur for the reason of the user context flag being zero (a system thread), instead of using DbgBreakPoint.
2018-04-24 23:07:02 +01:00
Thomas Faber 6b78ff036f
[NTOS:KE] Don't loop indefinitely trying to figure out the CPU frequency. CORE-14419
Previously, we would keep sampling the CPU frequency until two subsequent
samples differed by at most 1 MHz. This could take several seconds, and would
unnecessarily delay boot.
Instead, if sampling is too unreliable, just give up and calculate the average
frequency from 10 samples. This is no worse than picking the frequency that
just happened to be returned twice in a row.

The fact that this method of sampling fails could indicate that there's a
problem with our performance counter implementation or timer interrupt,
but that's a separate issue...
2018-03-01 14:26:44 +01:00
Pierre Schweitzer e26e4445b3
[NTOSKRNL] Revert 6ece4e9fc2 for third tools compatibility 2018-02-08 11:50:45 +01:00
Serge Gautherie 6ece4e9fc2 [NTOS:KE] Replace "Fatal System Error" with "BugCheck" 2018-02-07 22:22:28 +01:00
Timo Kreuzer 3021c2d571 [NTOS:MM] Pass page fault code to MmAccessFault
Note: before we had a BOOLEAN parameter called StoreInstruction, but in reality it was not specifying whether the fault was from a store store instruction, but whether it was an access violation rather than a page-not-present fault. On x86 without PAE there are only 2 kinds of access violations: (1) Access of a kernel mode page from user mode, which is handled early and (2) access of a read-only (or COW) page with a writing instruction. Therefore we could get away with this, even though it relied on the wrong assumption that a fault, which was not a page-not-present-fault, was automatically a write access. This commit only changes one thing: we pass the full fault-code to MmAccessFault and handle the rest from there in exactly the same way as before. More changes are coming to make things clear.
2018-01-06 18:20:24 +01:00
Timo Kreuzer c4d6c2c3f1 [NTOS:KE] Fix pushing of fake error code in KiDoubleFaultAbort (amd64) 2018-01-01 12:09:38 +01:00
Timo Kreuzer a2f7de7ee8
Amd64/misc 64bit fixes (#236)
[REACTOS] Misc 64 bit fixes

* [NTOS:MM] Allow MEM_DOS_LIM in NtMapViewOfSection on x64 as well
* [NTOS:MM] Implement x64 version of MmIsDisabledPage
* [HAL] Remove obsolete code
* [NTOS:KE] Fix amd64 version of KeContextToTrapFrame and KeTrapFrameToContext
* [XDK] Fix CONTEXT_XSTATE definition
* [PCNET] Convert physical address types from pointers to PHYSICAL_ADDRESS
2018-01-01 12:07:50 +01:00
Ivan Labutin ede3f4d449 [NTOS:KE] Improve readability of CPU flag checks and fix error checking wrong register for HT support 2017-12-20 06:56:09 +01:00
Ivan Labutin 1aa70ef6d1 [NTOS:KE] Move RtlpUse16ByteSLists initialization into KiInitializeKernel 2017-12-20 06:56:09 +01:00
Amine Khaldi 631a14ff64 [ASM][NDK][NTOS] Rename Self to SelfPcr in the KIPCR structure. 2017-12-13 13:49:00 +01:00
Colin Finck c2c66aff7d Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys. 2017-10-03 07:45:34 +00:00