All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Julien Grall <julien.grall@arm.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH for-4.9] x86/mm: Placate DEADCODE Coverity warning
Date: Thu, 01 Jun 2017 05:21:32 -0600	[thread overview]
Message-ID: <593014DC020000780015EABB@prv-mh.provo.novell.com> (raw)
In-Reply-To: <a873f459-5672-5c67-e5b7-ac22d82f5b41@arm.com>

>>> On 01.06.17 at 13:18, <julien.grall@arm.com> wrote:
> Hi Jan,
> 
> On 01/06/17 12:15, Jan Beulich wrote:
>>>>> On 01.06.17 at 13:09, <julien.grall@arm.com> wrote:
>>> Hi Andrew,
>>>
>>> On 31/05/17 14:23, Andrew Cooper wrote:
>>>> On 31/05/17 09:52, Julien Grall wrote:
>>>>> Hi,
>>>>>
>>>>> On 05/22/2017 02:32 PM, Jan Beulich wrote:
>>>>>>>>> On 22.05.17 at 15:12, <andrew.cooper3@citrix.com> wrote:
>>>>>>> _PAGE_GNTTAB is only used in debug builds of Xen; in release builds,
>>>>>>> it has
>>>>>>> the value 0.  Coverity complains that "l1e_get_flags(l1e) & 0" is
>>>>>>> logically
>>>>>>> dead.
>>>>>>>
>>>>>>> Add an extra condition into the logic to skip the flag check if
>>>>>>> _PAGE_GNTTAB
>>>>>>> is 0.
>>>>>>
>>>>>> And this helps? To me "if ( 0 && ... )" and "if ( (x & 0) && ... )" look
>>>>>> logically the same (i.e. I'd expect the same warnings to be triggered
>>>>>> [or not]).
>>>>>
>>>>> I haven't seen any answer on this question. Andrew, does this patch
>>>>> still hold for Xen 4.9?
>>>>
>>>> Sorry - it fell through the cracks, but yes, it does stand for 4.9.
>>>>
>>>> As to the "if ( 0 && ... )" and "if ( (x & 0) && ... )", one is very
>>>> clearly a "short circuit every thing else if this value is zero", while
>>>> the other looks like a programming mistake, which is also why I expect
>>>> this to resolve Coverity's complaint.
>>>>
>>>> Unfortunately, I can't be certain that this will resolve the issue until
>>>> it gets committed, as I don't have a useful way to run Coverity on
>>>> arbitrary non-debug builds.
>>>
>>> Are we running staging-4.* branch on Coverity? Looking at the git, I see
>>> *coverity* branch only on unstable.
>>
>> Yes, so my suggestion would be to commit the patch on master, see
>> if it helps, and if so consider backporting for 4.9. If it doesn't help,
>> it should be reverted or replaced by something "better".
> 
> Well master has now debug enabled and AFAIU the warning can only 
> occurred on non-debug build. So I am not sure how this would help to be 
> in master.

Oh, good point. I think it would really be a good idea to have
both debug and non-debug builds tested, which at once would
avoid sudden bursts of issues when switching the default.

Jan


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

  reply	other threads:[~2017-06-01 11:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-22 13:12 [PATCH for-4.9] x86/mm: Placate DEADCODE Coverity warning Andrew Cooper
2017-05-22 13:32 ` Jan Beulich
2017-05-31  8:52   ` Julien Grall
2017-05-31 13:23     ` Andrew Cooper
2017-06-01 11:09       ` Julien Grall
2017-06-01 11:15         ` Jan Beulich
2017-06-01 11:18           ` Julien Grall
2017-06-01 11:21             ` Jan Beulich [this message]
2017-06-01 17:25               ` Julien Grall
2017-06-01 17:44                 ` Andrew Cooper

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=593014DC020000780015EABB@prv-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=julien.grall@arm.com \
    --cc=xen-devel@lists.xen.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 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.