百科问答小站 logo
百科问答小站 font logo



如果在内核把特权级切换到用户态之前屏蔽 CPU 对软中断的响应,是不是就再也进不了内核态了? 第1页

  

user avatar   bei-ji-85 网友的相关建议: 
      

CLI — Clear Interrupt Flag

Description

In most cases, CLI clears the IF flag in the EFLAGS register and no other flags are affected. Clearing the IF flag causes the processor to ignore maskable external interrupts. The IF flag and the CLI and STI instruction have no effect on the generation of exceptions and NMI interrupts.

6.3.3 Software-Generated Interrupts

The INT n instruction permits interrupts to be generated from within software by supplying an interrupt vector number as an operand. For example, the INT 35 instruction forces an implicit call to the interrupt handler for interrupt 35.

Any of the interrupt vectors from 0 to 255 can be used as a parameter in this instruction. If the processor's predefined NMI vector is used, however, the response of the processor will not be the same as it would be from an NMI interrupt generated in the normal manner. If vector number 2 (the NMI vector) is used in this instruction, the NMI interrupt handler is called, but the processor’s NMI-handling hardware is not activated.

Interrupts generated in software with the INT n instruction cannot be masked by the IF flag in the EFLAGS register.

注意加粗部分。

另外,SYSENTER/SYSCALL都可以进内核态。

结论就是,不能。




  

相关话题

  会不会有两个中断绝对同时发出,cpu会如何处理? 
  请问i7和i9的区别是什么(希望尽量通俗易懂)? 
  图形方面的函数的参数为什么多用浮点? 
  搭载Windows 11的PC会有哪些新特点? 
  英特尔将停产300系列主板芯片组,入手旧型号主板及CPU值得吗,性价比如何? 
  多核cpu多线程同时执行cmpxchg指令会发生什么? 
  为什么 CPU 不做成可以换插槽的,或者把除内存插槽 PCIe 之外的东西都外置? 
  如何看待 2018 年 1 月 2 日爆出的 Intel CPU 设计漏洞? 
  如何评价 2019 年 5 月 27 日 AMD 发布的第三代 Ryzen(锐龙)处理器?有哪些亮点? 
  如果用 AMD 的 CPU 配上 N 卡会有什么后果? 

前一个讨论
都说固态硬盘寿命短,那么有谁把使用寿命用完了吗?
下一个讨论
USB 3.0 速度远不如 SATA,为什么现在外接硬盘柜还是普遍用 USB 接口?





© 2025-04-26 - tinynew.org. All Rights Reserved.
© 2025-04-26 - tinynew.org. 保留所有权利