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

RE: [PATCH] xen/arm: Enhance IPMMU-VMSA driver robustness and debug output


  • To: "Orzel, Michal" <michal.orzel@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jahan Murudi <jahan.murudi.zg@xxxxxxxxxxx>
  • Date: Wed, 25 Jun 2025 10:28:35 +0000
  • Accept-language: en-IN, kn-IN, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none
  • 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=fKzWTVWrGb0bC9gAvNTpISKhhAEiaXgjCxN0G+Rap/0=; b=kaN6sRb34FyPqpGqIGT5I+WX9yvm6cgvSC/qwuC0BB0d3HLUeXDrek+/PITyESMkxEVxSxKnjEFbxO1wjIuNz/n5kpU76xyeWLtBK5K0hYqbs8aERHtcbYWzSUkXqn+UV0AVgOptLUknWUEOXsHEVAbQCgzCBuxjhVhCucJ0YCfzTDPorEW2fdCYjHOyAGrAf/LwroJKc0Zn47MelW2aZFQ3nFC4VG0NsblL0DsYjdXsZzwLhxUOAQdiCrbLXXdNhCkNnkogjFah4MA6HXL6LKgyV2/w5wmrV0wKaljXH9G5eSvy/IR7jhdW+O+7z9KLgb3LA4l6goqtO1nyu7238g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=adI/X/gz2iA/JT2pk+3Mc22d4ruxNRrMVsgdppFy3hSfScMjIx8w7HuIK3WtJqJRQxFo8YOXPfBBQy74mIQxbnyG+uzm8h8xCsmw591+lF5HfnsOVyxdutFxDG7i/3GlWEcXLjGgHx1882irWBzLC01G0bUwE7zdOo8Bav5Mf0oNjpSrMrEt85adbAyLK+dCJJ/3wySc00YYFYYWvxEsZXS3U1nd+IzfSBEUOH+4YDW8vZxgyDilEilzWWuKgbLvoYOAvBZdUkh93Per8f+X5tvTtiOtm+GsLNmSLYMpbgB99wmTTfZwHBp4e6l2p9fbMcSFihlk+yH2W49XyeDY2A==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>
  • Delivery-date: Wed, 25 Jun 2025 10:28:50 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHb4c6ALl3IHvqkBEOgbLXzyjOhU7QQXHcAgANRIGA=
  • Thread-topic: [PATCH] xen/arm: Enhance IPMMU-VMSA driver robustness and debug output

Hi Michal,

Thank you for your review and the Ack.

>> +    dsb(sy);
> Any clue why Linux (mainline) does not do that?

The implementation writel() which contains an implicit dsb(st) which likely 
sufficient for Linux for its Stage-1 IOMMU usage where CPU and IOMMU 
interactions are coherent. 
However, Xen uses the IPMMU as a Stage-2 IOMMU for non-coherent DMA operations 
(such as PCIe passthrough), requiring the stronger dsb(sy) to ensure writes 
fully propagate to the IPMMU hardware before continuing.

Regards,
Jahan 

-----Original Message-----
From: Orzel, Michal <michal.orzel@xxxxxxx> 
Sent: 23 June 2025 12:56
To: Jahan Murudi <jahan.murudi.zg@xxxxxxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx
Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>; Julien Grall <julien@xxxxxxx>; 
Bertrand Marquis <bertrand.marquis@xxxxxxx>; Volodymyr Babchuk 
<volodymyr_babchuk@xxxxxxxx>
Subject: Re: [PATCH] xen/arm: Enhance IPMMU-VMSA driver robustness and debug 
output



On 20/06/2025 12:31, Jahan Murudi wrote:
> - Fix typo in source comment ("you can found" -> "which can be found").
> - Add dsb(sy) after IMCTR write to ensure flush is complete before polling.
> - Add dev_info() log in ipmmu_device_reset() to indicate the number of 
> disabled contexts.
> 
> These changes improve memory operation ordering, code readability, and 
> runtime traceability for IPMMU on R-Car Gen3/Gen4 SoCs
> 
> Signed-off-by: Jahan Murudi <jahan.murudi.zg@xxxxxxxxxxx>
Acked-by: Michal Orzel <michal.orzel@xxxxxxx>

> ---
>  xen/drivers/passthrough/arm/ipmmu-vmsa.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/xen/drivers/passthrough/arm/ipmmu-vmsa.c 
> b/xen/drivers/passthrough/arm/ipmmu-vmsa.c
> index d828d9cf6a..dac0dd6d46 100644
> --- a/xen/drivers/passthrough/arm/ipmmu-vmsa.c
> +++ b/xen/drivers/passthrough/arm/ipmmu-vmsa.c
> @@ -13,7 +13,7 @@
>   *
>   * Based on Linux's IPMMU-VMSA driver from Renesas BSP:
>   *    drivers/iommu/ipmmu-vmsa.c
> - * you can found at:
> + * which can be found at:
>   *    url: 
> git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas-bsp.git
>   *    branch: v4.14.75-ltsi/rcar-3.9.6
>   *    commit: e206eb5b81a60e64c35fbc3a999b1a0db2b98044
> @@ -433,6 +433,8 @@ static void ipmmu_tlb_invalidate(struct ipmmu_vmsa_domain 
> *domain)
>      data |= IMCTR_FLUSH;
>      ipmmu_ctx_write_all(domain, IMCTR, data);
>  
> +    /* Force IMCTR write to complete before polling to avoid false 
> completion check. */
> +    dsb(sy);
Any clue why Linux (mainline) does not do that?

~Michal


 


Rackspace

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