From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB94DC4332B for ; Sat, 21 Mar 2020 09:01:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8179520739 for ; Sat, 21 Mar 2020 09:01:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=kroah.com header.i=@kroah.com header.b="kEm5Ygo0"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="K5YF/0lq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728309AbgCUJBS (ORCPT ); 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