x2APIC & MSR


x2APIC & MSR

                        +-------------------------+    |
     +-----------+      |  +-------------+        | <--+-----> vcpu 0
     | IDT table |  <---+--|IDTR Register|   C    |    |        ...
     +-----------+      |  +-------------+   P    |    |
           ^|           |         |          U    |    |      +-----------+
           ||           |  +-------------+        |    |      | IDT table |
           ||           |  |  Local APIC |        |    |      +-----------+
           ||           |  +------+------+        | <--+>
           ||           +---------+---------------+    |      +---------------+
           ||                     |                    |      | virtual LAPIC |
           |v              +-------------+             |      +---------------+
        interrupt ------>  |  IO APIC    |             |      |
                           +-------------+             |      |
    ===================================================|======|=====================
                     Host Mode                         |      |
+-------------------------------------------------------------+
|- guest's virtual LAPIC represented as MMIO memory region
|- guest access its LAPIC will trigger a VM-Exit on x1APIC
|- when guest uses x2APIC, host trap LAPIC access through MSR bitmap.
|  In the x2APIC mode, host will maintain a MSR bitmap, which contains the info that
|  which MSRs is allowed to access directly by a guest and others are sensitive ones.
|  When guest accesses the sentitive MSRs, execution still exits to the host.


xAPIC模式下,APIC寄存器被映射到一段4K的内存。

x2APIC模式下,一段MSR地址区间被保留用作APIC寄存器访问。MSR的这些项可以通过bitmap配置来指示guest可否直接访问某项(访问某项时是否产生VM Exit)


Reference:

Abel Gordon,"ELI: Bare-Metal Performance for I/O Virtualization"

cat /proc/cpuinfo processor : 0 vendor_id : AuthenticAMD cpu family : 25 model : 33 model name : AMD Ryzen 5 5600 6-Core Processor stepping : 2 microcode : 0xa20120e cpu MHz : 3493.436 cache size : 512 KB physical id : 0 siblings : 1 core id : 0 cpu cores : 1 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 16 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl tsc_reliable nonstop_tsc cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext ibpb vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves clzero wbnoinvd arat umip pku ospke vaes vpclmulqdq rdpid overflow_recov succor fsrm bugs : fxsave_leak sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass srso bogomips : 6986.87 TLB size : 2560 4K pages clflush size : 64 cache_alignment : 64 address sizes : 45 bits physical, 48 bits virtual power management: processor : 1 vendor_id : AuthenticAMD cpu family : 25 model : 33 model name : AMD Ryzen 5 5600 6-Core Processor stepping : 2 microcode : 0xa20120e cpu MHz : 3493.436 cache size : 512 KB physical id : 2 siblings : 1 core id : 0 cpu cores : 1 apicid : 2 initial apicid : 2 fpu : yes fpu_exception : yes cpuid level : 16 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl tsc_reliable nonstop_tsc cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext ibpb vmmcall fsgsbase bmi1 avx2 smep
03-12
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值