From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7071FC10F03 for ; Thu, 25 Apr 2019 07:50:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 491BF217D7 for ; Thu, 25 Apr 2019 07:50:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728164AbfDYHuc (ORCPT ); Thu, 25 Apr 2019 03:50:32 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:56722 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728089AbfDYHub (ORCPT ); Thu, 25 Apr 2019 03:50:31 -0400 Received: from p5de0b374.dip0.t-ipconnect.de ([93.224.179.116] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1hJZ9B-0007Ip-WE; Thu, 25 Apr 2019 09:50:22 +0200 Date: Thu, 25 Apr 2019 09:50:20 +0200 (CEST) From: Thomas Gleixner To: Fenghua Yu cc: Ingo Molnar , Borislav Petkov , H Peter Anvin , Paolo Bonzini , Dave Hansen , Ashok Raj , Peter Zijlstra , Ravi V Shankar , Xiaoyao Li , Christopherson Sean J , Kalle Valo , Michael Chan , linux-kernel , x86 , kvm@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org Subject: Re: [PATCH v8 13/15] x86/split_lock: Enable split lock detection by default In-Reply-To: <1556134382-58814-14-git-send-email-fenghua.yu@intel.com> Message-ID: References: <1556134382-58814-1-git-send-email-fenghua.yu@intel.com> <1556134382-58814-14-git-send-email-fenghua.yu@intel.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, 24 Apr 2019, Fenghua Yu wrote: > > +static void split_lock_update_msr(void) > +{ > + /* Enable split lock detection */ > + msr_set_bit(MSR_TEST_CTL, TEST_CTL_SPLIT_LOCK_DETECT_SHIFT); > + this_cpu_or(msr_test_ctl_cache, TEST_CTL_SPLIT_LOCK_DETECT); I'm pretty sure, that I told you to utilize the cache proper. Again: > > Nothing in this file initializes msr_test_ctl_cache explicitely. Register > > caching always requires to read the register and store it in the cache > > before doing anything with it. Nothing guarantees that all bits in that MSR > > are 0 by default forever. > > > > And once you do that _before_ calling split_lock_update_msr() then you can > > spare the RMW in that function. So you managed to fix the initializaiton part, but then you still do a pointless RMW. Thanks, tglx