I read that there are some privileged instructions in our system that can be executed in kernel mode. But I am unable to understand who make these instructions privileged . Is it the hardware manufacturer that hardwire some harmful instructions as privileged with the help of mode bit or is it the OS designers that make instructions privileged make them work only in privileged mode.
Who decides which instructions are to be kept privileged? Is it the hardware manufacturer or the OS developers
513 Views Asked by Divyam Bhutani At
1
There are 1 best solutions below
Related Questions in OPERATING-SYSTEM
- the end of the I/O operation is notified to the system by an interrupt.how much system time do the mentioned operations occupy?
- Problem on CPU scheduling algorithms in OS
- OS-wide text autocomplete service with popup
- mkssecreenshotmgr taking a screenshot
- How to prevent app from crashing on android emulator
- Is there a function to end a child process?
- Swapping a healthy and unallocated partition in Windows 10
- ubuntu OS : Why my battery is completely drained of in just 2 hours in suspend mode
- 1 filenames = [] 2 ----> 3 for file in os.zipfile('images.zip'):
- Worth it to access data by blocks on modern OS/hardware?
- How does outlook disable screenshot
- How can I enable my app to access a specific partition directory for reading and writing without showing popup to user?
- Exception of type 'System.Exception' was thrown. Error in Cosmos Project
- Maximum CPU Voltage reading
- Java: get username from uid
Related Questions in CPU-ARCHITECTURE
- What is causing the store latency in this program?
- what's the difference between "nn layout" and "nt layout"
- Will a processor with such a defect work?
- How do i find number of Cycles of a processor?
- Why does LLVM-MCA measure an execution stall?
- Can out-of-order execution of CPU affect the order of new operator in C++?
- running SPEC in gem5 using the SimPoint methodology
- Why don't x86-64 (or other architectures) implement division by 10?
- warn: MOVNTDQ: Ignoring non-temporal hint, modeling as cacheable!, While simulating x86 with spec2006 benchamrks I am getting stuck in warn message
- arithmetic intensity of zgemv versus dgemv/sgemv?
- What is the microcode scoreboard?
- Why don't x86/ARM CPU just stop speculation for indirect branches when hardware prediction is not available?
- Question about the behaviour of registers
- How to increase throughput of random memory reads/writes on multi-GB buffers?
- RISVC Single Cycle Processor Data Path and Testbench
Related Questions in PROCESSOR
- How do i find number of Cycles of a processor?
- How add XML2CSV processor to Keboola components?
- Save Semantic data in GraphDB triplestore using Nifi
- No events detected! PAPI 7.1.0 on Ubuntu 22.04
- Create dynamic method using Annotation Processor
- Does getOpaque/order_relaxed/read_once have influence on the processor, or just the compiler during memory hoisting?
- How to match the microarchitectural values produced in the pipeline with its corresponding architectural instruction?
- Weird blinking of lights when trying to run the OWASPBWAP with one core count on laptop
- Do modern JIT compilers keep Program Order(PO) inside spinning loops?
- AWS EC2 instance crashing whenever I run my python program
- try add a criteria with include for telemetry processor in ApplicationInsights V3 (java) Codeless Approach is not working?
- how to implement this logic in mips
- how to use singe processor in nifi for connecting multiple table at a time
- Should I align data to their data type or cpu cache line size?
- How to write bootloader for multi cores ARM cortex-M0 processor
Related Questions in MACHINE-INSTRUCTION
- Transform a stack using Java Virtual Machine Instruction Set
- Instruction Cycle max and min?
- Is carry flag usually cleared after Jump-Not-Carry instruction has been evaluated?
- Why does CMP L and CMP M instructions in Microprocessor 8085 have same opcode BD?
- How computer CPU executes a Software Application
- Who decides which instructions are to be kept privileged? Is it the hardware manufacturer or the OS developers
- How many values can be stored per physical address in Memory?
- Extracting MachineBasicBlock from Branch Instruction
- How does the following I-Type instruction change the program counter?
- How to convert a memory address to a code segment address?
- What are the Absolute Far Jump Operands in X86
- What x86 instructions take two (or more) memory operands?
- mapping from (Assembly) instruction sequences to C code
- Can C++ have code in the global scope?
- 5 Stage Datapath - Multi-cycle without pipeline
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Kernel vs. user mode, and which instructions aren't allowed in user mode, is part of the ISA. That's baked in to the hardware.
CPU architects usually have a pretty good idea of what OSes need to do and want to prevent user-space from doing, so these choices at least make privilege levels possible, i.e. make it impossible for user-space to simply take over the machine.
But that's not the full picture: on some ISAs, such as x86, later ISA extensions have added control-register flag bits that let the OS choose whether some other instructions are privileged or not. On x86 that's done for instructions that could leak information about kernel ASLR, or make timing side-channels easier.
For example,
rdpmc(read performance monitor counter) can only be used from user-space if specially enabled by the kernel.rdtsc(Read TimeStamp Counter) can be read from user-space by default, but the TSD (TimeStamp Disable) flag in CR4 can restrict its use to priv level 0 (kernel mode). Stopping user-space from using high-resolution timing is a brute-force way of defending against timing side-channel attacks.Another x86 extension defends against leaking kernel addresses to make kernel ASLR more secret; CR4.UMIP (User Mode Instruction Prevention) disables instructions like
sgdtthat reads the virtual address of the GDT. Those instructions were basically useless for user-space in the first place, and unlikerdtsceasily could always have been privileged.The Linux Kernel option to enable use of this extension describes it:
Setting a new address for the IDT/GDT/LDT (e.g.
lgdt/lidt) is of course a privileged instruction; those let you take over the machine. But until kernel ASLR was a thing, there wasn't any reason to stop user-space from reading the address. It could be in a page that had its page-table entry set to kernel only, preventing user-space from doing anything with that address. (... until Meltdown made it possible for user-space to use a speculative side-channel to read data from kernel-only pages that were hot in cache.)