From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 91D99C433EF for ; Fri, 15 Apr 2022 08:06:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=aTva3JIYRz1F8OY4w73e5dP/xnkm8oDi4bQ+opdiZbw=; b=AgweQWCNK5w6i3 2bbJnBHDtJY7wU3fxkSWWYBTJ5DZRimHArF0wbJ5POAZwjEfMVfhFAiA+OtS+EKP3vu/l4xOSAIGU IX48lKusM8lR4WXcsdsCO4BFbsInTdA+dJ5H4m124Gz7GXTciybXpdOyUYEssZK/g6FoAwbmTkmKf nA3LABLRbCmYafgmUsjO+2LeZRMe7ZSQxL2ioVnodCocTNNhIbZiZzUjCz9Out0wVjZrCKtX9DWVx sndTs+ZcBPHu3WOWp+W+A8aAxlsrOdUWF8rJljE4TcW2t1sXVtUmLC0l53Wegzn5g6odTiOVpLd1X svw7+6x4L+lZojuOeDuw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nfGxU-009FTZ-T1; Fri, 15 Apr 2022 08:05:37 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nfGxR-009FT4-OV for linux-arm-kernel@lists.infradead.org; Fri, 15 Apr 2022 08:05:35 +0000 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 514E6620B1 for ; Fri, 15 Apr 2022 08:05:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6630C385A5 for ; Fri, 15 Apr 2022 08:05:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650009932; bh=riuuKXnoQlBRBV7zO25zHcF/JWwq7zfPNr5mu3m9+jI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=tXi9Jj5fnDgYEJrim5xfcMUIa9y+5BF6p9ZqnM7Q/aJgxGpwJRTGeSeibe2Y5Ezn1 teTDfS5nnAyKMU/ta+74JyWSeLIP6b0vZEqt5zWkyIVFKM3+0swjJv18a2cSQWQWqq IymLFV+D2iufYzMlVa94ag1HVsBOPhqflDvp4s7q4EBATTYae/zHKm9I0qr5DQXhq+ O3gLobRWXRaenBCExS0LOcP8DoW7qndV8GXQIUI6o8VBWak5jLP/LfgiimF9nZx3dj ieTcO471WheCh1GtnDnM5PCMP6nnZ1RBHzqfHMvWEGdMx24LHCdlY8kPryIqMxlDej +TVsRzXWf2zbQ== Received: by mail-oa1-f46.google.com with SMTP id 586e51a60fabf-d6ca46da48so7499397fac.12 for ; Fri, 15 Apr 2022 01:05:32 -0700 (PDT) X-Gm-Message-State: AOAM530YJRSuFKE+mb1pEYZK2MQOKpK4+jz3pq9PoFESzss5uWJashG3 0XtV7++gGS2RExFuN5HN243EoD3AcCAMw5nR78U= X-Google-Smtp-Source: ABdhPJwa5+CpOCKoPK7GU76i17Qy9CqHOdE4RymA/6S6MbMw45+zBMAYYJTH6M4NHw/fG0dhmipO+89okOHPFS+WrVU= X-Received: by 2002:a05:6870:eaa5:b0:da:b3f:2b45 with SMTP id s37-20020a056870eaa500b000da0b3f2b45mr1000528oap.228.1650009931924; Fri, 15 Apr 2022 01:05:31 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ard Biesheuvel Date: Fri, 15 Apr 2022 10:05:21 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 07/10] crypto: Use ARCH_DMA_MINALIGN instead of ARCH_KMALLOC_MINALIGN To: Herbert Xu Cc: Catalin Marinas , Will Deacon , Marc Zyngier , Arnd Bergmann , Greg Kroah-Hartman , Andrew Morton , Linus Torvalds , Linux Memory Management List , Linux ARM , Linux Kernel Mailing List , "David S. Miller" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220415_010533_891100_D2CD2B2C X-CRM114-Status: GOOD ( 19.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, 15 Apr 2022 at 09:52, Herbert Xu wrote: > > On Fri, Apr 15, 2022 at 09:49:12AM +0200, Ard Biesheuvel wrote: > > > > I'm not sure I understand what would go wrong if that assumption no > > longer holds. > > It's very simple, we don't do anything to the pointer returned > by kmalloc before returning it as a tfm or other object with > an alignment of CRYPTO_MINALIGN. IOW if kmalloc starts returning > pointers that are not aligned to CRYPTO_MINALIGN then we'd be > lying to the compiler. > I guess that should be fixable. GIven that this is about padding rather than alignment, we could do something like struct crypto_request { union { struct { ... fields ... }; u8 __padding[ARCH_DMA_MINALIGN]; }; void __ctx[] __align(CRYPTO_MINALIGN); }; And then hopefully, we can get rid of the padding once we fix drivers doing non-cache coherent inbound DMA into those structures. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel