On 12/08/19 22:20, Sean Christopherson wrote:
The refcounting approach seems a bit backwards, and AFAICT is driven by
implementing unhook via a message, which also seems backwards. I assume
hook and unhook are relatively rare events and not performance critical,
so make those the restricted/slow flows, e.g. force userspace to quiesce
the VM by making unhook() mutually exclusive with every vcpu ioctl() and
maybe anything that takes kvm->lock.
The reason for the unhook event, as far as I understand, is because the
introspection appliance can poke int3 into the guest and needs an
opportunity to undo that.
I don't have a big problem with that and the refcounting, at least for
this first iteration---it can be tackled later, once the general event
loop is simplified---however I agree with the other comments that Sean
made. Fortunately it should not be hard to apply them to the whole
patchset with search and replace on the patches themselves.
Paolo