[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



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"?


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.



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).

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.

Cheers,

--
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.