Re: Questions on HPMs
On Fri, Oct 29, 2021 at 9:13 AM Beeman Strong <beeman@...> wrote:
Exactly. Even if the after-effect of an instruction is to establish a new execution context for the target or next instruction, the instruction itself is considered as being fetched/decoded/executed in its starting context (privilege mode, translation context, etc.).
Agreed. For some events this would be straightforward; for others it will be fuzzier or not possible. There are many types of uarch events that are hard or not possible to clearly associate with a causative instruction and hence a PL (or even with just a causative PL for some types of events).
ARM and its attempt at standardizing arch (and uarch) events explicitly acknowledges that there are ones that cannot be required across all implementations to be non-speculative - and hence ARM allows an implementation to implement either a speculative or non-speculative version of the defined event.