From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: Device pass through on XEN on ARM Date: Wed, 11 Jun 2014 10:42:33 +0100 Message-ID: <1402479753.9727.6.camel@kazak.uk.xensource.com> References: <3A6586556649FF42BA3240F179473FD11454A64270@HIKAWSEX01.ad.harman.com> <53625DC9.7050704@linaro.org> <1398956164.22521.4.camel@kazak.uk.xensource.com> <3A6586556649FF42BA3240F179473FD114885FF8C1@HIKAWSEX01.ad.harman.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <3A6586556649FF42BA3240F179473FD114885FF8C1@HIKAWSEX01.ad.harman.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "Khandelwal, Shubham" Cc: Julien Grall , xen-devel , "xen-devel@lists.xensource.com" , Arianna Avanzini List-Id: xen-devel@lists.xenproject.org On Wed, 2014-06-11 at 11:16 +0200, Khandelwal, Shubham wrote: > 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, How does it fail? Does it give a fault in the hypervisor or the guest kernel or just silently eat the MMIO writes and not do anything? > 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. 0x4xxxxxxx is a RAM region on 4.5 (see the end of xen/include/public/arch-arm.h), I suspect your mmio mapping is being clobbered by a RAM mapping (and therefore that your answer above is "silently does nothing". Do you need this to be a 1:1 mapping or could you move it to some free space? Most of the low GB is free (but do check arch-arm.h) to be used for MMIO mappings. Ian.