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.3 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 77395C433E0 for ; Tue, 16 Feb 2021 16:25:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DE54964E07 for ; Tue, 16 Feb 2021 16:25:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DE54964E07 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 552DA6B0005; Tue, 16 Feb 2021 11:25:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 503A06B0006; Tue, 16 Feb 2021 11:25:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 441036B006C; Tue, 16 Feb 2021 11:25:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0019.hostedemail.com [216.40.44.19]) by kanga.kvack.org (Postfix) with ESMTP id 2F6236B0005 for ; Tue, 16 Feb 2021 11:25:09 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id DE4FD6116 for ; Tue, 16 Feb 2021 16:25:08 +0000 (UTC) X-FDA: 77824655496.17.78DAA8A Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf28.hostedemail.com (Postfix) with ESMTP id E2CF420001D6 for ; Tue, 16 Feb 2021 16:25:07 +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 E6B0BAD57; Tue, 16 Feb 2021 16:25:06 +0000 (UTC) Date: Tue, 16 Feb 2021 17:25:04 +0100 From: Joerg Roedel To: Paolo Bonzini Cc: Peter Zijlstra , Andi Kleen , David Rientjes , Borislav Petkov , Andy Lutomirski , Sean Christopherson , Andrew Morton , "Kirill A. Shutemov" , Brijesh Singh , Tom Lendacky , Jon Grimm , Thomas Gleixner , Christoph Hellwig , Ingo Molnar , x86@kernel.org, linux-mm@kvack.org Subject: Re: AMD SEV-SNP/Intel TDX: validation of memory pages Message-ID: <20210216162504.GH12716@suse.de> References: <20210212145318.GK5453@suse.de> <20210212152813.GA28884@suse.de> <20210212161849.GB28884@suse.de> <20210216100045.GE28884@suse.de> <20210216142741.GI365765@tassilo.jf.intel.com> <5ff9690f-331a-8322-3431-212b14f64fcc@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5ff9690f-331a-8322-3431-212b14f64fcc@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Stat-Signature: 4ruhwgpa1uysj7etmnzedgcqi1s3k3qi X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: E2CF420001D6 Received-SPF: none (suse.de>: No applicable sender policy available) receiver=imf28; identity=mailfrom; envelope-from=""; helo=mx2.suse.de; client-ip=195.135.220.15 X-HE-DKIM-Result: none/none X-HE-Tag: 1613492707-647693 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 Tue, Feb 16, 2021 at 04:59:52PM +0100, Paolo Bonzini wrote: > - the inner handler does nothing but telling the outer handler to rerun. > The way it does it is certainly not pretty, because it has to work at any > instruction boundary, but at its heart it's basically a do{}while loop. That only works if processing of all inner #VE can be deferred, which is not the case for instruction emulation #VEs like MSR accesses, io-port or MMIO accesses. I guess those could all be replaced direct TDCALLs, but the question remains whether this is possible with MSR accesses, means that the list of MSRs which will cause #VEs is statically defined and doesn't change between hypervisors. All in all this sounds hard to maintain and easy to break by unrelated changes. Regards, Joerg