lkml.org 
[lkml]   [2021]   [Oct]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [BUG] [5.15] Compilation error in arch/x86/kvm/mmu/spte.h with clang-14
On Mon, Oct 4, 2021 at 2:49 AM Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> On 04/10/21 11:30, torvic9@mailbox.org wrote:
> >
> >> Paolo Bonzini <pbonzini@redhat.com> hat am 04.10.2021 11:26 geschrieben:
> >>
> >>
> >> On 04/10/21 11:08, torvic9@mailbox.org wrote:
> >>> I encounter the following issue when compiling 5.15-rc4 with clang-14:
> >>>
> >>> In file included from arch/x86/kvm/mmu/mmu.c:27:
> >>> arch/x86/kvm/mmu/spte.h:318:9: error: use of bitwise '|' with boolean operands [-Werror,-Wbitwise-instead-of-logical]
> >>> return __is_bad_mt_xwr(rsvd_check, spte) |
> >>> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >>> ||
> >>> arch/x86/kvm/mmu/spte.h:318:9: note: cast one or both operands to int to silence this warning
> >>
> >> The warning is wrong, as mentioned in the line right above:
> >
> > So it's an issue with clang-14 then?
> > (I add Nick and Nathan)
>
> My clang here doesn't have the option, so I'm going to ask---are you
> using W=1? I can see why clang is warning for KVM's code, but in my
> opinion such a check should only be in -Wextra.

This is a newly added warning in top of tree clang.

>
> Paolo
>
> >>
> >> /*
> >> * Use a bitwise-OR instead of a logical-OR to aggregate the reserved
> >> * bits and EPT's invalid memtype/XWR checks to avoid an extra Jcc
> >> * (this is extremely unlikely to be short-circuited as true).
> >> */
> >>
> >> Paolo
> >
>


--
Thanks,
~Nick Desaulniers

\
 
 \ /
  Last update: 2021-10-04 18:15    [W:0.158 / U:0.752 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site