Message ID | 20090924152102.8d7d40cf.sfr@canb.auug.org.au (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
On Thu, 2009-09-24 at 15:21 +1000, Stephen Rothwell wrote: > Hi all, > > Today's linux-next build (powerpc ppc44x_defconfig) failed like this: > > In file included from arch/powerpc/kvm/booke.c:31: > arch/powerpc/kvm/timing.h: In function 'kvmppc_account_exit_stat': > arch/powerpc/kvm/timing.h:51: error: bit-field '<anonymous>' width not an integer constant > In file included from arch/powerpc/kvm/booke.h:26, > from arch/powerpc/kvm/booke_emulate.c:23: > arch/powerpc/kvm/timing.h: In function 'kvmppc_account_exit_stat': > arch/powerpc/kvm/timing.h:51: error: bit-field '<anonymous>' width not an integer constant > > Presumably caused by commit 8c87df457cb58fe75b9b893007917cf8095660a0 > ("BUILD_BUG_ON(): fix it and a couple of bogus uses of it"). First, I think there is a real bug here, and the code should read like this (to match the comment): /* type has to be known at build time for optimization */ - BUILD_BUG_ON(__builtin_constant_p(type)); + BUILD_BUG_ON(!__builtin_constant_p(type)); However, I get the same build error *both* ways, i.e. __builtin_constant_p(type) evaluates to both 0 and 1? Either that, or the new BUILD_BUG_ON() macro isn't working... > I applied the following patch for today. This inline function is > only called from one place in one file ... It's also called via kvmppc_account_exit() from a number of places.
diff --git a/arch/powerpc/kvm/timing.h b/arch/powerpc/kvm/timing.h index bb13b1f..4c34099 100644 --- a/arch/powerpc/kvm/timing.h +++ b/arch/powerpc/kvm/timing.h @@ -48,7 +48,7 @@ static inline void kvmppc_set_exit_type(struct kvm_vcpu *vcpu, int type) {} static inline void kvmppc_account_exit_stat(struct kvm_vcpu *vcpu, int type) { /* type has to be known at build time for optimization */ - BUILD_BUG_ON(__builtin_constant_p(type)); + //BUILD_BUG_ON(__builtin_constant_p(type)); switch (type) { case EXT_INTR_EXITS: vcpu->stat.ext_intr_exits++;