From: Roger Pau Monne Date: Fri, 16 Feb 2018 18:16:23 +0000 (+0000) Subject: hvm/monitor: fix usage of the control register mask X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=refs%2Fremotes%2Fgithub%2Fmaster;p=people%2Fdariof%2Fxen.git hvm/monitor: fix usage of the control register mask Previous usage is not correct and would prevent certain updates from being notified to the monitor client. For example if (value ^ old) == (PGE | PSE) and mask == PGE this update would not be notified. Signed-off-by: Roger Pau Monné Acked-by: Razvan Cojocaru --- diff --git a/xen/arch/x86/hvm/monitor.c b/xen/arch/x86/hvm/monitor.c index 5d568a39d3..160c0327b9 100644 --- a/xen/arch/x86/hvm/monitor.c +++ b/xen/arch/x86/hvm/monitor.c @@ -39,7 +39,7 @@ bool hvm_monitor_cr(unsigned int index, unsigned long value, unsigned long old) if ( (ad->monitor.write_ctrlreg_enabled & ctrlreg_bitmask) && (!(ad->monitor.write_ctrlreg_onchangeonly & ctrlreg_bitmask) || value != old) && - (!((value ^ old) & ad->monitor.write_ctrlreg_mask[index])) ) + ((value ^ old) & ~ad->monitor.write_ctrlreg_mask[index]) ) { bool sync = ad->monitor.write_ctrlreg_sync & ctrlreg_bitmask;