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=-6.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 4BEBFC433E0 for ; Fri, 12 Feb 2021 22:46:58 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DC0B564E00 for ; Fri, 12 Feb 2021 22:46:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DC0B564E00 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5B1818D00A4; Fri, 12 Feb 2021 17:46:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 560888D0060; Fri, 12 Feb 2021 17:46:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 49D5D8D00A4; Fri, 12 Feb 2021 17:46:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0109.hostedemail.com [216.40.44.109]) by kanga.kvack.org (Postfix) with ESMTP id 3446E8D0060 for ; Fri, 12 Feb 2021 17:46:57 -0500 (EST) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id E9990824805A for ; Fri, 12 Feb 2021 22:46:56 +0000 (UTC) X-FDA: 77811102432.04.gate23_3d1535627625 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin04.hostedemail.com (Postfix) with ESMTP id D0E8A801DC31 for ; Fri, 12 Feb 2021 22:46:56 +0000 (UTC) X-HE-Tag: gate23_3d1535627625 X-Filterd-Recvd-Size: 3837 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf04.hostedemail.com (Postfix) with ESMTP for ; Fri, 12 Feb 2021 22:46:56 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 13EF664DA5 for ; Fri, 12 Feb 2021 22:46:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1613170015; bh=3IPk/lZc3dXrZevkjE4XGNfUKSbWW2JASpqzYJlAXM8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ec/eP7peVCIqEaY+lWDdmsOacOy+Xo5BeBvn2EGk5uFceX3SHzxP0XBkQME0V6VIc YsmsUaykZ9k+V4uhubRQXovDBO1pt1QUfMmwZ/2YBt5I2Cm4K/fRxh2MCj46hpubW9 4GEgz8qhAw/1Qs2mYFAtsitw8fZ40K1hdrDp3v5uy8cTjYZ5jP+5x4DjEoEi+KCGZw 7+PpHDUlHk6L0oIkNJSv5feNVV3IzX8DDQsb2nBNOpLmjbGiDYo3tx/yd76nyjbVkx YKJ6C3l/nVvy8w6LYrn9jIFKLBJOfz0mT+VjKS1WElH79pobRAhEo2uxtRDrGHWcRh G3RPsfZHf5U5w== Received: by mail-ej1-f52.google.com with SMTP id b9so1710194ejy.12 for ; Fri, 12 Feb 2021 14:46:54 -0800 (PST) X-Gm-Message-State: AOAM530QvCcfwbdLPE/hVhJZVCDWLv5MSPlEw1XluGHN6BbGIV82BnE3 0dJs9gh9Mz49rrviomFZYi409u+5AS0OGSoTVjaTMQ== X-Google-Smtp-Source: ABdhPJzXqsLBfJkuL5S4MycxajbfxacxRxsNVd9nWTGq/pGa2zYDsF/g5LnRhVDkuM2VneMtgL98dHP7M9Emlh4ACss= X-Received: by 2002:a17:906:24d1:: with SMTP id f17mr5060954ejb.503.1613170013361; Fri, 12 Feb 2021 14:46:53 -0800 (PST) MIME-Version: 1.0 References: <7515a81a-19e-b063-2081-3f5e79f0f7a8@google.com> <20210212131907.GI5453@suse.de> <20210212145318.GK5453@suse.de> <20210212152813.GA28884@suse.de> <20210212214205.GF365765@tassilo.jf.intel.com> <20210212215852.GL8912@worktop.programming.kicks-ass.net> <20210212223918.GG365765@tassilo.jf.intel.com> In-Reply-To: <20210212223918.GG365765@tassilo.jf.intel.com> From: Andy Lutomirski Date: Fri, 12 Feb 2021 14:46:41 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: AMD SEV-SNP/Intel TDX: validation of memory pages To: Andi Kleen Cc: Peter Zijlstra , Joerg Roedel , David Rientjes , Borislav Petkov , Andy Lutomirski , Sean Christopherson , Andrew Morton , "Kirill A. Shutemov" , Brijesh Singh , Tom Lendacky , Jon Grimm , Thomas Gleixner , Christoph Hellwig , Paolo Bonzini , Ingo Molnar , X86 ML , Linux-MM Content-Type: text/plain; charset="UTF-8" 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 2:39 PM Andi Kleen wrote: > > > But AFAI recursive #VE is entirely possible. The moment #VE reads that > > ve_info thing, NMIs can happen, which can trigger another #VE which then > > clobbers your stack and we're irrecoverably screwed again. > > I don't believe we have anything currently in the NMI handler that > would trigger #VE. While some operations may need TDCALL (like MSR > accesses) those should be all directly hooked. > > Also in general to avoid clobbering your stack you would just need > to make sure to adjust the IST stack before you do anything that > could cause another #VE. Except that the world contains more than just #VE. We could get #VE and then NMI and then #VE or #VE and MCE (in a future revision?), etc. The x86 exception situation is a mess.