Hi, We recently encountered a failure in the code of test_apic_change_mode() (x86/apic.c of kvm-unit-test). This failure, so far, only happened on Intel Xeon "E3-1220 V2" CPU. Here is the code snip where the failure happens: static void test_apic_change_mode() { ... apic_write(APIC_TMICT, tmict); wait_until_tmcct_is_zero(tmict, true); apic_change_mode(APIC_LVT_TIMER_PERIODIC); report("TMCCT should have a non-zero value", apic_read(APIC_TMCCT)); /* * After the change of mode, the counter should not be reset and * continue counting down from where it was */ report("TMCCT should not be reset to TMICT value", apic_read(APIC_TMCCT) < (tmict / 2)); wait_until_tmcct_is_zero(tmict, false); report("TMCCT should be reset to the initial-count", apic_read(APIC_TMCCT) > (tmict / 2)); <=== FAILURE ... } The last statement above is where the failure happened. Obviously the code is expecting the APIC_TMCCT counter will be reset to the initial value stored in APIC_TMICT, right after the counter reach zero (it is a periodic timer anyway). However this assumption shouldn't be held true all the time. It is possible the test code will reads APIC_TMCCT before the reset happens. If this happens, the test will fail. In fact, in my experiment, it is quite common (>20% of chance) to see APIC_TMCCT 0 on Intel "E3-1220 V2" CPU. My suggestion is to remove the following two statements. - wait_until_tmcct_is_zero(tmict, false); - report("TMCCT should be reset to the initial-count", - apic_read(APIC_TMCCT) > (tmict / 2)); Thanks, -Wei