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

Re: [Xen-devel] Xen: ARM: Support for mapping ECAM PCIe Config Space Specified In Static ACPI Table



On Mon, 16 Jan 2017, Julien Grall wrote:
> Hi Stefano,
> 
> On 03/01/17 19:27, Stefano Stabellini wrote:
> > On Wed, 28 Dec 2016, Julien Grall wrote:
> > > On 20/12/16 22:33, Stefano Stabellini wrote:
> > > > On Tue, 20 Dec 2016, Julien Grall wrote:
> > > > > On 20/12/2016 00:54, Stefano Stabellini wrote:
> > > > > > On Mon, 19 Dec 2016, Julien Grall wrote:
> > > > > > > On 16/12/2016 15:49, Julien Grall wrote:
> > > > > > > > On 14/12/16 08:00, Jiandi An wrote:
> > > I disagree here. You make the assumption that DOM0 will always issue the
> > > hypercall with MFN == GFN.
> > > 
> > > Today we only check whether the region is allowed in iomem. If it is not
> > > allowed we will ignore the request and report as "succeeded". But it does
> > > not
> > > mean there will be an emulation behind nor DOM0 decided to map the region
> > > with
> > > MFN != GFN.
> > > 
> > > So DOM0 expects the region to be mapped, but actually it may not be done
> > > by
> > > the hypervisor. It will be a pain to debug it because the error may come
> > > up
> > > much later.
> > > 
> > > The description of the hypercall is "the region is mapped in Stage-2 using
> > > the
> > > memory attribute Device-nGnRE". Nowhere it is stated the region will not
> > > be
> > > mapped if emulated nor must be called MFN == GFN.
> > > 
> > > Now, we have two hypercalls XEN_DOMCTL_memory_mapping and
> > > XENMEM_add_to_physmap_range having two distinct behavior when mapping an
> > > MMIO
> > > into a guest.
> > > 
> > > We should at least return an error, even if DOM0 decides to ignore it.
> > > 
> > > I am open to any other suggestion. But I don't think the hypercall should
> > > silently ignore a request as it is done today.
> > 
> > I agree that assigning clear and unequivocal error codes is a good idea.
> > The error code for "failure to map" should be different from the error
> > code for "this belongs to an emulated device".
> 
> This hypercall is part of the stable ABI. So would it be fine to modify the
> error code?
> 
> This hypercall was introduced in Xen 4.7 and used with ACPI. The current
> behavior of Linux is to print a warning if the error code is not 0 and then
> return success. So previous Linux version would print spurious warning.
> 
> ACPI support for ARM in the hypervisor is still marked as experimental. I
> would like to see it fully supported in Xen 4.9. Before that, I think we
> should fix the hypercall.

The possible error codes for XENMEM_add_to_physmap_range are not clearly
listed. I don't think it would be a problem to add a new one.
Additionally, given that ACPI is still marked as experimental, I think
we have a pretty large degree of freedom in this regard.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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