Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp355982rdb; Fri, 8 Sep 2023 02:58:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEpj6vWYohVzJZdOs3KNaeP9VRhQTvRjIWu6krnz3k0o6gDTewxli3U8Nmtq4zdvjpbm8CJ X-Received: by 2002:a2e:bc08:0:b0:2bd:28:f56f with SMTP id b8-20020a2ebc08000000b002bd0028f56fmr1672930ljf.3.1694167094128; Fri, 08 Sep 2023 02:58:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694167094; cv=none; d=google.com; s=arc-20160816; b=cPEYp579JvCGxjdKtyq2B4W1qJf++kiITOoxSHVk6oZNU9aE/xzsB4hIm3Y6pI9CzQ oy2LCEL9UT2XAQGkdmAsQnp9Cpniztud1imas1oQN7526DH/8zemnARNu2M8s5aknfHB OI6m6kswRJXymuCoP9HiW8mjhhncMCNqChHYuQGFxgF+Ey7GxNhJ3tLOTX++vXGdXPgc P/dIp5F2rrlt5A9y5xr/CQ+ut2yVT83g9UkggQnANC8qpcApdJuXJ4L9wMLqxWRb1pGQ ECXQzmtqXjhY/mlYrc28//X9MtfrnqAqBnoIool66OlgkTSBsn7GyF9WMD47i/foaXmF ZlUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=ZrJi7h0eeavAPpY0d+XNLlUaIBE8ldEn50vB48bsb7o=; fh=V0erkPdQQSa11Ws5ktr6/6bKZsJ7uHzvhJ775kpEMJY=; b=e6Ki3ykr9U3aqd/4+lUyYIcyuG13GQQbk0YYUCvflWRL9tEu2frCKK3+1CDNDgH22e kgr/Na5wMSahqu8oIsHG+kPDVxPPv9DZzpkbItcKQvR9Cw7YTB0kAWwKWjBQI/PRiUb5 hSXV4E2tEvJh8hHQTGXp9o0mtaX7h7WZvziSWIqS7rKKMlyWgtHboS+0ErCVGgpAPHOo H2v83jEQl5wXElSNAAkJg+ZOOJnCcUJ3+xl5fFNPdldalTHEBnCfeWxG8tFfswIkmr33 H6jt9qEwGNmpTvpFKa6IZyb1IqBpyAffuENod2w4DkU5mr8jssQfjIsCDqMMqP8JTpyq GRcA== ARC-Authentication-Results: i=1; mx.google.com; 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 a20-20020a170906685400b00992e50eafcfsi1105169ejs.772.2023.09.08.02.57.39; Fri, 08 Sep 2023 02:58:14 -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; 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 S235732AbjIHITH (ORCPT + 99 others); Fri, 8 Sep 2023 04:19:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233092AbjIHITG (ORCPT ); Fri, 8 Sep 2023 04:19:06 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 399BF1FD0; Fri, 8 Sep 2023 01:18:52 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 7A9E268B05; Fri, 8 Sep 2023 10:18:48 +0200 (CEST) Date: Fri, 8 Sep 2023 10:18:48 +0200 From: Christoph Hellwig To: Robin Murphy Cc: Sean Christopherson , Yan Zhao , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, pbonzini@redhat.com, Christoph Hellwig , Marek Szyprowski , Linus Torvalds Subject: Re: [PATCH 0/2] KVM: x86/mmu: .change_pte() optimization in TDP MMU Message-ID: <20230908081848.GD8240@lst.de> References: <20230808085056.14644-1-yan.y.zhao@intel.com> <5ff1591c-d41c-331f-84a6-ac690c48ff5d@arm.com> <5d81a9cd-f96d-bcdb-7878-74c2ead26cfb@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5d81a9cd-f96d-bcdb-7878-74c2ead26cfb@arm.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE 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 Wed, Sep 06, 2023 at 05:18:51PM +0100, Robin Murphy wrote: > Indeed a bunch of work has gone into SWIOTLB recently trying to make it a > bit more efficient for such cases where it can't be avoided, so it is > definitely still interesting to learn about impacts at other levels like > this. Maybe there's a bit of a get-out for confidential VMs though, since > presumably there's not much point COW-ing encrypted private memory, so > perhaps KVM might end up wanting to optimise that out and thus happen to > end up less sensitive to unavoidable SWIOTLB behaviour anyway? Well, the fix for bounce buffering is to trust the device, and there is a lot of work going into device authentication and attesttion right now so that will happen. On the swiotlb side a new version of the dma_sync_*_device APIs that specifies the mapping len and the data length transfer would avoid some of the overhead here. We've decided that it is a good idea last time, but so far no one has volunteers to implement it.