瀏覽代碼

Merge branch 'kvm-updates/3.1' of git://github.com/avikivity/kvm

* 'kvm-updates/3.1' of git://github.com/avikivity/kvm:
  KVM: x86 emulator: fix Src2CL decode
  KVM: MMU: fix incorrect return of spte
Linus Torvalds 13 年之前
父節點
當前提交
231e58e7d9
共有 2 個文件被更改,包括 3 次插入2 次删除
  1. 1 1
      arch/x86/kvm/emulate.c
  2. 2 1
      arch/x86/kvm/mmu.c

+ 1 - 1
arch/x86/kvm/emulate.c

@@ -3603,7 +3603,7 @@ done_prefixes:
 		break;
 		break;
 	case Src2CL:
 	case Src2CL:
 		ctxt->src2.bytes = 1;
 		ctxt->src2.bytes = 1;
-		ctxt->src2.val = ctxt->regs[VCPU_REGS_RCX] & 0x8;
+		ctxt->src2.val = ctxt->regs[VCPU_REGS_RCX] & 0xff;
 		break;
 		break;
 	case Src2ImmByte:
 	case Src2ImmByte:
 		rc = decode_imm(ctxt, &ctxt->src2, 1, true);
 		rc = decode_imm(ctxt, &ctxt->src2, 1, true);

+ 2 - 1
arch/x86/kvm/mmu.c

@@ -400,7 +400,8 @@ static u64 __update_clear_spte_slow(u64 *sptep, u64 spte)
 
 
 	/* xchg acts as a barrier before the setting of the high bits */
 	/* xchg acts as a barrier before the setting of the high bits */
 	orig.spte_low = xchg(&ssptep->spte_low, sspte.spte_low);
 	orig.spte_low = xchg(&ssptep->spte_low, sspte.spte_low);
-	orig.spte_high = ssptep->spte_high = sspte.spte_high;
+	orig.spte_high = ssptep->spte_high;
+	ssptep->spte_high = sspte.spte_high;
 	count_spte_clear(sptep, spte);
 	count_spte_clear(sptep, spte);
 
 
 	return orig.spte;
 	return orig.spte;