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

Re: [PATCH v2 14/18] IOMMU: fold flush-all hook into "flush one"


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Mon, 13 Dec 2021 16:04:11 +0100
  • 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=KmoTZP7pdgDxqssA+7fJec2uWa9cA3TctljcGSNgq4U=; b=bda9sAbTOX4ikCcahBNKVzjcF6KaIuBjOjpDEMXzqL+aAzQjHOOM1oeAFJFLI7rGD3LQZVYtH44kRLS4hwFhoGHIVu2RsEJpO3LAeJN+bFKzkKx3Jg3atf3GqegRtos/We+uJs/3uFYsW0mfcgyZCVUMxGrfBx9b/xJisrf8EP0qCnq5pLvB+WUjNVEws13R2VTm3N5mGjjtGqd/+d7wm7pQy4wf7CJyQ44n+paZ8Fpzxcv5MKJTDjPrKEFVKO+oOwHEMnOvS6xQSOlorl24Obiggvby10IerJ+37IMtQXIuo0kzeWNSyy7yrc9RbSmEi4yGQrgT6vloYO0oseAFzg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WOa+jzTdIPidmm/ummHH8SC07leMO0++73hIRd4btnqmf9OEQNfwXxwI/cDQRAcjFFGYR2nfDftVtpRsx6zSofqG92OxbpFPrZvv80Yl01A0sNw984bERJLIF6bPgc6DRoZC1AxknbvOkw3zoVQZ0STp+FDrPDtECybtrSwcolw5zvcVpNpAzJLi8S/j+EhXXtmkAebJUrjVcM73qySTUCJ2DHNbIrXOSkzWxWNUWdQXlsIt1aAAywDmhh9CSX4XWwuBwJ+n9IfiPj4FrzZSy/YihlnWyDNafhYhTdhBQkx83X1fOhBnUqb4IlrZdx2Ew1XoMfu2/ooCX9qU1RPYZw==
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Rahul Singh <Rahul.Singh@xxxxxxx>
  • Delivery-date: Mon, 13 Dec 2021 15:04:54 +0000
  • Ironport-data: A9a23:NoWE+q2Wjd7PV/FhUvbD5Y93kn2cJEfYwER7XKvMYLTBsI5bpzNUm zQbW2DTbvjZY2L1e95yPovl/U4GucDWz9FnG1FppC1hF35El5HIVI+TRqvS04J+DSFhoGZPt Zh2hgzodZhsJpPkS5PE3oHJ9RGQ74nRLlbHILOCanAZqTNMEn970Es5wrVh2OaEvPDia++zk YKqyyHgEAfNNw5cagr4PIra9XuDFNyr0N8plgRWicJj5TcypFFMZH4rHomjLmOQf2VhNrXSq 9Avbl2O1jixEx8FUrtJm1tgG6EAaua60QOm0hK6V0U+6/TrS+NbPqsTbZIhhUlrZzqhz/Fpl tRE6qCLWA44JLPAuugUf14EOnQrVUFG0OevzXmXtMWSywvNcmf2wuUoB0YzVWEa0r8pWycUr 6VecW1TKEDY7w616OvTpu1EnMMsIdOtJIoCknph0SvYHbAtRpWrr6DiuI4Ih2pg2pwm8fD2Y eUbYDlIfBH8WhxjGUpOLsJ9tumaiSyqG9FfgA3M/vdmi4TJ9yRv17z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gOkn2a2ep4Yoxvu/OkVvB9GKeNLWFcqLX0fhcYHsPVS145bd Z0Vrd87iezOmBJOrEiwrDItg
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, Sep 24, 2021 at 11:53:59AM +0200, Jan Beulich wrote:
> Having a separate flush-all hook has always been puzzling me some. We
> will want to be able to force a full flush via accumulated flush flags
> from the map/unmap functions. Introduce a respective new flag and fold
> all flush handling to use the single remaining hook.
> 
> Note that because of the respective comments in SMMU and IPMMU-VMSA
> code, I've folded the two prior hook functions into one. For SMMU-v3,
> which lacks a comment towards incapable hardware, I've left both
> functions in place on the assumption that selective and full flushes
> will eventually want separating.
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Just one nit I think.

> --- a/xen/drivers/passthrough/vtd/iommu.c
> +++ b/xen/drivers/passthrough/vtd/iommu.c
> @@ -731,18 +731,21 @@ static int __must_check iommu_flush_iotl
>                                                  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;

Don't we expect callers to already pass an invalid dfn and a 0 page
count when doing a full flush?

In the equivalent AMD code you didn't set those for the FLUSHF_all
case.

Thanks, Roger.



 


Rackspace

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