Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Thanks very useful, I was just writing something similar.

INterested in: syscall32_from_64.c

What's does that do? I know in IA32 emu mode on a 64bit kernel from running binaries using strace that they make gettimeofday etc syscalls rather than use vdso.



I think I wrote syscall32_from_64 to try to test something related to the 32-bit syscall (as opposed to sysenter or int80) handler in ia32entry.S. TBH, I don't remember exactly what it was for.

On my Intel-based box, it gets SIGILL, but if I run it under QEMU without KVM, it says "syscall return = 137".

The more interesting things in there include segregs (testing for an info leak that has no CVE yet), syscall_exit_regs_64 (run it under strace and watch it fail), and dump_all_pmcs.

I'm hoping that dump_all_pmcs will stop working in Linux 3.20.

Also, on new enough kernels with new enough glibc (I think), even 32-bit programs use vdso timing.


> Also, on new enough kernels with new enough glibc (I think), even 32-bit programs use vdso timing.

I saw a patch being discussed but wasn't sure if it made it in. I'd rather it didn't because some people are insisting they need it so they can run 32bit Java (for performance reasons because GC is marginally faster). The irony is entirely lost on them.

Really useful little set of experiments, good to have them in one place.

Not familliar with pcmcs, what are they?


> Not familliar with pcmcs, what are they?

They're performance monitoring counters, which are complicated programmable things on most x86 chips that could cache misses, cycles, etc. They don't come with a sensible way to selectively grant user access.


Ahhh yes. of course. Thanks




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: