openhcl: support MPERF/APERF MSRs in CVMs
These are used to help diagnose performance issues in the guest. In a CVM, the paravisor needs to provide this implementation.
@stephensons2022 Can you please assign this ticket to me.
This is on hold - I'm not convinced we can safely expose this capability to the guest. Guests expect this value to be monotonically increasing, so if we directly return the hypervisor value, that could cause issue in the guest.
That leads to a question that if we must sanitize the access, what should we do? Or if we should fully emulate it?
There's a third point that Linux I believe will query APERF/MPERF on every scheduling quantum if available - that would greatly increase the number of exits which would be not what we want. Handling this exit could be extremely expensive depending on if we need to go to the hypervisor, but even just handling it internally would force a full L2 to L1 exit every access.
It seems like if it needs to be performant, it would have to be provided by the hardware. We're discussing a bit more internally about what to do next.