Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp2234618rwa; Mon, 22 Aug 2022 04:41:07 -0700 (PDT) X-Google-Smtp-Source: AA6agR4LEkyfqoHssXxO51DsqKgc+Nxh5mtPob019fsDcJAgfURbHbOdy8V7OzZa8dpi4h0EbYVl X-Received: by 2002:a05:6a00:1701:b0:535:91c1:b65f with SMTP id h1-20020a056a00170100b0053591c1b65fmr20247686pfc.40.1661168467425; Mon, 22 Aug 2022 04:41:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661168467; cv=none; d=google.com; s=arc-20160816; b=QLIXSy7lV6C9xeS/u76cTd1IjC02CcLfPPa8o9eDCo8OCOmIL/u24yePwyDlKO4lh2 MP9Eo4vwaZYbXhp5LdRUvzNy4gqkDJjqBVSW5oGphO0t4J0PCSKNi+4qG0Ce4wqsF610 kEAjbQ+UNOxnn9vSKSkGySfJ0OitBZJFRMZdqCu9aVkzpjmlUJF57f6GTK3mnP3am2W5 bkNZ5WOXPfehxdzTTl91cD0FOXEhMWeYmYqO1iFuXnEGTUtY61wAW9Cwx/ynPBXXCN63 Z/ufxOWNJNKiRILcm2CoScFDkZ9F3J7VgXBVQge3XaNavZj017lOj6J/Dus7FLN5qbus Sx1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=80Iob7m0eygDIBir23phYVn1p4Wv+1QMEBqUT1N4EkE=; b=nteGyEz3C17EF/tF3QIEWZH/xcl/8cboDtmryUFR/D1CrcN2hPVUPCv3By4I46R4Wp Pw2nQYm6+l9J9OxzBpNGf/FpVv2c3se0mdPZbTdJb2bCfsnBNuWdQUgS+RbkECvbA+8r 7C5wTYhNXRvZbi6ULZh+3hvGVupme8ldDxlYHvz46ZxVUI9BTKv3GvlJtYh9pQc1h8cn YwEhN0iXR/KqqpcZRjRMJ7/VhqvoNnvxPALBitHDdUUKzEh57f+wqa9PEZ5wyYCBDfDl xQmmQdWShtRIdhuJthK1c4M6u9l30po3Q1xNTStBMzy7I9ELXwZPLrD389S0hHViAKhy OBZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=w0XmYMb1; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c9-20020a170902d48900b0016d6f9a131csi14419320plg.232.2022.08.22.04.40.53; Mon, 22 Aug 2022 04:41:07 -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=@infradead.org header.s=bombadil.20210309 header.b=w0XmYMb1; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233931AbiHVL1P (ORCPT + 99 others); Mon, 22 Aug 2022 07:27:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232853AbiHVL1N (ORCPT ); Mon, 22 Aug 2022 07:27:13 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC09B32EE8; Mon, 22 Aug 2022 04:27:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=80Iob7m0eygDIBir23phYVn1p4Wv+1QMEBqUT1N4EkE=; b=w0XmYMb16FRlUUx5UI1bfzmXXs 3Jftu942ei0pgarFAfjnelYfSJ1IYVx2GFd0g/XIbbbwSdYSfwVpxXxNmZZpXXf0lPRrMo860RMUe 3XI5NdIwij0SFJuWWoFkMxB/0QS5RjtPkF546G7HiLYHm1E6ZGWlcr7PPoW2+QCq8bYfN4olg3h2u bw/1p2z4T/woptW0t9XxXDBhrPu8221SDDsGbUBRz0wveo2AEd+Oy0QCpYcUTj0gyGwdzJDTpx04/ EZyi5wBHcNzpVitRKhIN+VcPL7cLqgTTEwyQjh59+1GhRK8BoF6C8AoTSusP8DZvl7FacTlY4scXh wJiVNl0g==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1oQ5Zv-008DCF-58; Mon, 22 Aug 2022 11:26:47 +0000 Date: Mon, 22 Aug 2022 04:26:47 -0700 From: Christoph Hellwig To: Robin Murphy Cc: Yu Zhao , dongli.zhang@oracle.com, ak@linux.intel.com, akpm@linux-foundation.org, alexander.sverdlin@nokia.com, andi.kleen@intel.com, bp@alien8.de, bp@suse.de, cminyard@mvista.com, corbet@lwn.net, damien.lemoal@opensource.wdc.com, dave.hansen@linux.intel.com, hch@infradead.org, iommu@lists.linux-foundation.org, joe.jin@oracle.com, joe@perches.com, keescook@chromium.org, kirill.shutemov@intel.com, kys@microsoft.com, linux-doc@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, ltykernel@gmail.com, michael.h.kelley@microsoft.com, mingo@redhat.com, m.szyprowski@samsung.com, parri.andrea@gmail.com, paulmck@kernel.org, pmladek@suse.com, rdunlap@infradead.org, tglx@linutronix.de, thomas.lendacky@amd.com, Tianyu.Lan@microsoft.com, tsbogend@alpha.franken.de, vkuznets@redhat.com, wei.liu@kernel.org, x86@kernel.org Subject: Re: [PATCH v1 4/4] swiotlb: panic if nslabs is too small Message-ID: References: <20220611082514.37112-5-dongli.zhang@oracle.com> <20220820012031.1285979-1-yuzhao@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_NONE,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 On Mon, Aug 22, 2022 at 10:49:09AM +0100, Robin Murphy wrote: > Hmm, it's possible this might be quietly fixed by 20347fca71a3, but either > way I'm not sure why we would need to panic *before* we've even tried to > allocate anything, when we could simply return with no harm done? If we've > ended up calculating (or being told) a buffer size which is too small to be > usable, that should be no different to disabling SWIOTLB entirely. Hmm. I think this might be a philosophical question, but I think failing the boot with a clear error report for a configuration that is supposed to work but can't is way better than just panicing later on. > Historically, passing "swiotlb=1" on the command line has been used to save > memory when the user knows SWIOTLB isn't needed. That should definitely not > be allowed to start panicking. I've never seen swiotlb=1 advertized as a way to disable swiotlb. That's always been swiotlb=noforce, which cleanly disables it.