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.web11.11253.1674032735794925710 for ; Wed, 18 Jan 2023 01:05:35 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=caDybc6a; 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=1674032734; 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=TwHecZhMIWZcZ05zyDMoBs+yv6byEdlpXrDu/ZxTxFc=; b=caDybc6aNtg0AWcZXQaicqmpDwEdSeWdZByCef+ZFEtCe5gMFygXZqdgvvq3i2vYkO0X/n FodrJQmBoyHdIZkwW0FKKwL64IisZfWO1TLoBf9avniXRPkbODiV05HYhlSc9XC0SLntmn mNfaxZXxMhD+OMgr7rIACB97vaZBSwQ= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-346-wzrO0kP5NAmC8S-v909sOg-1; Wed, 18 Jan 2023 04:05:31 -0500 X-MC-Unique: wzrO0kP5NAmC8S-v909sOg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F32B43C02545; Wed, 18 Jan 2023 09:05:30 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.186]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BEAF153A0; Wed, 18 Jan 2023 09:05:30 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 1FB4E1800091; Wed, 18 Jan 2023 10:05:29 +0100 (CET) Date: Wed, 18 Jan 2023 10:05:29 +0100 From: "Gerd Hoffmann" To: Zhiguang Liu Cc: devel@edk2.groups.io, Rahul Kumar , Star Zeng , Wu@sirius.home.kraxel.org, Jiaxin , Ray Ni , Eric Dong Subject: Re: [PATCH v2] UefiCpuPkg: Fix SMM code hangs when InitPaging Message-ID: <20230118090529.bwp4qpluagrpk53x@sirius.home.kraxel.org> References: <20230118012348.1195-1-zhiguang.liu@intel.com> MIME-Version: 1.0 In-Reply-To: <20230118012348.1195-1-zhiguang.liu@intel.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Jan 18, 2023 at 09:23:48AM +0800, Zhiguang Liu wrote: > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4246 > > In function InitPaging, NumberOfPml5Entries is calculated by below code > NumberOfPml5Entries = (UINTN)LShiftU64 (1, SizeOfMemorySpace - 48); > If the SizeOfMemorySpace is larger than 48, NumberOfPml5Entries will be > larger than 1. However, this doesn't make sense if the hardware doesn't > support 5 level page table. ... if 5-level paging is not used. Hardware which does not support 5-level paging is limited to 48 anyway. This still does not explain why this fixes code hangs. take care, Gerd