From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web10.3804.1634705676126264622 for ; Tue, 19 Oct 2021 21:54:36 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IW0JyPpQ; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634705675; 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=08wXBSP0xN0UXrbZmeFj5SZE4KBhYy37FGzDaMZks20=; b=IW0JyPpQ1/botvt7tPwpDC8L446o5dZpcLKEjaiH0zDaOvoGckapzRCmGCk4QKWoCKVoJ8 ZlPG3QwwMfv2kb7kB297FrOR4peKQgclQPtUR15hm2aZ3i3wdTICS2jpluIMCzhEfjcIie ClzqRHDzwteRF8Z4hSLYbd+AHczmcvs= 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-374-Bs_ame7qPmaRuOgyYZlSOQ-1; Wed, 20 Oct 2021 00:54:29 -0400 X-MC-Unique: Bs_ame7qPmaRuOgyYZlSOQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1A57D1006AA2; Wed, 20 Oct 2021 04:54:28 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8CBB5103BAC7; Wed, 20 Oct 2021 04:54:27 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 75BDF180092E; Wed, 20 Oct 2021 06:54:25 +0200 (CEST) Date: Wed, 20 Oct 2021 06:54:25 +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 v10 17/32] OvmfPkg/MemEncryptSevLib: add support to validate > 4GB memory in PEI phase Message-ID: <20211020045425.qa375ym2tk7m7z2w@sirius.home.kraxel.org> References: <20211019193934.1052465-1-brijesh.singh@amd.com> <20211019193934.1052465-18-brijesh.singh@amd.com> MIME-Version: 1.0 In-Reply-To: <20211019193934.1052465-18-brijesh.singh@amd.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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 Tue, Oct 19, 2021 at 02:39:19PM -0500, Brijesh Singh wrote: > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3275 > > The initial page built during the SEC phase is used by the > MemEncryptSevSnpValidateSystemRam() for the system RAM validation. The > page validation process requires using the PVALIDATE instruction; the > instruction accepts a virtual address of the memory region that needs > to be validated. If hardware encounters a page table walk failure (due > to page-not-present) then it raises #GP. > > The initial page table built in SEC phase address up to 4GB. Add an > internal function to extend the page table to cover > 4GB. The function > builds 1GB entries in the page table for access > 4GB. This will provide > the support to call PVALIDATE instruction for the virtual address > > 4GB in PEI phase. > +/** > + Create 1GB identity mapping for the specified virtual address range. > + > + The function is preliminary used by the SEV-SNP page state change > + APIs to build the page table required before issuing the PVALIDATE > + instruction. The function must be removed after the EDK2 core is > + enhanced to do the lazy validation. Thanks for adding this. Acked-by: Gerd Hoffmann take care, Gerd