Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3257521pxt; Mon, 9 Aug 2021 22:18:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwl2t1F9r8yWt2QWY5O9fYPpdXpiIT2la4/Ks8IYsE4Gzr9ssyeNPFW7HFSUxIYMgMYhARL X-Received: by 2002:a02:2348:: with SMTP id u69mr25386408jau.141.1628572695465; Mon, 09 Aug 2021 22:18:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628572695; cv=none; d=google.com; s=arc-20160816; b=hl+kUpQB/N/YpGon2TzNiJIAfDhHiDdrZsBEJN1Q5tXN35heDXv2l9vKLmGyr5jTpK l5cAThXPbM40LgTyQ8S1k97u2AskFrUpVU08w9+813vstiazbCwy3L3nuUQOFumu/aGD R6HTHhRYA5guECnqPt4p3tcR9oenRW/nqVjkOGT0fuBCuz6Hcf9OQ3qXOYJigE1Y8OGr 9c11UBcMKYcPGDYh1g8uDUbSr9veWcCRdTAzxnGW+wErD8pEwZwc58xW558kW/wht0at oIRiX8yIXjv9LaAihXOWFnJ/2Cz0WgOuTq2zQVU/A35QprrNJ4wYDrNvAcy67fCm+OQA 5rQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=jSSgod6BCV7HGeJ5Sg1uN+xOqGDa0ESfr2yf+KMt7Os=; b=itAZkm4vAgeAh3v03Aim6JkLml4PSISeDtaIyS6tr51bdg+JxxMuf2gXWE6N12/bPZ ShtiUHY/ui0L79j9PZ7rQtgARTUHLhQTKKHc6H971RATY5998LKssfYeatv2Eu22zJOH jBKm/TfonuzruvUhkLyV2aFyFcICmx71uBkbqlLiSehifS0+0ghHgjR18LcP6fPdDXx1 b0knSHJautQ0w1c4B8klfRm7vKxJk550f3bMacABUuAfD0IzGZDtzt3DrmAOKdvIczOE nYvkF9z3y1Ughk2BlgPd4Jqdi6Uv3tYrS9YBWq57I5bEKneBhacI5TV2A4AdEBlVfx3l 6IGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="NT/EZu4A"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c8si22498055ilq.88.2021.08.09.22.18.03; Mon, 09 Aug 2021 22:18:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="NT/EZu4A"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237236AbhHJBlm (ORCPT + 99 others); Mon, 9 Aug 2021 21:41:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234710AbhHJBlm (ORCPT ); Mon, 9 Aug 2021 21:41:42 -0400 Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com [IPv6:2607:f8b0:4864:20::732]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF920C0613D3 for ; Mon, 9 Aug 2021 18:41:20 -0700 (PDT) Received: by mail-qk1-x732.google.com with SMTP id a19so20703829qkg.2 for ; Mon, 09 Aug 2021 18:41:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=jSSgod6BCV7HGeJ5Sg1uN+xOqGDa0ESfr2yf+KMt7Os=; b=NT/EZu4AHorIdqU60o5QtGc0fMe6Cl77W5uoGWCbmy3ERIZoZRDfnOIbarE2J19l/g p24uY2gVC58VBwUWJnDHQfpoQEionBEllQiSB3mrnXXZUemE3PNmfV31/1RlOaKOu4i1 3+/6ayglaF33MVtaBcdh8R5AdL5+V1uD+B64M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=jSSgod6BCV7HGeJ5Sg1uN+xOqGDa0ESfr2yf+KMt7Os=; b=cqlUMpeTCuaE0Grou/FJPf5lEn/2DKlsu2dbXvp4PoBR7/95mlQhpUxYNaAupq6wBX prES51EKgyP19L73hVnbzLViWjZU+UmwcDNuLS/g0hAy8/MUx+ZVwDLdFbxyKgVT2z2y 8HIsg/NrXGuRqwcCog3G0nvlkG04XRwRreWra6dP7LxMiA6/buuBAl9GKmcTaVQhMIiz IcOkM8LnF4GRGjChrwJGEkIqaZEyAurAMivxwpbqbNhyYOqWetZgIwOOTHddEXaZQkQP m/DBMfI0i6+81XHff/T6jhCrmO1kDzMVCoGWngOeCPy8lJvZARLEmMvX2xub5MjJ6Ul1 zBig== X-Gm-Message-State: AOAM5331cfXP8P9OXwWwhv83oHhQcBuZfpsYZfqMTVqyJJYljhQH0OKC XKIrBmm10+lnNUOyPqaKwncISMdPYyXbPls7ZyqP8A== X-Received: by 2002:a37:6d8:: with SMTP id 207mr12046983qkg.328.1628559680048; Mon, 09 Aug 2021 18:41:20 -0700 (PDT) MIME-Version: 1.0 References: <20210806103423.3341285-1-stevensd@google.com> <20210806103423.3341285-4-stevensd@google.com> In-Reply-To: From: David Stevens Date: Tue, 10 Aug 2021 10:41:08 +0900 Message-ID: Subject: Re: [PATCH v2 3/9] dma-iommu: bounce buffers for untrusted devices To: "Mi, Dapeng1" Cc: Robin Murphy , "linux-kernel@vger.kernel.org" , Sergey Senozhatsky , "iommu@lists.linux-foundation.org" , Will Deacon , Christoph Hellwig Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 10, 2021 at 10:19 AM Mi, Dapeng1 wrote: > > Hi David, > > I like this patch set and this is crucial for reducing the significant vI= OMMU performance. It looks you totally rewrite the IOMMU mapping/unmapping = part and use the dynamically allocated memory from buddy system as bounce b= uffer instead of using the legacy SWIOTLB bounce buffer. As I know, some le= gacy devices' DMA could not access the memory larger than 32-bit memory spa= ce and the dynamically allocated memory address could exceed the 32-bit mem= ory space. Is it a problem? My understanding is that when devices with that sort of limitation sit behind an IOMMU, the IOVA is what matters, not the physical address. The bounce bounce buffers use the same limits for IOVA allocation as the regular dma-iommu path, so compatible IOVAs will be allocated for the bounce buffers. -David > Thx, > Dapeng Mi