On Mon, Apr 29, 2013 at 3:29 AM, Jan Kiszka <jan.kis...@siemens.com> wrote: > On 2013-04-28 10:32, Jordan Justen wrote: >> On a Linux 3.8.0 based kernel, I occasionally saw a situation >> where the memory region would continue to trap on memory >> read even though KVM_MEM_READONLY was set. > > Only 3.8.0? Did you bisect the issue down to the causing commit? Is it > fixed in later versions?
I'm sorry, I have not tried to bisect, nor have I tried a newer kernel version. Speculating a bit, it seems that a trap to the region might cause the issue. This is what happens in the failing case: * Disable mem region * Trap on access to region * Enable readonly region * Next read access will trap when it shouldn't Here is the what happen with the work-around: * Disable mem region * Trap on access to region * (Re-)disable mem region (work-around adds this) * Enable readonly region * Next read access will not trap (proper behavior) -Jordan