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

Re: [PATCH v10 09/13] xen/arm: smmu-v3: add suspend/resume handlers


  • To: Mykola Kvach <xakep.amatop@xxxxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Mon, 1 Jun 2026 17:11:28 +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=mHCpt9R0MscnHP5iI7n/QSTLX/es9SLtyi98WJMGoyw=; b=R8dh9vReJNglgVwBVpOZ+MgRwz2IjlckXwY9lNW1aPorqSOqrrq1yqmrF0/gHroIj4lz+9IVhZbjKOiqKLB289elzJKd6LZBAsHgtCrF36U/PEUniQzZq8rlvi5r7z7IfhweN3ua+aOTHbPCmhkF1CPLaCJZg8Qkosj6lMbRx0iRrWJn0rt18th8xJ4Yvei8HoSQFl7OGxMoUFZAaTAnQOE3MKaoZOaR8R3JdPGAW5hJ8Wb6HZC3qozpOdRaKZbf4Q0tuFCDm637Sdum/To0ysRea7gJRyPfDT62x5hANlwJoE3T1TQURkb2ukdVumHByJsqutYJuTSaz4FwXpTu+w==
  • 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=mHCpt9R0MscnHP5iI7n/QSTLX/es9SLtyi98WJMGoyw=; b=pIBbttdoWIgkR/QrqbL0pj3nHKASOyWiGs0oIBb2KPsUa65OYiVeauiGqeGmozwu03cG8mzitBkmxGOPVTrcSM8Ol/bTDhrYEasZniuWeEv7czx7qOakdI/JnNVKMxmxHz55hL1AIG+eAUHmsH90uH9zXFFkV6XDrqswMYi3LBv8hRdEamz3ZiecHqtmF78rvDASWeTdjVGQaDXQWcaEh30Buz0G0AZFiAWsVAbeOHOgM3jomDfR93/9qaD44mmeNGCUWJqO7rkigRDjoFixj5oS9YIrATLD0nLT1E4btOyw/C+L8HHO3otOn6ZtVD3vjqIRaBumMV5PFdzbDRbbKQ==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=lUqEoMA1N5i2EnZVWb15zdtrhLkbkBeDK7tdJ7Va8tI0Y1ijbYuHEukIpeRL1AmKE9vq8Iv+TlLFDwyoeqI8UkHeY0yAJPy7HMf9X5E7BwElp/s+hSDi58hIMlxkmFwFw+Nyz/+zsfQ5MwOHPIjEWUXX30n4JxgHuT5YLAL5Q7cy54+wffEGyZD94wamc7mgFdvDDnsJ//wmCMrmFFI1LGlgmkeronPaAz1NbDZgjtC49jCieX8GSD/8yYqn+5A3wXoTVmu7zSu01hf0/QCFQcgjrxeKb/FtXlvqhwITyHEkJxkjs67UshxCm2tkLrTI2e1EMm4HvCXeVkOLnD2AJw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cGUyXIm9j4VamV337XwHDwK4o9hhXh1p8gaNeD/d3Xko9bVwgoNPgbnFW+GsQwXe9PqLVl+2vJWIgjJPIUNAfSSfyd9KV3D+ZQl4YwEsGyEfnkmeOZi37HFV7FoGuKJhCbOjlK0fFDUHuVcLdorvqUHcMIUcpLAGmM3Q9XwLvAukF0Tqt0duyh8MNfrs/wSkxgGN2EYzC2dVQS87UvcobqYKgBcYljbR53m2CIpttIOaN6Xshk1EaKeByedx2X/USYYo4WMOdyUspLilDBEGQq9lcyXvW8a21eVR1/HuSq0daz8UOHdYVvYFqDEMm6/xEPkBEac6LT0plmYR9CsiZQ==
  • 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>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Rahul Singh <Rahul.Singh@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Pranjal Shrivastava <praan@xxxxxxxxxx>
  • Delivery-date: Mon, 01 Jun 2026 17:12:41 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Thread-index: AQHc6UoJ2/A9TKf5Mki5mcNZE+ke7LYqAKSA
  • Thread-topic: [PATCH v10 09/13] xen/arm: smmu-v3: add suspend/resume handlers

