On Mon, Apr 29, 2024 at 4:13 PM Sean Christopherson <seanjc@xxxxxxxxxx> wrote: > Oh, don't get me wrong, I completely agree that the code isn't straightforward. > But I don't think this is a problem that can be reasonably solved in the caching > code, at least not easily, as a lot of the oddities stem from KVM's memslots, and > KVM's contracts with userspace and the guest. Thanks! I agree with you. It seems using flags to indicate that cross-page cache initialization failed and checking flags on following guest memory read and write also would mess up the code. On the other hand, simply refusing to set up the cross-page cache initialization also would confuse users. I think it is good to check the validity of asserts before using it. Not sure if a brief comment is helpful to it.