Received: by 2002:a05:7412:bc1a:b0:d7:7d3a:4fe2 with SMTP id ki26csp526392rdb; Sat, 19 Aug 2023 11:22:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGfPhI1B0ATA5Mlu6Q7pSOs1cb2ua1JrdC9wzjtkC7dVCD5D3GrRciaVvM9QGAa/d7SD0mu X-Received: by 2002:a17:90a:3041:b0:26d:412c:fc3c with SMTP id q1-20020a17090a304100b0026d412cfc3cmr2387886pjl.3.1692469357197; Sat, 19 Aug 2023 11:22:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692469357; cv=none; d=google.com; s=arc-20160816; b=y4PZpivpSdZS54FTb9WWxVwQGPO5v1MyMPoB0mIOv/IzJMhzkTyGBE+PxlJXs4KHaf N5hwbTE96O1nVzysSNdp2JQ++S1+Meyqp8VEfiqe7bLCwPKNoRvIy7/k6oTVp9CZ8+LW EvUfxIzkHLcgaS1hrOrg0Xktr30Y4CQUH0wtPBqUbhS6DeGiP0Egl6eNvDvqR/HDFl1E TklZRE08CgzsZofRkjJ67LebXp8rHfLDPxTuR/z2KXtD+Qt9yY7DruYuhiSQpWWNKIDe U4jY4HNxT/lA35sjuJYOwRua38fzwSTTcWZ07ZJrq6viIFOmal5WaucezwFPBd35Tw40 U4UQ== 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=mk5Xa7cyeVl1bluWvoXLKdqUAVMQrPcF9EQrApvXWHE=; fh=sRTp/QRcK430aLKHC3swG/RjKXs4dOrE4oJSzrj/eQw=; b=EiqQR4h6u1AtFEu94lS6SZWyT1s0th9JX+bz4zX9+Bu2E5lNTvLQWgFsstwr8B8o67 6AlxsBSgGQ9nJOFWnEIOzG0v4mQ1fQXHEfSnEOoYGv04DX+vKFODJTKjbY2HL0NRSHSJ TpB55V8qQgz7gMG/k+tWjFchc3EzX+EYTJr2sVgzY/WsftadsoocC12HggZR8+jiF84F Ez1NpQlF3eQkHzaBO+WsW3YYG48RHOGYEr+pybpMkBkEWBCaXJ0Y+0p3aaqxC+8w3mT3 +9cyHxFfImwpyiovfSa5otpZ6alzFlJXg8202W+Djj6Pu7Y4YF+4plWM6vFB6nOaCQhw QZoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b="U/G7HXJh"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id mv22-20020a17090b199600b002632a1243dbsi5380502pjb.104.2023.08.19.11.22.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Aug 2023 11:22:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b="U/G7HXJh"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9FD28570BB; Sat, 19 Aug 2023 01:32:37 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237658AbjHOOfL (ORCPT + 99 others); Tue, 15 Aug 2023 10:35:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237666AbjHOOel (ORCPT ); Tue, 15 Aug 2023 10:34:41 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2DCD93 for ; Tue, 15 Aug 2023 07:34:39 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-688769faa09so170962b3a.2 for ; Tue, 15 Aug 2023 07:34:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1692110079; x=1692714879; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=mk5Xa7cyeVl1bluWvoXLKdqUAVMQrPcF9EQrApvXWHE=; b=U/G7HXJhlv9yn9z1NYj9jDW7/1AAb8yB79vOJK7v78ivtTnBlTcEpgDvKWF5y/NhPS GpJMzmsdoh6FhJqrNrtWUU8TnMqpmYViri2nqHhVVLmaG0t65i1QxYxhVmWha6AUIyr0 3qjJSSXw6JtxgZ9otCLrmRisFh66LKVzrdN/z031ki81CXskjtXltILv/WW3/eeiCta5 dn+7/MM8A+Cd7dsvia1YnnXADru+vDih2poDzID0R3lfJ8llIEstDvU6+ngVmAhpo97c EGPB/FmVHbzziLzxGC+7NaeFdgu0jY9R5CG7kadUbCkcMa3eexZI9nB+UlFaXwQpk6oj lR4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692110079; x=1692714879; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=mk5Xa7cyeVl1bluWvoXLKdqUAVMQrPcF9EQrApvXWHE=; b=Jf5NNjp5d5iSu9J8Z+n0KxgI3FzDyaP0kWZWrAp/VD1X5Cia1k7N/wUNg1mw4r0hQH MDujULBpuEDWc1kdfxaUD1hTK0ca+zz/y0IQ4WahlEb0EG9XsOGAYUBFjX8FAARfjhKo vPkx8MjN6tem3TGvzFI8MSOKZSOdna/4EYvEP0v1EPCKghgCVmgFCffZNNBwOiy1Nq0k XE0ZNEwMad3/TbZp+qi8x2Oew80NMLkCOjkBUxtbWjGxVL/a5eluqgLlpTzhxAdP0h0p W3/3UFEQ4+Qv8qlZiKNxHPTpHU+VlDxKHg8TFkSWZ5oU2/DUtSrhsmZHSXgkkbN5mooj rUYA== X-Gm-Message-State: AOJu0Yzc9hTCNAsF5/9fqZmEUUuPXMkO6oA2Mn351NVViW3Twic2iGOr r3iUZFcWVAS6Ozx1pqT4StXF5A== X-Received: by 2002:a05:6a00:3a12:b0:687:3e8f:2211 with SMTP id fj18-20020a056a003a1200b006873e8f2211mr12162427pfb.34.1692110079248; Tue, 15 Aug 2023 07:34:39 -0700 (PDT) Received: from ziepe.ca ([206.223.160.26]) by smtp.gmail.com with ESMTPSA id q1-20020a63bc01000000b00565eb4fa8d1sm232221pge.16.2023.08.15.07.34.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Aug 2023 07:34:38 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1qVv7z-007bam-SR; Tue, 15 Aug 2023 11:34:35 -0300 Date: Tue, 15 Aug 2023 11:34:35 -0300 From: Jason Gunthorpe To: Jie Ji Cc: dwmw2@infradead.org, baolu.lu@linux.intel.com, joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, xianting.tian@linux.alibaba.com, kaijieguo@linux.alibaba.com, daishengdong@yeah.net Subject: Re: [PATCH] iommu/vt-d: Atomic breakdown of IOPT into finer granularity Message-ID: References: <20230814121016.32613-1-jijie.ji@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230814121016.32613-1-jijie.ji@linux.alibaba.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 14, 2023 at 08:10:16PM +0800, Jie Ji wrote: > With the addition of IOMMU support for IO page fault, it's now possible > to unpin the memory which DMA remapping. However, the lack of support > for unmapping a subrange of the I/O page table (IOPT) in IOMMU can lead > to some issues. > > For instance, a virtual machine can establish IOPT of 2M/1G for better > performance, while the host system enable swap and attempts to swap out > some 4K pages. Unfortunately, unmap subrange of the large-page mapping > will make IOMMU page walk to error level, and finally cause kernel crash. Nothing in-kernel does something like this. Jason