Skip to contentSkip to conversation

Memory Mapped IO devices in a domU

DISCUSSION Matthew Fioravante 2 participants 3 messages Dec 10, 2010

lore
Share & tools
lore
#0 lore raw

How would one pass a memory mapped device to a domU? In particular I'm
trying to pass the TPM to a domU. It is a memory mapped device with 5 pages starting at 0xfed40000.

Currently I'm playing with the memory_op hypercall, using XENMEN_add_to_phys but its failing and I'm currently investigating why. Is this even the right hypercall to use for this? How do I deal with the fact that the device is already mapped into dom0 by default? Do I need to explicitly unmap the pages from dom0 first somehow?

Thanks!

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 3 lines

How would one pass a memory mapped device to a domU? In particular I'm
trying to pass the TPM to a domU. It is a memory mapped device with 5 pages starting at 0xfed40000.

You probably actually want to pass locality 0 through to the guest, which is one page starting at 0xfed40000.

You can do this by adding the relevant mmio passthrough option to the domain config file [I forget the actual name].

The easiest way to ensure you're not using the device in dom0 is just not to load the TPM driver. Alternatively, modify the dom0 driver to use another TPM locality e.g. 1 (the page above).

Ian

Quoted 5 lines

Currently I'm playing with the memory_op hypercall, using XENMEN_add_to_phys but its failing and I'm currently investigating why. Is this even the right hypercall to use for this? How do I deal with the fact that the device is already mapped into dom0 by default? Do I need to explicitly unmap the pages from dom0 first somehow?

#2 lore raw
Quoted 11 lines · Ian Pratt
Quoted 3 lines

How would one pass a memory mapped device to a domU? In particular I'm
trying to pass the TPM to a domU. It is a memory mapped device with 5 pages starting at 0xfed40000.

You probably actually want to pass locality 0 through to the guest, which is one page starting at 0xfed40000.

You can do this by adding the relevant mmio passthrough option to the domain config file [I forget the actual name].

The easiest way to ensure you're not using the device in dom0 is just not to load the TPM driver. Alternatively, modify the dom0 driver to use another TPM locality e.g. 1 (the page above).

Ian

Does such an option even exist? I'm looking through the xm scripts in tools/python and I see options for iports and irqs, but nothing for memory mapped io.

Quoted 7 lines
Quoted 6 lines

Currently I'm playing with the memory_op hypercall, using XENMEN_add_to_phys but its failing and I'm currently investigating why. Is this even the right hypercall to use for this? How do I deal with the fact that the device is already mapped into dom0 by default? Do I need to explicitly unmap the pages from dom0 first somehow?

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel