RE: AMD64 and ExInitializeNPagedLookasideList (Unsigned Mail)

Thanks Tony and Mats,

lookaside
list is in the middle of that block of memory.>

This is exactly what I did, put it to the beginning and the BSOD is gone.

Regards
Else

Mats PETERSSON

.com> cc:
Sent by: Subject: RE: [ntdev] AMD64 and ExInitializeNPagedLookasideList (Unsigned Mail)
bounce-208989-16691@li
sts.osr.com

05/12/2005 02:15 PM
Please respond to
“Windows System
Software Devs Interest
List”

Tony,

x86-64 has no more alignment issues than x86 in general. The only
“alignment trap (fault)” available in x86-64 is Vector 17, which if the
right flags are enabled will trap unaligned access in user-mode (CPL=3),
but nothing else.

Of course, using MOVAxx (Move aligned SSE instructions) will cause a GP
fault.

I believe this is an assert from the kernel that fires for some reason, for
internal performance reasons most likely.

I agree with the solution, moving the base of the allocated memory to a 8
(or better yet, 16 byte) boundary will be a good idea. Even if the OS
didn’t trap, I’d recommend evening out any large memory block to start on a
16-byte boundary, as that is the cache-line size of the L1 cache, and it
will help keeping things in the cache more tidy.

IA64 may well have some other criteria, and the “assert” that the OS gives
off may well have something to do with IA64 requirements.


Mats

“Tony Mason”

Sent by: To
bounce-208984-140 “Windows System Software Devs
xxxxx@lists.osr.com Interest List”

cc
05/12/2005 12:54
PM Subject
RE: [ntdev] AMD64 and
ExInitializeNPagedLookasideList
Please respond to
“Windows System
Software Devs
Interest List”
com>

X86 platforms don’t have the same data alignment requirements as IA64 or
X64 systems have. You don’t provide the rest of the analysis (“!analyze
-v”) nor do you decode the context record (“.cxr 0xFFFFFADFF20EBEF0”)
which would have at least provided additional insight into the crash.

You also don’t tell us how you allocated your lookaside list. My
suspicion is that you have allocated a block of memory and the lookaside
list is in the middle of that block of memory. Move the lookaside list
so it is on an 8 byte boundary and the alignment issue will disappear.
It is possible this is related to something ELSE that you are doing.

Even x86 has alignment constraints (try manipulating data values using
SSE or SSE2 instructions) but they are generally more liberal than
64-bit platforms.

Regards,

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Else Kluger
Sent: Thursday, May 12, 2005 9:30 AM
To: ntdev redirect
Subject: [ntdev] AMD64 and ExInitializeNPagedLookasideList

Hi,

need some help with the AMD64.
My driver was working with AMD64 unless I began to use LookAsideLists.

Now as soon as it calls ExInitializeNPagedLookasideList, following BSOD
occurs:

InitializeSListHead unaligned Slist header. Address = FFFFFADFF39A8B78,
Caller = FFFFFADFF18BFAA6
*** Fatal System Error: 0x0000007e

(0xFFFFFFFF80000002,0xFFFFF800008AE817,0xFFFFFADFF20EBE50,0xFFFFFADFF20E
BEF0)

(meaning 0x80000002: STATUS_DATATYPE_MISALIGNMENT
=An unaligned data reference was encountered)

Under x86 the LookAsideLists work fine.

Kind regards,
Else


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@osr.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

ForwardSourceID:NT00012D92


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@utimaco.de
To unsubscribe send a blank email to xxxxx@lists.osr.com

If that’s the case, you might consider adding an alignment attribute to
the type. Then at least you’ll get the right alignment for globals, for
stack-based instances*, and relative to the start of a structure.

(*) By the way, what’s the ABI specify as the guaranteed minimum
alignment for stack frames?

Chuck

----- Original Message -----
From: “Else Kluger”
To: “Windows System Software Devs Interest List”
Sent: Thursday, May 12, 2005 9:41 PM
Subject: RE: [ntdev] AMD64 and ExInitializeNPagedLookasideList (Unsigned
Mail)

