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

Re: [Xen-devel] Device pass through on XEN on ARM



On 05/01/2014 08:26 PM, Ian Campbell wrote:
> On Thu, 2014-05-01 at 15:44 +0100, Julien Grall wrote:
> > On 04/29/2014 12:35 PM, Khandelwal, Shubham wrote:
> > > Hello,
> > 
> > Hello,
> > 
> > I've dropped the xen-arm list as it has been archived few months ago.
> > 
> > > I would like to understand how is pass through achieved on XEN on ARM
> > > for devices which do not have a PCI bus controller, like for example
> > > embedded devices. Any pointers in this direction will be appreciated.
> > 
> > For the moment, Xen 4.5 doesn't support device passthrough.
>
> People who are using 4.4 have been hardcoding mmio passthrough for
> specific platforms though, essentially by hacking the hypervisor code to
> do whatever magic was needed.
>
> The method is somewhat similar to the platform specific mappings
> callback which allows MMIO regions which are undescribed in the DT to be
> passed to dom0. xgene_storm_specific_mapping() is probably the best
> example.
>
> Essentially you just need to arrange for map_mmio_region() and
> gic_route_irq_to_guest() to be called for the appropriate regions when
> constructing the guest domain. Doing this statically for e.g. dom1 is
> pretty trivial, just hack some calls in somewhere on the domain create
> path with he appropriate checks.
>
> Allowing this to happen for any domain (useful if you want to reboot the
> guest domain) is a bit trickier, I'd probably be inclined to create a
> custom domctl and arrange for it to be called during domain build for
> the appropriate domain.
>
> Obviously this is all very hacky and as Julien says there are various
> things in the pipeline for 4.5 which will allow this to be done
> properly.
>
> Ian.

Hello Ian, Julien,

Just to try out the passthrough using the hacks you mentioned, I made changes 
in xen to assign a GPIO controlled LED to domU by calling map_mmio_regions() in 
the domain creation path. After domU boots, when I try to access the LED using 
ioremap, ioread and iowrite from kernel space I see that I am not able to 
control the LED, also when I try to control LED using sysfs from user space it 
shows 'no such device' error.

I am using xen 4.5 unstable and I have made the following changes in 
xen/common/domctl.c :: do_domctl(), after line 473:



int passthrough = map_mmio_regions(d, 0x4805B000, 0x4805B000 + 0x1000, 
0x4805B000);
if (passthrough)
        printk("Failed to map passthrough_LED @ 0x4805B000 to dom%d\n", 
d->domain_id); 



While booting domU, in the logs I can see there is no error in 
map_mmio_regions(). Am I missing something here.

Thanks and Regards

Shubham Khandelwal
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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