From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [RESEND PATCH 1/3] x86: Adding structs to reflect cpuid fields Date: Thu, 18 Sep 2014 12:00:17 +0200 Message-ID: <20140918100016.GA9260@potion.redhat.com> References: <20140917124501.GC5358@nazgul.tnic> <1410958454-7501-1-git-send-email-namit@cs.technion.ac.il> <1410958454-7501-2-git-send-email-namit@cs.technion.ac.il> <20140917132141.GD5358@nazgul.tnic> <20140917140601.GE5358@nazgul.tnic> <20140917150433.GC1273@potion.brq.redhat.com> <20140917152221.GF5358@nazgul.tnic> <20140918002953.GA6918@potion.redhat.com> <20140918071945.GA24842@nazgul.tnic> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Nadav Amit , Ingo Molnar , Paolo Bonzini , "H. Peter Anvin" , Ingo Molnar , Thomas Gleixner , the arch/x86 maintainers , kvm , Linux Kernel Mailing List , Linus Torvalds , Andrew Morton , Peter Zijlstra To: Borislav Petkov Return-path: Content-Disposition: inline In-Reply-To: <20140918071945.GA24842@nazgul.tnic> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org 2014-09-18 09:19+0200, Borislav Petkov: > On Thu, Sep 18, 2014 at 02:29:54AM +0200, Radim Kr=C4=8Dm=C3=A1=C5=99= wrote: > > I think you proposed to use magic constant in place of of MASK_FAM_= X, so >=20 > Huh, what? Your example. It cannot be verbatim MASK_FAM_X in real code. I interpreted it to be a placeholder for 0x1ffff (first 17 bits) and said why I think it is not a good thing. The other interpretation (well named macro) was against your goal. > > Second problem: Most elements don't begin at offset 0, so the usua= l > > retrieval would add a shift, (repurposing max_monitor_line_size) >=20 > So what? Your goal was easy parsing (last sentence of the mail). My argument is that bitfields are easier to read. (With examples.) > > max_monitor_line_size =3D (cpuid & MASK_FAM_X) >> OFFSET_FAM_X; > >=20 > > and it's not better when we write it back after doing stuff. >=20 > Writing back CPUID on baremetal? You can't be serious. We are not talking just about baremetal, see patch [3/3]. There are, and will be new, use cases for modifying and storing cpuid. > Ok, this is getting ridiculous so I'll stop wasting time. I stand by = my > initial statement - this is a bad idea. Acknowledged.