[xen master] svm: don't clear interception for MSRs required for introspection

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen master] svm: don't clear interception for MSRs required for introspection

patchbot
commit 2746088d9cb403470639508cbedbc9b952f7abc4
Author:     Razvan Cojocaru <[hidden email]>
AuthorDate: Mon Jul 2 13:08:27 2018 +0200
Commit:     Jan Beulich <[hidden email]>
CommitDate: Mon Jul 2 13:08:27 2018 +0200

    svm: don't clear interception for MSRs required for introspection
   
    This patch mirrors the VMX code that doesn't allow
    vmx_clear_msr_intercept() to clear interception of MSRs that an
    introspection agent is trying to monitor.
   
    Signed-off-by: Razvan Cojocaru <[hidden email]>
    Reviewed-by: Boris Ostrovsky <[hidden email]>
---
 xen/arch/x86/hvm/svm/svm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 165500e3f2..bb47f59e4a 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -148,6 +148,7 @@ svm_msrbit(unsigned long *msr_bitmap, uint32_t msr)
 void svm_intercept_msr(struct vcpu *v, uint32_t msr, int flags)
 {
     unsigned long *msr_bit;
+    const struct domain *d = v->domain;
 
     msr_bit = svm_msrbit(v->arch.hvm_svm.msrpm, msr);
     BUG_ON(msr_bit == NULL);
@@ -155,12 +156,12 @@ void svm_intercept_msr(struct vcpu *v, uint32_t msr, int flags)
 
     if ( flags & MSR_INTERCEPT_READ )
          __set_bit(msr * 2, msr_bit);
-    else
+    else if ( !monitored_msr(d, msr) )
          __clear_bit(msr * 2, msr_bit);
 
     if ( flags & MSR_INTERCEPT_WRITE )
         __set_bit(msr * 2 + 1, msr_bit);
-    else
+    else if ( !monitored_msr(d, msr) )
         __clear_bit(msr * 2 + 1, msr_bit);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog