Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp443170pxb; Thu, 21 Apr 2022 03:12:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1pKyZlzIz39Zo4ezQuw6utmNxChCLEzxo7kzcr15zRAP9pcs6dRbL9uqxqIReKTO6Aks0 X-Received: by 2002:a05:6402:442:b0:416:14b7:4d55 with SMTP id p2-20020a056402044200b0041614b74d55mr27960014edw.183.1650535949750; Thu, 21 Apr 2022 03:12:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650535949; cv=none; d=google.com; s=arc-20160816; b=Pr2gGK0DZ/YYFVys8ZxNDUOpr6cmL6eIdCJKEtC6fvy7Ijxikca8mK54TnQ3aerCJH 741528PRbUzn6swuik4dx7HqbkR47NvuaXPTMV0RZ+u8bJdQwo7KIFT5ItHnY39hzajg 9YOg7CZqw8wbyD1Ff3y8TYQOoYL0Iu4PhDOFmVdZeYgBZNPZaSRkqFuNyYFG7wkHl4VT pZGO4xOtyNM34dqXmP5hqzk5CjGxCRf1a47C80qxLtn4SBaugCGSUcAORI+vAbrY98fN cRkb2/4Fd6LiDYOq7EOPusWQdsNcX3t9XMwqugjnKQLV0t1ZyBhaqkD/qchtVlTkj+PZ d1Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=lU5BSaSjRzfiOicOUSKsJto3Y5ZINdD8/4ry3fxI5F8=; b=hmIhfw/nLeyvT0MGRGYYBRvJRwFfmniEkTmey1hSLZSnFO05gwV/33mbiy4fEp6wLo 3nIg0OLZH2cBIHmb063A9htVOZSK5x0tsU0kR49EglyIm7/NT29eAbsLaszk2NkbloSa MqAhXiOyMH5qp/qp9kd76QzcgH6tPFY+fWVCc+RM4Q/6AwiFiiX2x6VBsyCPsYHBKYDh rZSBVHP8VVoKjuWREjftBdmxABAxBJ1K9NVCJhN5OITScXZbjd8zZJhJRzZgQ2DsC0oc 53GIBBA811k81Qeqq+6wNBxuk2fxVG11TNgWPDGBeXzMNcKjs4/+T6J+KVcswQh4qFea 4Ncw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MIvk92Sr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i13-20020a1709061e4d00b006efe08752d0si3979540ejj.468.2022.04.21.03.12.06; Thu, 21 Apr 2022 03:12:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MIvk92Sr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381976AbiDUIIx (ORCPT + 99 others); Thu, 21 Apr 2022 04:08:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231173AbiDUIIv (ORCPT ); Thu, 21 Apr 2022 04:08:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85C311B78F for ; Thu, 21 Apr 2022 01:06:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 00D9B61ABA for ; Thu, 21 Apr 2022 08:06:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A98FC385AB for ; Thu, 21 Apr 2022 08:06:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650528361; bh=9MnyHMj4/WZWXBUrOQs4qeUaIaUlxdy8igZsS3lMkVw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=MIvk92Srxr23LX7TlLH90nQXY6T/havYMoWz5qtfT/UymbihSbaG+YUcaBK7o6qoN ncMEgsU0p12Mme6v+eLiYgWGS9GpFqHmYgS2hkoi/P1oQruLwiC8FPyZMGdXSDKGz4 R3twXJr1noDPWn9GSzmx1c+SWKpEBr2o0jMTB7vOK4x1430MtOzsEGJ5WP2a6rTamD sEEytXiegjePrMi10SwomqSqZrNF2ZdWxnAhj+Y3pXajj/cj4saAUE8xplNgbAy+ER O9yLgO6SXeq1aZ0ijCdnanLFIWNl3NIneyKJeRnOdR1oNmU2+55T4i4YRUuzAJpH10 vSMz3v5ZgHqmQ== Received: by mail-oa1-f41.google.com with SMTP id 586e51a60fabf-e5e433d66dso4647387fac.5 for ; Thu, 21 Apr 2022 01:06:01 -0700 (PDT) X-Gm-Message-State: AOAM531/6SeQkCLne6oRMerf8IqNntG5xT7cCuJ/0Von3ECJYl9QSsyM vmc9LVgUlh72su3/liXIZmVAUusinV5eLcAXTb0= X-Received: by 2002:a05:6871:297:b0:e5:f100:602f with SMTP id i23-20020a056871029700b000e5f100602fmr3358921oae.126.1650528360636; Thu, 21 Apr 2022 01:06:00 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ard Biesheuvel Date: Thu, 21 Apr 2022 10:05:49 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 07/10] crypto: Use ARCH_DMA_MINALIGN instead of ARCH_KMALLOC_MINALIGN To: Christoph Hellwig Cc: Arnd Bergmann , Catalin Marinas , Herbert Xu , Will Deacon , Marc Zyngier , Greg Kroah-Hartman , Andrew Morton , Linus Torvalds , Linux Memory Management List , Linux ARM , Linux Kernel Mailing List , "David S. Miller" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 21 Apr 2022 at 09:20, Christoph Hellwig wrote: > > Btw, there is another option: Most real systems already require having > swiotlb to bounce buffer in some cases. We could simply force bounce > buffering in the dma mapping code for too small or not properly aligned > transfers and just decrease the dma alignment. Strongly agree. As I pointed out before, we'd only need to do this for misaligned, non-cache coherent inbound DMA, and we'd only have to worry about performance regressions, not data corruption issues. And given the natural alignment of block I/O, and the fact that network drivers typically allocate and map their own RX buffers (which means they could reasonably be fixed if a performance bottleneck pops up), I think the risk for showstopper performance regressions is likely to be acceptable.