>
> However, it should be safe at least for a subset of those callbacks and

I believe there are very valid use-cases for allowing such usage. For
> example, we are currently working on a plugin API exposing traps. In
> those callbacks, users may want to peek at some registers such as
> "ecause" and "tval" (on RISC-V). We certainly will want to do so for the
> use-case we are pushing that API for.
>
> We could add a QEMU_PLUGIN_CB flag parameter to the respective
> registration functions. But since they are not run from translated
> blocks but _outside_ that context, I feel they would just clutter the
> API without introducing any real benefit. That is, if there is no valid
> safety or correctness concern that I'm not aware of.


This makes sense, I think we could just set QEMU_PLUGIN_CB_RW_REGS for
these callbacks if they're always called in a state where the stated
requirements are met (I think they are). This would avoid breaking
compatibility while maintaining the functionality. Same as you, I looked
around and it seems like the vcpu_(init|idle|exit) locations are definitely
okay, I'll check into the tb_trans callback, I'm not entirely sure about it.

Reply via email to