x86/hvm: Fix non-onchangeonly CR write events logic
PATCH 1/1 x86/hvm: Fix non-onchangeonly CR write events logic
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.
--- xen/arch/x86/hvm/hvm.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
xen/arch/x86/hvm/hvm.c +3 -6
@@ -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 );
Signature · 1 line
1.7.9.5
Quoted 6 lines · Razvan Cojocaru
hvm_event_crX()already returns abool_tto 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 <[email protected]>
I presume this is a 4.6 candidate? If so, you need to CC the release manager as we are into the RC's
~Andrew
Quoted 6 lines · Andrew Cooper
Quoted 5 lines · Razvan Cojocaru
hvm_event_crX()already returns abool_tto 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.
Quoted 6 lines
Quoted 1 line
Signed-off-by Razvan Cojocaru <[email protected]>Reviewed-by Andrew Cooper <[email protected]>I presume this is a 4.6 candidate? If so, you need to CC the release manager as we are into the RC's
Yes, it is. I've now CCd Wei, thank you for pointing that out! And sorry for missing this before.
Thanks,
Razvan
Quoted 9 lines · Razvan Cojocaru
Quoted 8 lines · Andrew Cooper
Quoted 6 lines · Razvan Cojocaru
hvm_event_crX()already returns abool_tto 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 <[email protected]>
Quoted 8 lines
Quoted 4 lines
Reviewed-by Andrew Cooper <[email protected]>I presume this is a 4.6 candidate? If so, you need to CC the release manager as we are into the RC's
Yes, it is. I've now CCd Wei, thank you for pointing that out! And sorry for missing this before.
Quoted 3 lines
Thanks,
Razvan