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.129.124]) by mx.groups.io with SMTP id smtpd.web10.5894.1645611244772935970 for ; Wed, 23 Feb 2022 02:14:05 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hEKHpXCW; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645611244; 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=1IXg4mW/Fc1k7KDna8Q9C0Nc5fejQQY2FIAVrmunE1M=; b=hEKHpXCWdg0pj3ArsFhrRqmIY5LfQaMuPp9eC2kTKeyhnYP68OfKiD5Sq1nny4irU1GSYw 7/7zqqjobgKAD7FSsiPMQ6LMoCvfhOUcChUbGgMN7AJdLX1ocu+xawg/RbBme0o4ZaLfGx oFq381hvL9BCYNRxvN+pBcDBwzBgIwA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-611-JxSxqINBMb2M8CLp6Tu80A-1; Wed, 23 Feb 2022 05:13:58 -0500 X-MC-Unique: JxSxqINBMb2M8CLp6Tu80A-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EF90C800496; Wed, 23 Feb 2022 10:13:56 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.195.81]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 48ED527C49; Wed, 23 Feb 2022 10:13:56 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 90F4C18003BA; Wed, 23 Feb 2022 11:13:54 +0100 (CET) Date: Wed, 23 Feb 2022 11:13:54 +0100 From: "Gerd Hoffmann" To: Min Xu Cc: devel@edk2.groups.io, Ard Biesheuvel , Jordan Justen , Brijesh Singh , Erdem Aktas , James Bottomley , Jiewen Yao , Tom Lendacky Subject: Re: [PATCH V6 34/42] OvmfPkg: Update PlatformPei to support Tdx guest Message-ID: <20220223101354.u5z5n2zdjkohx6kq@sirius.home.kraxel.org> References: MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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, > - Pml4Entries = 1 << (mPhysMemAddressWidth - 39); > + if (TdIsEnabled ()) { > + Pml4Entries = 0x200; > + } else { > + Pml4Entries = 1 << (mPhysMemAddressWidth - 39); > + } With the PlatformAddressWidthInitialization() update in patch #33 it should not be needed to special-case TDX here. You might need a check for 5-level paging support (mPhysMemAddressWidth > 48) though, or just cap Pml4Entries at 512 entries. take care, Gerd