Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp91768iog; Tue, 28 Jun 2022 17:09:40 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uXUK6u1FKwjwaUtZrkVkqPLriyDAskdCuPSg1MV9DttX6o6kgOKm0A183/AV539DJvfbVg X-Received: by 2002:a63:560b:0:b0:411:3ecb:ae86 with SMTP id k11-20020a63560b000000b004113ecbae86mr502808pgb.434.1656461380105; Tue, 28 Jun 2022 17:09:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656461380; cv=none; d=google.com; s=arc-20160816; b=GQ8uKpIeZfjPIwkLsqfGuqKJ2enQzmn31Jc+JnzemHqGRgigfzK8T9U1migh6kqShm z8KsvcL4FQxUJ2kq+pYOr0OttmDSA7y45zYJBlFK2yKzE7UrrAm6snUxUsacAYe4tZhA vO+k54fzCJDV4VvqbI+sHH36RgXi2xSFzfgZNnaF832F7T18YOdWcCtTaepvjrUZRK3L 1uxBA7Xt6fzWT41fDY0ZZS4fy28YIeK8tiNddPhyvsSwIAwMa9nvVSWLre1BeU6yf5y6 HZbqvjaetEYOkzaM0J2mHEbRFqVQ+bJbF5JCvzd+OVmVUi9bNlUhyVUPS4xjw+AWVclq 139g== 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:dkim-signature; bh=0kpjfuIly1nOW0q2ELB2CmN7oIQ7HX+3B2PaKKHsB78=; b=PKV47BoQL2W6o+eY7qYoFUcI3d54sg4Tjm5/KdV5cxwmRZORfMzGTfp4gxpEPBXY0R /RqU+OOvx+70X+WTbIEfuFv/73nP7glDryA52Ckhd+QDSkhmegRuE/mfFPazK5z7cRlb FB3lpM+npqjIpzeLdD1P6rFqTsFZhj9UMNbR+3dDNTVFEw/9tMUSwlHSxBuKsP40pDhn vwU3chUdoeUri5Nr1hfhPrlBr4ZC4ko3NNQhFAWzm7MwJtKDThEL865deAEYf80ZFVCj msRD8+196UJueqlDpH1fXvvznzVcNVM+48+suFDsSNn906Per9BhEuPsJWLH95we2glq VPCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=D7i2Nged; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t26-20020a63461a000000b0040c9dc657ffsi21822662pga.225.2022.06.28.17.09.27; Tue, 28 Jun 2022 17:09:40 -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=@gmail.com header.s=20210112 header.b=D7i2Nged; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230057AbiF2ABn (ORCPT + 99 others); Tue, 28 Jun 2022 20:01:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbiF2ABl (ORCPT ); Tue, 28 Jun 2022 20:01:41 -0400 Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE94531225; Tue, 28 Jun 2022 17:01:40 -0700 (PDT) Received: by mail-pg1-x52d.google.com with SMTP id 68so13659604pgb.10; Tue, 28 Jun 2022 17:01:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=0kpjfuIly1nOW0q2ELB2CmN7oIQ7HX+3B2PaKKHsB78=; b=D7i2NgedY/bHyI8emNN+y0jr/G9IOYRWkIjlIhVn6DbWgwRG2UARyfZk3UwO7T2V+D ESqmy18MQo7RMsisYmEMOTQj203NqQOZVs7qiFGDUYY81Hru7Iv0ADFCQgagZlaKMdVq xung15+Nlj1soULvCk9mS+bfRYyJ9ltpn9UcH1mz1cQDWfJ2ax2IcuBr2SQ3tsjHpoK1 NeL3oeSuqVVYbcSBohKZ73kauU8T3VpyxipPF6h/oJ8e2qxtdKJwYj9HlUbwfye7QPMt PuFn7aX0KOb+qDfsVshvX0sC/38kqLR1JFdKMTuOuvGx8cb2fuTFMwQneoiKRpnAUU2m 4Xkg== 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=0kpjfuIly1nOW0q2ELB2CmN7oIQ7HX+3B2PaKKHsB78=; b=4C5l0TQMlwumCsDZ4LSdd3QzskDu8GBG+vdBVd/2ZJ797l0ryCzqWCwKmYAcdUy7s4 oFki4t6oA6GTyDdLCN0gUoyroFuNDtXf9mGNhCENLg9c6xkFEwN6CKz8l4wStnCXtTC1 ylb+2z8ej7U8w0qjURaZt4Mt1wURzjPcfOPJ5IXGjwsNHtt8Nj4GDfkYUZeWMwH3wSaL nq5Ep/kzBqE3lvG/ITc1uA0zWooFGvuqUGcIyf0mhSOQ6O4xCdK94Wtnca0V68ZFPyjs kIonjPR/8V4gR6uYTi7FLLJbTCIsU+YzdOmLSdmAADNMTt2j7+dhmRwNQc8JiKIgFFHk hx+A== X-Gm-Message-State: AJIora/DSerp7bCeD5uvhPIBa482Wnauw1HIJ/+abqXL7QX7ej1U4L2e FMpFRnnAB4Ms46Sa3qauyu4= X-Received: by 2002:a63:2b16:0:b0:3fa:faf9:e6d7 with SMTP id r22-20020a632b16000000b003fafaf9e6d7mr446010pgr.325.1656460900460; Tue, 28 Jun 2022 17:01:40 -0700 (PDT) Received: from ?IPV6:2001:df0:0:200c:75aa:d6ca:4354:6033? ([2001:df0:0:200c:75aa:d6ca:4354:6033]) by smtp.gmail.com with ESMTPSA id cd21-20020a056a00421500b0051b32c2a5a7sm9863096pfb.138.2022.06.28.17.01.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Jun 2022 17:01:39 -0700 (PDT) Message-ID: <859c2adc-d3cb-64e8-faba-06e1ac5eddaf@gmail.com> Date: Wed, 29 Jun 2022 12:01:24 +1200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v2 3/3] arch/*/: remove CONFIG_VIRT_TO_BUS Content-Language: en-US To: Bart Van Assche , 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: Michael Schmitz In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Hi Bart, On 29/06/22 11:50, Bart Van Assche wrote: > 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 Thanks - four byte alignment actually wouldn't be an issue for me. It's two byte or smaller that would trip up the SCSI DMA. While I'm sure such an even more pathological test case could be written, I was rather worried about st.c and sr.c input ... Cheers,     Michael > > Bart.