From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mx3-rdu2.redhat.com ([66.187.233.73] helo=mx1.redhat.com) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fBXbX-0004NE-4x for speck@linutronix.de; Thu, 26 Apr 2018 05:29:55 +0200 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C65BC40858C3 for ; Thu, 26 Apr 2018 03:29:48 +0000 (UTC) Received: from washington.bos.jonmasters.org (ovpn-126-71.rdu2.redhat.com [10.10.126.71]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 97E57202323B for ; Thu, 26 Apr 2018 03:29:48 +0000 (UTC) Subject: [MODERATED] Re: [PATCH v2] Linux Patch 1/1 References: <92c45587-5eb3-2421-6fc1-42e74a715e30@linux.intel.com> From: Jon Masters Message-ID: <1941b004-3144-fdb4-4f82-e3070202f565@redhat.com> Date: Wed, 25 Apr 2018 23:29:48 -0400 MIME-Version: 1.0 In-Reply-To: <92c45587-5eb3-2421-6fc1-42e74a715e30@linux.intel.com> Content-Type: multipart/mixed; boundary="fByGCMLhrtNMusC51rnCZJMn2xz7shbd2"; protected-headers="v1" To: speck@linutronix.de List-ID: This is an OpenPGP/MIME encrypted message (RFC 4880 and 3156) --fByGCMLhrtNMusC51rnCZJMn2xz7shbd2 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable One general question beyond the below: Should we define a new auxvec for 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 mitigat= ion */ > +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) but the actual MSR is a u64. It might be worth a comment [ I've had to sanitize some of the previous IBRS assembly routines we've got in RHEL that were explicitly zeroing the high order bits during the MSR write to make sure we handle preserving those in case of future mitigations. ] > +#define TIF_RDS 5 /* Reduced data speculation */ In the threadinfo for x86 call it whatever, but previous comment applies overall on naming. Otherwise it looks ok. I prefer changing the name to something non-x86, and would like to know whether Linus would rather have a generic set of prctl knobs for speculation controls under one common name. Jon. --=20 Computer Architect | Sent from my Fedora powered laptop --fByGCMLhrtNMusC51rnCZJMn2xz7shbd2--