public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: devel@edk2.groups.io, anthony.perard@citrix.com
Cc: julien@xen.org, Igor Druzhinin <igor.druzhinin@citrix.com>,
	xen-devel@lists.xenproject.org, jordan.l.justen@intel.com,
	ard.biesheuvel@arm.com
Subject: Re: [edk2-devel] [PATCH] OvmfPkg/XenPlatformPei: Use CPUID to get physical address width on Xen
Date: Tue, 19 Jan 2021 18:23:06 +0100	[thread overview]
Message-ID: <64eb1777-44cb-c360-2597-7e436cba1a74@redhat.com> (raw)
In-Reply-To: <YAcARq/M7ouaD1c1@perard.uk.xensource.com>

On 01/19/21 16:52, Anthony PERARD via groups.io wrote:
> On Tue, Jan 19, 2021 at 03:49:34PM +0100, Laszlo Ersek wrote:
>> On 01/19/21 10:37, Julien Grall wrote:
>>> Hi Igor,
>>>
>>> On 13/01/2021 03:42, Igor Druzhinin wrote:
>>>> We faced a problem with passing through a PCI device with 64GB BAR to
>>>> UEFI guest. The BAR is expectedly programmed into 64-bit PCI aperture at
>>>> 64G address which pushes physical address space to 37 bits. That is above
>>>> 36-bit width that OVMF exposes currently to a guest without tweaking
>>>> PcdPciMmio64Size knob.
>>>>
>>>> The reverse calculation using this knob was inhereted from QEMU-KVM
>>>> platform
>>>> code where it serves the purpose of finding max accessible physical
>>>> address without necessary trusting emulated CPUID physbits value (that
>>>> could
>>>> be different from host physbits). On Xen we expect to use CPUID policy
>>>> to level the data correctly to prevent situations with guest physbits >
>>>> host physbits e.g. across migrations.
>>>>
>>>> The next aspect raising concern - resource consumption for DXE IPL
>>>> page tables
>>>> and time required to map the whole address space in case of using CPUID
>>>> bits directly. That could be mitigated by enabling support for 1G pages
>>>> in DXE IPL configuration. 1G pages are available on most CPUs produced in
>>>> the last 10 years and those without don't have many phys bits.
>>>>
>>>> Remove all the redundant code now (including PcdPciMmio64.. handling
>>>> that's
>>>> not used on Xen anyway) and grab physbits directly from CPUID that should
>>>> be what baremetal UEFI systems do.
>>>>
>>>> Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
>>>
>>> Reviewed-by: Julien Grall <julien@xen.org>
>>
>> I'm going to hold this patch until Anthony responds in this thread as well:
> 
> This new patch is fine, I didn't notice that it was a replacement for
> the previous one.
> 
> Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>

[lersek@redhat.com: fix up authorship from groups.io-mangled From line]
[lersek@redhat.com: wrap commit message at 74 characters]

Merged via <https://github.com/tianocore/edk2/pull/1369>, as commit
e68c2a22caae.

Thanks
Laszlo


      reply	other threads:[~2021-01-19 17:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-13  3:42 [PATCH] OvmfPkg/XenPlatformPei: Use CPUID to get physical address width on Xen Igor Druzhinin
2021-01-13  3:55 ` Laszlo Ersek
2021-01-19  9:37 ` julien
2021-01-19 14:49   ` [edk2-devel] " Laszlo Ersek
2021-01-19 15:52     ` Anthony PERARD
2021-01-19 17:23       ` Laszlo Ersek [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=64eb1777-44cb-c360-2597-7e436cba1a74@redhat.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