@@ -4575,41 +4575,6 @@ static void __vmx_disable_intercept_for_msr(unsigned long *msr_bitmap,
4575
4575
}
4576
4576
}
4577
4577
4578
- static void __vmx_enable_intercept_for_msr (unsigned long * msr_bitmap ,
4579
- u32 msr , int type )
4580
- {
4581
- int f = sizeof (unsigned long );
4582
-
4583
- if (!cpu_has_vmx_msr_bitmap ())
4584
- return ;
4585
-
4586
- /*
4587
- * See Intel PRM Vol. 3, 20.6.9 (MSR-Bitmap Address). Early manuals
4588
- * have the write-low and read-high bitmap offsets the wrong way round.
4589
- * We can control MSRs 0x00000000-0x00001fff and 0xc0000000-0xc0001fff.
4590
- */
4591
- if (msr <= 0x1fff ) {
4592
- if (type & MSR_TYPE_R )
4593
- /* read-low */
4594
- __set_bit (msr , msr_bitmap + 0x000 / f );
4595
-
4596
- if (type & MSR_TYPE_W )
4597
- /* write-low */
4598
- __set_bit (msr , msr_bitmap + 0x800 / f );
4599
-
4600
- } else if ((msr >= 0xc0000000 ) && (msr <= 0xc0001fff )) {
4601
- msr &= 0x1fff ;
4602
- if (type & MSR_TYPE_R )
4603
- /* read-high */
4604
- __set_bit (msr , msr_bitmap + 0x400 / f );
4605
-
4606
- if (type & MSR_TYPE_W )
4607
- /* write-high */
4608
- __set_bit (msr , msr_bitmap + 0xc00 / f );
4609
-
4610
- }
4611
- }
4612
-
4613
4578
/*
4614
4579
* If a msr is allowed by L0, we should check whether it is allowed by L1.
4615
4580
* The corresponding bit will be cleared unless both of L0 and L1 allow it.
@@ -4665,21 +4630,6 @@ static void vmx_disable_intercept_for_msr(u32 msr, bool longmode_only)
4665
4630
msr , MSR_TYPE_R | MSR_TYPE_W );
4666
4631
}
4667
4632
4668
- static void vmx_enable_intercept_msr_read_x2apic (u32 msr , bool apicv_active )
4669
- {
4670
- if (apicv_active ) {
4671
- __vmx_enable_intercept_for_msr (vmx_msr_bitmap_legacy_x2apic_apicv ,
4672
- msr , MSR_TYPE_R );
4673
- __vmx_enable_intercept_for_msr (vmx_msr_bitmap_longmode_x2apic_apicv ,
4674
- msr , MSR_TYPE_R );
4675
- } else {
4676
- __vmx_enable_intercept_for_msr (vmx_msr_bitmap_legacy_x2apic ,
4677
- msr , MSR_TYPE_R );
4678
- __vmx_enable_intercept_for_msr (vmx_msr_bitmap_longmode_x2apic ,
4679
- msr , MSR_TYPE_R );
4680
- }
4681
- }
4682
-
4683
4633
static void vmx_disable_intercept_msr_read_x2apic (u32 msr , bool apicv_active )
4684
4634
{
4685
4635
if (apicv_active ) {
@@ -6490,11 +6440,12 @@ static __init int hardware_setup(void)
6490
6440
/*
6491
6441
* enable_apicv && kvm_vcpu_apicv_active()
6492
6442
*/
6493
- for (msr = 0x800 ; msr <= 0x8ff ; msr ++ )
6443
+ for (msr = 0x800 ; msr <= 0x8ff ; msr ++ ) {
6444
+ if (msr == 0x839 /* TMCCT */ )
6445
+ continue ;
6494
6446
vmx_disable_intercept_msr_read_x2apic (msr , true);
6447
+ }
6495
6448
6496
- /* TMCCT */
6497
- vmx_enable_intercept_msr_read_x2apic (0x839 , true);
6498
6449
/* TPR */
6499
6450
vmx_disable_intercept_msr_write_x2apic (0x808 , true);
6500
6451
/* EOI */
0 commit comments