[Skiboot] [PATCH v2 4/5] external/opal-prd: Support manufacturing command HTMGT and attribute override
jk at ozlabs.org
Tue Sep 1 12:22:16 AEST 2015
> I believe it was Ben and I that originally worked this out. The
> thinking was that we only needed to change the version when an existing
> API changed and that we made the structure sufficiently big enough that
> any new function would just show up as a NULL to new firmware.
Without speaking for Ben here, I assume he'd have the intention that we
use up those function pointers.
> Changing the structure size is only a problem if we add 32 functions
> between two levels we need to support. Otherwise, neither side goes
> outside the boundaries of the function.
It's a problem even with <32 functions if we ever do anything to the
struct as a whole (eg., rely on sizeof()).
For example, we need to keep our own copy of the function pointers,
sz = sizeof(struct runtime_interfaces)/sizeof(uint64_t);
s = (uint64_t *)hservice_runtime;
d = (uint64_t *)&hservice_runtime_fixed;
/* Byte swap the function pointers */
for (i = 0; i < sz; i++)
d[i] = be64toh(s[i]);
If our size doesn't match the size of the memory that exists in the
hostboot memory, then we'd potentially access invalid memory.
> At what point is opal-prd considered "released" such that it is in an
> official distribution and will require long-term support? Are we
> already past that point? I am fine with changing our direction at that
> point and starting to reduce the function pointer count as we add new
We're at that point now; opal-prd is on its way into Ubuntu and RHEL.
More information about the Skiboot