Return-Path: Received: from mail.linutronix.de (193.142.43.55:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 26 Sep 2019 00:54:07 -0000 Received: from mga03.intel.com ([134.134.136.65]) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iDI2n-000582-Gm for speck@linutronix.de; Thu, 26 Sep 2019 02:54:07 +0200 Date: Wed, 25 Sep 2019 17:48:36 -0700 From: Pawan Gupta Subject: [MODERATED] Re: [PATCH v4 04/10] TAAv4 4 Message-ID: <20190926004836.GC16811@guptapadev.amr> References: <20190906080828.GF13480@guptapadev.amr> <00170736-0d97-4a48-2141-ffba4bb67199@intel.com> <20190925225831.a2krvh274t63sjqe@treble> MIME-Version: 1.0 In-Reply-To: <20190925225831.a2krvh274t63sjqe@treble> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: On Wed, Sep 25, 2019 at 05:58:31PM -0500, speck for Josh Poimboeuf wrote: > 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. Updating the changelog and moving this to the end. Thanks, Pawan