qemu-e2k/hw/timer
Paolo Bonzini 33f21e4f04 mc146818rtc: implement UIP latching as intended
In some cases, the guest can observe the wrong ordering of UIP and
interrupts.  This can happen if the VCPU exit is timed like this:

           iothread                 VCPU
                                  ... wait for interrupt ...
t-100ns                           read register A
t          wake up, take BQL
t+100ns                             update_in_progress
                                      return false
                                    return UIP=0
           trigger interrupt

The interrupt is late; the VCPU expected the falling edge of UIP to
happen after the interrupt.  update_in_progress is already trying to
cover this case by latching UIP if the timer is going to fire soon,
and the fix is documented in the commit message for commit 56038ef623
("RTC: Update the RTC clock only when reading it", 2012-09-10).  It
cannot be tested with qtest, because its timing of interrupts vs. reads
is exact.

However, the implementation was incorrect because UIP cmos_ioport_read
cleared register A instead of leaving that to rtc_update_timer.  Fixing
the implementation of cmos_ioport_read to match the commit message,
however, breaks the "uip-stuck" test case from the previous patch.
To fix it, skip update timer optimizations if UIP has been latched.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-08-01 17:27:34 +02:00
..
a9gtimer.c
allwinner-a10-pit.c
altera_timer.c altera_timer: fix incorrect memset 2017-06-04 18:42:55 +03:00
arm_mptimer.c
arm_timer.c
armv7m_systick.c
aspeed_timer.c timer/aspeed: fix timer enablement when a reload is not set 2017-06-13 14:57:00 +01:00
cadence_ttc.c
cmsdk-apb-timer.c hw/char/cmsdk-apb-timer: Implement CMSDK APB timer device 2017-07-17 13:36:08 +01:00
digic-timer.c
ds1338.c
etraxfs_timer.c shutdown: Add source information to SHUTDOWN and RESET 2017-05-23 13:28:17 +02:00
exynos4210_mct.c hw/timer/exynos4210_mct: Remove unused defines 2017-06-13 14:56:57 +01:00
exynos4210_pwm.c hw/arm/exynos: Convert fprintf to qemu_log_mask/error_report 2017-04-20 17:39:17 +01:00
exynos4210_rtc.c hw/arm/exynos: Convert fprintf to qemu_log_mask/error_report 2017-04-20 17:39:17 +01:00
grlib_gptimer.c
hpet.c hpet: Remove user_creatable flag 2017-05-17 10:37:01 -03:00
i8254_common.c qdev: Replace cannot_instantiate_with_device_add_yet with !user_creatable 2017-05-17 10:37:00 -03:00
i8254.c
imx_epit.c
imx_gpt.c
lm32_timer.c
m48t59-internal.h
m48t59-isa.c
m48t59.c hw/timer: QOM'ify m48txx_sysbus 2017-06-02 05:54:43 +01:00
Makefile.objs hw/char/cmsdk-apb-timer: Implement CMSDK APB timer device 2017-07-17 13:36:08 +01:00
mc146818rtc.c mc146818rtc: implement UIP latching as intended 2017-08-01 17:27:34 +02:00
milkymist-sysctl.c shutdown: Add source information to SHUTDOWN and RESET 2017-05-23 13:28:17 +02:00
mips_gictimer.c
omap_gptimer.c
omap_synctimer.c
pl031.c
puv3_ost.c
pxa2xx_timer.c shutdown: Add source information to SHUTDOWN and RESET 2017-05-23 13:28:17 +02:00
sh_timer.c
slavio_timer.c hw/timer: QOM'ify slavio_timer 2017-06-02 05:54:43 +01:00
stm32f2xx_timer.c
sun4v-rtc.c
trace-events trace-events: fix code style: print 0x before hex numbers 2017-08-01 12:13:07 +01:00
twl92230.c
xilinx_timer.c