On 5/15/2026 3:59 AM, Ard Biesheuvel via groups.io wrote:
Considering that
a) there is no mention of VA_LIST in the UEFI or PI specs
b) this is an EDK2 internal protocol, and will remain so given a)
c) there is already prior art in EDK2 (e.g. PrintLib) for passing
a VA_LIST by reference
d) there is apparently no disagreement between MSVC and GCC on how
to pass such a thing by reference
Well, there is an issue between MSVC/CLANGPDB and GCC when passing it
by reference as well (until the PR merges, which perhaps is the state
you are talking about), right, because the call will succeed, it is
just a pointer, but as soon as the other side tries to understand
the structure, it will be a different type and it will interpret it
incorrectly.
it wouldn't be the end of the world to just stick with VA_LIST
for now. But if there is an anticipated need to contribute this to
UEFI in the future, might be better to switch to VA_LIST* (and to
start thinking about how to standardise it across architectures,
including obsolete ones such as IPF or ARM unless we deprecate
those first).
I read section 2.3 of the UEFI spec as saying all UEFI modules must not
pass types larger than native width across protocols. It is debatable
whether the spec there means only UEFI APPLICATION/DRIVERs, but then
a few lines down it says UEFI modules when referring to runtime
services, so I think the intention is all drivers.
Now, this could certainly be viewed as an overreach of the UEFI spec
and that such a statement should be confined to the PI spec, if made
at all, since the UEFI spec generally doesn't define FW -> FW interfaces
(that aren't also used by UEFI APPLICATION/DRIVERs).
There is an effort that Doug is working on to produce an edk2 crypto
binary (https://github.com/tianocore/tianocore-wiki.github.io/pull/8 has
details, though I think that will be split up into two RFCs, with the
binary portion being the second wave). So all of the crypto interfaces
are expected to pass across an ABI (which again in the building up of
this is where we hit it). There is ongoing discussion about if this may
end up in a spec, I'm not sure what the current thinking is.
But overall, I think the difference between passing by value and by
reference here is really just one of efficiency, it being more efficient
to pass by reference than by value for structures, though this is not
a large one. But, unless I'm missing something, the ABI concerns are the
same either way.
TL;DR: I think it is a slightly better choice to pass by reference, but
I don't think the decision is a critical one.
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#121957): https://edk2.groups.io/g/devel/message/121957
Mute This Topic: https://groups.io/mt/119278849/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-