[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC 2/4] ptimer: Rename ptimer_init() to ptimer_init_with_bh()
From: |
Richard Henderson |
Subject: |
Re: [RFC 2/4] ptimer: Rename ptimer_init() to ptimer_init_with_bh() |
Date: |
Mon, 7 Oct 2019 09:20:40 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
On 10/4/19 4:48 AM, Peter Maydell wrote:
> Currently the ptimer design uses a QEMU bottom-half as its
> mechanism for calling back into the device model using the
> ptimer when the timer has expired. Unfortunately this design
> is fatally flawed, because it means that there is a lag
> between the ptimer updating its own state and the device
> callback function updating device state, and guest accesses
> to device registers between the two can return inconsistent
> device state.
>
> We want to replace the bottom-half design with one where
> the guest device's callback is called either immediately
> (when the ptimer triggers by timeout) or when the device
> model code closes a transaction-begin/end section (when the
> ptimer triggers because the device model changed the
> ptimer's count value or other state). As the first step,
> rename ptimer_init() to ptimer_init_with_bh(), to free up
> the ptimer_init() name for the new API. We can then convert
> all the ptimer users away from ptimer_init_with_bh() before
> removing it entirely.
>
> (Commit created with
> git grep -l ptimer_init | xargs sed -i -e
> 's/ptimer_init/ptimer_init_with_bh/'
> and three overlong lines folded by hand.)
>
> Signed-off-by: Peter Maydell <address@hidden>
> ---
Reviewed-by: Richard Henderson <address@hidden>
r~
- [RFC 0/4] transaction-based ptimer API, Peter Maydell, 2019/10/04
- [RFC 1/4] hw/timer/arm_timer: Add trace events, Peter Maydell, 2019/10/04
- [RFC 2/4] ptimer: Rename ptimer_init() to ptimer_init_with_bh(), Peter Maydell, 2019/10/04
- Re: [RFC 2/4] ptimer: Rename ptimer_init() to ptimer_init_with_bh(),
Richard Henderson <=
- [RFC 4/4] hw/timer/arm_timer.c: Switch to transaction-based ptimer API, Peter Maydell, 2019/10/04
- [RFC 3/4] ptimer: Provide new transaction-based API, Peter Maydell, 2019/10/04
- Re: [RFC 0/4] transaction-based ptimer API, Paolo Bonzini, 2019/10/04