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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E337C32772 for ; Tue, 23 Aug 2022 19:15:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232208AbiHWTPu (ORCPT ); Tue, 23 Aug 2022 15:15:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231617AbiHWTO4 (ORCPT ); Tue, 23 Aug 2022 15:14:56 -0400 Received: from mail-vk1-xa34.google.com (mail-vk1-xa34.google.com [IPv6:2607:f8b0:4864:20::a34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C07918E9B7 for ; Tue, 23 Aug 2022 10:52:19 -0700 (PDT) Received: by mail-vk1-xa34.google.com with SMTP id i129so7490686vke.3 for ; Tue, 23 Aug 2022 10:52:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=Es/SKRV3OFmw44FXdjOkfiW1qF34GTyugA5yXeHJg1o=; b=Htyr6zgvLeb7VOm7M8YiX0MsuKqOQFg/1Dp9MRFHsmMgRGKEd9WwyKRrcHeLFHDm29 nM/bfzgL5k3eFrWzgPUgctn35VeUeDiJtJePnx7M8C0hWVKT2REkwMdmxOUxw1i9Lfw/ CbaaQ7uMsAT/X0Ph7VPdpGckzFqaPwgU378K5NGCsUHDagyqlzkGONXRTiXCOcBGYWCI q+YsgKQhl5xhXQB8Pc+6yWmSx4zaOylSieaKP7lpCxr22IPB5+DWeJotUqS+aEZLUsRo lVTqqaXDT5t9QEmcI+bIRPwSAPgzInt39jLGTIsGH1dQuSP7u56N7t5qOqn2Fr4w4b5y /Ucw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=Es/SKRV3OFmw44FXdjOkfiW1qF34GTyugA5yXeHJg1o=; b=QFyHiHkHZHroWyVZHbD6BcDbtYP90ixQRvuGyS68ggSEZMIxdrgOuBNI+KOnNpb6Cs p6jNhJoI4tzW3bLjd+L8m+zjjel3E3/TXh0Hfug4TP/Bp/QghwEN9vtygOMRaIEFIjjw ozuKKkkYAJ+GTZTqF6LE4EHkU7OZAAHE2fBWY2/rUfdp5D4uAxReNujmiSjTJhET0Isy NQe5zvpsRwTfZ5NFXwgv8FAmsrzvMvezaWnuQpA4C5PUY9n1bveLNR+YXga3KrfyltEL BUIM+UVsN4i6q+bQG8Txw7ERtJdgPG044bc85LvTIOJYbton+XnLOBvmyJ9l9niKtKyK kW1g== X-Gm-Message-State: ACgBeo2CA7nI/2dA9zz43KddRcpIf+FiOM9wgUV7DNqxUagAvQJdq4Pn m7zhYyofcenjT5b78LaR9Uk+dMeadziq8NCe9dJnPg== X-Google-Smtp-Source: AA6agR5LT5c2oH4HlSHea9+vMd6hW5j0wL9NLrJYmoLqS7f6O+74rga8DGg+9ywWJM7NvmxoN1meBCLo0cewOr+i/3A= X-Received: by 2002:a1f:9b07:0:b0:378:7c48:c6c with SMTP id d7-20020a1f9b07000000b003787c480c6cmr9890448vke.32.1661277112758; Tue, 23 Aug 2022 10:51:52 -0700 (PDT) MIME-Version: 1.0 References: <20220823080118.128342613@linuxfoundation.org> <20220823080131.532813281@linuxfoundation.org> In-Reply-To: From: Yu Zhao Date: Tue, 23 Aug 2022 11:51:16 -0600 Message-ID: Subject: Re: [PATCH 5.19 319/365] swiotlb: panic if nslabs is too small To: Dongli Zhang Cc: Greg Kroah-Hartman , Christoph Hellwig , Robin Murphy , stable , Sasha Levin , linux-kernel , iommu@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 23, 2022 at 11:25 AM Dongli Zhang wrote: > > Adding Robin, Yu and swiotlb list. Thanks. > There is an on-going discussion whether to revert this patch, because it breaks > a corner case in MIPS I wouldn't call it a corner case. Cavium Octeon is the major platform we use to test Debian MIPS ports [1], and 4 out of 5 best-selling Wi-Fi routers are MIPS-based [2]. [1] https://wiki.debian.org/MIPSPort [2] https://www.amazon.com/bestsellers/pc/300189 > when many kernel CONFIGs are not enabled (related to PCI > and device). As a result, MIPS pre-allocates only PAGE_SIZE buffer as swiotlb. > > https://lore.kernel.org/all/20220820012031.1285979-1-yuzhao@google.com/ > > However, the core idea of the patch is to panic on purpose if the swiotlb is > configured with <1MB memory, in order to sync with the remap failure handler in > swiotlb_init_remap(). > > Therefore, I am waiting for suggestion from Christoph whether (1) to revert this > patch, or (2) enforce the restriction to disallow <1MB allocation. There are other archs (arm, ppc, riscv, s390, etc.) that call swiotlb_init(). Have you verified them all?