Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3918232rwa; Tue, 23 Aug 2022 12:29:44 -0700 (PDT) X-Google-Smtp-Source: AA6agR66HNm50ydyF/cHRuSOgDWx8+aCH50Hy5GEId6RX/DeIgt0zs40ANyQer4AW19cqGrU1ntP X-Received: by 2002:a05:6402:332:b0:446:3427:5c62 with SMTP id q18-20020a056402033200b0044634275c62mr4992630edw.141.1661282984563; Tue, 23 Aug 2022 12:29:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661282984; cv=none; d=google.com; s=arc-20160816; b=bopTIOul3Ru4JDk9yp7f032e9jRGyLdmkYo2lNJtWGhs29CQ8FcYM7x6YWGgWN+m16 V//Hck402FMyABhYJogZ3yWSjqz+dLY7wLby3vTsdR6Y+DPnkwFqf2I/p3Bi1/LPS3ck gURa1fdrCwZ8MXB1WZdurAyC/zlxbyhIS7J1nPA9+s+wDtFp8R0LYtuuwsXDjGGJA2xK WFMmqqjTPWD46ypiSy3Sjfiv1orJVDGOHjD2AUh0bOlfV7tmbBcO7qQ0V8H4WGe+C7wf 91fVkjc0xpZhITBtR+OhzdeJam3e8JicfUkI0m1sXwA5t2ole9CsEAwu3k2ZKSe0gxIC yHDw== 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=Es/SKRV3OFmw44FXdjOkfiW1qF34GTyugA5yXeHJg1o=; b=PH5W0k0MLlkXgYwfYhuUQIlPr2+3V9b4knTpa7U+dkk0Fy1vgmA8ZaUTMNEllncOar 5O5nNRk1FDBui+/lfWPqt0FbS8zow1S+8KEi2lQHpzm1Od6Xy7VmlFCfeHCrmRl/bBGf mC1ybT2bMH7ibs3vwDRzFeTCjmb6IdHEIq/zqLymLoYOJYt1uYRLPtqHmWLvF7bFdBcG BhWSnulm/qq0wYROSqNuprHkubx8VrTyjzQuAxxbicaqYEWWYi9hHP/7lhCEBwc2lJE8 1LSLGC1gASZK1vY+JGeDPojzj2TIYBhOEWl6Q1DiR23UVchsz+W4iqskaky9VvCXO/qT ZN4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Htyr6zgv; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ne11-20020a1709077b8b00b0072b40bc7412si402596ejc.223.2022.08.23.12.29.18; Tue, 23 Aug 2022 12:29:44 -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=@google.com header.s=20210112 header.b=Htyr6zgv; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232018AbiHWTPr (ORCPT + 99 others); Tue, 23 Aug 2022 15:15:47 -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-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" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable 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 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?