[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Pass-through on Arndale 5250

On Tue, 2016-02-02 at 08:37 -0600, xen sandberg wrote:
> I followed this guide:
> Â http://ssup2.iptime.org/wiki/Xen_4.5.0_on_Arndale
> to get xen installed on the arndale 5250 with an ubuntu Dom0 and I am
> able to create guests without problems.

Did you install something newer than 4.5.0? I'd highly recommend at least
4.6 for ARM, especially with passthrough.

I should also say upfront that platform device passthrough for ARM is not
for the faint hearted and you will need a pretty good familiarity with the
h/w in question as well as topics such as device tree syntax, semantics and
the bindings for the devices you are using as well as the ARM GIC
architecture (SPIs vs PPIs etc).

I should also further point out that the Arndale lacks SMMU hardware (I/O
virtualisation support). Therefore you cannot passthrough any device which
does DMA and there may be caveats even for devices which do not. I have not
looked to see if the USB controller on Arndale does DMA -- but I expect it
probably does. You should certainly confirm this before going any further
because if the controller does DMA then what you are trying to do is
essentially impossible with this hardware.

> ======================
> Details of what I tried:
> I get the error:
> libxl: error: libxl_arm.c:604:check_partial_fdt: Partial FDT is not a
> valid Flat Device Tree

I'll cover this below.

> libxl: error: libxl_dom.c:710:libxl__build_pv:
> libxl__arch_domain_init_hw_description failed: No such file or directory

This seems to correspond to the file named as your ramdisk in the guest cfg
not existing. Full logs with "xl -vvv create ..." would be useful for
diagnosing this sort of thing.

> I found that there was not a separate entry for the ethernet port under
> /proc/device-tree as there was in the example. Instead the port seems
> to be viewed as just a usb device and is given a random new mac address
> at each boot time.

Yes, Ethernet on Arndale is provided by a USB device. Since USB is a
"discoverable bus" only the root controller is described in DT and thus the
root controller is the only thing you can try to passthrough.

> Â I set it for pass-through by adding:
> fdt set /usb@12110000 status disabled
> fdt set /usb@12110000 xen,passthrough
> to my u-boot startup image. This disabled all of the usb ports and the
> ethernet port on the board but that is acceptable to me as long as it is
> a workable option to pass them all through to a DomU.
> Then using the example as a template it looked like the values for
> 'compatible' and 'interrupts' would be copied to the partial device tree
> so I ran:

You can use "dtc -I fd /proc/device-tree" to get the DTS from the running
system. Of course you also ought to have the source in your kernel build
tree somewhere.

> ÂÂÂ passthrough {
> ÂÂÂÂÂÂÂ compatible = "simple-bus";
> ÂÂÂÂÂÂÂ ranges;
> ÂÂÂÂÂÂÂ #address-cells = <2>;
> ÂÂÂÂÂÂÂ #size-cells = <2>;
> ÂÂÂ usb: usb@10000000 {
> ÂÂÂÂÂÂÂ compatible = "samsung,exynos42";

This looks truncated and/or wrong, it needs to be the compatible string
associated with the particular USB controller, which looks to be one of
"samsung,exynos5250-dwusb3", "samsung,exynos4210-ehci" or
"samsung,exynos4210-ohci" depending on which controller this is.

> ÂÂÂÂÂÂÂ reg = <0 0x10000000 0 0x1000>;
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ interrupts = <0 47 0>;
> ÂÂÂ };
> ÂÂÂ };
> };
> and compiled it with:
> dtc guest-midway.dts > guest-midway.dtb
> BTW: The pdf said to get the value for reg I would need to find a hole
> in the guest layout defined in xen/include/public/arch-arm.h. I checked
> out RELEASE-4.6.0 for my build and I found that file but couldn't figure
> out how to use the file to find a hole, an example would be much
> appreciated.

Towards the end of arch-arm.h you will find a section "Virtual machine
platform (memory layout, interrupts)" which defines the memory layout seen
by guests, in the form of various GUEST_FOO_{BASE,SIZE} defines.

You need to find a suitable hole not covered by any of those which is large
enough to contain the device which you are passing through.

> I then added the following to the DomU config file:
> device_tree = "/root/guest-midway.dtb"

Does this path correspond to where the dtc command above wrote to?

What does "file /root/guest-midway.dtb" say?

> dtdev = [ "/usb@12110000" ]
> irqs = [ 112, 113, 114 ]

These need to match the interrupts property in the partial device tree. You
will probably need to read up on device tree semantics in order to make
progress here. In particular the interrupt property for a device connected
to a ÂGIC interrupt controller is documented in
linux/Documentation/devicetree/bindings/interrupt-controller/arm and the DT
property must follow the correct syntax.

> iomem = [ "0x12110000,1@0x10000" ]

And the @0x10000 needs to correspond with the region defined in the partial
device tree's reg property. You need the size to match also.

> and thought perhaps I would need to use numbers 103 and 104 as they are
> the only usb devices in the list but I didn't know if I was on the right
> track.

Those are likely the correct IRQ numbers (so what is used in the guest
cfg). However the DT (as described in the binding doc referenced above)
needs the SPI number, which means it is offset by -32.


Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.