Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp85764iog; Tue, 28 Jun 2022 17:02:24 -0700 (PDT) X-Google-Smtp-Source: AGRyM1trryUhAeFcTXyt5/Uiu+Nz5Q6tMCB8iGuwghkiCABGqHEZ3nndJ3sXIoXzWvKEbRI5By68 X-Received: by 2002:a17:907:1b07:b0:6fe:2cbc:15c5 with SMTP id mp7-20020a1709071b0700b006fe2cbc15c5mr619213ejc.677.1656460944627; Tue, 28 Jun 2022 17:02:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656460944; cv=none; d=google.com; s=arc-20160816; b=CjvlpjLqbxqTmJznqtfdT35TX1n3k0Uf6rPmO1bgIYBzszsSqfYIlZQBs9WRyspkWJ Ko/h6jiiGfi8vzzlMsw+YXkrAFsWf/c/+lq0Zs7mnUnq3M3iidJusV94xlq26HBt9rDa u+ZDZIoRDp/J6O+lH8SEG5M3Tx2BCs38rI1stz0eWbOvzWwkU7f5ObTvHmCiz77tEdd7 3Iq/ZAcaUuK/j6bBMLyR5RS4m4J4rGMw1ttK6xq9Ro3rn5qMGckfiF38It/yO3OxKLxg e1JifNjdr25wyToLniuimVLWf/9NZLDm/8iYUwPnMnpV6fVJv2vWW5NvmDokHVcUOhA+ XgyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=SkmGWod1utKevQCGJfPo61gCs9z/vOcHKNlbLZdqJ/g=; b=blXF6iADzJWQf7Qkhm4o6x5RTmG2GoktZwyv6O3mqqiaIPIioSawBUuwomZ1dk9jI2 Y6tkoB8l4sZR8lNZfZboQ+hLGCLd3ce4oQivlpzIlT5gJTSOk2eyV5+96spOy8/6d3Xx nRwH+DUWEZ+3f5+nw9vVE8ej6+WJeYZdaX/4A4nt3jEatqyhhYSfP8z9UtB3AdVpMtaa WR1zrzyCFRrhvM4/zF+MMA7HhvA8nSBrc0pSbl/QW74qY0+0g48/jYJgd2KyKTh0oiE9 B8PDgH4UnsEZO21WmYHlNgq8+DLvMCwFxcsPJ9Jf+qMu9+kOQWwZhqSe5vJ4Sk8eeeXY 6m0Q== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=acm.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ho8-20020a1709070e8800b00718c1dc910bsi18454359ejc.719.2022.06.28.17.01.55; Tue, 28 Jun 2022 17:02:24 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=acm.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231324AbiF1XuT (ORCPT + 99 others); Tue, 28 Jun 2022 19:50:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230231AbiF1XuR (ORCPT ); Tue, 28 Jun 2022 19:50:17 -0400 Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 496503917E; Tue, 28 Jun 2022 16:50:15 -0700 (PDT) Received: by mail-pj1-f51.google.com with SMTP id dw10-20020a17090b094a00b001ed00a16eb4so14300314pjb.2; Tue, 28 Jun 2022 16:50:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=SkmGWod1utKevQCGJfPo61gCs9z/vOcHKNlbLZdqJ/g=; b=EJF6TCv+QdstsKjx9+Ll8rT4I6VWrHZYep+wOwkBBsFSeb+amOrTW3NOT8BhW4wqLP 7cSVavxsDll6Uwo4NYGjljVXHi1V6tQDTDrfJfLT/eL/P9aIUs8yEcIntYP6lGdv7Mr+ /X9wAwva55pxgYE2OP//TnhvIdpsBsShY+JFCz+O7rrgmrYuFfjAjckVHyj+OZZeerzw RB4zIe5n3FjcZrUEim692E+sbgmQs+7LRgeOGZpBKIGzNplYTcfA2ic5EhH2WET824d6 kNsht2MEPw5/Ka8eK/0q1EiUwcsNcAFtDHDcZsZzbrZto1WZwx99Cn1jPjCgJ1R2pyS5 DH+g== X-Gm-Message-State: AJIora9Mu1rfq1bUY1HAr3jSQ8g4kSZySnMESMNgqLO8e3Cpy5Qg4G+7 laDnT5mynD00DGdfQ+iHaG4= X-Received: by 2002:a17:90b:4c0d:b0:1ed:2466:c0d3 with SMTP id na13-20020a17090b4c0d00b001ed2466c0d3mr2517451pjb.6.1656460214627; Tue, 28 Jun 2022 16:50:14 -0700 (PDT) Received: from ?IPV6:2601:647:4000:d7:feaa:14ff:fe9d:6dbd? ([2601:647:4000:d7:feaa:14ff:fe9d:6dbd]) by smtp.gmail.com with ESMTPSA id cr9-20020a056a000f0900b0052594a3ba89sm6923182pfb.65.2022.06.28.16.50.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Jun 2022 16:50:13 -0700 (PDT) Message-ID: Date: Tue, 28 Jun 2022 16:50:09 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH v2 3/3] arch/*/: remove CONFIG_VIRT_TO_BUS Content-Language: en-US To: Michael Schmitz , Arnd Bergmann Cc: Geert Uytterhoeven , scsi , Linux Kernel Mailing List , Arnd Bergmann , Jakub Kicinski , Christoph Hellwig , Marek Szyprowski , Robin Murphy , Linux IOMMU , Khalid Aziz , "Maciej W . Rozycki" , Matt Wang , Miquel van Smoorenburg , Mark Salyzyn , linuxppc-dev , Linux-Arch , alpha , linux-m68k , Parisc List , Denis Efremov , Michael Ellerman , John Paul Adrian Glaubitz References: <20220617125750.728590-1-arnd@kernel.org> <20220617125750.728590-4-arnd@kernel.org> <6ba86afe-bf9f-1aca-7af1-d0d348d75ffc@gmail.com> <9289fd82-285c-035f-5355-4d70ce4f87b0@gmail.com> <9f812d3d-0fcd-46e6-6d7e-6d4bf66f24ab@gmail.com> From: Bart Van Assche In-Reply-To: <9f812d3d-0fcd-46e6-6d7e-6d4bf66f24ab@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 6/28/22 16:09, Michael Schmitz wrote: > On 29/06/22 09:50, Arnd Bergmann wrote: >> On Tue, Jun 28, 2022 at 11:03 PM Michael Schmitz >> wrote: >>> On 28/06/22 19:03, Geert Uytterhoeven wrote: >>>>> The driver allocates bounce buffers using kmalloc if it hits an >>>>> unaligned data buffer - can such buffers still even happen these days? >>>> No idea. >>> Hmmm - I think I'll stick a WARN_ONCE() in there so we know whether this >>> code path is still being used. >> kmalloc() guarantees alignment to the next power-of-two size or >> KMALLOC_MIN_ALIGN, whichever is bigger. On m68k this means it >> is cacheline aligned. > > And all SCSI buffers are allocated using kmalloc? No way at all for user > space to pass unaligned data? > > (SCSI is a weird beast - I have used a SCSI DAT tape driver many many > years ago, which broke all sorts of assumptions about transfer block > sizes ... but that might actually have been in the v0.99 days, many > rewrites of SCSI midlevel ago). > > Just being cautious, as getting any of this tested will be a stretch. An example of a user space application that passes an SG I/O data buffer to the kernel that is aligned to a four byte boundary but not to an eight byte boundary if the -s (scattered) command line option is used: https://github.com/osandov/blktests/blob/master/src/discontiguous-io.cpp Bart.