Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1609093ybb; Sat, 21 Mar 2020 02:03:11 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuOfW87NslWyK1P2l9WgPAsEZJPqIwB+fRxD66sJMIlFRl2fwOgEU7FenUtCOvdp9yOfUqU X-Received: by 2002:a9d:4505:: with SMTP id w5mr10528673ote.262.1584781390864; Sat, 21 Mar 2020 02:03:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584781390; cv=none; d=google.com; s=arc-20160816; b=SRBsnqZKKqpRTPi9BrCTjce97G4qaOcSAZME1ZCPqm0NIpI0lwZnxnixYu3R3NUpKD 1uKAQ0MWlIM5xOZIVmF6LT7SabJKWv5QZKSlX/iiSxTdnJywBrqKEgiyETu+xvltKluZ 06rpFzft2kMhK/uHH3OaUt1OCsrPnAM3Mpe36GxBvkcrcv53WEfslcXIweuY+d3GYsta yiXlONXVMFi7IFNgtI1mQzDxcuGbFZRnMvSNT6CTRUhTU5YDXOBmn35achEZorVLL/79 MojOtW5JdZNLmO5CBej78k93N/Hu2bu5zpvZb8HiccKDf2W+ZxKHCS6ucu5EtJyx3v9A YqJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=ALmjW+HIyhOT5zUGzSO/D37QXo/rPihFOsRD5OGJ6Rg=; b=WcjxVyTxXDa2usYDfdz6ftA5/CNBFBeLWtuNVMQM/eZkS6CUQM03DMl3ijrahhDhCE /pLrM6DFVQ8Lb5cpN4HjwPzC/S5WPpw0Mf3Qo4hkKTlpIsgf/LHKa9kNgnovNwepKgyC Oplww2uksF3d2WE5IoYv3oYHNIKSWl4X9FTqstbq2HvDaIhYCGzcI3wFQzjEDWxwjrE4 8WI8+swCoRmDBYC3sx5p4PHZENOIk7PpkpbplUYt5aGo4+u610buZlLPYz1j/zt8V5UP to4Y30+H/adO1Ihtn3vzZlcfmhUHVmv8tsuUG/xGXq+LHYl7aBgR58/EnM3yF6QHE0zK 0mCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kroah.com header.s=fm3 header.b=kEm5Ygo0; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b="K5YF/0lq"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 127si4229012oig.130.2020.03.21.02.02.58; Sat, 21 Mar 2020 02:03:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kroah.com header.s=fm3 header.b=kEm5Ygo0; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b="K5YF/0lq"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728301AbgCUJBS (ORCPT + 99 others); Sat, 21 Mar 2020 05:01:18 -0400 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:34793 "EHLO new4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728008AbgCUJBR (ORCPT ); Sat, 21 Mar 2020 05:01:17 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id F0B87580700; Sat, 21 Mar 2020 05:00:33 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sat, 21 Mar 2020 05:00:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=ALmjW+HIyhOT5zUGzSO/D37QXo/ rPihFOsRD5OGJ6Rg=; b=kEm5Ygo0FPZjRbTYocTFES8NPUlGElygVjugiSsRA3n vru8BJJ8tNWWA1aBC6MUE6AqY6wsLM3GXiyzB7/KcJWCNJ5lCCm/qDclG4dF8plq cNmoLuNTRlVe76ntEf+7CdsaxmJWLFFu4WB1muK4Vr1PWFPH+Sw4G81BFSLewgR+ 6JB2ll2rZZ1Fqd8jcerWqFgeMP0L+cILkgWYoMYlEPzb/cKy4uHV+HiCyK5HPTEC 5gleYoVjpBsM4HR+qUC63mvzdIcTYERc3wPbzHAK/+CXXir9mMtzStZCZrUv+SGR zGf2i6w5hnLo5ZBYfBLQudzv3kzZiHDRw7PCNutkR2g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=ALmjW+ HIyhOT5zUGzSO/D37QXo/rPihFOsRD5OGJ6Rg=; b=K5YF/0lqzw1nyUZssapERV MtAhWdygOUErp6IxIxf13m4mM6AQAI0DpHLEzGhWDooqcv+bylyHu3N/dfoZBDmj Zhfrekl8SxOJX0+8dtU+T0Wbcql66hw77sdHm8UNHjRryiGD8r1cejEtCeNkgqp+ 8J7AuVQyzAASfpsd28v/F88EJOVVbAsO14CtUDIMEI1dpYyrnFgJLaj5JcO1RXyl EWgNcRJ2tEoYpU4fr41gGrGUWIm7NOKL5/AxD6Rwh+KJGCzxwOvu/RDxUPGPIaav 8wt9JoHbXEWCIyKhYjGIaTP75XGn2edAcZZOq3wZWwKHTLFCu02DsBBLMoLt2NfQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrudegvddguddvfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepifhrvghg ucfmjfcuoehgrhgvgheskhhrohgrhhdrtghomheqnecuffhomhgrihhnpehkvghrnhgvlh drohhrghenucfkphepkeefrdekiedrkeelrddutdejnecuvehluhhsthgvrhfuihiivgep tdenucfrrghrrghmpehmrghilhhfrhhomhepghhrvghgsehkrhhorghhrdgtohhm X-ME-Proxy: Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id 62CB4328005A; Sat, 21 Mar 2020 05:00:32 -0400 (EDT) Date: Sat, 21 Mar 2020 10:00:30 +0100 From: Greg KH To: Tom Lendacky Cc: David Rientjes , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Brijesh Singh Subject: Re: [PATCH] KVM: SVM: Issue WBINVD after deactivating an SEV guest Message-ID: <20200321090030.GA884290@kroah.com> References: <7b8d0c8c-d685-627b-676c-01c3d194fc82@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7b8d0c8c-d685-627b-676c-01c3d194fc82@amd.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 20, 2020 at 03:37:23PM -0500, Tom Lendacky wrote: > On 3/20/20 3:34 PM, David Rientjes wrote: > > On Fri, 20 Mar 2020, Tom Lendacky wrote: > > > > > Currently, CLFLUSH is used to flush SEV guest memory before the guest is > > > terminated (or a memory hotplug region is removed). However, CLFLUSH is > > > not enough to ensure that SEV guest tagged data is flushed from the cache. > > > > > > With 33af3a7ef9e6 ("KVM: SVM: Reduce WBINVD/DF_FLUSH invocations"), the > > > original WBINVD was removed. This then exposed crashes at random times > > > because of a cache flush race with a page that had both a hypervisor and > > > a guest tag in the cache. > > > > > > Restore the WBINVD when destroying an SEV guest and add a WBINVD to the > > > svm_unregister_enc_region() function to ensure hotplug memory is flushed > > > when removed. The DF_FLUSH can still be avoided at this point. > > > > > > Fixes: 33af3a7ef9e6 ("KVM: SVM: Reduce WBINVD/DF_FLUSH invocations") > > > Signed-off-by: Tom Lendacky > > > > Acked-by: David Rientjes > > > > Should this be marked for stable? > > The Fixes tag should take care of that. No it does not. Please read: https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html for how to do this properly. Yes, I have had to go around and clean up after maintainers who don't seem to realize this, but for KVM patches I have been explicitly told to NOT take any patch unless it has a cc: stable on it, due to issues that have happened in the past. So for this subsystem, what you suggested guaranteed it would NOT get picked up, please do not do that. greg k-h