Hi Mykola,

> On 21 May 2026, at 18:45, Mykola Kvach <xakep.amatop@xxxxxxxxx> wrote:
> 
> From: Mykola Kvach <mykola_kvach@xxxxxxxx>
> 
> Add system suspend/resume callbacks for the Arm SMMUv3 driver.
> 
> During suspend, configure GBPA to abort incoming transactions, disable the
> translation interface while keeping CMDQ enabled, issue CMD_SYNC to ensure
> all previously issued commands have completed, then disable the SMMU IRQs
> and SMMU.
> 
> Resume uses arm_smmu_device_reset() to reprogram the SMMU and re-enable
> translation and interrupt generation.
> 
> The IRQ setup split follows the approach from Pranjal Shrivastava's Linux
> arm-smmu-v3 runtime/system sleep series: IRQ handlers are requested once
> during probe, while reset/resume only restores SMMU hardware state and
> re-enables IRQ_CTRL.
> 
> Only the pieces relevant to Xen's currently supported SMMUv3 path are
> ported here. Xen documents SMMUv3 MSI and PCI ATS as unsupported and not
> compiled/tested, so this patch does not restore SMMU MSI IRQ_CFGn registers
> nor reinitialize ATS/PRI endpoints. If those paths become usable,
> suspend/resume will need corresponding MSI restore and ATS/PRI
> quiesce/reinit steps.
> 
> Link: https://lore.kernel.org/r/20260414194702.1229094-1-praan@xxxxxxxxxx/
> Based-on-patch-by: Pranjal Shrivastava <praan@xxxxxxxxxx>
> Signed-off-by: Mykola Kvach <mykola_kvach@xxxxxxxx>
> ---
> Changes in V10:
> - Disable SMMU interrupt generation during suspend before disabling the
>  SMMU interface, matching the resume/reset path which re-enables IRQ_CTRL.
> 
> Changes in V9:
> - Use CMD_SYNC in suspend instead of polling CMDQ_CONS, so the suspend
>  path waits for command completion rather than only command consumption.
> - Document that arm_smmu_setup_irqs() is probe-only and that future Xen
>  SMMUv3 MSI support will need to restore SMMU IRQ_CFGn registers on
>  resume.
> - Restore the reference to Pranjal's Linux runtime/system sleep series and
>  clarify that MSI/ATS/PRI resume handling is outside the supported Xen
>  path.
> - Prefix the subject with xen/arm for consistency with the rest of the
>  Arm suspend/resume series.
> 
> Changes in V8:
> - Honor ARM_SMMU_FEAT_SEV when draining the CMDQ during suspend, matching
>  the existing runtime CMD_SYNC path.
> - Fold the suspend rollback reset path into a helper and rename the error
>  reporting to describe suspend rollback rather than resume.
> - Treat SMMU reset failure during resume as fatal instead of logging and
>  continuing with a potentially unusable IOMMU.
> - cosmetic changes
> ---
> xen/drivers/passthrough/arm/smmu-v3.c | 186 +++++++++++++++++++++-----
> 1 file changed, 150 insertions(+), 36 deletions(-)
> 
> diff --git a/xen/drivers/passthrough/arm/smmu-v3.c 
> b/xen/drivers/passthrough/arm/smmu-v3.c
> index bf153227db..be8028c036 100644
> --- a/xen/drivers/passthrough/arm/smmu-v3.c
> +++ b/xen/drivers/passthrough/arm/smmu-v3.c
> @@ -1814,8 +1814,7 @@ static int arm_smmu_write_reg_sync(struct 
> arm_smmu_device *smmu, u32 val,
> }
> 
> /* GBPA is "special" */
> -static int __init arm_smmu_update_gbpa(struct arm_smmu_device *smmu,
> -                                       u32 set, u32 clr)
> +static int arm_smmu_update_gbpa(struct arm_smmu_device *smmu, u32 set, u32 
> clr)

Now this one and arm_smmu_device_reset loose __init also for 
!CONFIG_SYSTEM_SUSPEND,
but I’m not sure if in the codebase we are dealing with these kind of cases 
already or if it’s still ok
to let it be without __init anyway.

Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx>

Cheers,
Luca


 


Rackspace

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