aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/kvm/x86_emulate.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
index 0a8696d9b82c..a6ace302e0cd 100644
--- a/drivers/kvm/x86_emulate.c
+++ b/drivers/kvm/x86_emulate.c
@@ -825,6 +825,14 @@ done_prefixes:
825 if (twobyte && b == 0x01 && modrm_reg == 7) 825 if (twobyte && b == 0x01 && modrm_reg == 7)
826 break; 826 break;
827 srcmem_common: 827 srcmem_common:
828 /*
829 * For instructions with a ModR/M byte, switch to register
830 * access if Mod = 3.
831 */
832 if ((d & ModRM) && modrm_mod == 3) {
833 src.type = OP_REG;
834 break;
835 }
828 src.type = OP_MEM; 836 src.type = OP_MEM;
829 src.ptr = (unsigned long *)cr2; 837 src.ptr = (unsigned long *)cr2;
830 src.val = 0; 838 src.val = 0;
@@ -893,6 +901,14 @@ done_prefixes:
893 dst.ptr = (unsigned long *)cr2; 901 dst.ptr = (unsigned long *)cr2;
894 dst.bytes = (d & ByteOp) ? 1 : op_bytes; 902 dst.bytes = (d & ByteOp) ? 1 : op_bytes;
895 dst.val = 0; 903 dst.val = 0;
904 /*
905 * For instructions with a ModR/M byte, switch to register
906 * access if Mod = 3.
907 */
908 if ((d & ModRM) && modrm_mod == 3) {
909 dst.type = OP_REG;
910 break;
911 }
896 if (d & BitOp) { 912 if (d & BitOp) {
897 unsigned long mask = ~(dst.bytes * 8 - 1); 913 unsigned long mask = ~(dst.bytes * 8 - 1);
898 914