 
	
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] arm/mem_access: properly handle traps caused by no-longer current settings
 On 02/08/2016 22:34, Tamas K Lengyel wrote: On Tue, Aug 2, 2016 at 2:02 PM, Julien Grall <julien.grall@xxxxxxx> wrote:Hello Tamas, Thank you for taking care of this bug. On 02/08/2016 19:53, Tamas K Lengyel wrote:When mem_access settings change, the active vCPUs may still cause a violation until the TLB gets flushed. Instead of just reinjecting the violation to the guest, in this patch we direct the vCPU to retry the access where appropriate or we crash the domain where the mem_access settings are corrupted.With this patch p2m_mem_access_check will always return false. So I am not sure why you want to return in p2m_mem_access_check.That's not the case, it returns true if mem_access is not enabled on the domain, which means whatever caused the trap wasn't mem_access and thus we should fall back on the default behavior, which is injecting the fault to the guest. Well, the data abort can only be a permission fault if memaccess is inuse so far. Unless there is another race condition in the memaccess code and in this case this is not the fault of the guest. So sending a data abort to the guest will not really help to know what's going on. Also, you are assuming that it will never be possible in the future to have another usage of the permission fault. By returning false you say "I handled the fault, it is not necessary to hand over to someone else". 
The right thing here is:
        1) Try to handle memaccess
        2) Re-execute the instruction
The instruction will fault again if it was really a permission issue. 
Otherwise it will normally be executed.Regards, -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel 
 
 
 | 
|  | Lists.xenproject.org is hosted with RackSpace, monitoring our |