[PATCH kvm-unit-tests 2/3] x86: svm: initialize IO bitmap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
---
 x86/svm.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/x86/svm.c b/x86/svm.c
index 4b7f06e..2cf5c81 100644
--- a/x86/svm.c
+++ b/x86/svm.c
@@ -36,6 +36,9 @@ u64 latclgi_max;
 u64 latclgi_min;
 u64 runs;
 
+u8 *io_bitmap;
+u8 io_bitmap_area[16384];
+
 static bool npt_supported(void)
 {
    return cpuid(0x8000000A).d & 1;
@@ -53,6 +56,8 @@ static void setup_svm(void)
 
     scratch_page = alloc_page();
 
+    io_bitmap = (void *) (((ulong)io_bitmap_area + 4095) & ~4095);
+
     if (!npt_supported())
         return;
 
@@ -149,6 +154,7 @@ static void vmcb_ident(struct vmcb *vmcb)
     save->g_pat = rdmsr(MSR_IA32_CR_PAT);
     save->dbgctl = rdmsr(MSR_IA32_DEBUGCTLMSR);
     ctrl->intercept = (1ULL << INTERCEPT_VMRUN) | (1ULL << INTERCEPT_VMMCALL);
+    ctrl->iopm_base_pa = virt_to_phys(io_bitmap);
 
     if (npt_supported()) {
         ctrl->nested_ctl = 1;
-- 
1.8.3.1


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux