Linux: Intel-Virtualization Technology(VT)下的中断
来源:互联网 发布:mac mini英雄联盟测评 编辑:程序博客网 时间:2024/05/29 08:32
这也是以前的一篇手记,由于涉及到公司的一些资料,摘录并整理。只是一个简单的流程说明,详细的知识点还请参考相关手册。
先来张图热个身。
在VT环境下,当中断产生时,有两种场景:在host上下文和guest上下文。 host收到中断后,可以自己处理,也可以将此中断重新路由给Guest;Guest上下文的中断,可以配置为直接路由给Guest,或配置为路由给host。所以需要host和guest间有统一的中断配置说明。
host下收到中断的情况:
如果中断是需要host处理,则host直接处理;如果此中断需要由guest处理,利用虚拟中断机制传递中断。
根据为Guest的vector设置VM-entry interruption-information field;则在vm-entry时,会触发对应的vector中断给guest。
VM-entry interruption-information field (32 bits)的结构描述如下:
VMX operation allows injecting interruptions to a guest virtual machine through the use of VM-entry interrupt-information field in VMCS. Injectable interruptions include external interrupts, NMI, processor exceptions, software generated interrupts, and software traps. If the interrupt-information field indicates a valid interrupt, exception or trap event upon the next VM entry; the processor will use the information in the field to vector a virtual interruption through the guest IDT after all guest state and MSRs are loaded. Delivery through the guest IDT emulates vectoring in non-VMX operation by doing the normal privilege checks and pushing appropriate entries to the guest stack (entries may include RFLAGS, EIP and exception error code). A VMM with host control of NMI and external interrupts can use the event-injection facility to
forward virtual interruptions to various guest virtual machines.
guest下收到中断的情况:
可通过exception bitmap和External-interrupt exiting来控制异常和中断的流向,见下面的描述。
The exception bitmap is a 32-bit field that contains one bit for each exception. When an exception occurs, its vector is used to select a bit in this field. If the bit is 1, the exception causes a VM exit. If the bit is 0, the exception is delivered normally through the IDT, using the descriptor corresponding to the exception’s vector.
External-interrupt exiting:If this control is 1, external interrupts cause VM exits. Otherwise, they are delivered normally through the guest interrupt-descriptor table (IDT). If this control is 1, the value of RFLAGS.IF does not affect interrupt blocking.
如果中断需要路由给host,则中断会触发vm-exit,退出的理由是:
External interrupt. An external interrupt arrived and the “external-interrupt exiting” VM-execution control was 1.
如果中断没有配置为退出vm,则直接路由给guest的IDT。
host和guest之间也可互相发送软中断,作为2者间信息交互的触发手段
host–>guest: 如前所述,利用VM-entry interruption-information field等控制位。
guest–>host: 利用vmcall
下图是当时画的中断重定向图。Line经由APIC重定向到IDT的vector;vector经由IDT重定向到不同的中断门;在经由中断门指向Linux的Irq号以及处理函数。
- Linux: Intel-Virtualization Technology(VT)下的中断
- Intel Virtualization Technology for Directed I/O (Intel VT-d)
- Understanding VT-d: Intel Virtualization Technology for Directed I/O
- Android studio模拟器 Intel HAXM Intel virtualization technology(VT-x) is not turned on解决办法
- Intel HAXM installation error - This computer does not support Intel Virtualization Technology (VT-x
- Android studio模拟器 Intel HAXM Intel virtualization technology(VT-x) is not turned on 解决办法
- Best Practices for Paravirtualization Enhancements from Intel® Virtualization Technology: EPT and VT-d
- 安装intelhaxm出错,this computer does not support intel virtualization Technology(VT-x)
- Intel Virtualization Technology: A Primer
- virtualization technology
- Virtualization technology targets Linux-powered devices
- Intel VT
- Intel VT
- VT not Supported – This computer does not support Intel Virtualization Tech nology (VT0x)......
- VT not Supported – This computer does not support Intel Virtualization Tech nology (VT0x). 解决方案
- VMware错误:CPU does not support long mode Intel Virtualization Technology
- VMware错误:CPU does not support long mode Intel Virtualization Technology
- 联想ThinkCenter M4350t型号主机怎样开启Intel Virtualization Technology功能
- JAVA垃圾回收详解(评价指标篇)
- 编程思想的理解(POP,OOP,SOA,AOP)
- Android Studio安装配置详细步骤(图文)
- 628. Maximum Product of Three Numbers的C++解法
- POJ 1862 Stripies 题解
- Linux: Intel-Virtualization Technology(VT)下的中断
- 拿代码量算绩效考核?别毁了程序员
- 【mysql】ERROR 1130: Host ’...′ is not allowed to connect to this MySQL server
- Android 内外存储说明
- sublime text3 emmet 插件 安装方法,快捷键
- 什么是Node.js?
- 操作系统——磁盘调度算法
- 补6/30
- Android 真正能监听输入法的显示和隐藏