[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: Mykola Kvach <xakep.amatop@xxxxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Fri, 8 May 2026 11:30:44 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=gmail.com smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GXrmYd9cObh5a/fjr3BcrO3AayHA1BYx1QIStZJvvbA=; b=MKJEkQLf6Nxivp7H1gkrvy3IQQXQ9jqTTPL2Df2ao3z8XfMQHsVpnZefOaJHqdgPIiaI4sLdT76YoUo2oLDx5UoIqGC/ZVHpSaiOi/4Yg9bkxl/xaWfgDT+Vc2cAs//GwKwk7MqjP/GzPfVOn7TDANUlb3PnbbCNgnUK2mNyLDhCPxD6QUq/PPILmy3z+paFi82FPi3aCiIIa1SKlY0u/zhnt0I6r7GLGb7Iy3lqmV6iJZNJX5/jcVSkP6Me9N/d65VAfZL4lCyobkOBCnfZm7fg1wARFnW4BgleP10tAuRr3YAIXv7qLj0vG3rH5+/RvrMRL6UKikJ+HgPFswm2kg==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GXrmYd9cObh5a/fjr3BcrO3AayHA1BYx1QIStZJvvbA=; b=yBVBd7vMiv0d3g6EbhGJJTw7f4YIbHwauOS1t4qYagQK4FstiPRFfWWkiPJgNXWNWBcvjgpMICM2Rw2bSVCuvgfnG/xjF+xXAB78FnKZCUF7aP/kEz79+tHVwaS4EtENlL625mLX2qNPXEZyvGEy08AQ/Ri6G6wiDBUQjyeUCeSS3srvwb5x74PnCNOUfvrDqJo/k9tJf4NVhxZVULoAQejDWIN6skCRBtVM5vj7Umi57t1enmrAY9jGsSdzrupIcj10ngmW6KYNAprXSv9o06UAQfza82X3bxLCNhFa9H1Bp7fb0v9pcVlivlMkkGkMthcbzGF+imxeFdKBDNgtmQ==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=gWrTilIqcL7CflzwETbISR34sZe3FAr3gk9jeaAL9SnWOcO3iSAKM8wncKNRGI9nbL9ghqVxp17BHS3eOCB11aPR/YcaIO4csHWAuuTGDi0Jc7XYxYTIc4qdoGAdn9fQrgT2s1WWUM7HRtYUWwBykw1bcB5rSSW5Je9raqNBXcYDhuRNOIrafkTZjQGFgFnH2rMryNMAbxlGQyQrOlXyYhe7912LfOQKLyTN2tFzNHnb5NPQ+t6/iKWtCtV2rx8jVdvfgcCjcHiwvNdSC6cVQghURLh6oj12oMIGZrSnVz0HKp/uV/SJgRTjL34xz3bkWeSysoTzwDdI/4BIcSKQPQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ie9/Fz95TFJUinsjZUxRf/nYkC1wPres7l9AXKp38dyDzjy6YGnhIwWnUQw1yTNQ7QIdH1eEY27pCPWjDDJdaeN8kIkSkFdKOUu1Fs0ICcKpAi4QKdxni4nwYWdoipPUpC2y6eOwpAs3X6fs9hjlPxfWGAmEsN95WGdU0D5e132K+tb4l850QxlLi9ApsYGoQn6qMMHGzbNOvya38cHuAbfxR7XxXEiBpqTLE2PqWYB/Dw255yZKLq0SxY7fTZ4kPxJ6ouMG2MvMD/zrMpaSr4lmaUrToqwxOTIO+J549wEC32cT09bqrMBEEG/pIVP4tp/d2FRhRmj/ojQuRi8USw==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • 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 11:32:11 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Thread-index: AQHc09iFdDokLL12tkS/bPm2SonHDLX/RtUAgATNjQA=
  • Thread-topic: [PATCH v8 05/13] xen/arm: gic-v3: add ITS suspend/resume support

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?

>>> 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

> 
>> 
>> 
>>> +        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®.