|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [RFC 06/22] xen/arm: traps: Check the P2M before injecting a data/instruction abort
Hi Stefano, On 23/08/16 02:05, Stefano Stabellini wrote: On Thu, 28 Jul 2016, Julien Grall wrote: This is not part of the coding style. We only use the brackets when local variable is defined for a specific case. See vgic-{v2,v3}.c for instance. Note that I am a bit surprised you complain here about the missing brackets but you did not on commit def4273 "xen/arm: traps: MMIO should only be emulated for fault translation" at the beginning of august. + /* + * The PT walk may have failed because someone was playing + * with the Stage-2 page table. Walk the Stage-2 PT to check + * if the entry exists. If it's the case, return to the guest + */ + mfn = p2m_lookup(current->domain, _gfn(paddr_to_pfn(gpa)), NULL); + if ( !mfn_eq(mfn, INVALID_MFN) ) + return;Just checking, but isn't it possible to get a genuine translation abort with an mfn != invalid_mfn? A translation fault means the entry is not present in the page table at the time the processor did the page table walk. This may happen because the hypervisor is modifying the stage-2 page table on another processor (for instance with the break-before-make sequence). p2m_lookup will do a software page walk to get entry. As the function is using a read lock, it will wait until the other processor finishes to update the page tables before doing the lookup. So if the mfn returned is valid, then we know that the translation fault is spurious and should return to the guest to retry the execution of the faulting instruction.
Yes. I will drop it. 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 |