From: Peter Maydell <peter.maydell@linaro.org>
To: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Cc: fam@euphon.net, pbonzini@redhat.com, Laurent@vivier.eu,
qemu-devel@nongnu.org
Subject: Re: [PATCH v2 09/10] esp: include the current PDMA callback in the migration stream
Date: Thu, 3 Mar 2022 15:40:53 +0000 [thread overview]
Message-ID: <CAFEAcA9eMZFvqn-VuA2EevOM7ZV3PiVYora+CsKpdjcqM7L4_Q@mail.gmail.com> (raw)
In-Reply-To: <20220302212752.6922-10-mark.cave-ayland@ilande.co.uk>
On Wed, 2 Mar 2022 at 21:38, Mark Cave-Ayland
<mark.cave-ayland@ilande.co.uk> wrote:
>
> This involves (re)adding a PDMA-specific subsection to hold the reference to the
> current PDMA callback.
>
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> ---
> hw/scsi/esp.c | 23 +++++++++++++++++++++++
> 1 file changed, 23 insertions(+)
>
> diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
> index a818b2b07a..32926834bc 100644
> --- a/hw/scsi/esp.c
> +++ b/hw/scsi/esp.c
> @@ -1209,6 +1209,25 @@ static int esp_post_load(void *opaque, int version_id)
> return 0;
> }
>
> +static bool esp_pdma_needed(void *opaque)
> +{
> + ESPState *s = ESP(opaque);
> +
> + return s->dma_memory_read == NULL && s->dma_memory_write == NULL &&
> + s->dma_enabled;
A comment about why this is the correct condition would be helpful.
If I understand it correctly, something like this ?
/*
* pdma_cb is used only by the sysbus ESP device, not the PCI ESP
* device. The PCI device sets the s->dma_memory_read and
* s->dma_memory_write function pointers at realize.
*/
Otherwise
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
> +}
> +
> +static const VMStateDescription vmstate_esp_pdma = {
> + .name = "esp/pdma",
> + .version_id = 0,
> + .minimum_version_id = 0,
> + .needed = esp_pdma_needed,
> + .fields = (VMStateField[]) {
> + VMSTATE_UINT8(pdma_cb, ESPState),
> + VMSTATE_END_OF_LIST()
> + }
> +};
> +
> const VMStateDescription vmstate_esp = {
> .name = "esp",
> .version_id = 6,
> @@ -1243,6 +1262,10 @@ const VMStateDescription vmstate_esp = {
> VMSTATE_UINT8_TEST(lun, ESPState, esp_is_version_6),
> VMSTATE_END_OF_LIST()
> },
> + .subsections = (const VMStateDescription * []) {
> + &vmstate_esp_pdma,
> + NULL
> + }
> };
Do we need to do something similar to handle s->dma_cb ?
thanks
-- PMM
next prev parent reply other threads:[~2022-03-03 16:03 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-02 21:27 [PATCH v2 00/10] q800: migration fixes Mark Cave-Ayland
2022-03-02 21:27 ` [PATCH v2 01/10] macfb: add VMStateDescription for MacfbNubusState and MacfbSysBusState Mark Cave-Ayland
2022-03-03 15:22 ` Peter Maydell
2022-03-04 10:19 ` Laurent Vivier
2022-03-02 21:27 ` [PATCH v2 02/10] macfb: don't use special irq_state and irq_mask variables in MacfbState Mark Cave-Ayland
2022-03-04 10:22 ` Laurent Vivier
2022-03-02 21:27 ` [PATCH v2 03/10] macfb: increase number of registers saved " Mark Cave-Ayland
2022-03-03 15:25 ` Peter Maydell
2022-03-03 15:25 ` Peter Maydell
2022-03-03 17:44 ` Mark Cave-Ayland
2022-03-03 18:40 ` Peter Maydell
2022-03-04 10:24 ` Laurent Vivier
2022-03-02 21:27 ` [PATCH v2 04/10] macfb: add VMStateDescription fields for display type and VBL timer Mark Cave-Ayland
2022-03-03 15:26 ` Peter Maydell
2022-03-03 17:45 ` Mark Cave-Ayland
2022-03-04 10:27 ` Laurent Vivier
2022-03-02 21:27 ` [PATCH v2 05/10] macfb: set initial value of mode control registers in macfb_common_realize() Mark Cave-Ayland
2022-03-03 15:28 ` Peter Maydell
2022-03-04 10:27 ` Laurent Vivier
2022-03-02 21:27 ` [PATCH v2 06/10] esp: introduce esp_set_pdma_cb() function Mark Cave-Ayland
2022-03-04 10:28 ` Laurent Vivier
2022-03-02 21:27 ` [PATCH v2 07/10] esp: introduce esp_pdma_cb() function Mark Cave-Ayland
2022-03-04 10:29 ` Laurent Vivier
2022-03-02 21:27 ` [PATCH v2 08/10] esp: convert ESPState pdma_cb from a function pointer to an integer Mark Cave-Ayland
2022-03-04 10:30 ` Laurent Vivier
2022-03-02 21:27 ` [PATCH v2 09/10] esp: include the current PDMA callback in the migration stream Mark Cave-Ayland
2022-03-03 15:40 ` Peter Maydell [this message]
2022-03-03 17:50 ` Mark Cave-Ayland
2022-03-04 10:31 ` Laurent Vivier
2022-03-02 21:27 ` [PATCH v2 10/10] esp: recreate ESPState current_req after migration Mark Cave-Ayland
2022-03-04 10:33 ` Laurent Vivier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAFEAcA9eMZFvqn-VuA2EevOM7ZV3PiVYora+CsKpdjcqM7L4_Q@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=Laurent@vivier.eu \
--cc=fam@euphon.net \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).