From: Shriram Rajagopalan Subject: Accessing Dom0 Physical memory from xen, via direct mappings (PML4:262-271) Date: Tue, 13 Mar 2012 08:45:58 -0700 Message-ID: <02FF9937-5F09-4CB1-93ED-A55FCC6F625C@cs.ubc.ca> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org In config.h (include/asm-x86/config.h) I found this: #if __x86_64__ ... * 0xffff830000000000 - 0xffff87ffffffffff [5TB, 5*2^40 bytes, PML4:262-271] * 1:1 direct mapping of all physical memory. ... I was wondering if it's possible for dom0 to malloc a huge chunk of memory and let xen know the starting address of this range. Inside xen, I can translate dom0 virt address to a virt address in the above range and access the entire chunk via these virtual addresses. The catch here is that I want this virtual address range to be accessible across all vcpu contexts in xen (whether it's servicing a hypercall from dom0 or a vmx fault caused by Guest). So far, I have only been able to achieve the former. In the latter case, where the "current" vcpu belongs to a guest (eg in a vmx fault handler), I can't access this address range inside xen. Do I have to add EPT mappings to guest's p2m to do this ? Or can I do something else ? thanks shriram