OSDN Git Service

target/ppc: Decrementer fix BookE semantics
authorNicholas Piggin <npiggin@gmail.com>
Tue, 30 May 2023 13:12:13 +0000 (23:12 +1000)
committerDaniel Henrique Barboza <danielhb413@gmail.com>
Sat, 10 Jun 2023 13:19:24 +0000 (10:19 -0300)
commit17dd1354c1d1aba9caf4af01e11aa7dbe128474f
treed6bb2fc16a339244899b6a2385fb06401276d59d
parent09d2db9f46e38e2da990df8ad914d735d764251a
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>
hw/ppc/ppc.c