[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH v2 01/20] migration/vmstate: Restrict vmstate_dummy to us
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [RFC PATCH v2 01/20] migration/vmstate: Restrict vmstate_dummy to user-mode |
Date: |
Wed, 20 Jan 2021 11:03:14 +0000 |
User-agent: |
Mutt/1.14.6 (2020-07-11) |
* Philippe Mathieu-Daudé (f4bug@amsat.org) wrote:
> On 1/19/21 2:50 PM, Peter Maydell wrote:
> > On Sun, 17 Jan 2021 at 19:24, Philippe Mathieu-Daudé <f4bug@amsat.org>
> > wrote:
> >>
> >> 'vmstate_dummy' is special and only used for user-mode. Rename
> >> it to something more specific.
> >> It was introduced restricted to user-mode in commit c71c3e99b8
> >> ("Add a vmstate_dummy struct for CONFIG_USER_ONLY") but this
> >> restriction was later removed in commit 6afc14e92ac ("migration:
> >> Fix warning caused by missing declaration of vmstate_dummy").
> >> Avoid the missing declaration warning by adding a stub for the
> >> symbol, and restore the #ifdef'ry.
> >
> > So what is the actual use of vmstate_dummy ? I had a grep
> > through and as far as I can see the points where vmstate_cpu_common
> > is used are all in softmmu-only code.
>
> No clue, maybe simply remnant from unfinished work?
Not sure either; but it looks like Paolo fixed some of it up in d9f24bf5724
a few months ago; prior to that cpu_exec_unrealizefn used it even on a
USER_ONLY build.
Dave
> > I tried this patch
> > and QEMU seems to compile OK:
> >
> > diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
> > index 140fa32a5e3..a827417a4d8 100644
> > --- a/include/hw/core/cpu.h
> > +++ b/include/hw/core/cpu.h
> > @@ -1131,8 +1131,6 @@ bool target_words_bigendian(void);
> >
> > #ifdef CONFIG_SOFTMMU
> > extern const VMStateDescription vmstate_cpu_common;
> > -#else
> > -#define vmstate_cpu_common vmstate_dummy
> > #endif
> >
> > #define VMSTATE_CPU() {
> > \
>
> Great! Maybe even restricting VMSTATE_CPU() to softmmu-only:
>
> -- >8 --
> @@ -1131,9 +1131,6 @@ bool target_words_bigendian(void);
>
> #ifdef CONFIG_SOFTMMU
> extern const VMStateDescription vmstate_cpu_common;
> -#else
> -#define vmstate_cpu_common vmstate_dummy
> -#endif
>
> #define VMSTATE_CPU() {
> \
> .name = "parent_obj",
> \
> @@ -1142,6 +1139,7 @@ extern const VMStateDescription vmstate_cpu_common;
> .flags = VMS_STRUCT,
> \
> .offset = 0,
> \
> }
> +#endif
>
> #endif /* NEED_CPU_H */
> ---
>
> I'll wait if David/Juan have any comment, else respin based
> on your patch.
>
> Thanks,
>
> Phil.
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
- [RFC PATCH v2 00/20] hw: Mark the device with no migratable fields, Philippe Mathieu-Daudé, 2021/01/17
- [RFC PATCH v2 02/20] hw/core/qdev: Add vmstate_qdev_no_state_to_migrate, Philippe Mathieu-Daudé, 2021/01/17
- [RFC PATCH v2 04/20] hw/arm/aspeed_soc: Mark the device with no migratable fields, Philippe Mathieu-Daudé, 2021/01/17
- [RFC PATCH v2 03/20] hw/arm/armv7m: Mark the device with no migratable fields, Philippe Mathieu-Daudé, 2021/01/17
- [RFC PATCH v2 05/20] hw/arm/bcm283x: Mark devices with no migratable fields, Philippe Mathieu-Daudé, 2021/01/17
- [RFC PATCH v2 06/20] hw/arm/msf2-soc: Mark the device with no migratable fields, Philippe Mathieu-Daudé, 2021/01/17
- [RFC PATCH v2 07/20] hw/core/split-irq: Mark the device with no migratable fields, Philippe Mathieu-Daudé, 2021/01/17
- [RFC PATCH v2 09/20] hw/cpu/cluster: Mark the device with no migratable fields, Philippe Mathieu-Daudé, 2021/01/17