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.web09.6418.1634199588786878781 for ; Thu, 14 Oct 2021 01:19:49 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Q/oqKcZb; 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=1634199588; 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=4CxxlCSzbre97jFFiHsGoMBGCefr9y/7fClSQoULV4s=; b=Q/oqKcZb9+I/xKbAAda3uMMvK/7LAyzqMSXrhFH4jbAxzlvUjGXbjoLLicnGCPLhJpBlB8 WLWrq7GFbk1C+wjWWjomLWhaCA/aJkDJsaa6cdQbx1828HuT/gcF22TLvzlU9lV9We0MqJ mn8i8D6WEXWJUFaAauoPYJ7Kdbdkc0Q= 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-601-LI9lCU1fNlijIjFmoYM08Q-1; Thu, 14 Oct 2021 04:19:43 -0400 X-MC-Unique: LI9lCU1fNlijIjFmoYM08Q-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1FF0F93C; Thu, 14 Oct 2021 08:19:41 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8F37A60936; Thu, 14 Oct 2021 08:19:40 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 2455118007AC; Thu, 14 Oct 2021 10:19:38 +0200 (CEST) Date: Thu, 14 Oct 2021 10:19:38 +0200 From: "Gerd Hoffmann" To: Brijesh Singh Cc: devel@edk2.groups.io, James Bottomley , Min Xu , Jiewen Yao , Tom Lendacky , Jordan Justen , Ard Biesheuvel , Erdem Aktas , Michael Roth Subject: Re: [PATCH v9 16/32] OvmfPkg/BaseMemEncryptSevLib: skip the pre-validated system RAM Message-ID: <20211014081938.zpn4mlnj6ejisbr4@sirius.home.kraxel.org> References: <20211013165713.727815-1-brijesh.singh@amd.com> <20211013165713.727815-17-brijesh.singh@amd.com> MIME-Version: 1.0 In-Reply-To: <20211013165713.727815-17-brijesh.singh@amd.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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 On Wed, Oct 13, 2021 at 11:56:57AM -0500, Brijesh Singh wrote: > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3275 > > The MemEncryptSevSnpPreValidateSystemRam() is used for pre-validating the > system RAM. As the boot progress, each phase validates a fixed region of > the RAM. In the PEI phase, the PlatformPei detects all the available RAM > and calls to pre-validate the detected system RAM. > > While validating the system RAM in PEI phase, we must skip previously > validated system RAM to avoid the double validation. Hmm, I think long-term we need something better to track page state than coding up ad-hoc solutions like this. But I think we can defer that until we add support for lazy acceptance / validation. The memory core will have to track page state anyway. So once memory core is updated we should be able to just use that instead of inventing something new. Acked-by: Gerd Hoffmann take care, Gerd