lkml.org 
[lkml]   [2019]   [Oct]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/3] KVM: x86/vPMU: Add lazy mechanism to release perf_event per vPMC
On Wed, Oct 09, 2019 at 11:21:30AM +0200, Paolo Bonzini wrote:
> On 09/10/19 10:16, Peter Zijlstra wrote:

> >> bool bitfields preserve the magic behavior where something like this:
> >>
> >> foo->x = y;
> >>
> >> (x is a bool bitfield) would be compiled as
> >>
> >> foo->x = (y != 0);
> >
> > This is confusion; if y is a single bit bitfield, then there is
> > absolutely _NO_ difference between these two expressions.
>
> y is not in a struct so it cannot be a single bit bitfield. :) If y is
> an int and foo->x is a bool bitfield, you get the following:
>
> foo->x = 6; /* foo->x is 1, it would be 0 for int:1 */
> foo->x = 7; /* foo->x is 1, it would be 1 for int:1 */
>

Urgh, reading hard. You're right!

\
 
 \ /
  Last update: 2019-10-09 11:33    [W:0.032 / U:37.868 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site