public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "duntan" <dun.tan@intel.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"Ni, Ray" <ray.ni@intel.com>, Laszlo Ersek <lersek@redhat.com>,
	"Kumar, Rahul R" <rahul.r.kumar@intel.com>
Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg:Limit PhysicalAddressBits in speicial case
Date: Thu, 11 Jan 2024 01:56:09 +0000	[thread overview]
Message-ID: <BN9PR11MB5483E700B31A0DEFA39E9E68E5682@BN9PR11MB5483.namprd11.prod.outlook.com> (raw)
In-Reply-To: <c7ahft27s5rozrirr3mdlzfdc7gfid2qaaf4c3iwhcn6x4czsy@3hiex4wsjftd>

Hi Gerd,

Thanks for your comments. I agree with your opinion. Will change the code and related comments in V2 patch.

Thanks,
Dun

-----Original Message-----
From: Gerd Hoffmann <kraxel@redhat.com> 
Sent: Wednesday, January 10, 2024 6:55 PM
To: Tan, Dun <dun.tan@intel.com>
Cc: devel@edk2.groups.io; Ni, Ray <ray.ni@intel.com>; Laszlo Ersek <lersek@redhat.com>; Kumar, Rahul R <rahul.r.kumar@intel.com>
Subject: Re: [PATCH] UefiCpuPkg:Limit PhysicalAddressBits in speicial case

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.

I think this is wrong.  Virtual addresses are sign-extended, i.e. the virtual address space without 5-level paging is:

 0x0000000000000000 -> 0x00007fffffffffff and
 0xffff800000000000 -> 0xffffffffffffffff

Therefore identity-mapping works for [0, 2^47-1] only.

take care,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113567): https://edk2.groups.io/g/devel/message/113567
Mute This Topic: https://groups.io/mt/103637402/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



      parent reply	other threads:[~2024-01-11  1:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-10  8:05 [edk2-devel] [PATCH] UefiCpuPkg:Limit PhysicalAddressBits in speicial case duntan
2024-01-10  9:08 ` Ni, Ray
2024-01-10 10:54 ` Gerd Hoffmann
2024-01-10 12:19   ` Laszlo Ersek
2024-01-11  1:56   ` duntan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BN9PR11MB5483E700B31A0DEFA39E9E68E5682@BN9PR11MB5483.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox