[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] x86/hvm: Fix non-onchangeonly CR write events logic


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>
  • Date: Wed, 12 Aug 2015 20:00:04 +0300
  • Cc: andrew.cooper3@xxxxxxxxxx, keir@xxxxxxx, Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>, jbeulich@xxxxxxxx
  • Comment: DomainKeys? See http://domainkeys.sourceforge.net/
  • Delivery-date: Wed, 12 Aug 2015 17:00:24 +0000
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=bitdefender.com; b=mgO/QEySSG5HDRkpUkjjDYe13Wfll0e0g3Usvf9ZSSDKRslwpDVJjm57Wk5OvD0XqVy7tBXMEH4VyI64Se7ImLcYpevKsf5umSLiisnwIhdWQ/drzb7HK9QXfi6cekAC2UkSf/p2A4YxceT2L1x1zelag/rffnuw+FeboHDT/jDyXck8luTvW7/zLvaV57s6XpmZpN/sZglIy2x8ilpDxBom4vD8wPQ90y6LKlKBhwIt/Z5Oi/bpHBGVkf33bau7Di6l6fa03GGGnMACdV4sR7RjnmW8b50+Sr9/pXk9gricilsOstleg+NT7jNAEQ5Ib0QgiI7rXTbV8kHOmfTCFw==; h=Received:Received:Received:Received:Received:From:To:Cc:Subject:Date:Message-Id:X-Mailer:X-BitDefender-Scanner:X-BitDefender-Spam:X-BitDefender-SpamStamp:X-BitDefender-CF-Stamp;
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

hvm_event_crX() already returns a bool_t to tell us whether an
event will be sent out or not, so the extra check that value != old
is not only useless, but also prevents non-onchangeonly events from
being sent.

Signed-off-by: Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>
---
 xen/arch/x86/hvm/hvm.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index c957610..707ad86 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3368,8 +3368,7 @@ int hvm_set_cr0(unsigned long value, bool_t may_defer)
     }
 
     if ( may_defer && unlikely(currad->monitor.write_ctrlreg_enabled &
-                               monitor_ctrlreg_bitmask(VM_EVENT_X86_CR0)) &&
-         value != old_value )
+                               monitor_ctrlreg_bitmask(VM_EVENT_X86_CR0)) )
     {
         ASSERT(currad->event_write_data != NULL);
 
@@ -3472,8 +3471,7 @@ int hvm_set_cr3(unsigned long value, bool_t may_defer)
     struct arch_domain *currad = &v->domain->arch;
 
     if ( may_defer && unlikely(currad->monitor.write_ctrlreg_enabled &
-                               monitor_ctrlreg_bitmask(VM_EVENT_X86_CR3)) &&
-         value != old )
+                               monitor_ctrlreg_bitmask(VM_EVENT_X86_CR3)) )
     {
         ASSERT(currad->event_write_data != NULL);
 
@@ -3546,8 +3544,7 @@ int hvm_set_cr4(unsigned long value, bool_t may_defer)
     }
 
     if ( may_defer && unlikely(currad->monitor.write_ctrlreg_enabled &
-                               monitor_ctrlreg_bitmask(VM_EVENT_X86_CR4)) &&
-         value != old_cr )
+                               monitor_ctrlreg_bitmask(VM_EVENT_X86_CR4)) )
     {
         ASSERT(currad->event_write_data != NULL);
 
-- 
1.7.9.5


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.