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=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 DD52CC433E0 for ; Fri, 12 Feb 2021 15:19:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6C48464DB1 for ; Fri, 12 Feb 2021 15:19:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6C48464DB1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id BF4BA8D0062; Fri, 12 Feb 2021 10:19:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BA5628D0060; Fri, 12 Feb 2021 10:19:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AE3448D0062; Fri, 12 Feb 2021 10:19:31 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0215.hostedemail.com [216.40.44.215]) by kanga.kvack.org (Postfix) with ESMTP id 97D9C8D0060 for ; Fri, 12 Feb 2021 10:19:31 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 6089E2826 for ; Fri, 12 Feb 2021 15:19:31 +0000 (UTC) X-FDA: 77809974942.08.knife56_0802dec27622 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin08.hostedemail.com (Postfix) with ESMTP id 436771819E627 for ; Fri, 12 Feb 2021 15:19:31 +0000 (UTC) X-HE-Tag: knife56_0802dec27622 X-Filterd-Recvd-Size: 4030 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by imf08.hostedemail.com (Postfix) with ESMTP for ; Fri, 12 Feb 2021 15:19:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=4Vkcbmi1vaMz3bDFUJr47Yvfd+sCGH2JuvQF+QmmUHA=; b=dgBWBjIcA8FMyKyai3bVGoxUUO dYWNwUSlvoBfc328tfxLSWEpTTE++rq8r+cgHIT6+LLHLbH8AZqMusDYc2GJH0ydI0jCR/oAuQi8X v/QULlxGgkeD3cvomx2IMXrZzYwBt+cE1uHt3ZL4aQXA70r9vWT2cs3/wInXaOCcf9H6ThPICPpkh AzR+HujjYcC6Eqlg6dvhvUqIwuLQc4m0VdxRxE9Msfr1Q904dQ0tiwLKZb0NQU1o0zY7pgekNTpiP NJaSLs/TBCe548NvEAPHC2GH/s7yvzwzIkeJmJPASTFh6o27hcuBsU+aeD+d9yBjPcLQXXDiE2KeW Ouv0Zwpw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1lAaE9-0002Y0-6H; Fri, 12 Feb 2021 15:19:25 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 0FFFE301A66; Fri, 12 Feb 2021 16:19:23 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id F12162C1CD099; Fri, 12 Feb 2021 16:19:22 +0100 (CET) Date: Fri, 12 Feb 2021 16:19:22 +0100 From: Peter Zijlstra To: Joerg Roedel Cc: David Rientjes , Borislav Petkov , Andy Lutomirski , Sean Christopherson , Andrew Morton , "Kirill A. Shutemov" , Andi Kleen , Brijesh Singh , Tom Lendacky , Jon Grimm , Thomas Gleixner , Christoph Hellwig , Paolo Bonzini , Ingo Molnar , x86@kernel.org, linux-mm@kvack.org Subject: Re: AMD SEV-SNP/Intel TDX: validation of memory pages Message-ID: References: <7515a81a-19e-b063-2081-3f5e79f0f7a8@google.com> <20210212131907.GI5453@suse.de> <20210212145318.GK5453@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210212145318.GK5453@suse.de> 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 Fri, Feb 12, 2021 at 03:53:18PM +0100, Joerg Roedel wrote: > On Fri, Feb 12, 2021 at 03:17:57PM +0100, Peter Zijlstra wrote: > > On Fri, Feb 12, 2021 at 02:19:07PM +0100, Joerg Roedel wrote: > > > - Then we can pass this information up the boot process by > > > extending struct boot_params. The bootloader can pass which > > > E820 usable memory it validated, same for the kernel > > > decompressor. The text+data (but not bss) of the running > > > kernel image is per definition validated by the decompressor > > > and does not need to be added explicitly to boot_params. > > > > Even if all text+data is prevalidated, we'll probably still need some > > prevalidated bss and certainly some prevalidated percpu data (like the > > various stacks, but also crud like the percpu variable we store the DR7 > > shadow in etc..). > > The kernel sets up early exception handling in head_64.S, right after > setting MSR_GS_BASE. So per-cpu data can probably be be on-demand. For > bss you might be right. That's the thing, we don't want #VE to happen in noinstr code *ever*. noinstr covers the whole entry code, things like the syscall gap and nmi recursion setup. Getting a #VE there is fail. So most per-cpu data can be on-demand, but some of it must absolutely not be.