kvm对外部中断的处理

本文探讨了虚拟机中外部中断的处理方式,特别是在KVM和Xen中的不同实现。介绍了“acknowledgeinterruptonexit”控制位的作用,以及其如何影响处理器对外部中断的响应。
摘要由CSDN通过智能技术生成

Acknowledge interrupt on exit. The “acknowledge interrupt on exit” VM-exit
control in the controlling VMCS controls processor behavior for external interrupt
acknowledgement. If the control is 1, the processor acknowledges the interrupt
controller to acquire the interrupt vector upon VM exit, and stores the vector in
the VM-exit interruption-information field. If the control is 0, the external
interrupt is not acknowledged during VM exit. Since RFLAGS.IF is automatically
cleared on VM exits due to external interrupts, VMM re-enabling of interrupts
(setting RFLAGS.IF = 1) initiates the external interrupt acknowledgement and
vectoring of the external interrupt through the monitor/host IDT.

 

kvm设置对应的字段为0,Xen设置为1。

 

在代码中,kvm处理如下:

  kvm_x86_ops->run(vcpu);


 local_irq_enable();

 

调用 local_irq_enable();打开中断,触发hostos进行处理。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值