[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH] x86/HVM: fix PM timer I/O port range version check
XOR-ing two arbitrary non-equal values may produce 1 even if both values are different from both 0 and 1 (2 and 3 would fit, for example). Use OR instead, which together with the earlier bailing upon finding "version == old_version" achieves the intended effect. Fixes: f0ad21c499f7 ("x86 hvm: Introduce pmtimer_change_ioport and HVM_PARAM_ACPI_IOPORTS_LOCATION") Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> --- a/xen/arch/x86/hvm/pmtimer.c +++ b/xen/arch/x86/hvm/pmtimer.c @@ -326,7 +326,7 @@ int pmtimer_change_ioport(struct domain return 0; /* Only allow changes between versions 0 and 1. */ - if ( (version ^ old_version) != 1 ) + if ( (version | old_version) != 1 ) return -EINVAL; if ( version == 1 ) _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |