]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/ppc: Decrementer fix BookE semantics
authorNicholas Piggin <npiggin@gmail.com>
Tue, 30 May 2023 13:12:13 +0000 (23:12 +1000)
committerMichael Tokarev <mjt@tls.msk.ru>
Mon, 25 Sep 2023 20:43:49 +0000 (23:43 +0300)
commite916d29608c83f4dc521c58fe9c57b17affcc943
tree76cec3e01a1b19888f5f861c7ee1e0f072c1b156
parent8cfe6d241bb0d857206c4ccc3cf1054de8f76637
target/ppc: Decrementer fix BookE semantics

The decrementer store function has logic that short-cuts the timer if a
very small value is stored (0, 1, or 2) and raises an interrupt
directly. There are two problem with this on BookE.

First is that BookE says a decrementer interrupt should not be raised
on a store of 0, only of a decrement from 1. Second is that raising
the irq directly will bypass the auto-reload logic in the booke decr
timer function, breaking autoreload when 1 or 2 is stored.

Fix this by removing that small-value special case. It makes this
tricky logic even more difficult to reason about, and it hardly matters
for performance.

Cc: sdicaro@DDCI.com
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20230530131214.373524-2-npiggin@gmail.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
(cherry picked from commit 17dd1354c1d1aba9caf4af01e11aa7dbe128474f)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/ppc/ppc.c