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

Re: [PATCH v4 12/21] IOMMU: fold flush-all hook into "flush one"


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Fri, 6 May 2022 10:38:33 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=6nPBJArNKj75A1bY9/7rifvJdi50/wj3Om+ibh/8hCs=; b=MyWl5X4/7YjnaFT6AE2ZMzdouWPMJ9fWaEhSD67P+th0ejkQQE/oKSX+lcvG0uvNJvZr/pakB1qK7/0MbXZaiiTkjJkjdqqHyA4hd+TvJqFxqnExuxm3FP1R4FmBC6laf5dq5nKu58NHZzmVgDpxAnW64ynT2VB8AYPcdxgoZreA9oSiuX0eIjke/Ua2NI4cd6LL6Pf8JIKA1z+s/kxmKPWmF6c1VthOT/5X99pl2L+jORFeRCuQKqR5DZGsf82XmvMTFOXukkgMfAdZMHi7Xwzh9fNpwa0QAh2pXwJQKRtcPic/fOZXQmfQROl33ISbU38jYsnGHutsvwshMgOKGQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iLGZOr+YuqGW4lFSBeL21McsNG/FRHq2oeWnW/hAcOdf5atcguSNPMyFY8V6IV3t4UWNcey4tCdYQOW0pyfVPc8ERBIuc71zs8I0eE8H7Z1BQrxppLgI8TFoOkuHDIKWg6/UT1UvgrOnzCn+DhRvfwGkgIVD9EfWjU+j03P5SCaidNuru2M8wNsevOd94FOHswJlu7w011HAnPw/ZdqFKB84ugcXGSZy9ptUIDcBBiv8+5n/Rx7KaVzLYf8MCKPjGEzKzh9u4dPvBqcdJvJpJ/uYcq52JS5eW0zzZ0BJabAwb/1T10LIMeJHDoDnKR13CuZD3493HGI2Ad5lQRvvJQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>
  • Delivery-date: Fri, 06 May 2022 08:38:52 +0000
  • Ironport-data: A9a23:lCPRN6OxHh2glQvvrR3TlsFynXyQoLVcMsEvi/4bfWQNrUolhTwBm zNOXG2Gb67ZZmv2c9x2YIWypB9VvpDUzYJjGwto+SlhQUwRpJueD7x1DKtR0wB+jCHnZBg6h ynLQoCYdKjYdleF+lH1dOKJQUBUjclkfJKlYAL/En03FFYMpBsJ00o5wbZk2tMw3bBVPivW0 T/Mi5yHULOa82Yc3lI8s8pvfzs24ZweEBtB1rAPTagjUG32zhH5P7pGTU2FFFPqQ5E8IwKPb 72rIIdVXI/u10xF5tuNyt4Xe6CRK1LYFVDmZnF+A8BOjvXez8CbP2lS2Pc0MC9qZzu1c99Z0 fEKq4SeEBcQfZLFtqMXTTpSUCtgMvgTkFPHCSDXXc276WTjKiOp5so0SUY8MMsf5/p9BnxI+ boAMjcRYxufhuWwhrWmVu1rgcdlJ87uVG8dkig4kXeFUrB7HNaaG/uiCdxwhV/cguhUGvnTf YwBYCdHZxXceRxffFwQDfrSmc/33iakLGME9Tp5o4I7uGaLyVVQ4IHDc9WNUNm4ReF7t0iX8 zeuE2PRR0ty2Mak4TiP/2+oh+TPtTjmQ49UH7q9ntZ6jVvWymENBRk+UVqgveL/mkO4Q8hYK UEf5mwpt6da3FSiU93VTxC+5nmesXYht8F4FuQ77ESI1fDS6gPAXmwcFGcZNpohqdM8QiEs2 hmRhdT1CDdzsbqTD3WA6rOTqjD0Mi8QRYMfWRI5ocI+y4GLiOkOYtjnEb6PzIbdYgXJJAzN
  • Ironport-hdrordr: A9a23:YRFYnKDVRCX0B0blHegwsceALOsnbusQ8zAXPh9KJCC9I/bzqy nxpp8mPH/P5wr5lktQ/OxoHJPwOU80lKQFmLX5WI3PYOCIgguVxe1ZnOjfKnjbalbDH41mpN tdmspFebrN5DFB5K6VgTVQUexQpuVvmJrY+Ns2pE0dKT2CBZsQjTuQXW2gYzdLrUR9dOwEPa vZwvACiyureHwRYMj+Ln4ZX9Lbr9mOsJ79exYJCzMu9QHL1FqTmfbHOind+i1bfyJEwL8k/2 SAuwvl5p+7u/X+7hPHzWfc47lfhdOk4NpeA86njNQTN1zX+0+VTbUkf4fHkCE+oemp5lpvuN 7Qoy04N8A20H/VdnHdm2qZ5yDQlBIVr1Pyw16RhnXu5ebjQighNsZHjYVFNjPE9ksJprhHoe 529lPck6ASIQLLnSz76dSNfQptjFCIrX0rlvNWp2BDULEZdKRaoeUkjQ5o+a87bWzHAb0cYa hT5Jm23ocXTbraVQGSgoBX+q3iYpxpdS32AXTruaSuokprdT5CvgklLfck7wk9HaIGOuZ5Dt v/Q9VVfZF1P7srhPFGdZA8qfXeMB28fTv8dESvHH/AKIYrf1rwlr+f2sRH2AjtQu1C8KcP
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Mon, Apr 25, 2022 at 10:40:06AM +0200, Jan Beulich wrote:
> --- a/xen/drivers/passthrough/vtd/iommu.c
> +++ b/xen/drivers/passthrough/vtd/iommu.c
> @@ -772,18 +772,21 @@ static int __must_check cf_check iommu_f
>      struct domain *d, dfn_t dfn, unsigned long page_count,
>      unsigned int flush_flags)
>  {
> -    ASSERT(page_count && !dfn_eq(dfn, INVALID_DFN));
> -    ASSERT(flush_flags);
> +    if ( flush_flags & IOMMU_FLUSHF_all )
> +    {
> +        dfn = INVALID_DFN;
> +        page_count = 0;
> +    }
> +    else
> +    {
> +        ASSERT(page_count && !dfn_eq(dfn, INVALID_DFN));
> +        ASSERT(flush_flags);
> +    }
>  
>      return iommu_flush_iotlb(d, dfn, flush_flags & IOMMU_FLUSHF_modified,
>                               page_count);

In a future patch we could likely move the code in iommu_flush_iotlb
into iommu_flush_iotlb_pages, seeing as iommu_flush_iotlb_pages is the
only caller of iommu_flush_iotlb.

Thanks, Roger.



 


Rackspace

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