On 9/16/22 19:12, Sean Christopherson wrote: > On Fri, Sep 16, 2022, Michal Luczaj wrote: >> For example: a race between ioctl(KVM_XEN_HVM_EVTCHN_SEND) and >> kvm_gfn_to_pfn_cache_init() leads to a corrupted shinfo gpc lock. >> >> (thread 1) | (thread 2) >> | >> kvm_xen_set_evtchn_fast | >> read_lock_irqsave(&gpc->lock, ...) | >> | kvm_gfn_to_pfn_cache_init >> | rwlock_init(&gpc->lock) >> read_unlock_irqrestore(&gpc->lock, ...) | >> > > Please explicitly include a sample call stack for reaching kvm_gfn_to_pfn_cache_init(). > Without that, it's difficult to understand if this is a bug in the gfn_to_pfn_cache > code, or if it's a bug in the caller. OK, I'll try to be more specific. > Rather than add another flag, (...) > Let me know if yout want to take on the above cleanups, if not I'll add them to > my todo list. Sure, I'll do it. Thanks for all the suggestions, Michal