From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web12.5044.1630049624722330627 for ; Fri, 27 Aug 2021 00:33:45 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=begvi9fm; spf=pass (domain: redhat.com, ip: 216.205.24.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630049623; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=kD50vPNAuw8tcvdA1lSA6fv+NHXQTmeH0uzrEOZX830=; b=begvi9fmFUOuPIuqrYdkU0A8mCZIaG5nM9Z5w+3SCT9E+UorAdDav6FIU8NtZWASC/z8Mw t8KQN+YUHMjPb3eMVtAJcYTBcq7LewjFIuQAYCL0dZbu1Orxsk8LoB+wC8p6ObIqB9ii4g 08TP7KSLIPeX0BUBBr4mCyegsom7RFM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-139-pVJVR9tMOCOYVC4TJsMdUA-1; Fri, 27 Aug 2021 03:33:40 -0400 X-MC-Unique: pVJVR9tMOCOYVC4TJsMdUA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 09F13190B2A0; Fri, 27 Aug 2021 07:33:37 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1F2A85F724; Fri, 27 Aug 2021 07:33:36 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 4908218000AE; Fri, 27 Aug 2021 09:33:34 +0200 (CEST) Date: Fri, 27 Aug 2021 09:33:34 +0200 From: "Gerd Hoffmann" To: devel@edk2.groups.io, brijesh.singh@amd.com Cc: James Bottomley , Min Xu , Jiewen Yao , Tom Lendacky , Jordan Justen , Ard Biesheuvel , Laszlo Ersek , Erdem Aktas , Eric Dong , Ray Ni , Rahul Kumar , Michael D Kinney , Liming Gao , Zhiguang Liu , Michael Roth Subject: Re: [edk2-devel] [RFC PATCH v5 00/28] Add AMD Secure Nested Paging (SEV-SNP) support Message-ID: <20210827073334.y26sihpldsyfvusz@sirius.home.kraxel.org> References: <20210630125321.30278-1-brijesh.singh@amd.com> MIME-Version: 1.0 In-Reply-To: <20210630125321.30278-1-brijesh.singh@amd.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, [ /me reading through a bunch of old threads .... ] > Many of the integrity guarantees of SEV-SNP are enforced through a new > structure called the Reverse Map Table (RMP). Adding a new page to SEV-SNP > VM requires a 2-step process. First, the hypervisor assigns a page to the > guest using the new RMPUPDATE instruction. This transitions the page to > guest-invalid. Second, the guest validates the page using the new PVALIDATE > instruction. Intel TDX names this "accepting pages", but it is basically the same concept, correct? If so I see opportunities to share code here. The problem of tracking which pages are validated/accepted and which are not should be the same for both TDX and SEV-SNP. The overall workflow (which phase validates/accepts which pages etc.) should be identical too. > At this time we only support the pre-validation. OVMF detects all the available > system RAM in the PEI phase. When SEV-SNP is enabled, the memory is validated > before it is made available to the EDK2 core. How do you detect memory? Intel wants pass a hob with a memory map (and possibly more config info) to the early boot code, and I'm wondering why TDX needs that while SEV-SNP apparently doesn't (at least I havn't noticed anything similar while going over the patches quickly). thanks, Gerd