Hi,
I just started working on nasm 2 weeks ago and I am stuck at something (of course). Can anyone please tell me how can I set CPL=0 so that I can use WBINVD
How can I set CPL=0 for WBINVD in NASM (Linux)
-
- Posts: 5
- Joined: Thu Jul 08, 2010 6:03 pm
Re: How can I set CPL=0 for WBINVD in NASM (Linux)
Hi,
This basically means that normal processes can't screw everything up when the programmer makes the mistake of thinking that they want to use something like WBINVD...
Note: the CLFLUSH instruction may be what you actually want...
Cheers,
Brendan
You can't, unless you're writing kernel code or a device driver (which runs as part of the kernel as a kernel module).yousafsajjad wrote:I just started working on nasm 2 weeks ago and I am stuck at something (of course). Can anyone please tell me how can I set CPL=0 so that I can use WBINVD
This basically means that normal processes can't screw everything up when the programmer makes the mistake of thinking that they want to use something like WBINVD...
Note: the CLFLUSH instruction may be what you actually want...
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
-
- Posts: 5
- Joined: Thu Jul 08, 2010 6:03 pm
Re: How can I set CPL=0 for WBINVD in NASM (Linux)
Yeah it seems like it would work but in this description it says something like "Invalidates the cache line that contains the linear address specified with the source operand from all levels of the processor cache hierarchy". I am not much sure what that suppose to mean
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: How can I set CPL=0 for WBINVD in NASM (Linux)
The linear address is the address passed into the paging system. It's the same as the virtual address unless you use segmentation (which most people don't).