Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 197588
b: refs/heads/master
c: 4c7da8c
h: refs/heads/master
v: v3
  • Loading branch information
Joerg Roedel authored and Avi Kivity committed Apr 25, 2010
1 parent f89a90d commit 1156541
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6c3bd3d7660c35a703073b81eccfd5a3b7c15295
refs/heads/master: 4c7da8cb43c09e71a405b5aeaa58a1dbac3c39e9
13 changes: 3 additions & 10 deletions trunk/arch/x86/kvm/svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1461,19 +1461,13 @@ static bool nested_svm_exit_handled_msr(struct vcpu_svm *svm)
{
u32 param = svm->vmcb->control.exit_info_1 & 1;
u32 msr = svm->vcpu.arch.regs[VCPU_REGS_RCX];
struct page *page;
bool ret = false;
u32 t0, t1;
u8 *msrpm;
u8 val;

if (!(svm->nested.intercept & (1ULL << INTERCEPT_MSR_PROT)))
return false;

msrpm = nested_svm_map(svm, svm->nested.vmcb_msrpm, &page);

if (!msrpm)
goto out;

switch (msr) {
case 0 ... 0x1fff:
t0 = (msr * 2) % 8;
Expand All @@ -1494,11 +1488,10 @@ static bool nested_svm_exit_handled_msr(struct vcpu_svm *svm)
goto out;
}

ret = msrpm[t1] & ((1 << param) << t0);
if (!kvm_read_guest(svm->vcpu.kvm, svm->nested.vmcb_msrpm + t1, &val, 1))
ret = val & ((1 << param) << t0);

out:
nested_svm_unmap(page);

return ret;
}

Expand Down

0 comments on commit 1156541

Please sign in to comment.