* [OVMF] What would be the best way to make PcdPciMmio64Size dynamic?
@ 2023-01-17 14:10 Boeuf, Sebastien
2023-01-17 14:38 ` Gerd Hoffmann
0 siblings, 1 reply; 3+ messages in thread
From: Boeuf, Sebastien @ 2023-01-17 14:10 UTC (permalink / raw)
To: kraxel@redhat.com, Yao, Jiewen, Justen, Jordan L,
devel@edk2.groups.io, ardb+tianocore@kernel.org
Hi,
Looking at the hardcoded limitation provided by PcdPciMmio64Size
(32GiB), I was wondering what would be the best approach to make this a
bit more dynamic?
I know that for QEMU, the fw_cfg mechanism can be used to override the
value of PcdPciMmio64Size, but this isn't something Cloud Hypervisor or
other VMMs can implement given they don't support fw_cfg at all.
Would it be acceptable to dynamically compute PcdPciMmio64Size from the
physical address space? Given the reason why PcdPciMmio64Size can't be
increased is to make sure it can support host with small address space
(such as 36 bits), we could introduce a very simple function that would
determine the available address space and consider PcdPciMmio64Size
being half the size.
I'm not sure if PcdPciMmio64Size should still be provided or not, as a
default value to fallback on.
Please let me know your thoughts on this and I can start preparing a
patch.
Thanks,
Sebastien
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number: 302 456 199 R.C.S. NANTERRE
Capital: 5 208 026.16 Euros
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [OVMF] What would be the best way to make PcdPciMmio64Size dynamic?
2023-01-17 14:10 [OVMF] What would be the best way to make PcdPciMmio64Size dynamic? Boeuf, Sebastien
@ 2023-01-17 14:38 ` Gerd Hoffmann
2023-01-18 14:24 ` Boeuf, Sebastien
0 siblings, 1 reply; 3+ messages in thread
From: Gerd Hoffmann @ 2023-01-17 14:38 UTC (permalink / raw)
To: Boeuf, Sebastien
Cc: Yao, Jiewen, Justen, Jordan L, devel@edk2.groups.io,
ardb+tianocore@kernel.org
On Tue, Jan 17, 2023 at 02:10:08PM +0000, Boeuf, Sebastien wrote:
> Hi,
>
> Looking at the hardcoded limitation provided by PcdPciMmio64Size
> (32GiB), I was wondering what would be the best approach to make this a
> bit more dynamic?
>
> I know that for QEMU, the fw_cfg mechanism can be used to override the
> value of PcdPciMmio64Size, but this isn't something Cloud Hypervisor or
> other VMMs can implement given they don't support fw_cfg at all.
>
> Would it be acceptable to dynamically compute PcdPciMmio64Size from the
> physical address space? Given the reason why PcdPciMmio64Size can't be
> increased is to make sure it can support host with small address space
> (such as 36 bits), we could introduce a very simple function that would
> determine the available address space and consider PcdPciMmio64Size
> being half the size.
Sure, check master branch, the code is already there. Should just be a
matter of wiring up the function calls for cloundhv, and you can
probably call PlatformAddressWidthFromCpuid() with QemuQuirk = false
unconditionally.
take care,
Gerd
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [OVMF] What would be the best way to make PcdPciMmio64Size dynamic?
2023-01-17 14:38 ` Gerd Hoffmann
@ 2023-01-18 14:24 ` Boeuf, Sebastien
0 siblings, 0 replies; 3+ messages in thread
From: Boeuf, Sebastien @ 2023-01-18 14:24 UTC (permalink / raw)
To: kraxel@redhat.com
Cc: Yao, Jiewen, Justen, Jordan L, devel@edk2.groups.io,
ardb+tianocore@kernel.org
On Tue, 2023-01-17 at 15:38 +0100, kraxel@redhat.com wrote:
> On Tue, Jan 17, 2023 at 02:10:08PM +0000, Boeuf, Sebastien wrote:
> > Hi,
> >
> > Looking at the hardcoded limitation provided by PcdPciMmio64Size
> > (32GiB), I was wondering what would be the best approach to make
> > this a
> > bit more dynamic?
> >
> > I know that for QEMU, the fw_cfg mechanism can be used to override
> > the
> > value of PcdPciMmio64Size, but this isn't something Cloud
> > Hypervisor or
> > other VMMs can implement given they don't support fw_cfg at all.
> >
> > Would it be acceptable to dynamically compute PcdPciMmio64Size from
> > the
> > physical address space? Given the reason why PcdPciMmio64Size can't
> > be
> > increased is to make sure it can support host with small address
> > space
> > (such as 36 bits), we could introduce a very simple function that
> > would
> > determine the available address space and consider PcdPciMmio64Size
> > being half the size.
>
> Sure, check master branch, the code is already there. Should just be
> a
> matter of wiring up the function calls for cloundhv, and you can
> probably call PlatformAddressWidthFromCpuid() with QemuQuirk = false
> unconditionally.
Ah thank you for the pointer, the code is exactly what I had in mind.
I sent a patch to disable the QemuQuirk in case of Cloud Hypervisor,
which then result in the proper address space size to be returned, and
therefore the 64-bit MMIO window to be computed dynamically!
Thanks,
Sebastien
>
> take care,
> Gerd
>
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number: 302 456 199 R.C.S. NANTERRE
Capital: 5 208 026.16 Euros
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-01-18 14:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-17 14:10 [OVMF] What would be the best way to make PcdPciMmio64Size dynamic? Boeuf, Sebastien
2023-01-17 14:38 ` Gerd Hoffmann
2023-01-18 14:24 ` Boeuf, Sebastien
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox