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 E4D99C433DB for ; Fri, 12 Feb 2021 16:12:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B6E7A64E74 for ; Fri, 12 Feb 2021 16:12:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B6E7A64E74 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 C7AC08D0068; Fri, 12 Feb 2021 11:12:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C29698D0060; Fri, 12 Feb 2021 11:12:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B19198D0068; Fri, 12 Feb 2021 11:12:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0096.hostedemail.com [216.40.44.96]) by kanga.kvack.org (Postfix) with ESMTP id 98EE58D0060 for ; Fri, 12 Feb 2021 11:12:55 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 5B4C2824934B for ; Fri, 12 Feb 2021 16:12:55 +0000 (UTC) X-FDA: 77810109510.07.D7837ED Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by imf22.hostedemail.com (Postfix) with ESMTP id 85858C0001EA for ; Fri, 12 Feb 2021 16:12:51 +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=SQCTOFmd2RysCQ6LKusNvYa1znRfvXUplU4cIxY3SDs=; b=GRctiORSHFBbMKcmS/yxQrF2gl 9osc7/56zmNkXKliUUZSQitaTYSTK4FBHrIAQCCgUpdB+QGuq9xTjZiBQUnJThUi1SkP2Jd/BKFl2 mWNP2sNtRb0s1F/4V9y6djNxyeIyPXfXlfQJ5cbg3PP5v89QfetcPoR3Ut9+npbM9LpxIzZO9Ov6M cb7jzR20lNWK1AKc+7YsKqdjig86V+wnr1rws74KPQVp9PeclCWJL+HJZAvgl3J5sAozbymJpi7qn PhitjbkewaRfGxQSQJulbBsBjm92XRVgZiLAbb873O2YsWk746rX0fRvfKSwlx6QacWpXFF7l/Bfc QP3pt1tg==; 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 1lAb3j-0000df-M4; Fri, 12 Feb 2021 16:12:44 +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 72D493019CE; Fri, 12 Feb 2021 17:12:41 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 58BC42C1D2BD6; Fri, 12 Feb 2021 17:12:41 +0100 (CET) Date: Fri, 12 Feb 2021 17:12:41 +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> <20210212152813.GA28884@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210212152813.GA28884@suse.de> X-Stat-Signature: bwsi8i6rcbartrqo5io5tja57j3qd4t4 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 85858C0001EA Received-SPF: none (infradead.org>: No applicable sender policy available) receiver=imf22; identity=mailfrom; envelope-from=""; helo=merlin.infradead.org; client-ip=205.233.59.134 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1613146371-205436 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 04:28:13PM +0100, Joerg Roedel wrote: > On Fri, Feb 12, 2021 at 04:19:22PM +0100, Peter Zijlstra wrote: > > 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. > > I don't know the details about TDX and #VE, but could a malicious HV not > trigger a #VE basically everywhere by mapping around pages? So 'fail' > means panic() in this case, right? Right. > > So most per-cpu data can be on-demand, but some of it must absolutely > > not be. > > The kernel can validate those itself in the early setup code, the > decompressor shouldn't care about those details. Oh sure, I was just pointing out it needs to be done before normal operation.