https://git.reactos.org/?p=reactos.git;a=commitdiff;h=acdf74aa3b92a49336f41…
commit acdf74aa3b92a49336f413dd524b8840c56bbb84
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Sat Nov 17 15:49:50 2018 +0100
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Sat Nov 17 16:44:36 2018 +0100
[NTOSKRNL] Properly align runrefs on SMP in ExInitializeRundownProtectionCacheAware()
---
ntoskrnl/ex/rundown.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/ntoskrnl/ex/rundown.c b/ntoskrnl/ex/rundown.c
index cde0bf7aea..340a2d8832 100644
--- a/ntoskrnl/ex/rundown.c
+++ b/ntoskrnl/ex/rundown.c
@@ -581,7 +581,7 @@ ExInitializeRundownProtectionCacheAware(IN PEX_RUNDOWN_REF_CACHE_AWARE
RunRefCac
{
PVOID Pool;
PEX_RUNDOWN_REF RunRef;
- ULONG Count, RunRefSize, Offset;
+ ULONG Count, RunRefSize, Offset, Align;
PAGED_CODE();
@@ -601,8 +601,13 @@ ExInitializeRundownProtectionCacheAware(IN
PEX_RUNDOWN_REF_CACHE_AWARE RunRefCac
}
else
{
- /* FIXME: Properly align on SMP */
- UNIMPLEMENTED;
+ /* Get alignment constraint */
+ Align = KeGetRecommendedSharedDataAlignment();
+
+ /* How many runrefs given the alignment? */
+ RunRefSize = Align;
+ Count = ((Size - sizeof(EX_RUNDOWN_REF_CACHE_AWARE)) / Align) - 1;
+ Pool = (PVOID)ALIGN_UP_BY(Pool, Align);
}
/* Initialize the structure */