[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [PATCH 3/8] fdc: Introduce fdctrl->phase
From: |
Peter Maydell |
Subject: |
Re: [Qemu-block] [Qemu-devel] [PATCH 3/8] fdc: Introduce fdctrl->phase |
Date: |
Wed, 20 May 2015 09:06:15 +0100 |
On 20 May 2015 at 08:54, Kevin Wolf <address@hidden> wrote:
> Am 19.05.2015 um 22:57 hat Peter Maydell geschrieben:
>> Yeah, if there's genuinely an underlying state machine that's
>> not completely visible in registers you need to actually model it.
>> You should probably then model the register bits by calculating
>> them from the state rather than by changing them as you go along
>> in parallel with moving the state machine around.
>
> I think the combination of registers is actually enough to reconstruct
> what state we're in, so it is derived (otherwise I would have fixed a
> bug that I'm not aware of). Adding logic to derive it in a post-load
> handler should be good enough.
That handles migration, which is good. But I still think that
storing the same information in two places in the device
state (phase field and the register fields) is error-prone.
If we want to switch to having a phase field we should calculate
the relevant register bits on demand based on the phase, rather
than keeping both copies of the state in sync manually.
thanks
-- PMM
- [Qemu-block] [PATCH 1/8] fdc: Rename fdctrl_reset_fifo() to fdctrl_to_command_phase(), (continued)
- [Qemu-block] [PATCH 1/8] fdc: Rename fdctrl_reset_fifo() to fdctrl_to_command_phase(), Kevin Wolf, 2015/05/19
- [Qemu-block] [PATCH 2/8] fdc: Rename fdctrl_set_fifo() to fdctrl_to_result_phase(), Kevin Wolf, 2015/05/19
- [Qemu-block] [PATCH 3/8] fdc: Introduce fdctrl->phase, Kevin Wolf, 2015/05/19
- Re: [Qemu-block] [Qemu-devel] [PATCH 3/8] fdc: Introduce fdctrl->phase, John Snow, 2015/05/19
- Re: [Qemu-block] [Qemu-devel] [PATCH 3/8] fdc: Introduce fdctrl->phase, Peter Maydell, 2015/05/19
- Re: [Qemu-block] [Qemu-devel] [PATCH 3/8] fdc: Introduce fdctrl->phase, John Snow, 2015/05/19
- Re: [Qemu-block] [Qemu-devel] [PATCH 3/8] fdc: Introduce fdctrl->phase, Peter Maydell, 2015/05/19
- Re: [Qemu-block] [Qemu-devel] [PATCH 3/8] fdc: Introduce fdctrl->phase, Kevin Wolf, 2015/05/20
- Re: [Qemu-block] [Qemu-devel] [PATCH 3/8] fdc: Introduce fdctrl->phase,
Peter Maydell <=
- Re: [Qemu-block] [Qemu-devel] [PATCH 3/8] fdc: Introduce fdctrl->phase, Kevin Wolf, 2015/05/20
- Re: [Qemu-block] [Qemu-devel] [PATCH 3/8] fdc: Introduce fdctrl->phase, Peter Maydell, 2015/05/20
- Re: [Qemu-block] [Qemu-devel] [PATCH 3/8] fdc: Introduce fdctrl->phase, John Snow, 2015/05/20
- Re: [Qemu-block] [Qemu-devel] [PATCH 3/8] fdc: Introduce fdctrl->phase, Peter Maydell, 2015/05/20
- Re: [Qemu-block] [Qemu-devel] [PATCH 3/8] fdc: Introduce fdctrl->phase, Kevin Wolf, 2015/05/21
- Re: [Qemu-block] [Qemu-devel] [PATCH 3/8] fdc: Introduce fdctrl->phase, Dr. David Alan Gilbert, 2015/05/21
- Re: [Qemu-block] [Qemu-devel] [PATCH 3/8] fdc: Introduce fdctrl->phase, Peter Maydell, 2015/05/21
- Re: [Qemu-block] [Qemu-devel] [PATCH 3/8] fdc: Introduce fdctrl->phase, Kevin Wolf, 2015/05/21
- Re: [Qemu-block] [Qemu-devel] [PATCH 3/8] fdc: Introduce fdctrl->phase, Markus Armbruster, 2015/05/21
- Re: [Qemu-block] [Qemu-devel] [PATCH 3/8] fdc: Introduce fdctrl->phase, Peter Maydell, 2015/05/21