Make SVM IOIO intercept check all needed bits, by Bernhard Kauer.
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>
Sun, 9 Dec 2007 23:39:22 +0000 (23:39 +0000)
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>
Sun, 9 Dec 2007 23:39:22 +0000 (23:39 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3792 c046a42c-6fe2-441c-8c8c-71466251a162

target-i386/helper.c

index 07ff3563cceb86717e28c7ba2f3a9e7d4bb0eb8c..bad3f7c1b6988ffbfacd2971fbf483aa0cfd4b01 100644 (file)
@@ -4262,7 +4262,8 @@ int svm_check_intercept_param(uint32_t type, uint64_t param)
             uint64_t addr = ldq_phys(env->vm_vmcb + offsetof(struct vmcb, control.iopm_base_pa));
             uint16_t port = (uint16_t) (param >> 16);
 
-            if(ldub_phys(addr + port / 8) & (1 << (port % 8)))
+            uint16_t mask = (1 << ((param >> 4) & 7)) - 1;
+            if(lduw_phys(addr + port / 8) & (mask << (port & 7)))
                 vmexit(type, param);
         }
         break;