All of lore.kernel.org
 help / color / mirror / Atom feed
* staging aarch64 build fails in xc_dom_arm.c
@ 2017-05-30 15:27 Olaf Hering
  2017-05-30 15:34 ` Andrew Cooper
  0 siblings, 1 reply; 4+ messages in thread
From: Olaf Hering @ 2017-05-30 15:27 UTC (permalink / raw)
  To: xen-devel


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

With gcc7 the aarch64 build in staging fails:

 xc_dom_arm.c: In function 'meminit':
 xc_dom_arm.c:229:31: error: 'domctl.u.address_size.size' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      if ( domctl.u.address_size.size == 0 )
           ~~~~~~~~~~~~~~~~~~~~~^~~~~

Olaf

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

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

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

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

* Re: staging aarch64 build fails in xc_dom_arm.c
  2017-05-30 15:27 staging aarch64 build fails in xc_dom_arm.c Olaf Hering
@ 2017-05-30 15:34 ` Andrew Cooper
  2017-05-30 15:40   ` Olaf Hering
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Cooper @ 2017-05-30 15:34 UTC (permalink / raw)
  To: Olaf Hering, xen-devel

On 30/05/17 16:27, Olaf Hering wrote:
> With gcc7 the aarch64 build in staging fails:
>
>  xc_dom_arm.c: In function 'meminit':
>  xc_dom_arm.c:229:31: error: 'domctl.u.address_size.size' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>       if ( domctl.u.address_size.size == 0 )
>            ~~~~~~~~~~~~~~~~~~~~~^~~~~

That's because it really will be uninitialised if the caller passes
anything other than "xen-3.0-aarch64" or "xen-3.0-armv7l" into guest type.

Does

diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index e7d4bd0..e669fb0 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -223,6 +223,8 @@ static int set_mode(xc_interface *xch, domid_t
domid, char *guest_type)
 
     domctl.domain = domid;
     domctl.cmd    = XEN_DOMCTL_set_address_size;
+    domctl.u.address_size.size = 0;
+
     for ( i = 0; i < ARRAY_SIZE(types); i++ )
         if ( !strcmp(types[i].guest, guest_type) )
             domctl.u.address_size.size = types[i].size;

help?

~Andrew

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

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

* Re: staging aarch64 build fails in xc_dom_arm.c
  2017-05-30 15:34 ` Andrew Cooper
@ 2017-05-30 15:40   ` Olaf Hering
  2017-05-30 15:43     ` Andrew Cooper
  0 siblings, 1 reply; 4+ messages in thread
From: Olaf Hering @ 2017-05-30 15:40 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: xen-devel


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

On Tue, May 30, Andrew Cooper wrote:

> Does
> +    domctl.u.address_size.size = 0;
> help?

Likely yes. I just scanned the buildlogs and found this failure.
I do not have a ARM toolchain around to double check.
Not sure why the marco, or its usage, is not like 'struct xen_domctl domctl = {}'

Olaf

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

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

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

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

* Re: staging aarch64 build fails in xc_dom_arm.c
  2017-05-30 15:40   ` Olaf Hering
@ 2017-05-30 15:43     ` Andrew Cooper
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Cooper @ 2017-05-30 15:43 UTC (permalink / raw)
  To: Olaf Hering; +Cc: xen-devel

On 30/05/17 16:40, Olaf Hering wrote:
> On Tue, May 30, Andrew Cooper wrote:
>
>> Does
>> +    domctl.u.address_size.size = 0;
>> help?
> Likely yes. I just scanned the buildlogs and found this failure.
> I do not have a ARM toolchain around to double check.
> Not sure why the marco, or its usage, is not like 'struct xen_domctl domctl = {}'

I've never been convinced by the utility of those macros.  All they do
is make it cognitively harder to read the code.

I think I even tried to kill them once, but got nacked.

Either way, my position still stands that they should be relegated to
/dev/null and we pretend that they never existed.

~Andrew

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

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

end of thread, other threads:[~2017-05-30 15:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-30 15:27 staging aarch64 build fails in xc_dom_arm.c Olaf Hering
2017-05-30 15:34 ` Andrew Cooper
2017-05-30 15:40   ` Olaf Hering
2017-05-30 15:43     ` Andrew Cooper

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.