All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen/tools: Introduce QNX IFS loader
@ 2014-08-19 15:51 Oleksandr Tyshchenko
  2014-08-19 16:13 ` Andrew Cooper
  2014-08-19 16:41 ` Julien Grall
  0 siblings, 2 replies; 16+ messages in thread
From: Oleksandr Tyshchenko @ 2014-08-19 15:51 UTC (permalink / raw
  To: xen-devel, julien.grall, ian.campbell, stefano.stabellini, tim

Add ability to load QNX IFS image. Based on IPL code (U-Boot for QNX).

Signed-off-by: Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
---
 tools/libxc/Makefile              |   1 +
 tools/libxc/xc_dom_qnxifsloader.c | 189 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 190 insertions(+)
 create mode 100644 tools/libxc/xc_dom_qnxifsloader.c

diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index 22eef8e..812cc7e 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -67,6 +67,7 @@ GUEST_SRCS-y                 += xc_dom_elfloader.c
 GUEST_SRCS-$(CONFIG_X86)     += xc_dom_bzimageloader.c
 GUEST_SRCS-$(CONFIG_X86)     += xc_dom_decompress_lz4.c
 GUEST_SRCS-$(CONFIG_ARM)     += xc_dom_armzimageloader.c
+GUEST_SRCS-$(CONFIG_ARM)     += xc_dom_qnxifsloader.c
 GUEST_SRCS-y                 += xc_dom_binloader.c
 GUEST_SRCS-y                 += xc_dom_compat_linux.c
 
diff --git a/tools/libxc/xc_dom_qnxifsloader.c b/tools/libxc/xc_dom_qnxifsloader.c
new file mode 100644
index 0000000..45d007d
--- /dev/null
+++ b/tools/libxc/xc_dom_qnxifsloader.c
@@ -0,0 +1,189 @@
+/*
+ * Xen domain builder -- QNX IFS bits
+ *
+ * Parse and load QNX IFS image.
+ *
+ * Copyright (C) 2014, Globallogic.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"). You
+ * may not reproduce, modify or distribute this software except in
+ * compliance with the License. You may obtain a copy of the License
+ * at: http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OF ANY KIND, either express or implied.
+ *
+ * This file may contain contributions from others, either as
+ * contributors under the License or as licensors under other terms.
+ * Please review this entire file for other proprietary rights or license
+ * notices, as well as the QNX Development Suite License Guide at
+ * http://licensing.qnx.com/license-guide/ for other information.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <inttypes.h>
+
+#include "xg_private.h"
+#include "xc_dom.h"
+
+struct startup_header {
+    uint32_t signature;        /* Header sig */
+    uint16_t version;          /* Header vers */
+    uint8_t flags1;            /* Misc flags */
+    uint8_t flags2;            /* No flags defined yet */
+    uint16_t header_size;      /* sizeof(struct startup_header) */
+    uint16_t machine;          /* Machine type */
+    uint32_t startup_vaddr;    /* Virtual Address to transfer */
+                               /* to after IPL is done */
+    uint32_t paddr_bias;       /* Value to add to physical address */
+                               /* to get a value to put into a */
+                               /* pointer and indirected through */
+    uint32_t image_paddr;      /* Physical address of image */
+    uint32_t ram_paddr;        /* Physical address of RAM to copy */
+                               /* image to (startup_size bytes copied) */
+    uint32_t ram_size;         /* Amount of RAM used by the startup */
+                               /* program and executables contained */
+                               /* in the file system */
+    uint32_t startup_size;     /* Size of startup (never compressed) */
+    uint32_t stored_size;      /* Size of entire image */
+    uint32_t imagefs_paddr;    /* Set by IPL to where the imagefs is */
+                               /* when startup runs */
+    uint32_t imagefs_size;     /* Size of uncompressed imagefs */
+    uint16_t preboot_size;     /* Size of loaded before header */
+    uint16_t zero0;            /* Zeros */
+    uint32_t zero[3];          /* Zeros */
+    uint32_t info[48];         /* Array of startup_info* structures */
+};
+
+#define STARTUP_HDR_SIGNATURE    0x00ff7eeb
+
+static uint32_t image_addr;
+
+static uint32_t image_scan(uint32_t start_addr, uint32_t end_addr)
+{
+    struct startup_header *startup_hdr;
+    uint32_t last_addr = 0xffffffff;
+
+    for (; start_addr < end_addr; start_addr += 4)
+    {
+        startup_hdr = (struct startup_header *)start_addr;
+        if ( (startup_hdr->header_size == sizeof(struct startup_header)) &&
+             (startup_hdr->signature == STARTUP_HDR_SIGNATURE) )
+        {
+            last_addr = start_addr;
+            break;
+        }
+    }
+
+    return last_addr;
+}
+
+static int xc_dom_probe_qnx_ifs(struct xc_dom_image *dom)
+{
+    struct startup_header *startup_hdr;
+
+    if ( dom->kernel_blob == NULL )
+    {
+        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                     "%s: no QNX IFS loaded", __FUNCTION__);
+        return -EINVAL;
+    }
+
+    image_addr = *(uint32_t *)&dom->kernel_blob;
+    image_addr = image_scan(image_addr, image_addr + 0x200);
+    if (image_addr == 0xffffffff)
+    {
+        xc_dom_printf(dom->xch, "%s: image is not a QNX IFS", __FUNCTION__);
+        return -EINVAL;
+    }
+
+    startup_hdr = (struct startup_header *)image_addr;
+    if ( (startup_hdr->stored_size + startup_hdr->preboot_size) != dom->kernel_size )
+    {
+        xc_dom_printf(dom->xch, "%s: QNX IFS has wrong size", __FUNCTION__);
+        return -EINVAL;
+    }
+
+    return 0;
+}
+
+static int xc_dom_parse_qnx_ifs(struct xc_dom_image *dom)
+{
+    struct startup_header *startup_hdr;
+    uint64_t v_start, v_end;
+    uint64_t rambase = GUEST_RAM_BASE;
+
+    DOMPRINTF_CALLED(dom->xch);
+
+    startup_hdr = (struct startup_header *)image_addr;
+
+    dom->rambase_pfn = rambase >> XC_PAGE_SHIFT;
+
+    /* Do not load kernel at the very first RAM address */
+    v_start = rambase + 0x8000;
+    v_end = v_start + dom->kernel_size;
+
+    /* find kernel segment */
+    dom->kernel_seg.vstart = v_start;
+    dom->kernel_seg.vend   = v_end;
+
+    dom->parms.virt_entry = startup_hdr->startup_vaddr;
+    dom->parms.virt_base = rambase;
+
+    dom->guest_type = "xen-3.0-armv7l";
+    DOMPRINTF("%s: %s: RAM starts at %"PRI_xen_pfn,
+              __FUNCTION__, dom->guest_type, dom->rambase_pfn);
+    DOMPRINTF("%s: %s: 0x%" PRIx64 " -> 0x%" PRIx64 "",
+              __FUNCTION__, dom->guest_type,
+              dom->kernel_seg.vstart, dom->kernel_seg.vend);
+
+    return 0;
+}
+
+static int xc_dom_load_qnx_ifs(struct xc_dom_image *dom)
+{
+    void *dst;
+
+    DOMPRINTF_CALLED(dom->xch);
+
+    dst = xc_dom_seg_to_ptr(dom, &dom->kernel_seg);
+    if ( dst == NULL )
+    {
+        DOMPRINTF("%s: xc_dom_seg_to_ptr(dom, &dom->kernel_seg) => NULL",
+                  __func__);
+        return -1;
+    }
+
+    DOMPRINTF("%s: kernel seg %#"PRIx64"-%#"PRIx64,
+              __func__, dom->kernel_seg.vstart, dom->kernel_seg.vend);
+    DOMPRINTF("%s: copy %zd bytes from blob %p to dst %p",
+              __func__, dom->kernel_size, dom->kernel_blob, dst);
+
+    memcpy(dst, dom->kernel_blob, dom->kernel_size);
+
+    return 0;
+}
+
+static struct xc_dom_loader qnx_ifs_loader = {
+    .name = "QNX IFS",
+    .probe = xc_dom_probe_qnx_ifs,
+    .parser = xc_dom_parse_qnx_ifs,
+    .loader = xc_dom_load_qnx_ifs,
+};
+
+static void __init register_loader(void)
+{
+    xc_dom_register_loader(&qnx_ifs_loader);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
-- 
1.9.1

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

* Re: [PATCH] xen/tools: Introduce QNX IFS loader
  2014-08-19 15:51 [PATCH] xen/tools: Introduce QNX IFS loader Oleksandr Tyshchenko
@ 2014-08-19 16:13 ` Andrew Cooper
  2014-08-19 16:26   ` Dario Faggioli
  2014-08-19 16:41 ` Julien Grall
  1 sibling, 1 reply; 16+ messages in thread
From: Andrew Cooper @ 2014-08-19 16:13 UTC (permalink / raw
  To: Oleksandr Tyshchenko, xen-devel, julien.grall, ian.campbell,
	stefano.stabellini, tim

On 19/08/14 16:51, Oleksandr Tyshchenko wrote:
> Add ability to load QNX IFS image. Based on IPL code (U-Boot for QNX).
>
> Signed-off-by: Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
> ---
>  tools/libxc/Makefile              |   1 +
>  tools/libxc/xc_dom_qnxifsloader.c | 189 ++++++++++++++++++++++++++++++++++++++
>  2 files changed, 190 insertions(+)
>  create mode 100644 tools/libxc/xc_dom_qnxifsloader.c
>
> diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
> index 22eef8e..812cc7e 100644
> --- a/tools/libxc/Makefile
> +++ b/tools/libxc/Makefile
> @@ -67,6 +67,7 @@ GUEST_SRCS-y                 += xc_dom_elfloader.c
>  GUEST_SRCS-$(CONFIG_X86)     += xc_dom_bzimageloader.c
>  GUEST_SRCS-$(CONFIG_X86)     += xc_dom_decompress_lz4.c
>  GUEST_SRCS-$(CONFIG_ARM)     += xc_dom_armzimageloader.c
> +GUEST_SRCS-$(CONFIG_ARM)     += xc_dom_qnxifsloader.c
>  GUEST_SRCS-y                 += xc_dom_binloader.c
>  GUEST_SRCS-y                 += xc_dom_compat_linux.c
>  
> diff --git a/tools/libxc/xc_dom_qnxifsloader.c b/tools/libxc/xc_dom_qnxifsloader.c
> new file mode 100644
> index 0000000..45d007d
> --- /dev/null
> +++ b/tools/libxc/xc_dom_qnxifsloader.c
> @@ -0,0 +1,189 @@
> +/*
> + * Xen domain builder -- QNX IFS bits
> + *
> + * Parse and load QNX IFS image.
> + *
> + * Copyright (C) 2014, Globallogic.
> + *
> + * Licensed under the Apache License, Version 2.0 (the "License"). You
> + * may not reproduce, modify or distribute this software except in
> + * compliance with the License. You may obtain a copy of the License
> + * at: http://www.apache.org/licenses/LICENSE-2.0
> + *
> + * Unless required by applicable law or agreed to in writing, software
> + * distributed under the License is distributed on an "AS IS" basis,
> + * WITHOUT WARRANTIES OF ANY KIND, either express or implied.
> + *
> + * This file may contain contributions from others, either as
> + * contributors under the License or as licensors under other terms.
> + * Please review this entire file for other proprietary rights or license
> + * notices, as well as the QNX Development Suite License Guide at
> + * http://licensing.qnx.com/license-guide/ for other information.
> + */

The rest of libxc is licensed under GPLv2.1, which is incompatible with
Apache 2.0

IANAL, but I don't believe this can be accepted in its current form.

~Andrew

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

* Re: [PATCH] xen/tools: Introduce QNX IFS loader
  2014-08-19 16:13 ` Andrew Cooper
@ 2014-08-19 16:26   ` Dario Faggioli
  2014-08-20  4:09     ` Lars Kurth
  0 siblings, 1 reply; 16+ messages in thread
From: Dario Faggioli @ 2014-08-19 16:26 UTC (permalink / raw
  To: Andrew Cooper
  Cc: Lars Kurth, ian.campbell, stefano.stabellini, julien.grall, tim,
	xen-devel, Oleksandr Tyshchenko


[-- Attachment #1.1: Type: text/plain, Size: 3057 bytes --]

[Adding Lars, as he may be of help with licensing things]

On mar, 2014-08-19 at 17:13 +0100, Andrew Cooper wrote:
> On 19/08/14 16:51, Oleksandr Tyshchenko wrote:
> > Add ability to load QNX IFS image. Based on IPL code (U-Boot for QNX).
> >
> > Signed-off-by: Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
> > ---
> >  tools/libxc/Makefile              |   1 +
> >  tools/libxc/xc_dom_qnxifsloader.c | 189 ++++++++++++++++++++++++++++++++++++++
> >  2 files changed, 190 insertions(+)
> >  create mode 100644 tools/libxc/xc_dom_qnxifsloader.c
> >
> > diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
> > index 22eef8e..812cc7e 100644
> > --- a/tools/libxc/Makefile
> > +++ b/tools/libxc/Makefile
> > @@ -67,6 +67,7 @@ GUEST_SRCS-y                 += xc_dom_elfloader.c
> >  GUEST_SRCS-$(CONFIG_X86)     += xc_dom_bzimageloader.c
> >  GUEST_SRCS-$(CONFIG_X86)     += xc_dom_decompress_lz4.c
> >  GUEST_SRCS-$(CONFIG_ARM)     += xc_dom_armzimageloader.c
> > +GUEST_SRCS-$(CONFIG_ARM)     += xc_dom_qnxifsloader.c
> >  GUEST_SRCS-y                 += xc_dom_binloader.c
> >  GUEST_SRCS-y                 += xc_dom_compat_linux.c
> >  
> > diff --git a/tools/libxc/xc_dom_qnxifsloader.c b/tools/libxc/xc_dom_qnxifsloader.c
> > new file mode 100644
> > index 0000000..45d007d
> > --- /dev/null
> > +++ b/tools/libxc/xc_dom_qnxifsloader.c
> > @@ -0,0 +1,189 @@
> > +/*
> > + * Xen domain builder -- QNX IFS bits
> > + *
> > + * Parse and load QNX IFS image.
> > + *
> > + * Copyright (C) 2014, Globallogic.
> > + *
> > + * Licensed under the Apache License, Version 2.0 (the "License"). You
> > + * may not reproduce, modify or distribute this software except in
> > + * compliance with the License. You may obtain a copy of the License
> > + * at: http://www.apache.org/licenses/LICENSE-2.0
> > + *
> > + * Unless required by applicable law or agreed to in writing, software
> > + * distributed under the License is distributed on an "AS IS" basis,
> > + * WITHOUT WARRANTIES OF ANY KIND, either express or implied.
> > + *
> > + * This file may contain contributions from others, either as
> > + * contributors under the License or as licensors under other terms.
> > + * Please review this entire file for other proprietary rights or license
> > + * notices, as well as the QNX Development Suite License Guide at
> > + * http://licensing.qnx.com/license-guide/ for other information.
> > + */
> 
> The rest of libxc is licensed under GPLv2.1, which is incompatible with
> Apache 2.0
> 
> IANAL, but I don't believe this can be accepted in its current form.
> 
> ~Andrew
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

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

* Re: [PATCH] xen/tools: Introduce QNX IFS loader
  2014-08-19 15:51 [PATCH] xen/tools: Introduce QNX IFS loader Oleksandr Tyshchenko
  2014-08-19 16:13 ` Andrew Cooper
@ 2014-08-19 16:41 ` Julien Grall
  2014-08-20 11:10   ` Oleksandr Tyshchenko
  2014-08-20 13:00   ` Oleksandr Tyshchenko
  1 sibling, 2 replies; 16+ messages in thread
From: Julien Grall @ 2014-08-19 16:41 UTC (permalink / raw
  To: Oleksandr Tyshchenko, xen-devel, ian.campbell, stefano.stabellini,
	tim

Hi Oleksandr,

Thank you for your patch.

On 19/08/14 10:51, Oleksandr Tyshchenko wrote:
> Add ability to load QNX IFS image. Based on IPL code (U-Boot for QNX).

Do you have any link to the IPL code? Such as commit ID...

Also, is there any website to explain the QNX IFS image?

[..]

> diff --git a/tools/libxc/xc_dom_qnxifsloader.c b/tools/libxc/xc_dom_qnxifsloader.c

[..]

> +static uint32_t image_addr;

All the below functions can be called concurrently for different 
domains. I would add a new field in xc_dom_image.

> +static uint32_t image_scan(uint32_t start_addr, uint32_t end_addr)
> +{
> +    struct startup_header *startup_hdr;
> +    uint32_t last_addr = 0xffffffff;
> +
> +    for (; start_addr < end_addr; start_addr += 4)

Coding style:

for ( ... )

> +    {
> +        startup_hdr = (struct startup_header *)start_addr;

AFAIU, QNX loader is only for 32 bits guest, right?

You are casting on multiple place 32 bits address to a pointer. This 
won't work on ARM64. Even though you are targeting 32 bits, you still 
have to make this code working on ARM64.

[..]

> +static int xc_dom_probe_qnx_ifs(struct xc_dom_image *dom)
> +{
> +    struct startup_header *startup_hdr;
> +
> +    if ( dom->kernel_blob == NULL )
> +    {
> +        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
> +                     "%s: no QNX IFS loaded", __FUNCTION__);
> +        return -EINVAL;
> +    }
> +
> +    image_addr = *(uint32_t *)&dom->kernel_blob;
> +    image_addr = image_scan(image_addr, image_addr + 0x200);
> +    if (image_addr == 0xffffffff)

Coding style:

if ( ... )

Regards,

-- 
Julien Grall

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

* Re: [PATCH] xen/tools: Introduce QNX IFS loader
  2014-08-19 16:26   ` Dario Faggioli
@ 2014-08-20  4:09     ` Lars Kurth
  2014-08-20 10:07       ` Artem Mygaiev
  2014-08-20 10:20       ` Oleksandr Tyshchenko
  0 siblings, 2 replies; 16+ messages in thread
From: Lars Kurth @ 2014-08-20  4:09 UTC (permalink / raw
  To: Dario Faggioli, Andrew Cooper
  Cc: Ian Campbell, Brian Warner, julien.grall@linaro.org,
	Tim (Xen.org), xen-devel@lists.xen.org, Oleksandr Tyshchenko,
	Stefano Stabellini



On 19/08/2014 11:26, "Dario Faggioli" <dario.faggioli@citrix.com> wrote:

>[Adding Lars, as he may be of help with licensing things]
>
>On mar, 2014-08-19 at 17:13 +0100, Andrew Cooper wrote:
>> On 19/08/14 16:51, Oleksandr Tyshchenko wrote:
>> > Add ability to load QNX IFS image. Based on IPL code (U-Boot for QNX).
>> >
>> > Signed-off-by: Oleksandr Tyshchenko
>><oleksandr.tyshchenko@globallogic.com>
>> > ---
>> >  tools/libxc/Makefile              |   1 +
>> >  tools/libxc/xc_dom_qnxifsloader.c | 189
>>++++++++++++++++++++++++++++++++++++++
>> >  2 files changed, 190 insertions(+)
>> >  create mode 100644 tools/libxc/xc_dom_qnxifsloader.c
>> >
>> > diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
>> > index 22eef8e..812cc7e 100644
>> > --- a/tools/libxc/Makefile
>> > +++ b/tools/libxc/Makefile
>> > @@ -67,6 +67,7 @@ GUEST_SRCS-y                 += xc_dom_elfloader.c
>> >  GUEST_SRCS-$(CONFIG_X86)     += xc_dom_bzimageloader.c
>> >  GUEST_SRCS-$(CONFIG_X86)     += xc_dom_decompress_lz4.c
>> >  GUEST_SRCS-$(CONFIG_ARM)     += xc_dom_armzimageloader.c
>> > +GUEST_SRCS-$(CONFIG_ARM)     += xc_dom_qnxifsloader.c
>> >  GUEST_SRCS-y                 += xc_dom_binloader.c
>> >  GUEST_SRCS-y                 += xc_dom_compat_linux.c
>> >  
>> > diff --git a/tools/libxc/xc_dom_qnxifsloader.c
>>b/tools/libxc/xc_dom_qnxifsloader.c
>> > new file mode 100644
>> > index 0000000..45d007d
>> > --- /dev/null
>> > +++ b/tools/libxc/xc_dom_qnxifsloader.c
>> > @@ -0,0 +1,189 @@
>> > +/*
>> > + * Xen domain builder -- QNX IFS bits
>> > + *
>> > + * Parse and load QNX IFS image.
>> > + *
>> > + * Copyright (C) 2014, Globallogic.
>> > + *
>> > + * Licensed under the Apache License, Version 2.0 (the "License").
>>You
>> > + * may not reproduce, modify or distribute this software except in
>> > + * compliance with the License. You may obtain a copy of the License
>> > + * at: http://www.apache.org/licenses/LICENSE-2.0
>> > + *
>> > + * Unless required by applicable law or agreed to in writing,
>>software
>> > + * distributed under the License is distributed on an "AS IS" basis,
>> > + * WITHOUT WARRANTIES OF ANY KIND, either express or implied.
>> > + *
>> > + * This file may contain contributions from others, either as
>> > + * contributors under the License or as licensors under other terms.
>> > + * Please review this entire file for other proprietary rights or
>>license
>> > + * notices, as well as the QNX Development Suite License Guide at
>> > + * http://licensing.qnx.com/license-guide/ for other information.
>> > + */
>> 
>> The rest of libxc is licensed under GPLv2.1, which is incompatible with
>> Apache 2.0

That is correct. 

The question is whether this code needs to be Apache 2.0. My understanding
was that the QNX recommendation is that a base port of QNX (aka the
drivers) are recommended to be Apache 2. But it is not clear to me whether
the boot loader needs to be. I don¹t have enough context and can¹t find
any reference to the file system itself in the license guide.

I do not know enough about the subtleties of licenses here and am adding
Brian, in case we need to get some more advice on how to mitigate this
issue.

@Oleksandr, can you also check with your legal guys?

Regards
Lars

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

* Re: [PATCH] xen/tools: Introduce QNX IFS loader
  2014-08-20  4:09     ` Lars Kurth
@ 2014-08-20 10:07       ` Artem Mygaiev
  2014-08-20 10:11         ` Dario Faggioli
  2014-08-20 10:20       ` Oleksandr Tyshchenko
  1 sibling, 1 reply; 16+ messages in thread
From: Artem Mygaiev @ 2014-08-20 10:07 UTC (permalink / raw
  To: Lars Kurth
  Cc: Ian Campbell, Andrew Cooper, Dario Faggioli,
	julien.grall@linaro.org, Tim (Xen.org), xen-devel@lists.xen.org,
	Oleksandr Tyshchenko, Stefano Stabellini, Brian Warner

Lars, let me comment here. Apache 2 license is used on reference
loader supplied by QNX to allow re-use code of the reference
implementation, so it is OK to stick to it here.

Artem Mygaiev | Associate Vice President, Engineering
GlobalLogic
P +380.44.4929695 ext.2023 M +380.67.9211131 S rosenkrantzguildenstern
www.globallogic.com
http://www.globallogic.com/email_disclaimer.txt


On Wed, Aug 20, 2014 at 7:09 AM, Lars Kurth <lars.kurth@citrix.com> wrote:
>
>
> On 19/08/2014 11:26, "Dario Faggioli" <dario.faggioli@citrix.com> wrote:
>
>>[Adding Lars, as he may be of help with licensing things]
>>
>>On mar, 2014-08-19 at 17:13 +0100, Andrew Cooper wrote:
>>> On 19/08/14 16:51, Oleksandr Tyshchenko wrote:
>>> > Add ability to load QNX IFS image. Based on IPL code (U-Boot for QNX).
>>> >
>>> > Signed-off-by: Oleksandr Tyshchenko
>>><oleksandr.tyshchenko@globallogic.com>
>>> > ---
>>> >  tools/libxc/Makefile              |   1 +
>>> >  tools/libxc/xc_dom_qnxifsloader.c | 189
>>>++++++++++++++++++++++++++++++++++++++
>>> >  2 files changed, 190 insertions(+)
>>> >  create mode 100644 tools/libxc/xc_dom_qnxifsloader.c
>>> >
>>> > diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
>>> > index 22eef8e..812cc7e 100644
>>> > --- a/tools/libxc/Makefile
>>> > +++ b/tools/libxc/Makefile
>>> > @@ -67,6 +67,7 @@ GUEST_SRCS-y                 += xc_dom_elfloader.c
>>> >  GUEST_SRCS-$(CONFIG_X86)     += xc_dom_bzimageloader.c
>>> >  GUEST_SRCS-$(CONFIG_X86)     += xc_dom_decompress_lz4.c
>>> >  GUEST_SRCS-$(CONFIG_ARM)     += xc_dom_armzimageloader.c
>>> > +GUEST_SRCS-$(CONFIG_ARM)     += xc_dom_qnxifsloader.c
>>> >  GUEST_SRCS-y                 += xc_dom_binloader.c
>>> >  GUEST_SRCS-y                 += xc_dom_compat_linux.c
>>> >
>>> > diff --git a/tools/libxc/xc_dom_qnxifsloader.c
>>>b/tools/libxc/xc_dom_qnxifsloader.c
>>> > new file mode 100644
>>> > index 0000000..45d007d
>>> > --- /dev/null
>>> > +++ b/tools/libxc/xc_dom_qnxifsloader.c
>>> > @@ -0,0 +1,189 @@
>>> > +/*
>>> > + * Xen domain builder -- QNX IFS bits
>>> > + *
>>> > + * Parse and load QNX IFS image.
>>> > + *
>>> > + * Copyright (C) 2014, Globallogic.
>>> > + *
>>> > + * Licensed under the Apache License, Version 2.0 (the "License").
>>>You
>>> > + * may not reproduce, modify or distribute this software except in
>>> > + * compliance with the License. You may obtain a copy of the License
>>> > + * at: http://www.apache.org/licenses/LICENSE-2.0
>>> > + *
>>> > + * Unless required by applicable law or agreed to in writing,
>>>software
>>> > + * distributed under the License is distributed on an "AS IS" basis,
>>> > + * WITHOUT WARRANTIES OF ANY KIND, either express or implied.
>>> > + *
>>> > + * This file may contain contributions from others, either as
>>> > + * contributors under the License or as licensors under other terms.
>>> > + * Please review this entire file for other proprietary rights or
>>>license
>>> > + * notices, as well as the QNX Development Suite License Guide at
>>> > + * http://licensing.qnx.com/license-guide/ for other information.
>>> > + */
>>>
>>> The rest of libxc is licensed under GPLv2.1, which is incompatible with
>>> Apache 2.0
>
> That is correct.
>
> The question is whether this code needs to be Apache 2.0. My understanding
> was that the QNX recommendation is that a base port of QNX (aka the
> drivers) are recommended to be Apache 2. But it is not clear to me whether
> the boot loader needs to be. I don¹t have enough context and can¹t find
> any reference to the file system itself in the license guide.
>
> I do not know enough about the subtleties of licenses here and am adding
> Brian, in case we need to get some more advice on how to mitigate this
> issue.
>
> @Oleksandr, can you also check with your legal guys?
>
> Regards
> Lars
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

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

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

* Re: [PATCH] xen/tools: Introduce QNX IFS loader
  2014-08-20 10:07       ` Artem Mygaiev
@ 2014-08-20 10:11         ` Dario Faggioli
  2014-08-20 13:56           ` Artem Mygaiev
  0 siblings, 1 reply; 16+ messages in thread
From: Dario Faggioli @ 2014-08-20 10:11 UTC (permalink / raw
  To: Artem Mygaiev
  Cc: Lars Kurth, Ian Campbell, Andrew Cooper, Brian Warner,
	julien.grall@linaro.org, Tim (Xen.org), xen-devel@lists.xen.org,
	Oleksandr Tyshchenko, Stefano Stabellini


[-- Attachment #1.1: Type: text/plain, Size: 4213 bytes --]

On mer, 2014-08-20 at 13:07 +0300, Artem Mygaiev wrote:
> Lars, let me comment here. Apache 2 license is used on reference
> loader supplied by QNX to allow re-use code of the reference
> implementation, so it is OK to stick to it here.
> 
Yeah but, AFAIUI, the problem here is that it is *not* ok to have
Apache2 licensed code in libxc... :-(

Regards,
Dario

> >>On mar, 2014-08-19 at 17:13 +0100, Andrew Cooper wrote:
> >>> On 19/08/14 16:51, Oleksandr Tyshchenko wrote:
> >>> > Add ability to load QNX IFS image. Based on IPL code (U-Boot for QNX).
> >>> >
> >>> > Signed-off-by: Oleksandr Tyshchenko
> >>><oleksandr.tyshchenko@globallogic.com>
> >>> > ---
> >>> >  tools/libxc/Makefile              |   1 +
> >>> >  tools/libxc/xc_dom_qnxifsloader.c | 189
> >>>++++++++++++++++++++++++++++++++++++++
> >>> >  2 files changed, 190 insertions(+)
> >>> >  create mode 100644 tools/libxc/xc_dom_qnxifsloader.c
> >>> >
> >>> > diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
> >>> > index 22eef8e..812cc7e 100644
> >>> > --- a/tools/libxc/Makefile
> >>> > +++ b/tools/libxc/Makefile
> >>> > @@ -67,6 +67,7 @@ GUEST_SRCS-y                 += xc_dom_elfloader.c
> >>> >  GUEST_SRCS-$(CONFIG_X86)     += xc_dom_bzimageloader.c
> >>> >  GUEST_SRCS-$(CONFIG_X86)     += xc_dom_decompress_lz4.c
> >>> >  GUEST_SRCS-$(CONFIG_ARM)     += xc_dom_armzimageloader.c
> >>> > +GUEST_SRCS-$(CONFIG_ARM)     += xc_dom_qnxifsloader.c
> >>> >  GUEST_SRCS-y                 += xc_dom_binloader.c
> >>> >  GUEST_SRCS-y                 += xc_dom_compat_linux.c
> >>> >
> >>> > diff --git a/tools/libxc/xc_dom_qnxifsloader.c
> >>>b/tools/libxc/xc_dom_qnxifsloader.c
> >>> > new file mode 100644
> >>> > index 0000000..45d007d
> >>> > --- /dev/null
> >>> > +++ b/tools/libxc/xc_dom_qnxifsloader.c
> >>> > @@ -0,0 +1,189 @@
> >>> > +/*
> >>> > + * Xen domain builder -- QNX IFS bits
> >>> > + *
> >>> > + * Parse and load QNX IFS image.
> >>> > + *
> >>> > + * Copyright (C) 2014, Globallogic.
> >>> > + *
> >>> > + * Licensed under the Apache License, Version 2.0 (the "License").
> >>>You
> >>> > + * may not reproduce, modify or distribute this software except in
> >>> > + * compliance with the License. You may obtain a copy of the License
> >>> > + * at: http://www.apache.org/licenses/LICENSE-2.0
> >>> > + *
> >>> > + * Unless required by applicable law or agreed to in writing,
> >>>software
> >>> > + * distributed under the License is distributed on an "AS IS" basis,
> >>> > + * WITHOUT WARRANTIES OF ANY KIND, either express or implied.
> >>> > + *
> >>> > + * This file may contain contributions from others, either as
> >>> > + * contributors under the License or as licensors under other terms.
> >>> > + * Please review this entire file for other proprietary rights or
> >>>license
> >>> > + * notices, as well as the QNX Development Suite License Guide at
> >>> > + * http://licensing.qnx.com/license-guide/ for other information.
> >>> > + */
> >>>
> >>> The rest of libxc is licensed under GPLv2.1, which is incompatible with
> >>> Apache 2.0
> >
> > That is correct.
> >
> > The question is whether this code needs to be Apache 2.0. My understanding
> > was that the QNX recommendation is that a base port of QNX (aka the
> > drivers) are recommended to be Apache 2. But it is not clear to me whether
> > the boot loader needs to be. I don¹t have enough context and can¹t find
> > any reference to the file system itself in the license guide.
> >
> > I do not know enough about the subtleties of licenses here and am adding
> > Brian, in case we need to get some more advice on how to mitigate this
> > issue.
> >
> > @Oleksandr, can you also check with your legal guys?
> >
> > Regards
> > Lars
> >
> >
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xen.org
> > http://lists.xen.org/xen-devel

-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

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

* Re: [PATCH] xen/tools: Introduce QNX IFS loader
  2014-08-20  4:09     ` Lars Kurth
  2014-08-20 10:07       ` Artem Mygaiev
@ 2014-08-20 10:20       ` Oleksandr Tyshchenko
  1 sibling, 0 replies; 16+ messages in thread
From: Oleksandr Tyshchenko @ 2014-08-20 10:20 UTC (permalink / raw
  To: Lars Kurth
  Cc: Ian Campbell, Andrew Cooper, Dario Faggioli,
	julien.grall@linaro.org, Tim (Xen.org), xen-devel@lists.xen.org,
	Stefano Stabellini, Brian Warner

On Wed, Aug 20, 2014 at 7:09 AM, Lars Kurth <lars.kurth@citrix.com> wrote:
>
>
> On 19/08/2014 11:26, "Dario Faggioli" <dario.faggioli@citrix.com> wrote:
>
>>[Adding Lars, as he may be of help with licensing things]
>>
>>On mar, 2014-08-19 at 17:13 +0100, Andrew Cooper wrote:
>>> On 19/08/14 16:51, Oleksandr Tyshchenko wrote:
>>> > Add ability to load QNX IFS image. Based on IPL code (U-Boot for QNX).
>>> >
>>> > Signed-off-by: Oleksandr Tyshchenko
>>><oleksandr.tyshchenko@globallogic.com>
>>> > ---
>>> >  tools/libxc/Makefile              |   1 +
>>> >  tools/libxc/xc_dom_qnxifsloader.c | 189
>>>++++++++++++++++++++++++++++++++++++++
>>> >  2 files changed, 190 insertions(+)
>>> >  create mode 100644 tools/libxc/xc_dom_qnxifsloader.c
>>> >
>>> > diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
>>> > index 22eef8e..812cc7e 100644
>>> > --- a/tools/libxc/Makefile
>>> > +++ b/tools/libxc/Makefile
>>> > @@ -67,6 +67,7 @@ GUEST_SRCS-y                 += xc_dom_elfloader.c
>>> >  GUEST_SRCS-$(CONFIG_X86)     += xc_dom_bzimageloader.c
>>> >  GUEST_SRCS-$(CONFIG_X86)     += xc_dom_decompress_lz4.c
>>> >  GUEST_SRCS-$(CONFIG_ARM)     += xc_dom_armzimageloader.c
>>> > +GUEST_SRCS-$(CONFIG_ARM)     += xc_dom_qnxifsloader.c
>>> >  GUEST_SRCS-y                 += xc_dom_binloader.c
>>> >  GUEST_SRCS-y                 += xc_dom_compat_linux.c
>>> >
>>> > diff --git a/tools/libxc/xc_dom_qnxifsloader.c
>>>b/tools/libxc/xc_dom_qnxifsloader.c
>>> > new file mode 100644
>>> > index 0000000..45d007d
>>> > --- /dev/null
>>> > +++ b/tools/libxc/xc_dom_qnxifsloader.c
>>> > @@ -0,0 +1,189 @@
>>> > +/*
>>> > + * Xen domain builder -- QNX IFS bits
>>> > + *
>>> > + * Parse and load QNX IFS image.
>>> > + *
>>> > + * Copyright (C) 2014, Globallogic.
>>> > + *
>>> > + * Licensed under the Apache License, Version 2.0 (the "License").
>>>You
>>> > + * may not reproduce, modify or distribute this software except in
>>> > + * compliance with the License. You may obtain a copy of the License
>>> > + * at: http://www.apache.org/licenses/LICENSE-2.0
>>> > + *
>>> > + * Unless required by applicable law or agreed to in writing,
>>>software
>>> > + * distributed under the License is distributed on an "AS IS" basis,
>>> > + * WITHOUT WARRANTIES OF ANY KIND, either express or implied.
>>> > + *
>>> > + * This file may contain contributions from others, either as
>>> > + * contributors under the License or as licensors under other terms.
>>> > + * Please review this entire file for other proprietary rights or
>>>license
>>> > + * notices, as well as the QNX Development Suite License Guide at
>>> > + * http://licensing.qnx.com/license-guide/ for other information.
>>> > + */
>>>
>>> The rest of libxc is licensed under GPLv2.1, which is incompatible with
>>> Apache 2.0
>
> That is correct.
>
> The question is whether this code needs to be Apache 2.0. My understanding
> was that the QNX recommendation is that a base port of QNX (aka the
> drivers) are recommended to be Apache 2. But it is not clear to me whether
> the boot loader needs to be. I don¹t have enough context and can¹t find
> any reference to the file system itself in the license guide.
>
> I do not know enough about the subtleties of licenses here and am adding
> Brian, in case we need to get some more advice on how to mitigate this
> issue.
>
> @Oleksandr, can you also check with your legal guys?

Yes, I can.

>
> Regards
> Lars
>



-- 

Oleksandr Tyshchenko | Embedded Dev
GlobalLogic
www.globallogic.com

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

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

* Re: [PATCH] xen/tools: Introduce QNX IFS loader
  2014-08-19 16:41 ` Julien Grall
@ 2014-08-20 11:10   ` Oleksandr Tyshchenko
  2014-08-20 13:00   ` Oleksandr Tyshchenko
  1 sibling, 0 replies; 16+ messages in thread
From: Oleksandr Tyshchenko @ 2014-08-20 11:10 UTC (permalink / raw
  To: Julien Grall
  Cc: Stefano Stabellini, Tim Deegan, Ian Campbell,
	xen-devel@lists.xen.org

On Tue, Aug 19, 2014 at 7:41 PM, Julien Grall <julien.grall@linaro.org> wrote:
> Hi Oleksandr,

Hi Julien

>
> Thank you for your patch.
>
>
> On 19/08/14 10:51, Oleksandr Tyshchenko wrote:
>>
>> Add ability to load QNX IFS image. Based on IPL code (U-Boot for QNX).
>
>
> Do you have any link to the IPL code? Such as commit ID...

There is no commit ID. Version Control Systems are not used for QNX
Board Support Packages.
BSPs for particular board differ from one QNX SDP version to another
and shipped as archive.
What has been changed, for example, between two BSPs you can see in
Release Notes.

>
> Also, is there any website to explain the QNX IFS image?

Yes, there is. Almost all information needed for QNX development I
find in www.qnx.com.
As for current questions there are detailed howto:
1. Writing an IPL Program:
http://www.qnx.com/developers/docs/6.4.1/neutrino/building/load_process.html
2. Building OS and Flash Images:
http://www.qnx.com/developers/docs/6.3.2/ide_en/user_guide/builder.html

Also, you can find IPL code in almost all BSPs you download from:
http://community.qnx.com/sf/wiki/do/viewPage/projects.bsp/wiki/BSPAndDrivers

Although the current patch based on IPL from TI OMAP5432 EVM BSP,
but IPL code from different BSPs are similar (in parts of code
responsible for load image).
http://community.qnx.com/sf/wiki/do/viewPage/projects.bsp/wiki/TexasInstrumentsOMAP5432EVM
I only dropped checksum verification during image scan step to improve
boot time. But, I will
be able to restore it if needed.

>
> [..]
>
>> diff --git a/tools/libxc/xc_dom_qnxifsloader.c
>> b/tools/libxc/xc_dom_qnxifsloader.c
>
>
> [..]
>
>> +static uint32_t image_addr;
>
>
> All the below functions can be called concurrently for different domains. I
> would add a new field in xc_dom_image.

ok

>
>
>> +static uint32_t image_scan(uint32_t start_addr, uint32_t end_addr)
>> +{
>> +    struct startup_header *startup_hdr;
>> +    uint32_t last_addr = 0xffffffff;
>> +
>> +    for (; start_addr < end_addr; start_addr += 4)
>
>
> Coding style:
>
> for ( ... )

ok

>
>
>> +    {
>> +        startup_hdr = (struct startup_header *)start_addr;
>
>
> AFAIU, QNX loader is only for 32 bits guest, right?

right

>
> You are casting on multiple place 32 bits address to a pointer. This won't
> work on ARM64. Even though you are targeting 32 bits, you still have to make
> this code working on ARM64.

I got it. I will think about it.

>
> [..]
>
>
>> +static int xc_dom_probe_qnx_ifs(struct xc_dom_image *dom)
>> +{
>> +    struct startup_header *startup_hdr;
>> +
>> +    if ( dom->kernel_blob == NULL )
>> +    {
>> +        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
>> +                     "%s: no QNX IFS loaded", __FUNCTION__);
>> +        return -EINVAL;
>> +    }
>> +
>> +    image_addr = *(uint32_t *)&dom->kernel_blob;
>> +    image_addr = image_scan(image_addr, image_addr + 0x200);
>> +    if (image_addr == 0xffffffff)
>
>
> Coding style:
>
> if ( ... )

ok

>
> Regards,
>
> --
> Julien Grall



-- 

Oleksandr Tyshchenko | Embedded Dev
GlobalLogic
www.globallogic.com

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

* Re: [PATCH] xen/tools: Introduce QNX IFS loader
  2014-08-19 16:41 ` Julien Grall
  2014-08-20 11:10   ` Oleksandr Tyshchenko
@ 2014-08-20 13:00   ` Oleksandr Tyshchenko
  2014-08-20 14:55     ` Julien Grall
  1 sibling, 1 reply; 16+ messages in thread
From: Oleksandr Tyshchenko @ 2014-08-20 13:00 UTC (permalink / raw
  To: Julien Grall
  Cc: Stefano Stabellini, Tim Deegan, Ian Campbell,
	xen-devel@lists.xen.org

On Tue, Aug 19, 2014 at 7:41 PM, Julien Grall <julien.grall@linaro.org> wrote:
> Hi Oleksandr,
>
> Thank you for your patch.
>
>
> On 19/08/14 10:51, Oleksandr Tyshchenko wrote:
>>
>> Add ability to load QNX IFS image. Based on IPL code (U-Boot for QNX).
>
>
> Do you have any link to the IPL code? Such as commit ID...
>
> Also, is there any website to explain the QNX IFS image?
>
> [..]
>
>> diff --git a/tools/libxc/xc_dom_qnxifsloader.c
>> b/tools/libxc/xc_dom_qnxifsloader.c
>
>
> [..]
>
>> +static uint32_t image_addr;
>
>
> All the below functions can be called concurrently for different domains. I
> would add a new field in xc_dom_image.
>
>
>> +static uint32_t image_scan(uint32_t start_addr, uint32_t end_addr)
>> +{
>> +    struct startup_header *startup_hdr;
>> +    uint32_t last_addr = 0xffffffff;
>> +
>> +    for (; start_addr < end_addr; start_addr += 4)
>
>
> Coding style:
>
> for ( ... )
>
>
>> +    {
>> +        startup_hdr = (struct startup_header *)start_addr;
>
>
> AFAIU, QNX loader is only for 32 bits guest, right?
>
> You are casting on multiple place 32 bits address to a pointer. This won't
> work on ARM64. Even though you are targeting 32 bits, you still have to make
> this code working on ARM64.

Julien, can I introduce QNX loader as a loader for ARM32 only
(I mean, just add prefix 32 to callbacks and so on)?
Or should I make 2 separate loaders:
- qnx_ifs_loader32;
- qnx_ifs_loader64;
as it was done in armzimageloader?

What do you think?

Thank you.

>
> [..]
>
>
>> +static int xc_dom_probe_qnx_ifs(struct xc_dom_image *dom)
>> +{
>> +    struct startup_header *startup_hdr;
>> +
>> +    if ( dom->kernel_blob == NULL )
>> +    {
>> +        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
>> +                     "%s: no QNX IFS loaded", __FUNCTION__);
>> +        return -EINVAL;
>> +    }
>> +
>> +    image_addr = *(uint32_t *)&dom->kernel_blob;
>> +    image_addr = image_scan(image_addr, image_addr + 0x200);
>> +    if (image_addr == 0xffffffff)
>
>
> Coding style:
>
> if ( ... )
>
> Regards,
>
> --
> Julien Grall



-- 

Oleksandr Tyshchenko | Embedded Dev
GlobalLogic
www.globallogic.com

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

* Re: [PATCH] xen/tools: Introduce QNX IFS loader
  2014-08-20 10:11         ` Dario Faggioli
@ 2014-08-20 13:56           ` Artem Mygaiev
  2014-08-20 14:00             ` Dario Faggioli
  2014-08-26 21:09             ` Ian Campbell
  0 siblings, 2 replies; 16+ messages in thread
From: Artem Mygaiev @ 2014-08-20 13:56 UTC (permalink / raw
  To: Dario Faggioli
  Cc: Lars Kurth, Ian Campbell, Andrew Cooper, Brian Warner,
	julien.grall@linaro.org, Tim (Xen.org), xen-devel@lists.xen.org,
	Oleksandr Tyshchenko, Stefano Stabellini


[-- Attachment #1.1: Type: text/plain, Size: 5030 bytes --]

​Oh, then we stick to libxc GPL license ensuring that no Apache 2 code gets
in from us. QNX doesnt really enforce using some specific license in
loader; for example it is possible to use grub (GPL) on x86... Oleksandr
will have to re-submit patches

Artem Mygaiev | *Associate Vice President, Engineering*
GlobalLogic
P +380.44.4929695 ext.2023 M +380.67.9211131 S rosenkrantzguildenstern
www.globallogic.com
<http://www.globallogic.com/>
http://www.globallogic.com/email_disclaimer.txt


On Wed, Aug 20, 2014 at 1:11 PM, Dario Faggioli <dario.faggioli@citrix.com>
wrote:

> On mer, 2014-08-20 at 13:07 +0300, Artem Mygaiev wrote:
> > Lars, let me comment here. Apache 2 license is used on reference
> > loader supplied by QNX to allow re-use code of the reference
> > implementation, so it is OK to stick to it here.
> >
> Yeah but, AFAIUI, the problem here is that it is *not* ok to have
> Apache2 licensed code in libxc... :-(
>
> Regards,
> Dario
>
> > >>On mar, 2014-08-19 at 17:13 +0100, Andrew Cooper wrote:
> > >>> On 19/08/14 16:51, Oleksandr Tyshchenko wrote:
> > >>> > Add ability to load QNX IFS image. Based on IPL code (U-Boot for
> QNX).
> > >>> >
> > >>> > Signed-off-by: Oleksandr Tyshchenko
> > >>><oleksandr.tyshchenko@globallogic.com>
> > >>> > ---
> > >>> >  tools/libxc/Makefile              |   1 +
> > >>> >  tools/libxc/xc_dom_qnxifsloader.c | 189
> > >>>++++++++++++++++++++++++++++++++++++++
> > >>> >  2 files changed, 190 insertions(+)
> > >>> >  create mode 100644 tools/libxc/xc_dom_qnxifsloader.c
> > >>> >
> > >>> > diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
> > >>> > index 22eef8e..812cc7e 100644
> > >>> > --- a/tools/libxc/Makefile
> > >>> > +++ b/tools/libxc/Makefile
> > >>> > @@ -67,6 +67,7 @@ GUEST_SRCS-y                 +=
> xc_dom_elfloader.c
> > >>> >  GUEST_SRCS-$(CONFIG_X86)     += xc_dom_bzimageloader.c
> > >>> >  GUEST_SRCS-$(CONFIG_X86)     += xc_dom_decompress_lz4.c
> > >>> >  GUEST_SRCS-$(CONFIG_ARM)     += xc_dom_armzimageloader.c
> > >>> > +GUEST_SRCS-$(CONFIG_ARM)     += xc_dom_qnxifsloader.c
> > >>> >  GUEST_SRCS-y                 += xc_dom_binloader.c
> > >>> >  GUEST_SRCS-y                 += xc_dom_compat_linux.c
> > >>> >
> > >>> > diff --git a/tools/libxc/xc_dom_qnxifsloader.c
> > >>>b/tools/libxc/xc_dom_qnxifsloader.c
> > >>> > new file mode 100644
> > >>> > index 0000000..45d007d
> > >>> > --- /dev/null
> > >>> > +++ b/tools/libxc/xc_dom_qnxifsloader.c
> > >>> > @@ -0,0 +1,189 @@
> > >>> > +/*
> > >>> > + * Xen domain builder -- QNX IFS bits
> > >>> > + *
> > >>> > + * Parse and load QNX IFS image.
> > >>> > + *
> > >>> > + * Copyright (C) 2014, Globallogic.
> > >>> > + *
> > >>> > + * Licensed under the Apache License, Version 2.0 (the "License").
> > >>>You
> > >>> > + * may not reproduce, modify or distribute this software except in
> > >>> > + * compliance with the License. You may obtain a copy of the
> License
> > >>> > + * at: http://www.apache.org/licenses/LICENSE-2.0
> > >>> > + *
> > >>> > + * Unless required by applicable law or agreed to in writing,
> > >>>software
> > >>> > + * distributed under the License is distributed on an "AS IS"
> basis,
> > >>> > + * WITHOUT WARRANTIES OF ANY KIND, either express or implied.
> > >>> > + *
> > >>> > + * This file may contain contributions from others, either as
> > >>> > + * contributors under the License or as licensors under other
> terms.
> > >>> > + * Please review this entire file for other proprietary rights or
> > >>>license
> > >>> > + * notices, as well as the QNX Development Suite License Guide at
> > >>> > + * http://licensing.qnx.com/license-guide/ for other information.
> > >>> > + */
> > >>>
> > >>> The rest of libxc is licensed under GPLv2.1, which is incompatible
> with
> > >>> Apache 2.0
> > >
> > > That is correct.
> > >
> > > The question is whether this code needs to be Apache 2.0. My
> understanding
> > > was that the QNX recommendation is that a base port of QNX (aka the
> > > drivers) are recommended to be Apache 2. But it is not clear to me
> whether
> > > the boot loader needs to be. I don¹t have enough context and can¹t find
> > > any reference to the file system itself in the license guide.
> > >
> > > I do not know enough about the subtleties of licenses here and am
> adding
> > > Brian, in case we need to get some more advice on how to mitigate this
> > > issue.
> > >
> > > @Oleksandr, can you also check with your legal guys?
> > >
> > > Regards
> > > Lars
> > >
> > >
> > > _______________________________________________
> > > Xen-devel mailing list
> > > Xen-devel@lists.xen.org
> > > http://lists.xen.org/xen-devel
>
> --
> <<This happens because I choose it to happen!>> (Raistlin Majere)
> -----------------------------------------------------------------
> Dario Faggioli, Ph.D, http://about.me/dario.faggioli
> Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
>
>

[-- Attachment #1.2: Type: text/html, Size: 9158 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

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

* Re: [PATCH] xen/tools: Introduce QNX IFS loader
  2014-08-20 13:56           ` Artem Mygaiev
@ 2014-08-20 14:00             ` Dario Faggioli
  2014-08-26 21:09             ` Ian Campbell
  1 sibling, 0 replies; 16+ messages in thread
From: Dario Faggioli @ 2014-08-20 14:00 UTC (permalink / raw
  To: Artem Mygaiev
  Cc: Lars Kurth, Ian Campbell, Andrew Cooper, Brian Warner,
	julien.grall@linaro.org, Tim (Xen.org), xen-devel@lists.xen.org,
	Oleksandr Tyshchenko, Stefano Stabellini


[-- Attachment #1.1: Type: text/plain, Size: 800 bytes --]

On mer, 2014-08-20 at 16:56 +0300, Artem Mygaiev wrote:
> ​Oh, then we stick to libxc GPL license ensuring that no Apache 2 code
> gets in from us. 
>
Exactly. If that's doable, I think it really would be the best solution.

> QNX doesnt really enforce using some specific license in loader; for
> example it is possible to use grub (GPL) on x86... 
>
Great!

> Oleksandr will have to re-submit patches
> 
Yep, that's unavoidable, I guess.

Regards,
Dario

PS. can you please switch from HTML to plain text messages?
-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

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

* Re: [PATCH] xen/tools: Introduce QNX IFS loader
  2014-08-20 13:00   ` Oleksandr Tyshchenko
@ 2014-08-20 14:55     ` Julien Grall
  2014-08-20 16:35       ` Oleksandr Tyshchenko
  0 siblings, 1 reply; 16+ messages in thread
From: Julien Grall @ 2014-08-20 14:55 UTC (permalink / raw
  To: Oleksandr Tyshchenko
  Cc: Stefano Stabellini, Tim Deegan, Ian Campbell,
	xen-devel@lists.xen.org



On 20/08/14 08:00, Oleksandr Tyshchenko wrote:
> Julien, can I introduce QNX loader as a loader for ARM32 only
> (I mean, just add prefix 32 to callbacks and so on)?
> Or should I make 2 separate loaders:
> - qnx_ifs_loader32;
> - qnx_ifs_loader64;
> as it was done in armzimageloader?

I'm not sure to understand why you would introduce 2 different loaders. 
The code will be built for both 32 bits and 64 bits toolstack because 
people may want to run QNX 32 bits guest on a 64 bits hardware.

For instance armzimageloader{32,64} don't do the same things, the former 
is loading a zImage while the latter loads an Image.

Regards,

-- 
Julien Grall

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

* Re: [PATCH] xen/tools: Introduce QNX IFS loader
  2014-08-20 14:55     ` Julien Grall
@ 2014-08-20 16:35       ` Oleksandr Tyshchenko
  0 siblings, 0 replies; 16+ messages in thread
From: Oleksandr Tyshchenko @ 2014-08-20 16:35 UTC (permalink / raw
  To: Julien Grall
  Cc: Stefano Stabellini, Tim Deegan, Ian Campbell,
	xen-devel@lists.xen.org

On Wed, Aug 20, 2014 at 5:55 PM, Julien Grall <julien.grall@linaro.org> wrote:
>
>
> On 20/08/14 08:00, Oleksandr Tyshchenko wrote:
>>
>> Julien, can I introduce QNX loader as a loader for ARM32 only
>> (I mean, just add prefix 32 to callbacks and so on)?
>> Or should I make 2 separate loaders:
>> - qnx_ifs_loader32;
>> - qnx_ifs_loader64;
>> as it was done in armzimageloader?
>
>
> I'm not sure to understand why you would introduce 2 different loaders. The
> code will be built for both 32 bits and 64 bits toolstack because people may
> want to run QNX 32 bits guest on a 64 bits hardware.

It is clear. Thank you.
>
> For instance armzimageloader{32,64} don't do the same things, the former is
> loading a zImage while the latter loads an Image.
>
> Regards,
>
> --
> Julien Grall



-- 

Oleksandr Tyshchenko | Embedded Dev
GlobalLogic
www.globallogic.com

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

* Re: [PATCH] xen/tools: Introduce QNX IFS loader
  2014-08-20 13:56           ` Artem Mygaiev
  2014-08-20 14:00             ` Dario Faggioli
@ 2014-08-26 21:09             ` Ian Campbell
  2014-08-27  7:53               ` Andrii Tseglytskyi
  1 sibling, 1 reply; 16+ messages in thread
From: Ian Campbell @ 2014-08-26 21:09 UTC (permalink / raw
  To: Artem Mygaiev
  Cc: Lars Kurth, Andrew Cooper, Dario Faggioli,
	julien.grall@linaro.org, Tim (Xen.org), xen-devel@lists.xen.org,
	Oleksandr Tyshchenko, Stefano Stabellini, Brian Warner

On Wed, 2014-08-20 at 16:56 +0300, Artem Mygaiev wrote:
> ​Oh, then we stick to libxc GPL license ensuring that no Apache 2 code
> gets in from us. QNX doesnt really enforce using some specific license
> in loader; for example it is possible to use grub (GPL) on x86...

Note that libxc is LGPL, not GPL. We cannot take GPL code into libxc
either.

>  Oleksandr will have to re-submit patches

Just to be clear, can you confirm that this patch consists entirely of
code which GlobalLogic has written from scratch and/or remains the sole
copyright holder on?

If this code is derived from some Apache licensed QNX example code then
you cannot simply slap an (L)GPL license on it without the copyright
holder's permission.

Ian.



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

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

* Re: [PATCH] xen/tools: Introduce QNX IFS loader
  2014-08-26 21:09             ` Ian Campbell
@ 2014-08-27  7:53               ` Andrii Tseglytskyi
  0 siblings, 0 replies; 16+ messages in thread
From: Andrii Tseglytskyi @ 2014-08-27  7:53 UTC (permalink / raw
  To: Ian Campbell
  Cc: Lars Kurth, Artem Mygaiev, Andrew Cooper, Dario Faggioli,
	julien.grall@linaro.org, Tim (Xen.org), xen-devel@lists.xen.org,
	Oleksandr Tyshchenko, Stefano Stabellini, Brian Warner

Hi Ian,


On Wed, Aug 27, 2014 at 12:09 AM, Ian Campbell <ian.campbell@citrix.com> wrote:
> On Wed, 2014-08-20 at 16:56 +0300, Artem Mygaiev wrote:
>> Oh, then we stick to libxc GPL license ensuring that no Apache 2 code
>> gets in from us. QNX doesnt really enforce using some specific license
>> in loader; for example it is possible to use grub (GPL) on x86...
>
> Note that libxc is LGPL, not GPL. We cannot take GPL code into libxc
> either.
>
>>  Oleksandr will have to re-submit patches
>
> Just to be clear, can you confirm that this patch consists entirely of
> code which GlobalLogic has written from scratch and/or remains the sole
> copyright holder on?
>

Yes, next revision will contain code written from scratch. This is
what we agreed to do.

Thank you for your comment,

Regards,
Andrii



-- 

Andrii Tseglytskyi | Embedded Dev
GlobalLogic
www.globallogic.com

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

end of thread, other threads:[~2014-08-27  7:53 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-19 15:51 [PATCH] xen/tools: Introduce QNX IFS loader Oleksandr Tyshchenko
2014-08-19 16:13 ` Andrew Cooper
2014-08-19 16:26   ` Dario Faggioli
2014-08-20  4:09     ` Lars Kurth
2014-08-20 10:07       ` Artem Mygaiev
2014-08-20 10:11         ` Dario Faggioli
2014-08-20 13:56           ` Artem Mygaiev
2014-08-20 14:00             ` Dario Faggioli
2014-08-26 21:09             ` Ian Campbell
2014-08-27  7:53               ` Andrii Tseglytskyi
2014-08-20 10:20       ` Oleksandr Tyshchenko
2014-08-19 16:41 ` Julien Grall
2014-08-20 11:10   ` Oleksandr Tyshchenko
2014-08-20 13:00   ` Oleksandr Tyshchenko
2014-08-20 14:55     ` Julien Grall
2014-08-20 16:35       ` Oleksandr Tyshchenko

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.