Skip to contentSkip to conversation

Question on QEMU and P2M

DISCUSSION Wei Huang 2 participants 2 messages Jun 23, 2009 – Jun 24, 2009

lore
Share & tools
lore

Wei Huang

author
#0 lore raw

I am facing a qemu-dm problem when setting up 1GB page table to P2M.

Setting 1GB page table is very straight forward: just skip the last two levels of p2m table. While doing gfn_to_mfn translation, I have to check PSE bits in level 3 page table entry first. If this bit is 1, I calculate the target mfn and return immediately. Two gfn_to_mfn translation functions, p2m_gfn_to_mfn_current() and p2m_gfn_to_mfn(), are changed in this way.

However, QEMU dm starts to function weirdly with this change. For instance, linux guest won't be able to locate hard disk because port IO access returns incorrect values. I couldn't control guest keyboard either.

I am thinking that there are some Xen codes (related to qemu) which doesn't goes through gfn_to_mfn translation inside p2m.c. It might assume p2m table always has L2 P2M table and does fast translation. But I haven't found such areas yet.

Any suggestion of suspicious code areas to look at?

-Wei

#1 lore raw

Wei Huang writes ("[Xen-devel] Question on QEMU and P2M"):

Quoted 1 line

I am facing a qemu-dm problem when setting up 1GB page table to P2M.

...

Quoted 1 line

Any suggestion of suspicious code areas to look at?

This is unlikely to be a problem in qemu-dm; qemu-dm gets told the guest-physical of IO requests addresses by Xen. I would suggest that the starting point would be xen/arch/x86/hvm/io.c and its subroutines and callers. That's the place where the IO requests are collected and sent on to the device model (ie, qemu-dm).

Ian.