From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 17C0ED80F71 for ; Wed, 10 Jan 2024 12:19:44 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=dBxfZiFWWg0/zTvYlCFaB5pH6i/heICBMKA3YTWCYHM=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1704889183; v=1; b=i7AQsq4FcpIDKtmx6gQm90uNoizc9PFzS6ihW82gOmMduHG1ffMGCqdRBIjgfZQm/iV6wc5V 8DmgidDZK+QqOZnsaV4oORaBy3VYGhOQvIKs+Ds4lIue4PBYZW1EWse6BdZB8npExWdH8VA1OF/ 4AZpJaLyK7/kH3NKHy4qfgY8= X-Received: by 127.0.0.2 with SMTP id c5alYY7687511xMfM1HzcO1I; Wed, 10 Jan 2024 04:19:43 -0800 X-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.web11.10283.1704889182923612794 for ; Wed, 10 Jan 2024 04:19:43 -0800 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-495-VoOPmWXDPAiVNLCa9ei16Q-1; Wed, 10 Jan 2024 07:19:38 -0500 X-MC-Unique: VoOPmWXDPAiVNLCa9ei16Q-1 X-Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 93F40811E9C; Wed, 10 Jan 2024 12:19:38 +0000 (UTC) X-Received: from [10.39.192.166] (unknown [10.39.192.166]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C96BF492BC7; Wed, 10 Jan 2024 12:19:37 +0000 (UTC) Message-ID: Date: Wed, 10 Jan 2024 13:19:36 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg:Limit PhysicalAddressBits in speicial case To: Gerd Hoffmann Cc: devel@edk2.groups.io, Ray Ni , Rahul Kumar , Dun Tan References: <20240110080544.1350-1-dun.tan@intel.com> From: "Laszlo Ersek" In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: iBIeOQ9lurBq8lBtbc0aiFoAx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=i7AQsq4F; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none) On 1/10/24 11:54, Gerd Hoffmann wrote: > On Wed, Jan 10, 2024 at 04:05:44PM +0800, Dun Tan wrote: >> When creating smm page table, limit maximum >> supported physical address bits returned by >> CalculateMaximumSupportAddress() to 48 if >> 5-Level Paging is disabled. >> When 5-Level Paging is disabled and the >> PhysicalAddressBits retrived from CPU HOB or >> CpuId is bigger than 48, only [0, 2^48 -1] >> range in 52-bit physical address is mapped >> in page table. >=20 > I think this is wrong. Virtual addresses are sign-extended, > i.e. the virtual address space without 5-level paging is: >=20 > 0x0000000000000000 -> 0x00007fffffffffff and > 0xffff800000000000 -> 0xffffffffffffffff >=20 > Therefore identity-mapping works for [0, 2^47-1] only. I'd have never noticed this. I'll happily defer reviewing this patch to you then! :) Thanks! Laszlo -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113529): https://edk2.groups.io/g/devel/message/113529 Mute This Topic: https://groups.io/mt/103637402/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-