Tomas Kouba
2007-Jan-05 14:19 UTC
[Xen-devel] [PATCH][libxc] xc_translate_foreign_address with additional parameter
Hi, I think it would be handy(*) to have additional function xc_translate_foreign_address_cr3 that does the same as xc_translate_foreign_address but with explicit cr3 register. The actual xc_translate_foreign_address takes its cr3 from vcpu context. This is my first patch/post so please excuse me if I misfollowed some procedure. (*) handy for xenaccess library -- Tomas Kouba _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2007-Jan-05 14:36 UTC
Re: [Xen-devel] [PATCH][libxc] xc_translate_foreign_address with additional parameter
On 5/1/07 14:19, "Tomas Kouba" <tomas@jikos.cz> wrote:> I think it would be handy(*) to have additional function > xc_translate_foreign_address_cr3 that does the same as > xc_translate_foreign_address but with explicit cr3 register. > The actual xc_translate_foreign_address takes its cr3 from > vcpu context.Even better would be to accept cr3, cr4 and efer msr. That''s sufficient to work out the execution mode (non-pae, pae, 64-bit). Or the caller could work out the mode and pass it in as an enumeration value (perhaps with a fallback default of ''whatever is most likely''). -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Bryan D. Payne
2007-Jan-05 16:32 UTC
Re: [Xen-devel] [PATCH][libxc] xc_translate_foreign_address with additional parameter
> Even better would be to accept cr3, cr4 and efer msr. That''s > sufficient to > work out the execution mode (non-pae, pae, 64-bit). Or the caller > could workExecution mode is one thing. But the other problem is that sometimes you want to translate a virtual address for a process that is not currently running. In this case, the register values would not hold the correct page table base address and it would be nice to specify your own (e.g., taken from the task struct). -bryan - Bryan D. Payne Graduate Student, Computer Science Georgia Tech Information Security Center http://www.bryanpayne.org _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel