[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180620013624.GH169030@google.com>
Date: Tue, 19 Jun 2018 18:36:24 -0700
From: Matthias Kaehlcke <mka@...omium.org>
To: Joe Perches <joe@...ches.com>
Cc: Paolo Bonzini <pbonzini@...hat.com>,
Nick Desaulniers <ndesaulniers@...gle.com>, rkrcmar@...hat.com,
Thomas Gleixner <tglx@...utronix.de>, hpa@...or.com,
x86@...nel.org, kvm@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>,
Masahiro Yamada <yamada.masahiro@...ionext.com>
Subject: Re: [PATCH] kvm: x86: mmu: Add cast to negated bitmasks in
update_permission_bitmask()
On Tue, Jun 19, 2018 at 05:18:02PM -0700, Joe Perches wrote:
> On Tue, 2018-06-19 at 16:45 -0700, Matthias Kaehlcke wrote:
> > On Tue, Jun 19, 2018 at 02:55:05PM -0700, Joe Perches wrote:
> > > Well, you advocate to disable a possibly useful warning globally ...
> > > You're advocating for making the code more complex/ugly for a
> > > condition where the result is identical.
> > My goal is no to make the code (slightly) more complex/ugly but have
> > the rest of the kernel benefit from a possibly useful warning.
>
> For what case in the kernel is this warning useful?
It's less about finding errors that are currently in the kernel (I
don't know if there are any) and more about preventing new ones from
creeping in.
Code similar to the example from the link shared by Nick could easily
be part of some kernel driver:
https://wiki.sei.cmu.edu/confluence/display/c/EXP14-C.+Beware+of+integer+promotion+when+performing+bitwise+operations+on+integer+types+smaller+than+int
Powered by blists - more mailing lists