xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: "Andrew Cooper" <andrew.cooper3@citrix.com>
Cc: Charles Arnold <CARNOLD@suse.com>,
	xen-devel <xen-devel@lists.xenproject.org>,
	Wei Liu <wei.liu2@citrix.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] Ping: [PATCH 2/2] x86/mtrr: fix build with gcc9
Date: Mon, 17 Jun 2019 10:08:02 -0600	[thread overview]
Message-ID: <5D07BAE20200007800238E5D@prv1-mh.provo.novell.com> (raw)
In-Reply-To: <fb71b7c1-133d-b68d-f4a4-ce788cb7d32a@citrix.com>

>>> On 17.06.19 at 17:47, <andrew.cooper3@citrix.com> wrote:
> On 14/06/2019 16:56, Jan Beulich wrote:
>>>>> On 07.03.19 at 11:32,  wrote:
>>> generic.c: In function ‘print_mtrr_state’:
>>> generic.c:210:11: error: ‘%0*lx’ directive output between 1 and 1073741823 
>>> bytes may cause result to exceed ‘INT_MAX’ [-Werror=format-overflow=]
>>>   210 |    printk("%s  %u base %0*"PRIx64"000 mask %0*"PRIx64"000 %s\n",
>>>       |           ^~~~~~~~~~~~~~~~~
>>> generic.c:210:44: note: format string is defined here
>>>   210 |    printk("%s  %u base %0*"PRIx64"000 mask %0*"PRIx64"000 %s\n",
>>> generic.c:210:11: note: directive argument in the range [0, 
>>> 4503599627370495]
>>>   210 |    printk("%s  %u base %0*"PRIx64"000 mask %0*"PRIx64"000 %s\n",
>>>       |           ^~~~~~~~~~~~~~~~~
>>> generic.c:210:11: note: assuming directive output of 1 byte
>>>
>>> Restrict the width of the variable "width" controlling the number of
>>> address digits output.
>>>
>>> Reported-by: Charles Arnold <carnold@suse.com>
>>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> This one's still pending for us to build cleanly with gcc 9.
> 
> I can't reproduce it with any build of GCC 9 (all of which are straight
> from the upstream tree).  Is this a locally patched version?

This was with a pre-RC version of gcc9; I wouldn't be surprised if they
changed their code before the release. I admit it didn't occur to me to
retry building without the patch.

>> I know you'd like it be done differently, but I'm not happy with the
>> implications of your suggestion, and I've explained why.
> 
> But you haven't adequately (IMO) addressed any of the shortcomings. 
> Notably that the argument falls down on all common Intel platforms, and
> its still a piece of magic which only you know how to interpret.

I'm unaware of shortcomings, and the "magics" of the number of digits
logged is simply not relevant to people now knowing of this. It is
relevant to people like me who do know. And I can't do anything about
the number of address bits on common Intel platforms not being evenly
divisible by 4.

>> I would
>> (hesitantly, i.e. just to get the build issue out of the way) ack
>> your variant if you submitted it, but I'd appreciate if you would
>> re-consider whether you could live with going with the one here.
> 
> I'm happy to put a SoB and real commit message on my patch, but I'd like
> to actually get to the bottom of the build failure, given that it hasn't
> been reproduced by anyone else using GCC 9.
> 
> I don't view limiting the type as a viable fix, because all does is try
> to game whichever piece of logic GCC is using to object to the
> construct, and is therefore likely to break again in the future.

Well, I can't exclude this happening, but the mention of INT_MAX in
the diagnostic doesn't seem to make this very likely with an 8-bit wide
width specifier.

Jan


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

  reply	other threads:[~2019-06-17 16:08 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-07 10:23 [PATCH 0/2] x86: fix build with gcc9 Jan Beulich
2019-03-07 10:31 ` [PATCH 1/2] x86/e820: " Jan Beulich
2019-03-07 10:46   ` Roger Pau Monné
2019-03-07 10:55     ` Wei Liu
2019-03-15 16:07   ` Andrew Cooper
2019-03-18 10:00     ` Jan Beulich
2019-03-07 10:32 ` [PATCH 2/2] x86/mtrr: " Jan Beulich
2019-03-07 10:55   ` Roger Pau Monné
2019-03-07 11:22     ` Jan Beulich
2019-03-07 14:20       ` Roger Pau Monné
2019-03-15 16:21   ` Andrew Cooper
2019-03-18 10:11     ` Jan Beulich
2019-03-18 10:30       ` Andrew Cooper
2019-03-18 10:53         ` Jan Beulich
     [not found]   ` <5C80F32C0200000000103FF7@prv1-mh.provo.novell.com>
     [not found]     ` <5C80F32C0200007800232900@prv1-mh.provo.novell.com>
     [not found]       ` <5C80F32C0200000000104D67@prv1-mh.provo.novell.com>
     [not found]         ` <5C80F32C0200007800238665@prv1-mh.provo.novell.com>
2019-06-14 15:56           ` [Xen-devel] Ping: " Jan Beulich
2019-06-17 15:47             ` Andrew Cooper
2019-06-17 16:08               ` Jan Beulich [this message]
2019-03-07 11:12 ` [PATCH 0/2] x86: " Wei Liu
2019-03-07 11:37 ` M A Young
2019-03-07 11:57   ` Jan Beulich
2019-03-15 12:33 ` Ping: " Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5D07BAE20200007800238E5D@prv1-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=CARNOLD@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).