All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] libxl: Don't ignore error when we fail to give access to ioport/irq/iomem
@ 2015-01-09 15:56 Julien Grall
  2015-01-09 16:06 ` Wei Liu
  0 siblings, 1 reply; 8+ messages in thread
From: Julien Grall @ 2015-01-09 15:56 UTC (permalink / raw)
  To: xen-devel
  Cc: Wei Liu, Julien Grall, Ian Jackson, Ian Campbell,
	Stefano Stabellini

If we fail to give the access, the domain will unlikely work correctly.
So we should bail out at the first error.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>

---
This patch is candidate for a backport for at least Xen 4.4 and Xen 4.5.

    Changes in v2:
        - Also bail out when libxl fails to give access to iomem
---
 tools/libxl/libxl_create.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 1198225..6f87d1c 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -1167,6 +1167,7 @@ static void domcreate_launch_dm(libxl__egc *egc, libxl__multidev *multidev,
                  "failed give dom%d access to ioports %"PRIx32"-%"PRIx32,
                  domid, io->first, io->first + io->number - 1);
             ret = ERROR_FAIL;
+            goto error_out;
         }
     }
 
@@ -1182,6 +1183,7 @@ static void domcreate_launch_dm(libxl__egc *egc, libxl__multidev *multidev,
         if (ret < 0) {
             LOGE(ERROR, "failed give dom%d access to irq %d", domid, irq);
             ret = ERROR_FAIL;
+            goto error_out;
         }
     }
 
@@ -1198,7 +1200,7 @@ static void domcreate_launch_dm(libxl__egc *egc, libxl__multidev *multidev,
                  "failed give dom%d access to iomem range %"PRIx64"-%"PRIx64,
                  domid, io->start, io->start + io->number - 1);
             ret = ERROR_FAIL;
-            continue;
+            goto error_out;
         }
         ret = xc_domain_memory_mapping(CTX->xch, domid,
                                        io->gfn, io->start,
@@ -1209,6 +1211,7 @@ static void domcreate_launch_dm(libxl__egc *egc, libxl__multidev *multidev,
                  " to guest address %"PRIx64,
                  domid, io->start, io->start + io->number - 1, io->gfn);
             ret = ERROR_FAIL;
+            goto error_out;
         }
     }
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] libxl: Don't ignore error when we fail to give access to ioport/irq/iomem
  2015-01-09 15:56 [PATCH v2] libxl: Don't ignore error when we fail to give access to ioport/irq/iomem Julien Grall
@ 2015-01-09 16:06 ` Wei Liu
  2015-01-12 16:35   ` Ian Campbell
  0 siblings, 1 reply; 8+ messages in thread
From: Wei Liu @ 2015-01-09 16:06 UTC (permalink / raw)
  To: Julien Grall
  Cc: xen-devel, Wei Liu, Ian Jackson, Ian Campbell, Stefano Stabellini

On Fri, Jan 09, 2015 at 03:56:45PM +0000, Julien Grall wrote:
> If we fail to give the access, the domain will unlikely work correctly.
> So we should bail out at the first error.
> 
> Signed-off-by: Julien Grall <julien.grall@linaro.org>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> Cc: Ian Campbell <ian.campbell@citrix.com>

Acked-by: Wei Liu <wei.liu2@citrix.com>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] libxl: Don't ignore error when we fail to give access to ioport/irq/iomem
  2015-01-09 16:06 ` Wei Liu
@ 2015-01-12 16:35   ` Ian Campbell
  2015-01-12 16:36     ` Julien Grall
  2015-01-12 16:38     ` Wei Liu
  0 siblings, 2 replies; 8+ messages in thread
From: Ian Campbell @ 2015-01-12 16:35 UTC (permalink / raw)
  To: Wei Liu; +Cc: xen-devel, Julien Grall, Ian Jackson, Stefano Stabellini

On Fri, 2015-01-09 at 16:06 +0000, Wei Liu wrote:
> On Fri, Jan 09, 2015 at 03:56:45PM +0000, Julien Grall wrote:
> > If we fail to give the access, the domain will unlikely work correctly.
> > So we should bail out at the first error.
> > 
> > Signed-off-by: Julien Grall <julien.grall@linaro.org>
> > Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> > Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > Cc: Ian Campbell <ian.campbell@citrix.com>
> 
> Acked-by: Wei Liu <wei.liu2@citrix.com>

Applied, thanks.

Should this be backported?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] libxl: Don't ignore error when we fail to give access to ioport/irq/iomem
  2015-01-12 16:35   ` Ian Campbell
@ 2015-01-12 16:36     ` Julien Grall
  2015-01-12 16:59       ` Ian Jackson
  2015-01-12 16:38     ` Wei Liu
  1 sibling, 1 reply; 8+ messages in thread
From: Julien Grall @ 2015-01-12 16:36 UTC (permalink / raw)
  To: Ian Campbell, Wei Liu; +Cc: xen-devel, Ian Jackson, Stefano Stabellini

Hi Ian,

On 12/01/15 16:35, Ian Campbell wrote:
> On Fri, 2015-01-09 at 16:06 +0000, Wei Liu wrote:
>> On Fri, Jan 09, 2015 at 03:56:45PM +0000, Julien Grall wrote:
>>> If we fail to give the access, the domain will unlikely work correctly.
>>> So we should bail out at the first error.
>>>
>>> Signed-off-by: Julien Grall <julien.grall@linaro.org>
>>> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
>>> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
>>> Cc: Ian Campbell <ian.campbell@citrix.com>
>>
>> Acked-by: Wei Liu <wei.liu2@citrix.com>
> 
> Applied, thanks.
> 
> Should this be backported?

Yes. But it may not apply directly on Xen 4.4.

Regards,

-- 
Julien Grall

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] libxl: Don't ignore error when we fail to give access to ioport/irq/iomem
  2015-01-12 16:35   ` Ian Campbell
  2015-01-12 16:36     ` Julien Grall
@ 2015-01-12 16:38     ` Wei Liu
  1 sibling, 0 replies; 8+ messages in thread
