qemu-patch-raspberry4/hw/timer
Joel Stanley 8137355e85 aspeed/timer: Fix behaviour running Linux
The Linux kernel driver was updated in commit 4451d3f59f2a
("clocksource/drivers/fttmr010: Fix set_next_event handler) to fix an
issue observed on hardware:

 > RELOAD register is loaded into COUNT register when the aspeed timer
 > is enabled, which means the next event may be delayed because timer
 > interrupt won't be generated until <0xFFFFFFFF - current_count +
 > cycles>.

When running under Qemu, the system appeared "laggy". The guest is now
scheduling timer events too regularly, starving the host of CPU time.

This patch modifies the timer model to attempt to schedule the timer
expiry as the guest requests, but if we have missed the deadline we
re interrupt and try again, which allows the guest to catch up.

Provides expected behaviour with old and new guest code.

Fixes: c04bd47db6 ("hw/timer: Add ASPEED timer device model")
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-id: 20190618165311.27066-8-clg@kaod.org
[clg: - merged a fix from Andrew Jeffery <andrew@aj.id.au>
        "Fire interrupt on failure to meet deadline"
        https://lists.ozlabs.org/pipermail/openbmc/2019-January/014641.html
      - adapted commit log
      - checkpatch fixes ]
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-07-01 17:28:59 +01:00
..
a9gtimer.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
allwinner-a10-pit.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
altera_timer.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
arm_mptimer.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
arm_timer.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
armv7m_systick.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
aspeed_rtc.c hw: timer: Add ASPEED RTC device 2019-07-01 17:28:59 +01:00
aspeed_timer.c aspeed/timer: Fix behaviour running Linux 2019-07-01 17:28:59 +01:00
cadence_ttc.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
cmsdk-apb-dualtimer.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
cmsdk-apb-timer.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
digic-timer.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
ds1338.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
etraxfs_timer.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
exynos4210_mct.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
exynos4210_pwm.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
exynos4210_rtc.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
grlib_gptimer.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
hpet.c hpet: Report warnings with warn_report(), not error_printf() 2019-04-17 21:21:49 +02:00
i8254.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
i8254_common.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
imx_epit.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
imx_gpt.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
Kconfig i386-softmmu.mak: remove all CONFIG_* except boards definitions 2019-03-07 21:45:53 +01:00
lm32_timer.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
m41t80.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
m48t59-internal.h Normalize header guard symbol definition. 2019-05-13 08:58:55 +02:00
m48t59-isa.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
m48t59.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
Makefile.objs hw: timer: Add ASPEED RTC device 2019-07-01 17:28:59 +01:00
mc146818rtc.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
milkymist-sysctl.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
mips_gictimer.c hw/mips_gictimer: provide API for retrieving frequency 2017-02-21 22:24:58 +00:00
mss-timer.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
nrf51_timer.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
omap_gptimer.c Replace all occurances of __FUNCTION__ with __func__ 2018-01-22 09:46:18 +01:00
omap_synctimer.c hw/timer/omap_synctimer.c: Don't use old_mmio 2017-09-21 16:34:27 +01:00
pl031.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
puv3_ost.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
pxa2xx_timer.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
sh_timer.c fix "Missing break in switch" coverity reports 2018-08-23 13:32:50 +02:00
slavio_timer.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
stm32f2xx_timer.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
sun4v-rtc.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
trace-events hw: timer: Add ASPEED RTC device 2019-07-01 17:28:59 +01:00
twl92230.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
xilinx_timer.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
xlnx-zynqmp-rtc.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00