On Tue, Sep 2, 2025 at 6:43 PM Jan Beulich <jbeul...@suse.com> wrote:
>
> On 02.09.2025 11:03, Mykola Kvach wrote:
> > ---
> >  xen/arch/arm/domain.c                 |  37 ++++++++
> >  xen/arch/arm/include/asm/domain.h     |   6 ++
> >  xen/arch/arm/include/asm/perfc_defn.h |   1 +
> >  xen/arch/arm/include/asm/psci.h       |   2 +
> >  xen/arch/arm/include/asm/suspend.h    |  18 ++++
> >  xen/arch/arm/include/asm/vpsci.h      |   5 +-
> >  xen/arch/arm/vpsci.c                  | 116 +++++++++++++++++++++-----
> >  xen/common/domain.c                   |   9 ++
> >  xen/include/xen/domain.h              |  11 +++
> >  9 files changed, 183 insertions(+), 22 deletions(-)
> >  create mode 100644 xen/arch/arm/include/asm/suspend.h
>
> Note, btw, how this way you won't need x86, ppc, and riscv acks.

Thanks for suggesting this approach. Hopefully, the other stub functions
can be updated in a similar manner.

>
> > --- a/xen/include/xen/domain.h
> > +++ b/xen/include/xen/domain.h
> > @@ -8,6 +8,10 @@
> >
> >  #include <public/xen.h>
> >
> > +#if __has_include(<asm/suspend.h>)
> > +#include <asm/suspend.h>
> > +#endif
> > +
> >  struct guest_area {
> >      struct page_info *pg;
> >      void *map;
> > @@ -109,6 +113,13 @@ int arch_domain_soft_reset(struct domain *d);
> >
> >  void arch_domain_creation_finished(struct domain *d);
> >
> > +#if !__has_include(<asm/suspend.h>)
> > +static inline int arch_domain_resume(struct domain *d)
> > +{
> > +    return 0;
> > +}
> > +#endif /* !__has_include(<asm/suspend.h>) */
> > +
> >  void arch_p2m_set_access_required(struct domain *d, bool access_required);
> >
> >  int arch_set_info_guest(struct vcpu *v, vcpu_guest_context_u c);
>
> Imo it would be preferable to have such in a single #if/#else. There's nothing
> wrong with an #include not sitting at the very top.

I understand that includes can be placed near where something from the
header is used. However, I find it more natural to keep them together
in a single location.

>
> (Another question is whether to put this in xen/domain.h at all. There could
> be a xen/suspend.h having - for now at least - just this and nothing else.)

With this approach, I don’t need to move the include to the middle of
the file.

>
> Jan

Best regards,
Mykola

Reply via email to