[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2 1/2] arm/mem_access: adjust check_and_get_page to not rely on current
On 13/12/16 18:41, Julien Grall wrote: > Hi Andrew, > > On 13/12/16 18:28, Andrew Cooper wrote: >> On 12/12/16 23:47, Tamas K Lengyel wrote: >>> >>>> It works on x86 because, IIRC, you do a software page table walking. >>>> Although, I don't think you have particular write/read access >>>> checking on >>>> x86. >>> I don't recall there being any software page walking being involved on >>> x86. Why would that be needed? On x86 we get the guest physical >>> address recorded by the CPU automatically. AFAIK in case the pagetable >>> was unaccessible for the translation of a VA, we would get an event >>> with the pagetable's PA and the type of event that generated it (ie. >>> reading during translation). >> >> x86 provides no mechanism to have hardware translate an address in a >> separate context. Therefore, all translations which are necessary need >> to be done in hardware. > > I guess you meant "need to be done in sofware"? I did. Sorry for the confusion. > >> >> Newer versions of VT-x/SVM may provide additional information on a >> vmexit, which include a guest physical address relevant to the the >> reason for the vmexit. >> >> Xen will attempt to proactively use this information to avoid a software >> pagewalk, but can always fall back to the software method if needs be. > > That is a good idea, but may bring some issue with memacces as we > currently have on ARM. Why would a software-only approach have problem on ARM? Slow certainly, but it should function correctly. > >> >> >> I presume ARM has always relied on hardware support for translation, and >> has no software translation support? I presume therefore that >> translations only work when in current context? > > That's correct. ARM provided hardware support for most of translation > from the start. But it relies on the guest page table to be accessible > (e.g there is no memory restriction in stage-2). Ok, so ARM provides an instruction to translate an arbitrary virtual address to guest physical. How does this work in the context of Xen, or can hardware follow the currently-active virtualisation state to find the guest pagetables? Or does it rely on information in the TLB? > Note that ARM does not provide any hardware instruction to translate > an IPA (guest physical address) to a PA. So we have a walker there. > > We also a walk for debugging guest page table (though only when it is > using LPAE). I guess it could be re-used in the case where it is not > possible to do it in hardware. Although, it would be rewritten to make > it safe. This sounds like the kind of thing which would be generally useful, although I'd like to understand the problem better before making suggestions. ~Andrew _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |