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=-17.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 5CD8BC07E98 for ; Mon, 5 Jul 2021 07:15:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3B030613F6 for ; Mon, 5 Jul 2021 07:15:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229970AbhGEHRv (ORCPT ); Mon, 5 Jul 2021 03:17:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:58642 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229884AbhGEHRu (ORCPT ); Mon, 5 Jul 2021 03:17:50 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 47504613E7; Mon, 5 Jul 2021 07:15:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1625469313; bh=SOjGa1fUpp7kWo5PgWHKJPZDcl2wZsXkl22SDaP62uM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JRKlug1B56OpbdsEjLHMyYk5Ywc/LQ+hPWpolQCL7qKudBGfj2ZKidWC+j2vlvcY9 Ze5kTNFu3g8bkjgpgNHAgoh9pH0GOiXQDodD2swgNEXOiJR/tsto79CmMb/JPpQhyo bADiT3W70DH52YReQMarlHtLsNQzInETAmJHiqq0= Date: Mon, 5 Jul 2021 09:15:11 +0200 From: Greg KH To: Alper Gun Cc: stable@vger.kernel.org, Peter Gonda , Marc Orr , Paolo Bonzini Subject: Re: [PATCH 5.4] KVM: SVM: Call SEV Guest Decommission if ASID binding fails Message-ID: References: <20210628211054.61528-1-alpergun@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210628211054.61528-1-alpergun@google.com> Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Mon, Jun 28, 2021 at 09:10:54PM +0000, Alper Gun wrote: > commit 934002cd660b035b926438244b4294e647507e13 upstream. > > Send SEV_CMD_DECOMMISSION command to PSP firmware if ASID binding > fails. If a failure happens after a successful LAUNCH_START command, > a decommission command should be executed. Otherwise, guest context > will be unfreed inside the AMD SP. After the firmware will not have > memory to allocate more SEV guest context, LAUNCH_START command will > begin to fail with SEV_RET_RESOURCE_LIMIT error. > > The existing code calls decommission inside sev_unbind_asid, but it is > not called if a failure happens before guest activation succeeds. If > sev_bind_asid fails, decommission is never called. PSP firmware has a > limit for the number of guests. If sev_asid_binding fails many times, > PSP firmware will not have resources to create another guest context. > > Cc: stable@vger.kernel.org > Fixes: 59414c989220 ("KVM: SVM: Add support for KVM_SEV_LAUNCH_START command") > Reported-by: Peter Gonda > Signed-off-by: Alper Gun > Reviewed-by: Marc Orr > Signed-off-by: Paolo Bonzini > Message-Id: <20210610174604.2554090-1-alpergun@google.com> Message-id? Odd... > --- > arch/x86/kvm/svm.c | 32 +++++++++++++++++++++----------- > 1 file changed, 21 insertions(+), 11 deletions(-) Can you also provide working backports for the newer kernel trees as well? We would need this in 5.10 and 5.12, right? thanks, greg k-h