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=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 437DEC433E0 for ; Fri, 12 Feb 2021 15:28:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AE51364E65 for ; Fri, 12 Feb 2021 15:28:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE51364E65 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 12E2B8D0063; Fri, 12 Feb 2021 10:28:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0B9EA8D0060; Fri, 12 Feb 2021 10:28:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EC1F28D0063; Fri, 12 Feb 2021 10:28:17 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0080.hostedemail.com [216.40.44.80]) by kanga.kvack.org (Postfix) with ESMTP id D3DCB8D0060 for ; Fri, 12 Feb 2021 10:28:17 -0500 (EST) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 98BB1364C for ; Fri, 12 Feb 2021 15:28:17 +0000 (UTC) X-FDA: 77809997034.04.2436E50 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf05.hostedemail.com (Postfix) with ESMTP id DD08EE0011C0 for ; Fri, 12 Feb 2021 15:28:15 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id C3974AC90; Fri, 12 Feb 2021 15:28:15 +0000 (UTC) Date: Fri, 12 Feb 2021 16:28:13 +0100 From: Joerg Roedel To: Peter Zijlstra 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: <20210212152813.GA28884@suse.de> 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: User-Agent: Mutt/1.10.1 (2018-07-13) X-Stat-Signature: r1rk83q8xhrf6xk5jkuefn46i9z17f9n X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: DD08EE0011C0 Received-SPF: none (suse.de>: No applicable sender policy available) receiver=imf05; identity=mailfrom; envelope-from=""; helo=mx2.suse.de; client-ip=195.135.220.15 X-HE-DKIM-Result: none/none X-HE-Tag: 1613143695-146028 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: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? > 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. Regards, Joerg