From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) (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 7F1C81846 for ; Tue, 22 Nov 2022 10:17:49 +0000 (UTC) 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> Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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