Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5608221rwb; Tue, 22 Nov 2022 02:20:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf6/Y7ESHCQtfWW96vBOSaSNPFwtUgWhdCOe4P5anEI1kjgTHyFMuISd9CJcZANXiN3cMCJ/ X-Received: by 2002:a17:906:a18c:b0:7ad:9629:fb96 with SMTP id s12-20020a170906a18c00b007ad9629fb96mr3038462ejy.751.1669112455659; Tue, 22 Nov 2022 02:20:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669112455; cv=none; d=google.com; s=arc-20160816; b=Kk/qpsm+IR3wnD21Omw4TUQ7gHaM8AsB8vAFLwPMUpAaQCQN12FnOx0f/bk778kQJE AvcZ/q3L6BmOmnHxpIs0vU3/6zMTZ4TzQANqlsOh5cHicZXtzpax5CFRh1R0P2U4+UDW cdC5YuWK70ajxIyQ8ROCTDZE3rC+u9T7p0qbrZlz48adXDWdaiGKta5BpsiAR2chvxZd bBncrVEKCIvli81tUGzyRNY27deLM+GyosnOn+OZXZJT9NJM3+zSz+5iEBXND4ZrjiNM ITbS2k1QPTZWw4L1GRLW9A5FHle41lJnzODeGs+y6gFJJau9Pvi/Zdcby6VurX4gi1Dx U4+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=XW4KmeE1lzqUbSDQgw0OBkM1KYWQdDzwu91w2ZjF5TE=; b=WOCof7JWBXENAf0+NkjUaYmVeMaBgJXATUBjC5TBapR3KJ6fp/VMyGgih4G6e+ctZl gFz6AiKYWSo7Ktr0RpZwOLYjpoaH0V81u2bRc8S+W/useGDmyvzE6vpHfiDlkf/GFsS5 TYBz9/cPqGw8Y0s+aduLwOHchUmI7yTYR02vem80G+ZG7rv7BGYdgRh51vS+7QuqQRhb SQImfKCZNXBvOANoLHe/3vhCG/qLrMhAT943lDV/4Ock3+P6POrQje3ou8d0fedo9eI9 DmKAPRuHRMqVOfOnUpZ7Z+ZK+TUV4qz7cT3AQ585LkrGkJwh+ytZDsbGcBL3KWdgIqtN UJBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=DuntGKBH; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d13-20020a05640208cd00b004680dc9f654si10935411edz.266.2022.11.22.02.20.30; Tue, 22 Nov 2022 02:20:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-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; dkim=pass header.i=@alien8.de header.s=dkim header.b=DuntGKBH; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233134AbiKVKSR (ORCPT + 99 others); Tue, 22 Nov 2022 05:18:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233092AbiKVKRf (ORCPT ); Tue, 22 Nov 2022 05:17:35 -0500 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54C21E03B; Tue, 22 Nov 2022 02:17:33 -0800 (PST) Received: from zn.tnic (p200300ea9733e79b329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:9733:e79b:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id BD30A1EC05B0; Tue, 22 Nov 2022 11:17:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1669112251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=XW4KmeE1lzqUbSDQgw0OBkM1KYWQdDzwu91w2ZjF5TE=; b=DuntGKBHRGyMI+yzTr/TwqOwnXXDvqJwm7SvqoGXUYJE2lj3j59lFGw4qmF1O/GolhkxaD znTMJZE0D+1CNoNoXmaS8NoRZqyVqGPCi+dEqhpgxF1zpSS8HjfKxbF+sGYlPJQ0JAISRH NfC5xXH13XU7o0cbQWyhEwSOCcWVIZ4= Date: Tue, 22 Nov 2022 11:17:26 +0100 From: Borislav Petkov To: "Kalra, Ashish" Cc: x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-coco@lists.linux.dev, linux-mm@kvack.org, linux-crypto@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, jroedel@suse.de, thomas.lendacky@amd.com, hpa@zytor.com, ardb@kernel.org, pbonzini@redhat.com, seanjc@google.com, vkuznets@redhat.com, jmattson@google.com, luto@kernel.org, dave.hansen@linux.intel.com, slp@redhat.com, pgonda@google.com, peterz@infradead.org, srinivas.pandruvada@linux.intel.com, rientjes@google.com, dovmurik@linux.ibm.com, tobin@ibm.com, michael.roth@amd.com, vbabka@suse.cz, kirill@shutemov.name, ak@linux.intel.com, tony.luck@intel.com, marcorr@google.com, sathyanarayanan.kuppuswamy@linux.intel.com, alpergun@google.com, dgilbert@redhat.com, jarkko@kernel.org Subject: Re: [PATCH Part2 v6 14/49] crypto: ccp: Handle the legacy TMR allocation when SNP is enabled Message-ID: References: <3a51840f6a80c87b39632dc728dbd9b5dd444cd7.1655761627.git.ashish.kalra@amd.com> <380c9748-1c86-4763-ea18-b884280a3b60@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS 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-crypto@vger.kernel.org On Mon, Nov 21, 2022 at 06:37:18PM -0600, Kalra, Ashish wrote: > I agree, but these pages are not in the right state to be released back to Which pages exactly? Some pages' state has really changed underneath or you've given the wrong range? > It might be a user/sev-guest error, but these pages are now unsafe to use. > So is a kernel panic justified here, instead of not releasing the pages back > to host and logging errors for the same. Ok, there are two cases: * kernel error: I guess a big fat warning is the least we can issue here. Not sure about panic considering this should almost never happen and a warning would allow for people to catch dumps and debug the issue. * firmware error: I don't think you can know that that is really the case on a production system without additional fw debugging capabilities. Dumping a warning would be the least we can do here too, to signal that something's out of the ordinary and so people can look into it further. So yeah, a big fat warning is a good start. And then you don't need any memory poisoning etc gunk. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette