flat assembler
Message board for the users of flat assembler.

Index > Windows > What is blocking the INVD (invalidate cache) under Windows

Author
Thread Post new topic Reply to topic
StrenoJr



Joined: 13 Mar 2014
Posts: 22
Location: Slovakia
StrenoJr 26 Jan 2015, 21:45
Hello.
I was looking for a list of x86 instructions mnemonics.
Accidentally, I found an "INVD" instruction, that should clear the CPU cache.
Compiles fine, but the program closes after executing the instruction.
The question is: What is blocking that instruction?
Is it the OS? Or somehow the CPU handles this in protected mode?
Thanks for reading, have a nice day.
Post 26 Jan 2015, 21:45
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20409
Location: In your JS exploiting you and your system
revolution 27 Jan 2015, 01:29
TFM wrote:
The INVD instruction is a privileged instruction. When the processor is running in protected mode, the CPL of a
program or procedure must be 0 to execute this instruction.
Post 27 Jan 2015, 01:29
View user's profile Send private message Visit poster's website Reply with quote
StrenoJr



Joined: 13 Mar 2014
Posts: 22
Location: Slovakia
StrenoJr 27 Jan 2015, 06:45
revolution wrote:
TFM wrote:
The INVD instruction is a privileged instruction. When the processor is running in protected mode, the CPL of a
program or procedure must be 0 to execute this instruction.
Thanks, I found this resource too but I don't know what is the CPL of a program. Could you explain?
Post 27 Jan 2015, 06:45
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20409
Location: In your JS exploiting you and your system
revolution 27 Jan 2015, 07:00
What is means is that you have to be running at the highest privilege level to execute INVD. So in Windows you have to have your code as part of the kernel or as a driver that runs in ring 0. No user application can execute the instruction because user applications run in ring 3.
Post 27 Jan 2015, 07:00
View user's profile Send private message Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1903
DOS386 30 Jan 2015, 10:35
You will soon find out that many other privileged and sensitive instructions don't work either (access to CRx & DRx , CLI , LIDT , IN , OUT , RDMSR , WRMSR , ...).

> The question is: What is blocking that instruction?

The protected mode.
Post 30 Jan 2015, 10:35
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.