Return-path: Received: from mga06.intel.com ([134.134.136.31]) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fDEVH-00030F-2G for speck@linutronix.de; Mon, 30 Apr 2018 21:30:27 +0200 Subject: [MODERATED] Re: [patch V7 15/15] SBB 15 References: <20180429193045.711908246@linutronix.de> <20180429193938.717571156@linutronix.de> From: Tim Chen Message-ID: Date: Mon, 30 Apr 2018 12:30:18 -0700 MIME-Version: 1.0 In-Reply-To: <20180429193938.717571156@linutronix.de> Content-Type: multipart/mixed; boundary="6b35VZTz2qAC0FqbBbuwfMqkCALXkguU8"; protected-headers="v1" To: speck@linutronix.de List-ID: This is an OpenPGP/MIME encrypted message (RFC 4880 and 3156) --6b35VZTz2qAC0FqbBbuwfMqkCALXkguU8 Content-Type: multipart/mixed; boundary="z9hAP8WUERLpSXeI7CASFXZ9RJzhGkTAN" --z9hAP8WUERLpSXeI7CASFXZ9RJzhGkTAN Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 04/29/2018 12:31 PM, speck for Thomas Gleixner wrote: >+static int sbb_prctl_set(unsigned long ctrl) >+{ >+ bool rds =3D !!test_tsk_thread_flag(current, TIF_RDS); >+ >+ if (ssb_mode !=3D SPEC_STORE_BYPASS_PRCTL) >+ return -ENXIO; Perhaps we should not use the prctl if we don't have the SSB bug. Something like: if (ssb_mode !=3D SPEC_STORE_BYPASS_PRCTL || !boot_cpu_has_bug(X86_BUG_SPEC_STORE_BYPASS)) return -ENXIO;=20 Thanks. Tim >+ >+ if (ctrl =3D=3D PR_SPEC_ENABLE) >+ clear_tsk_thread_flag(current, TIF_RDS); >+ else >+ set_tsk_thread_flag(current, TIF_RDS); >+ >+ if (rds !=3D !!test_tsk_thread_flag(current, TIF_RDS)) >+ speculative_store_bypass_update(); >+ return 0; +} + --z9hAP8WUERLpSXeI7CASFXZ9RJzhGkTAN-- --6b35VZTz2qAC0FqbBbuwfMqkCALXkguU8--