[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v8 05/13] xen/arm: gic-v3: add ITS suspend/resume support


  • To: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • From: Mykola Kvach <xakep.amatop@xxxxxxxxx>
  • Date: Sat, 9 May 2026 01:11:00 +0300
  • Arc-authentication-results: i=1; mx.google.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=4uoSD4dv/lM4JCjO11NQ3fturTKgoKsOxneWDpV0nVw=; fh=URHEk7klKxjqc5bXwxtPgt12zwbJaOVjsCphaVnE7cw=; b=Z/0mSUiTU3IoY0fIp3e5sDBGNOSFNuVxs6cB1DaTD7J4brf6nmLLui9X/Pul/TneuK rfD5jESnayv9cqeUd2ec7zct9gM8oPtSkz6KL1q0l0vojJgWHzYocj6zgro9dlACrEre k9QSEXgyQYfBRzADQ25l2dwdEu8enQOJDjaXfdyruy5UK1jDI+pLgrB9Il1rpv7WBwY2 GnE2bZjuSKqnzVziWwp+h3o57EWbotlGpn3mxAS454ai06N6lhnXwClm+uhjWWrfqlEX DfiKkYAr9rkBGJr48ajTAL8/qmuzonrQmcyumGtaLfzOj4JKD36DTWOHy7SJZcxkxhjE F/8w==; darn=lists.xenproject.org
  • Arc-seal: i=1; a=rsa-sha256; t=1778278272; cv=none; d=google.com; s=arc-20240605; b=ctEPWtcrRH7/AL/gpGVlLx7wM7EkOI+33f4sCAwisOknQMFUMABo3E7hFQbuh/7VYC mVqExXjx79FxN4h59yFo8BGP5uk/KAoz7tEWRUl/GunO0XwMlHL64fVBL7De46dvvIpI eeUbdxgL1853u0NEUWMM8WHkG/nYFy1Y4wYL8+MRzFpusp3UqoNYSMx3J7NtYDkTTdnf JeLeZzgbYLbEop0uG7rP63PKkL7EnA9Dk8hzCLHxX/Mi4QWfyXU72R67y+8WmdGB0wj2 4943bmQcWaUa58PFnjs1WvA9XHxplnldxn6xBaOmDMaarj66EEQjuqi7imJ7vyjRhoH4 ZQeg==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Mykola Kvach <mykola_kvach@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Fri, 08 May 2026 22:11:16 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, May 8, 2026 at 2:31 PM Luca Fancellu <Luca.Fancellu@xxxxxxx> wrote:
>
> Hi Mykola,
>
> >
> > On Fri, Apr 24, 2026 at 1:54 PM Luca Fancellu <Luca.Fancellu@xxxxxxx> wrote:
> >>
> >> Hi Mykola,
> >>
> >>> On 2 Apr 2026, at 11:45, Mykola Kvach <xakep.amatop@xxxxxxxxx> wrote:
> >>>
> >>> From: Mykola Kvach <mykola_kvach@xxxxxxxx>
> >>>
> >>> Handle system suspend/resume for GICv3 with an ITS present so LPIs keep
> >>> working after firmware powers the GIC down. Snapshot the CPU interface,
> >>> distributor and last-CPU redistributor state,
>
> “Snapshot the CPU interface, distributor and last-CPU redistributor state” 
> happened in the commit before?

Yes, fair point.

That wording is too broad for this patch. It describes the wider GICv3
suspend/resume flow in which the ITS handling is invoked, rather than the
ITS-specific part added here.

The CPU interface, distributor and redistributor handling are covered by
the related GICv3 suspend/resume patches, while this patch itself adds the
ITS state save/restore.

I will tighten the commit message in the next version so it only describes
the ITS-specific suspend/resume handling done by this patch.

>
> >>> disable the ITS to cache its
> >>> CTLR/CBASER/BASER registers, then restore everything and re-arm the
> >>> collection on resume.
> >>>
> >>> Add list_for_each_entry_continue_reverse() in list.h for the ITS suspend
> >>> error path that needs to roll back partially saved state.
> >>>
> >>> Based on Linux commit dba0bc7b76dc ("irqchip/gic-v3-its: Add ability to 
> >>> save/restore ITS state")
> >>> Signed-off-by: Mykola Kvach <mykola_kvach@xxxxxxxx>
> >>> ---
> […]
> >
> >>
> >>> +    {
> >>> +        unsigned int i;
> >>> +        void __iomem *base = its->its_base;
> >>> +
> >>> +        its->suspend_ctx.ctlr = readl_relaxed(base + GITS_CTLR);
> >>> +        ret = gicv3_disable_its(its);
> >>
> >> This is called from system_suspend(), along the path iommu_suspend and
> >> console_suspend() are called, finally reaching gic_suspend() and this one.
> >>
> >> In the IHI 0069H.b, 5.6.2 Disabling an ITS, it says:
> >> “Ensure that all interrupts that target the ITS that is being powered down 
> >> are
> >> either redirected or disabled”, is it correct to assume all the ITS 
> >> targeting source
> >> at this point are disabled because domains should be already suspended?
> >
> > Yes, that is the assumption here.
> >
> > Before Xen reaches this path, each domain must already have entered
> > SHUTDOWN_suspend. In other words, the guest OS has already requested
> > SYSTEM_SUSPEND only after completing its own suspend flow, so the
> > ITS-targeting interrupt sources owned by that OS are expected to be
> > quiesced at this point.
> >
> > So this code relies on the owning OS having disabled or otherwise
> > quiesced those sources before issuing SYSTEM_SUSPEND, rather than Xen
> > explicitly doing that in gicv3_its_suspend().
>
> Ok! I would be for a comment stating this assumption, unless the maintainers 
> disagree

Ack.

Best regards,
Mykola

>
> >
> >>
> >>
> >>> +        if ( ret )
> >>> +        {
> >>> +            writel_relaxed(its->suspend_ctx.ctlr, base + GITS_CTLR);
> >>
> >> here and in the other places we write GITS_CTLR, this reg has Quiescent as 
> >> RO,
> >> maybe we should mask the write to only the other bits that are writable?
> >
> > Yes, this was inherited from the Linux ITS suspend/resume code, which 
> > restores
> > the saved GITS_CTLR value directly.
> >
> > That said, masking the write to the writable bits is cleaner, and I will do
> > that in the next version.
>
> ok
>
> Cheers,
> Luca
>



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.