From: Wei Liu @ 2015-01-12 16:38 UTC (permalink / raw)
  To: Ian Campbell
  Cc: xen-devel, Julien Grall, Wei Liu, Ian Jackson, Stefano Stabellini

On Mon, Jan 12, 2015 at 04:35:19PM +0000, Ian Campbell wrote:
> On Fri, 2015-01-09 at 16:06 +0000, Wei Liu wrote:
> > On Fri, Jan 09, 2015 at 03:56:45PM +0000, Julien Grall wrote:
> > > If we fail to give the access, the domain will unlikely work correctly.
> > > So we should bail out at the first error.
> > > 
> > > Signed-off-by: Julien Grall <julien.grall@linaro.org>
> > > Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> > > Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > > Cc: Ian Campbell <ian.campbell@citrix.com>
> > 
> > Acked-by: Wei Liu <wei.liu2@citrix.com>
> 
> Applied, thanks.
> 
> Should this be backported?
> 

Yes. This should be backported.

Wei.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] libxl: Don't ignore error when we fail to give access to ioport/irq/iomem
  2015-01-12 16:36     ` Julien Grall
@ 2015-01-12 16:59       ` Ian Jackson
  2015-01-12 17:03         ` Julien Grall
  0 siblings, 1 reply; 8+ messages in thread
From: Ian Jackson @ 2015-01-12 16:59 UTC (permalink / raw)
  To: Julien Grall; +Cc: xen-devel, Wei Liu, Ian Campbell, Stefano Stabellini

Julien Grall writes ("Re: [PATCH v2] libxl: Don't ignore error when we fail to give access to ioport/irq/iomem"):
> On 12/01/15 16:35, Ian Campbell wrote:
> > Should this be backported?
> 
> Yes. But it may not apply directly on Xen 4.4.

I have made a note of this.  I will apply it to 4.5 after the release
freeze is over and 4.5 is handed over to stable tree maintenance.

As you suspected, it doesn't apply cleanly to 4.4.  I would welcome a
backport.  If no-one else backports it I will do it myself.

Thanks,
Ian.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] libxl: Don't ignore error when we fail to give access to ioport/irq/iomem
  2015-01-12 16:59       ` Ian Jackson
@ 2015-01-12 17:03         ` Julien Grall
  2015-01-12 17:07           ` Ian Jackson
  0 siblings, 1 reply; 8+ messages in thread
From: Julien Grall @ 2015-01-12 17:03 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel, Wei Liu, Ian Campbell, Stefano Stabellini

Hi Ian,

On 12/01/15 16:59, Ian Jackson wrote:
> Julien Grall writes ("Re: [PATCH v2] libxl: Don't ignore error when we fail to give access to ioport/irq/iomem"):
>> On 12/01/15 16:35, Ian Campbell wrote:
>>> Should this be backported?
>>
>> Yes. But it may not apply directly on Xen 4.4.
> 
> I have made a note of this.  I will apply it to 4.5 after the release
> freeze is over and 4.5 is handed over to stable tree maintenance.
> 
> As you suspected, it doesn't apply cleanly to 4.4.  I would welcome a
> backport.  If no-one else backports it I will do it myself.

I will give a look to provide a backport for Xen 4.4.

Would it useful to have a backport for Xen 4.3?

Regards,

-- 
Julien Grall

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] libxl: Don't ignore error when we fail to give access to ioport/irq/iomem
  2015-01-12 17:03         ` Julien Grall
@ 2015-01-12 17:07           ` Ian Jackson
  0 siblings, 0 replies; 8+ messages in thread
From: Ian Jackson @ 2015-01-12 17:07 UTC (permalink / raw)
  To: Julien Grall; +Cc: xen-devel, Wei Liu, Ian Campbell, Stefano Stabellini

Julien Grall writes ("Re: [PATCH v2] libxl: Don't ignore error when we fail to give access to ioport/irq/iomem"):
> On 12/01/15 16:59, Ian Jackson wrote:
> > As you suspected, it doesn't apply cleanly to 4.4.  I would welcome a
> > backport.  If no-one else backports it I will do it myself.
> 
> I will give a look to provide a backport for Xen 4.4.

Thanks.

> Would it useful to have a backport for Xen 4.3?

Yes.  With luck, though, the 4.4 patch can be cherry-picked onto 4.3.

Ian.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-01-12 17:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-09 15:56 [PATCH v2] libxl: Don't ignore error when we fail to give access to ioport/irq/iomem Julien Grall
2015-01-09 16:06 ` Wei Liu
2015-01-12 16:35   ` Ian Campbell
2015-01-12 16:36     ` Julien Grall
2015-01-12 16:59       ` Ian Jackson
2015-01-12 17:03         ` Julien Grall
2015-01-12 17:07           ` Ian Jackson
2015-01-12 16:38     ` Wei Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.