Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4572999yba; Tue, 9 Apr 2019 23:45:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqyxD53ZUQZQjg9rJWcHIEAyGP277WtaZLcAi/kFwiltPPmS3Uga5kZjZTMnDM9oI3Hnk/kX X-Received: by 2002:a17:902:28ab:: with SMTP id f40mr21291635plb.297.1554878753874; Tue, 09 Apr 2019 23:45:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554878753; cv=none; d=google.com; s=arc-20160816; b=JlWeeXLhXHDd/MPGqEpJn1Qt2/RsNDkvdq16SU17c6fVXQBCjC3SHlDnw+L/kJSHFv SREkm6dzDXE5CpBsyDuAvO8XyI3rM5JXOaGpDge6cXiWAGYP/IvlpVkofshUp70HphOk cWZ3dh7V70vB1m81j4H/f5jB/n0MXk9Dv7WTfxai/tKMYnyMV4Qsxb2+b8v00fIhhR2r k/6W0mlDn2ZP/ggJKpkTKWg4PBBayHm1RgbLyrnZdCUnqTi/2Uv0QLHkJal72ZFFt6EV Cpis1s91Sj3IjoL8IRrPZqjMgW7EZC3VPiEsZavZKurUnrA+XcfCbhX+/Ny3IcuUtx6M sG9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=YsEzog1VDoDqjHuugy1cxisgzx7xmowalcDYvqR3Wpk=; b=RSewxg4x6udYQSnlhCbJT/DTt+ofMKzTRUPozqdRPyyMAmcS27GP4OUxlht2zXrJl2 FfZ1VJ60rHJmBEEE5n8Cg4uVCn/nGPc/Bw9RA46sbe4oF3iBLPrltk1yKUwOzfosoMMH mffRI4g8zdw183qBkHcSfdMa3P2BksrDAIAPZsgqttbZnbTBEAI7tHtaiqUTKM+dfdMJ 5k98R/dhjbT0DzpmFED3K1JF5xynYxotCB0Mm0LrlQgvaQI49Lb/7gwuM/MWFuNy5gLf vD9gVNXsWDXDP/EJdisAnlQEMmu4g68wBTwENKhqC7bryU3D4TrSnnFv0mN1sGBv8Qo8 Xpcw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l25si32747453pfi.9.2019.04.09.23.45.38; Tue, 09 Apr 2019 23:45:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727753AbfDJGbr (ORCPT + 99 others); Wed, 10 Apr 2019 02:31:47 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:57740 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726056AbfDJGbr (ORCPT ); Wed, 10 Apr 2019 02:31:47 -0400 Received: from 135.red-80-26-73.staticip.rima-tde.net ([80.26.73.135] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1hE6lg-0007QM-Pa; Wed, 10 Apr 2019 08:31:32 +0200 Date: Wed, 10 Apr 2019 08:31:31 +0200 (CEST) From: Thomas Gleixner To: Fenghua Yu cc: Ingo Molnar , Borislav Petkov , H Peter Anvin , Dave Hansen , Paolo Bonzini , Ashok Raj , Peter Zijlstra , Kalle Valo , Xiaoyao Li , Michael Chan , Ravi V Shankar , linux-kernel , x86 , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, kvm@vger.kernel.org Subject: Re: [PATCH v6 13/20] x86/split_lock: Enable split lock detection by default In-Reply-To: <20190410000229.GA209676@romley-ivt3.sc.intel.com> Message-ID: References: <1554326526-172295-1-git-send-email-fenghua.yu@intel.com> <1554326526-172295-14-git-send-email-fenghua.yu@intel.com> <20190410000229.GA209676@romley-ivt3.sc.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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 9 Apr 2019, Fenghua Yu wrote: > On Thu, Apr 04, 2019 at 08:07:57PM +0200, Thomas Gleixner wrote: > > On Wed, 3 Apr 2019, Fenghua Yu wrote: > > > static void early_init_intel(struct cpuinfo_x86 *c) > > > { > > > u64 misc_enable; > > > > > > + init_split_lock_detect(c); > > > > so we have in early boot: > > > > early_cpu_init() > > early_identify_cpu() > > this_cpu->c_early_init(c) > > early_init_intel() { > > init_split_lock_detect(); > > } > > .... > > cpu_set_core_cap_bits(c) > > set(FEATURE_SPLIT_LOCK) > > > > I don't have to understand how init_split_lock_detect() will magically see > > the feature bit which gets set afterwards, right? > > early_init_intel() is called twice on the boot CPU. Besides it's called > in earl_cpu_init(), it's also called in: > identify_boot_cpu() > identify_cpu() > init_intel() > early_init_intel() > init_split_lock_detect(); > > It's true that init_split_lock_detect() doesn't see the feature bit when > it's called for the first time in early_cpu_init(). But it sees the feature > bit when it's called for the second time in identify_boot_cpu(). That's hideous, really. > So is init_split_lock_detect() in the right place? You're not seriously asking that? It's obviously not the right place. We are not placing calls at random points just because they happen to work by chance. Thanks, tglx