Return-path: Received: from mga18.intel.com ([134.134.136.126]) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fBk4l-00012P-KU for speck@linutronix.de; Thu, 26 Apr 2018 18:48:56 +0200 Subject: [MODERATED] Re: [PATCH v2] Linux Patch 1/1 References: <92c45587-5eb3-2421-6fc1-42e74a715e30@linux.intel.com> <1941b004-3144-fdb4-4f82-e3070202f565@redhat.com> From: Tim Chen Message-ID: <36c2ed71-b058-c496-e8c9-94f097083efd@linux.intel.com> Date: Thu, 26 Apr 2018 09:48:51 -0700 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="QHnryiVbNUmojfSyqUEZQCkZED0OFt6fP"; protected-headers="v1" To: speck@linutronix.de List-ID: This is an OpenPGP/MIME encrypted message (RFC 4880 and 3156) --QHnryiVbNUmojfSyqUEZQCkZED0OFt6fP Content-Type: multipart/mixed; boundary="KQEskJrzUroN4z8kO5675mMaa0sUCMYZA" --KQEskJrzUroN4z8kO5675mMaa0sUCMYZA Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 04/26/2018 05:03 AM, speck for Thomas Gleixner wrote: > On Wed, 25 Apr 2018, speck for Jon Masters wrote: >=20 >> One general question beyond the below: Should we define a new auxvec f= or >> processes to be told about speculation restrictions that they might be= >> operating under, in case those are inherited, say across a fork? >> >> Comments on the rest of the patch... >> >> On 04/25/2018 08:11 PM, speck for Tim Chen wrote: >> >>> +/* cpu's MSR_IA32_SPEC_CTRL state for speculation store bypass mitig= ation */ >>> +DECLARE_PER_CPU(int, rds_msr_val); >> >> We do similar in RHEL today for IBRS, for similar performance reasons.= >> Ultimately you /might/ want this to include additional bits for future= >> mitigations that are toggled on top of the x86_spec_ctrl_base and thus= >> call it something a bit more generic, but that's a nit for now. >> >> Also, you're using an int here for the rds bit (which is fair enough) >=20 > No. It's not fair enough. >=20 > Variables which store information which is read or written to registers= > should have an explicit data type which matches the register. Everythin= g > else with and without a comment is just sloppy hackery and utter crap. >=20 > It's fine to use u32 if you are sure that this is the lower part of the= > MSR, but then the variable name should reflect it, but int and a name w= hich > suggest that it's the actual MSR value is just not going to fly. It is an oversight on my part. Will fix this in next version of patch. Thanks. Tim --KQEskJrzUroN4z8kO5675mMaa0sUCMYZA-- --QHnryiVbNUmojfSyqUEZQCkZED0OFt6fP--