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 7B8E2C3DA79 for ; Mon, 15 Jan 2024 09:23:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0FF9C6B008A; Mon, 15 Jan 2024 04:23:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 094536B008C; Mon, 15 Jan 2024 04:23:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E1E756B0092; Mon, 15 Jan 2024 04:23:22 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id CC5FC6B008A for ; Mon, 15 Jan 2024 04:23:22 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 99A0F120355 for ; Mon, 15 Jan 2024 09:23:22 +0000 (UTC) X-FDA: 81681007044.06.4FEA7B5 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by imf02.hostedemail.com (Postfix) with ESMTP id 76FB880016 for ; Mon, 15 Jan 2024 09:23:20 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=DwSRoxEo; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=kA3Crk0x; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=DwSRoxEo; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=kA3Crk0x; dmarc=none; spf=pass (imf02.hostedemail.com: domain of vbabka@suse.cz designates 195.135.223.130 as permitted sender) smtp.mailfrom=vbabka@suse.cz ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1705310600; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=cAvAmgb/jPWg9AlkaccrOmdOwRCSsdippzeZcx291nI=; b=5ugfFqPSWU9C5ThijgHPWOA+DV4WG+cCIHB5I//tNc6yyecU4lg5zVH3Lhml62kDvUMORS AGNdimPUpoZfKivz+EFOPgoLMOX5L10V0LxINk1BE0eZDEAsmgmayzNBCW+9YVKawKVkb/ BkXA5jYh/+xrF72JeKuAYnvh7Nq6PdI= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=DwSRoxEo; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=kA3Crk0x; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=DwSRoxEo; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=kA3Crk0x; dmarc=none; spf=pass (imf02.hostedemail.com: domain of vbabka@suse.cz designates 195.135.223.130 as permitted sender) smtp.mailfrom=vbabka@suse.cz ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1705310600; a=rsa-sha256; cv=none; b=jrRInvsqAbjWZYevnDov4KPDZgwieRIM+fNDNIQN+RbeMkysd4jUgH3mASEpR7/jVNBoYR J1X+yqrOupLfhJ8i1nAN2vHFZsC+FzyoKGjakQoLInD29qcuPE/AL2qT5WdAa3pzHQjysK Dx48HsDHaTBs9gj48QezoBEqCL+4kOM= Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 989B722150; Mon, 15 Jan 2024 09:23:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1705310598; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cAvAmgb/jPWg9AlkaccrOmdOwRCSsdippzeZcx291nI=; b=DwSRoxEoiZW4TfXc4fF+UH6GBBSvPVkAmEhT07+0QAIj26qFIMksxaCur1+5JSJLMCy7B9 v/+ZtmjzRhoLXPTBMYfF7KkuOR4oUwo4FvTnzlWfoZYjRVF/+xJDTtAu0wCtGtMrm6GudZ TGjumFbt6AdFGn0Zl8gyqMwqvWBBzVo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1705310598; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cAvAmgb/jPWg9AlkaccrOmdOwRCSsdippzeZcx291nI=; b=kA3Crk0xZEfgJb4J6mqAN5ZS7yw5zCilj6ACcSSlpobTV6Exuk6q44u8bK9neKpLGTIakg UM2XD+NvPvgehlAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1705310598; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cAvAmgb/jPWg9AlkaccrOmdOwRCSsdippzeZcx291nI=; b=DwSRoxEoiZW4TfXc4fF+UH6GBBSvPVkAmEhT07+0QAIj26qFIMksxaCur1+5JSJLMCy7B9 v/+ZtmjzRhoLXPTBMYfF7KkuOR4oUwo4FvTnzlWfoZYjRVF/+xJDTtAu0wCtGtMrm6GudZ TGjumFbt6AdFGn0Zl8gyqMwqvWBBzVo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1705310598; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cAvAmgb/jPWg9AlkaccrOmdOwRCSsdippzeZcx291nI=; b=kA3Crk0xZEfgJb4J6mqAN5ZS7yw5zCilj6ACcSSlpobTV6Exuk6q44u8bK9neKpLGTIakg UM2XD+NvPvgehlAg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 4DD7713712; Mon, 15 Jan 2024 09:23:18 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id OHGxEob5pGXdEwAAD6G6ig (envelope-from ); Mon, 15 Jan 2024 09:23:18 +0000 Message-ID: <91f54c39-a8f4-4186-9a5b-83dcbc5c929c@suse.cz> Date: Mon, 15 Jan 2024 10:23:18 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 11/26] x86/sev: Invalidate pages from the direct map when adding them to the RMP table Content-Language: en-US To: Dave Hansen , Tom Lendacky , Borislav Petkov Cc: Michael Roth , x86@kernel.org, kvm@vger.kernel.org, linux-coco@lists.linux.dev, linux-mm@kvack.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, jroedel@suse.de, 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, tobin@ibm.com, kirill@shutemov.name, ak@linux.intel.com, tony.luck@intel.com, sathyanarayanan.kuppuswamy@linux.intel.com, alpergun@google.com, jarkko@kernel.org, ashish.kalra@amd.com, nikunj.dadhania@amd.com, pankaj.gupta@amd.com, liam.merwick@oracle.com, zhi.a.wang@intel.com, Brijesh Singh References: <20231230161954.569267-1-michael.roth@amd.com> <20231230161954.569267-12-michael.roth@amd.com> <20240112200751.GHZaGcF0-OZVJiIB7y@fat_crate.local> <63297d29-bb24-ac5e-0b47-35e22bb1a2f8@amd.com> <336b55f9-c7e6-4ec9-806b-cb3659dbfdc3@intel.com> From: Vlastimil Babka In-Reply-To: <336b55f9-c7e6-4ec9-806b-cb3659dbfdc3@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 76FB880016 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: nnutwpx9zgbihq7f9qruisht31d76qb9 X-HE-Tag: 1705310600-587766 X-HE-Meta: U2FsdGVkX1+zyruoxcr4TewLPUn6Dd40JSQHUzAiWtqzVG7G1X33xM/cl0q2PDeX+ZzfKk1JpwFkfCjmSKLvKjCz0CMvFZizki8xwqeevssgi8Esbo9Cko9PJFifbDo+IGbkcdmL1WMMZ4OuCjKi3OyjTqzIkItzO02wSlzrR+RUbykjGscizhyVXpAW3Lpxrnt0CNld+KP1J9KkJ+ct1CR2nEN5qAOQbKgRI+tVyKiPAnDTEGDRnnd3t+cywjUE39pIAvU65TzUebr6x/pmv4e48AbqF/fh6iFZMdGG0aviA58ZUBIV+Dco5Xb1uGkMhzuYr/XTk/RueXNAKK3z2X0Gtd92H7ke1ZKKM6t39kq3BorWOTDQARbN8SgN7QJ9kcPnXqojBKcJb+JiuIw7mYGOkP8uiD691O5JzCMvZ+n6WmiWnHeaYsia5WL5W4fpuFWyJhKnsKdAoqwWKBIJ+2InQpHlJWyEBw8ktIC78lZhAwL5drDKdMGh/Re8L1CrSX02lN3+dh5t1nRn/TbszFO0SdQL/8dd9KiQi2wdang8Zs2daR+lf4jxbZgRxn74Yb2wYuYWxOTwVeTIs4OWkrPIxUQYKWEbTm/f+jPrd5w/iBCNlTkktPU4nzrkjyygYpjoRvefUF3WSUmNNikNZJFh/KilhHhohKOQ/uOdkfSL21Nr/NoF5252rPhWc1XZSoESX1KncJ9p5WlY2+2kaQCrXgXrVNev49Tc1iFKutb5V2Nb0jrs2FuXEU7Xw/DKX6SgU2QAbqv7q7ajsRgU37TbdH/yQ+xui2zkYz1Jg/IKUNLfY36h0f4Trh9saswyLjo3Kwf1XXVlVWXzZ+CZBURc/8dRgz57S/DJ2e2dR8QRtCuAf7B0C5b7824GBmV+L67D0CO6roRaj91Ga94g5kxG0UbocN+cwjK+PlO6R+HI9Rio0tuL1EckqINzY2mA 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: List-Subscribe: List-Unsubscribe: On 1/12/24 21:37, Dave Hansen wrote: > On 1/12/24 12:28, Tom Lendacky wrote: >> I thought there was also a desire to remove the direct map for any pages >> assigned to a guest as private, not just the case that the comment says. >> So updating the comment would probably the best action. > > I'm not sure who desires that. > > It's sloooooooow to remove things from the direct map. There's almost > certainly a frequency cutoff where running the whole direct mapping as > 4k is better than the cost of mapping/unmapping. > > Actually, where _is_ the TLB flushing here? Hm yeah it seems to be using the _noflush version? Maybe the RMP issues this avoids are only triggered with actual page tables and a stray outdated TLB hit doesn't trigger it? Needs documenting though if that's the case.