>
> Thanks Tony and Mats,
>
> > lookaside
> list is in the middle of that block of memory.>
>
> This is exactly what I did, put it to the beginning and the BSOD is
> gone.
>
> Regards
> Else
>
>
>
>
>
> Mats PETERSSON
> > System Software Devs Interest List"
> .com> cc:
> Sent by: Subject: RE:
> [ntdev] AMD64 and ExInitializeNPagedLookasideList (Unsigned Mail)
> bounce-208989-16691@li
> sts.osr.com
>
>
> 05/12/2005 02:15 PM
> Please respond to
> “Windows System
> Software Devs Interest
> List”
>
>
>
>
>
> Tony,
>
> x86-64 has no more alignment issues than x86 in general. The only
> “alignment trap (fault)” available in x86-64 is Vector 17, which if
> the
> right flags are enabled will trap unaligned access in user-mode
> (CPL=3),
> but nothing else.
>
> Of course, using MOVAxx (Move aligned SSE instructions) will cause a
> GP
> fault.
>
> I believe this is an assert from the kernel that fires for some
> reason, for
> internal performance reasons most likely.
>
> I agree with the solution, moving the base of the allocated memory to
> a 8
> (or better yet, 16 byte) boundary will be a good idea. Even if the OS
> didn’t trap, I’d recommend evening out any large memory block to start
> on a
> 16-byte boundary, as that is the cache-line size of the L1 cache, and
> it
> will help keeping things in the cache more tidy.
>
> IA64 may well have some other criteria, and the “assert” that the OS
> gives
> off may well have something to do with IA64 requirements.
>
> –
> Mats
>
>
> “Tony Mason”
>
> Sent by:
> To
> bounce-208984-140 “Windows System Software Devs
> xxxxx@lists.osr.com Interest List”
>
>
> cc
> 05/12/2005 12:54
> PM
> Subject
> RE: [ntdev] AMD64 and
> ExInitializeNPagedLookasideList
> Please respond to
> “Windows System
> Software Devs
> Interest List”
> > com>
>
>
>
>
>
>
> X86 platforms don’t have the same data alignment requirements as IA64
> or
> X64 systems have. You don’t provide the rest of the analysis
> (“!analyze
> -v”) nor do you decode the context record (“.cxr 0xFFFFFADFF20EBEF0”)
> which would have at least provided additional insight into the crash.
>
> You also don’t tell us how you allocated your lookaside list. My
> suspicion is that you have allocated a block of memory and the
> lookaside
> list is in the middle of that block of memory. Move the lookaside
> list
> so it is on an 8 byte boundary and the alignment issue will disappear.
> It is possible this is related to something ELSE that you are doing.
>
> Even x86 has alignment constraints (try manipulating data values using
> SSE or SSE2 instructions) but they are generally more liberal than
> 64-bit platforms.
>
> Regards,
>
> Tony
>
> Tony Mason
> Consulting Partner
> OSR Open Systems Resources, Inc.
> http://www.osr.com
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Else Kluger
> Sent: Thursday, May 12, 2005 9:30 AM
> To: ntdev redirect
> Subject: [ntdev] AMD64 and ExInitializeNPagedLookasideList
>
> Hi,
>
> need some help with the AMD64.
> My driver was working with AMD64 unless I began to use LookAsideLists.
>
> Now as soon as it calls ExInitializeNPagedLookasideList, following
> BSOD
> occurs:
>
> InitializeSListHead unaligned Slist header. Address =
> FFFFFADFF39A8B78,
> Caller = FFFFFADFF18BFAA6
> *** Fatal System Error: 0x0000007e
>
> (0xFFFFFFFF80000002,0xFFFFF800008AE817,0xFFFFFADFF20EBE50,0xFFFFFADFF20E
> BEF0)
>
> (meaning 0x80000002: STATUS_DATATYPE_MISALIGNMENT
> =An unaligned data reference was encountered)
>
> Under x86 the LookAsideLists work fine.
>
> Kind regards,
> Else