Skip to contentSkip to conversation

target-i386: svm: Fix MSRPM check

PATCH Applied Adam Lackorzynski 2 participants 2 messages Aug 15, 2010 – Aug 22, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target-i386: svm: Fix MSRPM check

Correct the calculation of the offset in the msrpm for the MSR range 0 - 0x1fff.

---
 target-i386/op_helper.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
target-i386/op_helper.c +1 -1
index c50e818..ec6b3e9 100644
@@ -5237,7 +5237,7 @@ void helper_svm_check_intercept_param(uint32_t type, uint64_t param)
             switch((uint32_t)ECX) {
             case 0 ... 0x1fff:
                 t0 = (ECX * 2) % 8;
-                t1 = ECX / 8;
+                t1 = (ECX * 2) / 8;
                 break;
             case 0xc0000000 ... 0xc0001fff:
                 t0 = (8192 + ECX - 0xc0000000) * 2;
Signature · 1 line
1.7.1
#1 lore raw
Quoted 5 lines · Adam Lackorzynski

Correct the calculation of the offset in the msrpm for the MSR range 0 - 0x1fff.

Applied. Thanks.

Regards,

Anthony Liguori

Quoted 18 lines
---
  target-i386/op_helper.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
target-i386/op_helper.c +1 -1
index c50e818..ec6b3e9 100644
@@ -5237,7 +5237,7 @@ void helper_svm_check_intercept_param(uint32_t type, uint64_t param)
              switch((uint32_t)ECX) {
              case 0 ... 0x1fff:
                  t0 = (ECX * 2) % 8;
-                t1 = ECX / 8;
+                t1 = (ECX * 2) / 8;
                  break;
              case 0xc0000000 ... 0xc0001fff:
                  t0 = (8192 + ECX - 0xc0000000) * 2;