Re: RDTSC

  • From: Peter Cawley <corsix@xxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Mon, 10 Sep 2012 11:16:33 -0700

In that case, you might want to investigate as to why DEP is turned
off, and then possibly turn it on. By default it should be on.

On Mon, Sep 10, 2012 at 10:50 AM, Szabó Antal <szabo.antal.92@xxxxxxxxx> wrote:
> It happily runs on my 32 bit Windows 7 machine (though it's not the
> newest, I admit), but I will try it on my 64bit laptop, just for
> curiosity :D
>
> 2012/9/10 Mike Pall <mike-1209@xxxxxxxxxx>:
>> Szabó Antal wrote:
>>> local rdtsc = ffi.cast("__cdecl uint64_t (*)()", "\x0F\x31\xC3") --rdtsc, 
>>> ret
>>>
>>> print(rdtsc())
>>>
>>> I think this should work on any x86-32 machine, but not on x64,
>>> because of the calling convention differences.
>>
>> This does not work on any modern x86 or x64 operating system with
>> any CPU made in the last 10 years, due to NX page protections.
>>
>> (Yes, Windows XP without PAE is not "modern".)
>>
>> --Mike
>>
>

Other related posts: