[Info-vax] x86-64 data aligment / faulting

John Reagan xyzzy1959 at gmail.com
Tue Mar 15 22:57:06 EDT 2022


On Tuesday, March 15, 2022 at 11:50:48 AM UTC-4, Mark Daniel wrote:
> On 26/2/22 8:23 am, Mark Daniel wrote:
> > Alpha and Itanium had data alignment requirements with penalties for 
> > faulting.  Does x86-64?  Is sys$start_align_fault_report() et al. still 
> > relevant
> Recent reply under the VSI Engineering imprimatur: 
> 
> "On Alpha and IA64, accessing unaligned data results in an exception and 
> an exception handler fixes up the read and records the alignment fault. 
> On X86, there is no such thing as an alignment fault nor is there a 
> performance penalty for accessing unaligned data. The various tools to 
> report alignment faults are still present on X86, but they are not 
> relevant and will never report any alignment faults." 
> 
> https://forum.vmssoftware.com/viewtopic.php?f=37&t=8475&p=17487#p17486
> -- 
> Anyone, who using social-media, forms an opinion regarding anything 
> other than the relative cuteness of this or that puppy-dog, needs 
> seriously to examine their critical thinking.
Dave's answer isn't technically correct.

On Alpha, all unaligned access trap to the PAL code where the unaligned operation
is fixed up without the knowledge of OpenVMS.  Fast and quick.

On Itanium, unaligned accesses within the same cache line are handled by the chip
unless the 'ac' flag is set in the User Mask register.

>From the Itanium SRM Volume 1

ac 3 Alignment check for data memory references (including IA-32)
0: unaligned data memory references may cause an Unaligned Data Reference fault.
1: all unaligned data memory references cause an Unaligned Data Reference fault.

When trapped to OpenVMS, there are several possible spinlocks that need to be acquired
in the event that the unaligned access might be with memory that is being deallocated by
another CPU.

On x86, at this point, we don't even turn on the trapping.  I'm sure there are hardware
performance registers that count them globally but OpenVMS doesn't ask about that.
Tools like MONITOR ALIGNMENT and the various system services to report alignment
faults will just return 0s.



More information about the Info-vax mailing list