On 11/5/21 9:55 AM, Andrew Cooper wrote:
The current xsm_fixup_ops() is just shy of a full page when compiled, and very
fragile to NULL function pointer errors.

Address both of these issues with a minor piece of structure (ab)use.
Introduce dummy_ops, and fixup the provided xsm_ops pointer by treating both
as an array of unsigned longs.

The compiled size improvement speaks for itself:

   $ ../scripts/bloat-o-meter xen-syms-before xen-syms-after
   add/remove: 1/0 grow/shrink: 0/1 up/down: 712/-3897 (-3185)
   Function                                     old     new   delta
   dummy_ops                                      -     712    +712
   xsm_fixup_ops                               3987      90   -3897

and there is an additional safety check that will make it obvious during
development if there is an issue with the fallback handling.

Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com>
---
CC: Daniel De Graaf <dgde...@tycho.nsa.gov>
CC: Daniel Smith <dpsm...@apertussolutions.com>


Reviewed-by: Daniel P. Smith <dpsm...@apertussolutions.com>


Reply via email to