Skip to contentSkip to conversation

mapping virtual address to corresponding shadow page in xen

DISCUSSION Mohamad Rezaei 2 participants 4 messages Dec 24, 2011 – Dec 27, 2011

lore
Share & tools
lore
#0 lore raw

hi,

How can I get corresponding shadowed page number of a virtual address in vm?

Signature · 2 lines
Best Regards,
Mohamad Rezaei
#2 lore raw

My question is when I want to read a data from domain, I use copy_from_guest. but now I want to map that address in domain (guest) to an address inside xen (hypervisor). I need to translate that address. somehow like this: gva -> gpfn -> gmfn -> mfn. To do this I have started a dom0 with dom0_shadow=1 option. So I presume that vtx is enabled for dom0.

Best Regards
Mohamad Rezaei
--------------------
Distributed Systems Research Laboratory
Computer Engineering Department
Iran University of Science and Technology

Quoted 13 lines · Tim Deegan
Quoted 3 lines · Mohamad Rezaei

hi,

How can I get corresponding shadowed page number of a virtual address in vm?

I'm afraid I don't know what you mean.

Please read this: http://wiki.xen.org/wiki/AskingXenDevelQuestions
and try again.

Cheers,

Tim.

#3 lore raw

Hi,

Quoted 6 lines · Mohamad Rezaei

My question is when I want to read a data from domain, I use copy_from_guest. but now I want to map that address in domain (guest) to an address inside xen (hypervisor). I need to translate that address. somehow like this: gva -> gpfn -> gmfn -> mfn. To do this I have started a dom0 with dom0_shadow=1 option. So I presume that vtx is enabled for dom0.

Actually shadow pagetables are quite separate from VT-x (and predate it
- they were originally used for live migratoin of PV guests). So no, dom0_shadow=1 doesn't turn on VT-x for dom0.

Luckily, you don't need VT-x to map a page of dom0 memory (in fact it wouldn't help).

Have a look at mem_event_enable() in xen/arch/x86/mm/mem_event.c - it does exactly wat you need, starting with VA ring_addr and ending with a mapping in med->ring_page.

Cheers,

Tim.