* ARM32 - build-issues with xen/arm: vpl011: Add a new vuart node in the xenstore
@ 2017-10-05 1:58 Konrad Rzeszutek Wilk
2017-10-05 9:37 ` Wei Liu
0 siblings, 1 reply; 7+ messages in thread
From: Konrad Rzeszutek Wilk @ 2017-10-05 1:58 UTC (permalink / raw)
To: xen-devel, bhupinder.thakur, wei.liu2, sstabellini
I get this when compiling under ARM32 (Ubuntu 15.04,
gcc (Ubuntu/Linaro 4.9.2-10ubuntu13) 4.9.2):
libxl_console.c: In function ‘libxl__device_vuart_add’:
libxl_console.c:379:5: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘xen_pfn_t’ [-Werror=format=]
flexarray_append(ro_front, GCSPRINTF("%lu", state->vuart_gfn));
^
;
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: ARM32 - build-issues with xen/arm: vpl011: Add a new vuart node in the xenstore
2017-10-05 1:58 ARM32 - build-issues with xen/arm: vpl011: Add a new vuart node in the xenstore Konrad Rzeszutek Wilk
@ 2017-10-05 9:37 ` Wei Liu
2017-10-05 14:14 ` Bhupinder Thakur
2017-10-12 18:54 ` Bhupinder Thakur
0 siblings, 2 replies; 7+ messages in thread
From: Wei Liu @ 2017-10-05 9:37 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk; +Cc: bhupinder.thakur, xen-devel, sstabellini, wei.liu2
On Wed, Oct 04, 2017 at 09:58:32PM -0400, Konrad Rzeszutek Wilk wrote:
> I get this when compiling under ARM32 (Ubuntu 15.04,
> gcc (Ubuntu/Linaro 4.9.2-10ubuntu13) 4.9.2):
>
> libxl_console.c: In function ‘libxl__device_vuart_add’:
> libxl_console.c:379:5: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘xen_pfn_t’ [-Werror=format=]
> flexarray_append(ro_front, GCSPRINTF("%lu", state->vuart_gfn));
> ^
> ;
My Wheezy 32bit chroot didn't catch this, sigh.
Does the following patch work?
From ae531197382bf0bc003606a9712075bdd22cfc24 Mon Sep 17 00:00:00 2001
From: Wei Liu <wei.liu2@citrix.com>
Date: Thu, 5 Oct 2017 10:35:28 +0100
Subject: [PATCH] libxl: use correct type modifier for vuart_gfn
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixes compilation error like:
libxl_console.c: In function ‘libxl__device_vuart_add’:
libxl_console.c:379:5: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘xen_pfn_t’ [-Werror=format=]
flexarray_append(ro_front, GCSPRINTF("%lu", state->vuart_gfn));
Reported-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
tools/libxl/libxl_console.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/libxl/libxl_console.c b/tools/libxl/libxl_console.c
index 13ecf128e2..c05dc28b99 100644
--- a/tools/libxl/libxl_console.c
+++ b/tools/libxl/libxl_console.c
@@ -376,7 +376,7 @@ int libxl__device_vuart_add(libxl__gc *gc, uint32_t domid,
flexarray_append(ro_front, "port");
flexarray_append(ro_front, GCSPRINTF("%"PRIu32, state->vuart_port));
flexarray_append(ro_front, "ring-ref");
- flexarray_append(ro_front, GCSPRINTF("%lu", state->vuart_gfn));
+ flexarray_append(ro_front, GCSPRINTF("%"PRI_xen_pfn, state->vuart_gfn));
flexarray_append(ro_front, "limit");
flexarray_append(ro_front, GCSPRINTF("%d", LIBXL_XENCONSOLE_LIMIT));
flexarray_append(ro_front, "type");
--
2.11.0
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: ARM32 - build-issues with xen/arm: vpl011: Add a new vuart node in the xenstore
2017-10-05 9:37 ` Wei Liu
@ 2017-10-05 14:14 ` Bhupinder Thakur
2017-10-05 14:16 ` Wei Liu
2017-10-12 18:54 ` Bhupinder Thakur
1 sibling, 1 reply; 7+ messages in thread
From: Bhupinder Thakur @ 2017-10-05 14:14 UTC (permalink / raw)
To: Wei Liu; +Cc: xen-devel, Stefano Stabellini, Konrad Rzeszutek Wilk
Hi Wei,
On 5 October 2017 at 15:07, Wei Liu <wei.liu2@citrix.com> wrote:
> On Wed, Oct 04, 2017 at 09:58:32PM -0400, Konrad Rzeszutek Wilk wrote:
>> I get this when compiling under ARM32 (Ubuntu 15.04,
>> gcc (Ubuntu/Linaro 4.9.2-10ubuntu13) 4.9.2):
>>
>> libxl_console.c: In function ‘libxl__device_vuart_add’:
>> libxl_console.c:379:5: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘xen_pfn_t’ [-Werror=format=]
>> flexarray_append(ro_front, GCSPRINTF("%lu", state->vuart_gfn));
>> ^
>> ;
>
> My Wheezy 32bit chroot didn't catch this, sigh.
>
> Does the following patch work?
>
I verified that with this fix, the arm32 toolstack compiles fine.
> From ae531197382bf0bc003606a9712075bdd22cfc24 Mon Sep 17 00:00:00 2001
> From: Wei Liu <wei.liu2@citrix.com>
> Date: Thu, 5 Oct 2017 10:35:28 +0100
> Subject: [PATCH] libxl: use correct type modifier for vuart_gfn
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
>
> Fixes compilation error like:
>
> libxl_console.c: In function ‘libxl__device_vuart_add’:
> libxl_console.c:379:5: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘xen_pfn_t’ [-Werror=format=]
> flexarray_append(ro_front, GCSPRINTF("%lu", state->vuart_gfn));
>
> Reported-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> ---
> tools/libxl/libxl_console.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/libxl/libxl_console.c b/tools/libxl/libxl_console.c
> index 13ecf128e2..c05dc28b99 100644
> --- a/tools/libxl/libxl_console.c
> +++ b/tools/libxl/libxl_console.c
> @@ -376,7 +376,7 @@ int libxl__device_vuart_add(libxl__gc *gc, uint32_t domid,
> flexarray_append(ro_front, "port");
> flexarray_append(ro_front, GCSPRINTF("%"PRIu32, state->vuart_port));
> flexarray_append(ro_front, "ring-ref");
> - flexarray_append(ro_front, GCSPRINTF("%lu", state->vuart_gfn));
> + flexarray_append(ro_front, GCSPRINTF("%"PRI_xen_pfn, state->vuart_gfn));
> flexarray_append(ro_front, "limit");
> flexarray_append(ro_front, GCSPRINTF("%d", LIBXL_XENCONSOLE_LIMIT));
> flexarray_append(ro_front, "type");
> --
> 2.11.0
>
Regards,
Bhupinder
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: ARM32 - build-issues with xen/arm: vpl011: Add a new vuart node in the xenstore
2017-10-05 14:14 ` Bhupinder Thakur
@ 2017-10-05 14:16 ` Wei Liu
0 siblings, 0 replies; 7+ messages in thread
From: Wei Liu @ 2017-10-05 14:16 UTC (permalink / raw)
To: Bhupinder Thakur
Cc: xen-devel, Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk
On Thu, Oct 05, 2017 at 07:44:17PM +0530, Bhupinder Thakur wrote:
> Hi Wei,
>
> On 5 October 2017 at 15:07, Wei Liu <wei.liu2@citrix.com> wrote:
> > On Wed, Oct 04, 2017 at 09:58:32PM -0400, Konrad Rzeszutek Wilk wrote:
> >> I get this when compiling under ARM32 (Ubuntu 15.04,
> >> gcc (Ubuntu/Linaro 4.9.2-10ubuntu13) 4.9.2):
> >>
> >> libxl_console.c: In function ‘libxl__device_vuart_add’:
> >> libxl_console.c:379:5: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘xen_pfn_t’ [-Werror=format=]
> >> flexarray_append(ro_front, GCSPRINTF("%lu", state->vuart_gfn));
> >> ^
> >> ;
> >
> > My Wheezy 32bit chroot didn't catch this, sigh.
> >
> > Does the following patch work?
> >
>
> I verified that with this fix, the arm32 toolstack compiles fine.
>
Thanks. I will commit this shortly.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: ARM32 - build-issues with xen/arm: vpl011: Add a new vuart node in the xenstore
2017-10-05 9:37 ` Wei Liu
2017-10-05 14:14 ` Bhupinder Thakur
@ 2017-10-12 18:54 ` Bhupinder Thakur
2017-10-12 19:04 ` Andrew Cooper
1 sibling, 1 reply; 7+ messages in thread
From: Bhupinder Thakur @ 2017-10-12 18:54 UTC (permalink / raw)
To: Wei Liu; +Cc: Xen-devel, Stefano Stabellini, Konrad Rzeszutek Wilk
On 5 October 2017 at 15:07, Wei Liu <wei.liu2@citrix.com> wrote:
> On Wed, Oct 04, 2017 at 09:58:32PM -0400, Konrad Rzeszutek Wilk wrote:
>> I get this when compiling under ARM32 (Ubuntu 15.04,
>> gcc (Ubuntu/Linaro 4.9.2-10ubuntu13) 4.9.2):
>>
>> libxl_console.c: In function ‘libxl__device_vuart_add’:
>> libxl_console.c:379:5: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘xen_pfn_t’ [-Werror=format=]
>> flexarray_append(ro_front, GCSPRINTF("%lu", state->vuart_gfn));
>> ^
>> ;
>
> My Wheezy 32bit chroot didn't catch this, sigh.
>
> Does the following patch work?
>
> From ae531197382bf0bc003606a9712075bdd22cfc24 Mon Sep 17 00:00:00 2001
> From: Wei Liu <wei.liu2@citrix.com>
> Date: Thu, 5 Oct 2017 10:35:28 +0100
> Subject: [PATCH] libxl: use correct type modifier for vuart_gfn
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
>
> Fixes compilation error like:
>
> libxl_console.c: In function ‘libxl__device_vuart_add’:
> libxl_console.c:379:5: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘xen_pfn_t’ [-Werror=format=]
> flexarray_append(ro_front, GCSPRINTF("%lu", state->vuart_gfn));
>
> Reported-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> ---
> tools/libxl/libxl_console.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/libxl/libxl_console.c b/tools/libxl/libxl_console.c
> index 13ecf128e2..c05dc28b99 100644
> --- a/tools/libxl/libxl_console.c
> +++ b/tools/libxl/libxl_console.c
> @@ -376,7 +376,7 @@ int libxl__device_vuart_add(libxl__gc *gc, uint32_t domid,
> flexarray_append(ro_front, "port");
> flexarray_append(ro_front, GCSPRINTF("%"PRIu32, state->vuart_port));
> flexarray_append(ro_front, "ring-ref");
> - flexarray_append(ro_front, GCSPRINTF("%lu", state->vuart_gfn));
> + flexarray_append(ro_front, GCSPRINTF("%"PRI_xen_pfn, state->vuart_gfn));
Unfortunately, this is causing an issue as PRI_xen_pfn formats the
value as a hexadecimal value but xenconsole later reads it as a
decimal value and tries to map it, which fails and therefore vuart
console initialization fails.
Earlier, I verified only 32-bit compilation but did not test the
change. It was a miss from my side. I have tested now with the format
string changed to PRIu64 and the vuart console is working fine.
Regards,
Bhupinder
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: ARM32 - build-issues with xen/arm: vpl011: Add a new vuart node in the xenstore
2017-10-12 18:54 ` Bhupinder Thakur
@ 2017-10-12 19:04 ` Andrew Cooper
2017-10-13 9:17 ` Bhupinder Thakur
0 siblings, 1 reply; 7+ messages in thread
From: Andrew Cooper @ 2017-10-12 19:04 UTC (permalink / raw)
To: Bhupinder Thakur, Wei Liu
Cc: Xen-devel, Stefano Stabellini, Konrad Rzeszutek Wilk
On 12/10/17 19:54, Bhupinder Thakur wrote:
> On 5 October 2017 at 15:07, Wei Liu <wei.liu2@citrix.com> wrote:
>> On Wed, Oct 04, 2017 at 09:58:32PM -0400, Konrad Rzeszutek Wilk wrote:
>>> I get this when compiling under ARM32 (Ubuntu 15.04,
>>> gcc (Ubuntu/Linaro 4.9.2-10ubuntu13) 4.9.2):
>>>
>>> libxl_console.c: In function ‘libxl__device_vuart_add’:
>>> libxl_console.c:379:5: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘xen_pfn_t’ [-Werror=format=]
>>> flexarray_append(ro_front, GCSPRINTF("%lu", state->vuart_gfn));
>>> ^
>>> ;
>> My Wheezy 32bit chroot didn't catch this, sigh.
>>
>> Does the following patch work?
>>
>> From ae531197382bf0bc003606a9712075bdd22cfc24 Mon Sep 17 00:00:00 2001
>> From: Wei Liu <wei.liu2@citrix.com>
>> Date: Thu, 5 Oct 2017 10:35:28 +0100
>> Subject: [PATCH] libxl: use correct type modifier for vuart_gfn
>> MIME-Version: 1.0
>> Content-Type: text/plain; charset=UTF-8
>> Content-Transfer-Encoding: 8bit
>>
>> Fixes compilation error like:
>>
>> libxl_console.c: In function ‘libxl__device_vuart_add’:
>> libxl_console.c:379:5: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘xen_pfn_t’ [-Werror=format=]
>> flexarray_append(ro_front, GCSPRINTF("%lu", state->vuart_gfn));
>>
>> Reported-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
>> ---
>> tools/libxl/libxl_console.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/tools/libxl/libxl_console.c b/tools/libxl/libxl_console.c
>> index 13ecf128e2..c05dc28b99 100644
>> --- a/tools/libxl/libxl_console.c
>> +++ b/tools/libxl/libxl_console.c
>> @@ -376,7 +376,7 @@ int libxl__device_vuart_add(libxl__gc *gc, uint32_t domid,
>> flexarray_append(ro_front, "port");
>> flexarray_append(ro_front, GCSPRINTF("%"PRIu32, state->vuart_port));
>> flexarray_append(ro_front, "ring-ref");
>> - flexarray_append(ro_front, GCSPRINTF("%lu", state->vuart_gfn));
>> + flexarray_append(ro_front, GCSPRINTF("%"PRI_xen_pfn, state->vuart_gfn));
> Unfortunately, this is causing an issue as PRI_xen_pfn formats the
> value as a hexadecimal value but xenconsole later reads it as a
> decimal value and tries to map it, which fails and therefore vuart
> console initialization fails.
>
> Earlier, I verified only 32-bit compilation but did not test the
> change. It was a miss from my side. I have tested now with the format
> string changed to PRIu64 and the vuart console is working fine.
That however, would break x86.
andrewcoop@andrewcoop:/local/xen.git/xen$ git grep 'define PRI_xen_pfn' -- :/
include/public/arch-arm.h:276:#define PRI_xen_pfn PRIx64
include/public/arch-x86/xen.h:77:#define PRI_xen_pfn "lx"
The best way to fix this is to introduce a new define for both
architectures which is PRIu64 and "lu" as appropriate.
Suggestions:
PRI_xen_pfn_dec
PRIu_xen_pfn
Neither are great, but the latter does follow the PRI nomenclature.
~Andrew
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: ARM32 - build-issues with xen/arm: vpl011: Add a new vuart node in the xenstore
2017-10-12 19:04 ` Andrew Cooper
@ 2017-10-13 9:17 ` Bhupinder Thakur
0 siblings, 0 replies; 7+ messages in thread
From: Bhupinder Thakur @ 2017-10-13 9:17 UTC (permalink / raw)
To: Andrew Cooper
Cc: Xen-devel, Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk
On 13 October 2017 at 00:34, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
> On 12/10/17 19:54, Bhupinder Thakur wrote:
>> On 5 October 2017 at 15:07, Wei Liu <wei.liu2@citrix.com> wrote:
>>> On Wed, Oct 04, 2017 at 09:58:32PM -0400, Konrad Rzeszutek Wilk wrote:
>>>> I get this when compiling under ARM32 (Ubuntu 15.04,
>>>> gcc (Ubuntu/Linaro 4.9.2-10ubuntu13) 4.9.2):
>>>>
>>>> libxl_console.c: In function ‘libxl__device_vuart_add’:
>>>> libxl_console.c:379:5: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘xen_pfn_t’ [-Werror=format=]
>>>> flexarray_append(ro_front, GCSPRINTF("%lu", state->vuart_gfn));
>>>> ^
>>>> ;
>>> My Wheezy 32bit chroot didn't catch this, sigh.
>>>
>>> Does the following patch work?
>>>
>>> From ae531197382bf0bc003606a9712075bdd22cfc24 Mon Sep 17 00:00:00 2001
>>> From: Wei Liu <wei.liu2@citrix.com>
>>> Date: Thu, 5 Oct 2017 10:35:28 +0100
>>> Subject: [PATCH] libxl: use correct type modifier for vuart_gfn
>>> MIME-Version: 1.0
>>> Content-Type: text/plain; charset=UTF-8
>>> Content-Transfer-Encoding: 8bit
>>>
>>> Fixes compilation error like:
>>>
>>> libxl_console.c: In function ‘libxl__device_vuart_add’:
>>> libxl_console.c:379:5: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘xen_pfn_t’ [-Werror=format=]
>>> flexarray_append(ro_front, GCSPRINTF("%lu", state->vuart_gfn));
>>>
>>> Reported-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>>> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
>>> ---
>>> tools/libxl/libxl_console.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/tools/libxl/libxl_console.c b/tools/libxl/libxl_console.c
>>> index 13ecf128e2..c05dc28b99 100644
>>> --- a/tools/libxl/libxl_console.c
>>> +++ b/tools/libxl/libxl_console.c
>>> @@ -376,7 +376,7 @@ int libxl__device_vuart_add(libxl__gc *gc, uint32_t domid,
>>> flexarray_append(ro_front, "port");
>>> flexarray_append(ro_front, GCSPRINTF("%"PRIu32, state->vuart_port));
>>> flexarray_append(ro_front, "ring-ref");
>>> - flexarray_append(ro_front, GCSPRINTF("%lu", state->vuart_gfn));
>>> + flexarray_append(ro_front, GCSPRINTF("%"PRI_xen_pfn, state->vuart_gfn));
>> Unfortunately, this is causing an issue as PRI_xen_pfn formats the
>> value as a hexadecimal value but xenconsole later reads it as a
>> decimal value and tries to map it, which fails and therefore vuart
>> console initialization fails.
>>
>> Earlier, I verified only 32-bit compilation but did not test the
>> change. It was a miss from my side. I have tested now with the format
>> string changed to PRIu64 and the vuart console is working fine.
>
> That however, would break x86.
>
> andrewcoop@andrewcoop:/local/xen.git/xen$ git grep 'define PRI_xen_pfn' -- :/
> include/public/arch-arm.h:276:#define PRI_xen_pfn PRIx64
> include/public/arch-x86/xen.h:77:#define PRI_xen_pfn "lx"
>
> The best way to fix this is to introduce a new define for both
> architectures which is PRIu64 and "lu" as appropriate.
>
> Suggestions:
>
> PRI_xen_pfn_dec
> PRIu_xen_pfn
>
> Neither are great, but the latter does follow the PRI nomenclature.
Thanks. I will introduce this new format specifier.
Regards,
Bhupinder
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-10-13 9:17 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-05 1:58 ARM32 - build-issues with xen/arm: vpl011: Add a new vuart node in the xenstore Konrad Rzeszutek Wilk
2017-10-05 9:37 ` Wei Liu
2017-10-05 14:14 ` Bhupinder Thakur
2017-10-05 14:16 ` Wei Liu
2017-10-12 18:54 ` Bhupinder Thakur
2017-10-12 19:04 ` Andrew Cooper
2017-10-13 9:17 ` Bhupinder Thakur
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.