[RFC PATCH v3 2/5] x86: Support for Static Trampolines

DJ Delorie dj@redhat.com
Mon Feb 1 19:46:09 GMT 2021


"Madhavan T. Venkataraman" <madvenka@linux.microsoft.com> writes:
> Yes. But the problem I ran into is that if libffi is compiled with old
> compilers that have not yet been updated for Intel CET, the builds fail
> because the assembler cannot recognize endbr64 and endbr32.
>
> This happened in CI testing. In the previous version, I had the endbr64 in the code
> like you suggested.

I suggested keeping the __CET_ENDBR macro in, not the endbr64 code itself.

> As for the repeat count, here is the reason.

Yes, I know why we're *using* repeat.  I'm suggesting some clever math
to *calculate* the repeat count, instead of hard-coding it.  That way
the math gives you the most copies per page regardless of whether
__CET_ENDBR is defined or empty.

Of course, you could just use the largest repeate count you'll need, and
ignore any parts of the template that fall past the end of the page.
But you still need to know how many trampolines are usable in that page.



More information about the Libffi-discuss mailing list