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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 075CAFA3741 for ; Mon, 31 Oct 2022 21:24:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 96B1B6B0071; Mon, 31 Oct 2022 17:24:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 91B596B0072; Mon, 31 Oct 2022 17:24:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7E28A6B0073; Mon, 31 Oct 2022 17:24:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 6C5616B0071 for ; Mon, 31 Oct 2022 17:24:38 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 31932C06CE for ; Mon, 31 Oct 2022 21:24:38 +0000 (UTC) X-FDA: 80082523836.23.D2DB11B Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by imf26.hostedemail.com (Postfix) with ESMTP id B7D5614000B for ; Mon, 31 Oct 2022 21:24:36 +0000 (UTC) Received: from zn.tnic (p200300ea9733e7f5329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:9733:e7f5: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 DFF1F1EC0430; Mon, 31 Oct 2022 22:15:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1667250944; 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=DgU+XgOhdBAORYCQvXhnNLYByJbTFJfkVBopLrqf9iI=; b=UBchbjp0cXfAYDiw9MvIMfTMohAQvNHSEOqD0qqH300draA9eAuqTP3tB0n+GzdafOpSSF Wn3qr3VbpZy/af3JUemdiT8IjltBlnFK4Jwa7BMsG/jgkXRWcGI5AozcGEKCyqA4ThKP5g w59EfXwJZcbCayMtLfvJao65kEkVlNU= Date: Mon, 31 Oct 2022 22:15:41 +0100 From: Borislav Petkov To: "Kalra, Ashish" Cc: vbabka@suse.cz, 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, 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> <6511c122-d5cc-3f8d-9651-7c2cd67dc5af@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <6511c122-d5cc-3f8d-9651-7c2cd67dc5af@amd.com> ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1667251477; a=rsa-sha256; cv=none; b=yIIDDsA9wSzvCCHMaO2ojchMAXrKcl+qiir0XrIq2cRXINAt9J9uGRAAt4QTEVjblr1q+i LU8Bi7bCKpk5W1a1+rg7Z4xhPh/wwyp3miGGFdhAB1pO2fM+VGpKJfyP/uXn5XIwWz8THU Pc7rYLHp5maDjs2YOUtWMPi6SdiJELU= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=alien8.de header.s=dkim header.b=UBchbjp0; spf=pass (imf26.hostedemail.com: domain of bp@alien8.de designates 5.9.137.197 as permitted sender) smtp.mailfrom=bp@alien8.de; dmarc=pass (policy=none) header.from=alien8.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1667251477; h=from:from:sender: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:dkim-signature; bh=DgU+XgOhdBAORYCQvXhnNLYByJbTFJfkVBopLrqf9iI=; b=skbxDMggMQut8YfD/gPw9tynemovbiwzmKVPDp1DHzXoEFBZepknvbuHTXjAOv6DQk3yim 89mHO8Gwv6rdQ7mbDEZDvTGkpnpipLpzCAIN5Q3+iaBTCQ/Bw2CJl/PmsFo59EXEqeusbN MN16fkCSD0VpvIJ8wq9QAk0uBnOePq0= Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=alien8.de header.s=dkim header.b=UBchbjp0; spf=pass (imf26.hostedemail.com: domain of bp@alien8.de designates 5.9.137.197 as permitted sender) smtp.mailfrom=bp@alien8.de; dmarc=pass (policy=none) header.from=alien8.de X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: B7D5614000B X-Stat-Signature: cxddwi3imcdn8x363nwb3d1wgnj5bob4 X-Rspam-User: X-HE-Tag: 1667251476-427697 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Oct 31, 2022 at 03:10:16PM -0500, Kalra, Ashish wrote: > Just to add here, writing to any of these pages from the Host > will trigger a RMP #PF which will cause the RMP page fault handler > to send a SIGBUS to the current process, as this page is not owned > by Host. And kill the host process? So this is another "policy" which sounds iffy. If we kill the process, we should at least say why. Are we doing that currently? > So calling memory_failure() is proactively doing the same, marking the > page as poisoned and probably also killing the current process. But the page is not suffering a memory failure - it cannot be reclaimed for whatever reason. Btw, how can that reclaim failure ever happen? Any real scenarios? Anyway, memory failure just happens to fit what you wanna do but you can't just reuse that - that's hacky. What is the problem with writing your own function which does that? Also, btw, please do not top-post. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette