On Fri, 21 Nov 2014, Vincent Bernat wrote: > ❦ 21 novembre 2014 17:34 -0200, Henrique de Moraes Holschuh > <h...@debian.org> : > >> I thought there was a flag bit you could set on x86 that causes > >> unaligned access to trap there too. > > > > 1. CR0.AM must be set. > > > > 2. Ask For The Pain! > > > > i386: > > __asm__("pushf\norl $0x40000,(%esp)\npopf"); > > > > x86-64: > > __asm__("pushf\norl $0x40000,(%rsp)\npopf"); > > That's pretty interesting for unittests. Is one of those flags restored > during context switch so that it could affect only a selected process?
I never tried it. I suggest asking around in LKML. Also, read about Intel SMAP first. I have never looked into it, but since it has an "AC" flag, and added instructions STAC and CLAC, it might have overloaded or repurposed EFLAGS.AC. Make sure the stuff in the VDSO won't object to it, as well. It runs without a context switch, so it would #AC. Too bad unaligned access checks have not made it into valgrind memcheck yet (first proposed in 2011!)... -- "One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie." -- The Silicon Valley Tarot Henrique Holschuh -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/20141121230736.ga5...@khazad-dum.debian.net