Return-Path: Received: from mail.linutronix.de (193.142.43.55:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 25 Sep 2019 22:58:45 -0000 Received: from mx1.redhat.com ([209.132.183.28]) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iDGF7-0003Jo-3s for speck@linutronix.de; Thu, 26 Sep 2019 00:58:41 +0200 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 461D2305FC56 for ; Wed, 25 Sep 2019 22:58:34 +0000 (UTC) Received: from treble (ovpn-120-76.rdu2.redhat.com [10.10.120.76]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CB4C15C221 for ; Wed, 25 Sep 2019 22:58:33 +0000 (UTC) Date: Wed, 25 Sep 2019 17:58:31 -0500 From: Josh Poimboeuf Subject: [MODERATED] Re: [PATCH v4 04/10] TAAv4 4 Message-ID: <20190925225831.a2krvh274t63sjqe@treble> References: =?utf-8?q?=3C5035f099110b983ecd7af0cb8dafb1c061a20510=2E1567543894=2Egi?= =?utf-8?q?t=2Epawan=2Ekumar=2Egupta=40linux=2Eintel=2Ecom=3E?= <20190906080828.GF13480@guptapadev.amr> <00170736-0d97-4a48-2141-ffba4bb67199@intel.com> MIME-Version: 1.0 In-Reply-To: <00170736-0d97-4a48-2141-ffba4bb67199@intel.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: On Mon, Sep 09, 2019 at 08:42:54AM -0700, speck for Dave Hansen wrote: > >>> +static void tsx_update_this_cpu(void *arg) > >>> +{ > >>> + struct cpuinfo_x86 *c = &cpu_data(smp_processor_id()); > >>> + unsigned long enable = (unsigned long)arg; > >>> + > >>> + if (enable) { > >>> + tsx_enable(); > >>> + set_cpu_cap(c, X86_FEATURE_RTM); > >>> + } else { > >>> + tsx_disable(); > >>> + clear_cpu_cap(c, X86_FEATURE_RTM); > >>> + } > >>> +} > >> > >> This makes me really nervous. > >> > >> Do we have any other *runtime* (after early boot) manipulation of > >> X86_FEATURE_* flags? > > > > I don't think we have an option. TSX_CTRL MSR write would change the > > CPUID anyways. It is probably better to have X86_FEATURE_RTM reflect > > the correct state. > > We have a choice. > > If we don't have the infrastructure to do something right, we don't do > it. Poking at the bits and praying nothing breaks is not my preferred > approach. Could you please take a look and try to answer my question: > > Do we have any other *runtime* (after early boot) manipulation > of X86_FEATURE_* flags? > > If the answer is no, then there's some homework that needs to be done to > see what the implications are here and to make sure that nothing will > break. From the changelog and comments, it appears that research hasn't > been done. Right. This patch feels dangerous and fragile... And what's the point anyway? There's hardly any justification in the patch description. Is it a theoretical problem or is there a real-world production use case? Please drop this patch, or at least, put it at the very end of the set. -- Josh