Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp56882lqt; Wed, 5 Jun 2024 17:14:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUpDDS0Z8yuP5mWLnlQKWLSpKoIM/pnDy1pW9srKqcDnN+jMBwNAmrud0IDmnvhGxJ4Hfz41F2RtawH8CU43fN/I77nVzxTXwS/N/qkmg== X-Google-Smtp-Source: AGHT+IGU+0EwLkV/iFG1R6sUDl4nwjQjUXlv6NS86exZwVb/4JKbjpv7zb3my9ImehG1ANEKdkyI X-Received: by 2002:ac2:46d4:0:b0:529:b023:6b9d with SMTP id 2adb3069b0e04-52bab4ddd82mr2717066e87.16.1717632889693; Wed, 05 Jun 2024 17:14:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717632889; cv=pass; d=google.com; s=arc-20160816; b=vdeEan00/SvjdtzDehpc1NeRm2TT0Cn5qRWg9/HABsafb9BJyTQ0AxFZknQ+YStTMt cQC8Dxlo91Y1BrbqZf+5QsjtUxBSKTACWFZ0UCSheF19rjX+GrJOSBvSF9SxqystDoUs tPHGqx8LKCrgGX49X1xpr2Grhc4tjJVurJTrwguP4RHfSM8hITzir3KRssajI4Kar1X8 +KQwkQgqGjVxq6hn0CCDfToIz5V+on3I9rIIhqN8e7P43XGMFnVBhoVl4L0ZZprHLR/A EZ/wAGBF36KGkLeBTiRwzQk1xJwa8odmuuRzMra58GKAOXjyOKK2cwGunnyCl5k2kFQi NN5w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=GR9YbtP2vLw9FEc4d4h4ySgYJcTUA0pSktEe6A8PAtg=; fh=ep+HxRbyhg4gd1Xy56Pvu63+DhEF48gK+E2Dy6T4IT8=; b=BKgpttd4d2MH4pzRcrkKDaTriglVtp3DLH0t+XHRGaFbGo6hMmvSma/B4/AGXWESPI xkerjNKJ7ORhdQzTtcNPtVzW7eqYZ4L1fVAVLbaQgQ+v5fw+90RrY5L6eeH0oGajNYsT NCJRuK71jygXaUSwlrigOXOci2F9NAjQdGKrUitGGCtrbbfT7AdgSbTjF9yvgz+EBJ24 vXNUnNBc3YtpTF4vV/5tdXDMjXv2KVOHMdMR3vh1UywkVcMjExF3vkHPadgwiBCL4WIo u2MhQH8cdd/VV82KWV6c6bwvoEWmyGEH2CHgAVfoioA1Lxj5eqvMbvudtUmXPOMuhqYb 9mJQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oaL+ViSx; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-203440-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203440-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6c807088e3si7249766b.637.2024.06.05.17.14.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 17:14:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203440-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oaL+ViSx; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-203440-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203440-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 3C7601F29896 for ; Thu, 6 Jun 2024 00:03:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3E80D29AF; Thu, 6 Jun 2024 00:03:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oaL+ViSx" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D7061361; Thu, 6 Jun 2024 00:03:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717632188; cv=none; b=eCPaGW1ZYR65Wz5MJcf9TcBKSbE8ENLQRXBYnr8sYBLKIymBYkf4P0bNNaqHsNtTmek/gjjDCegOQ/1Iwmspp7q5VkFEH3lpdSeeF/oIG+hh1j3dOrk5DOez/g+d1/IPWiKxthSlFt3+/PUaSImQ6YtZhFKciM24R03hYmED5lw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717632188; c=relaxed/simple; bh=pEb77qEh1YQhDCWDnmGRFn7J+aICZOK+0n9H7O4r2S8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZI0G30ZDt7yMysuWbfe333rybv75ZizPJpCxe1kuRQhLv8LRnjFYmenRG0T527fQDPCHT226tMGVeLBTAROs29Qzys5/3RiEU42wweqhz6pDgCEZ4eyNan6/snfd+ktwkjW9eThPFz10SfmoZk7LL0dT6WxqoUX1dD+gFr/6RJY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oaL+ViSx; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CF706C2BD11; Thu, 6 Jun 2024 00:03:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717632187; bh=pEb77qEh1YQhDCWDnmGRFn7J+aICZOK+0n9H7O4r2S8=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=oaL+ViSxcZMZHcfEmvKuOODkduYaZSUGxdnGDKsc8YzN0J30aTv9PjLGVOtfSI1w4 hkzGtcAYfxuoj3rb/dK4OJC6xG+bA6tWeiIBtkYARpwxQcrqyneHH9aEPFZAuv3GHF q/dazwJe/ftPfYxLvShiM0FK0ezNLIZDgScJT62B7NXpivT+J9CASJKx0YN1dlJWoA vciYklsYXYzTQJtVkBDjvcb0y3j908VMBgGGigxUDE10hEXL6f+gzv5kBadvjzMIkA rApQ18Ur9VFqrd+B7k7FTCS8p9gFZP9iCyqCUCEKxHoezrJnBWhRTASs/0SzUs35Vw FRM3FNwv+4izg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 7462FCE0A72; Wed, 5 Jun 2024 17:03:07 -0700 (PDT) Date: Wed, 5 Jun 2024 17:03:07 -0700 From: "Paul E. McKenney" To: Sean Christopherson Cc: Paolo Bonzini , Lai Jiangshan , Josh Triplett , kvm@vger.kernel.org, rcu@vger.kernel.org, linux-kernel@vger.kernel.org, Kevin Tian , Yan Zhao , Yiwei Zhang Subject: Re: [PATCH 0/5] KVM: VMX: Drop MTRR virtualization, honor guest PAT Message-ID: <3b56ffd4-cbb4-4e17-89a7-1be537962dec@paulmck-laptop> Reply-To: paulmck@kernel.org References: <20240309010929.1403984-1-seanjc@google.com> <171762600665.2901886.14234246510506582276.b4-ty@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <171762600665.2901886.14234246510506582276.b4-ty@google.com> On Wed, Jun 05, 2024 at 04:20:34PM -0700, Sean Christopherson wrote: > On Fri, 08 Mar 2024 17:09:24 -0800, Sean Christopherson wrote: > > First, rip out KVM's support for virtualizing guest MTRRs on VMX. The > > code is costly to main, a drag on guest boot performance, imperfect, and > > not required for functional correctness with modern guest kernels. Many > > details in patch 1's changelog. > > > > With MTRR virtualization gone, always honor guest PAT on Intel CPUs that > > support self-snoop, as such CPUs are guaranteed to maintain coherency > > even if the guest is aliasing memtypes, e.g. if the host is using WB but > > the guest is using WC. Honoring guest PAT is desirable for use cases > > where the guest must use WC when accessing memory that is DMA'd from a > > non-coherent device that does NOT bounce through VFIO, e.g. for mediated > > virtual GPUs. > > > > [...] > > Applied to kvm-x86 mtrrs, to get as much testing as possible before a potential > merge in 6.11. > > Paul, if you can take a gander at patch 3, it would be much appreciated. > > Thanks! > > [1/5] KVM: x86: Remove VMX support for virtualizing guest MTRR memtypes > https://github.com/kvm-x86/linux/commit/0a7b73559b39 > [2/5] KVM: VMX: Drop support for forcing UC memory when guest CR0.CD=1 > https://github.com/kvm-x86/linux/commit/e1548088ff54 > [3/5] srcu: Add an API for a memory barrier after SRCU read lock > https://github.com/kvm-x86/linux/commit/fcfe671e0879 Looks straightforward enough. We could combine this with the existing smp_mb__after_srcu_read_unlock(), but if we did that, someone would no doubt come up with some clever optimization that provided a full barrier in srcu_read_lock() but not in srcu_read_unlock() or vice versa. So: Reviewed-by: Paul E. McKenney > [4/5] KVM: x86: Ensure a full memory barrier is emitted in the VM-Exit path > https://github.com/kvm-x86/linux/commit/eb8d8fc29286 > [5/5] KVM: VMX: Always honor guest PAT on CPUs that support self-snoop > https://github.com/kvm-x86/linux/commit/95200f24b862 > > -- > https://github.com/kvm-x86/linux/tree/next