Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3222545ybc; Thu, 21 Nov 2019 05:18:07 -0800 (PST) X-Google-Smtp-Source: APXvYqz/oPYsOV3r+Xuh37rbMcEnQHQwwjGkBVUjEWNBaMH+R6ulOC6DnL/bvt/qDiZx/xx5FJjA X-Received: by 2002:adf:ec89:: with SMTP id z9mr10582860wrn.153.1574342286903; Thu, 21 Nov 2019 05:18:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574342286; cv=none; d=google.com; s=arc-20160816; b=q53HSeESt4auUxrICwfP5qxMFHYIm7URfxeshDO0zDYxwuzu7LFfNPiLLfOyLHRbGP 3UNJetMLvnQmQwnLJShHOzEeW5rpFJx6ed6U+zByG8ULkM1S/1US498AcSnbXKRHqt8V qu35k/qvyo2hRjLwGDjB+4DpLhX94ooLHX5jKXzxc+yn9DEMwr7Av7ssqaE0qYAqUX9K C2beIsnG+0tg8dvDA5VQDtWZVSEuMMlSj1zSXKi4K6E1t6a39inDZkrOQmBDQAFunCq9 T4jpkS8sE7XI5r/3aIvaW3SjEBvdyNwGS7W1UlsbdWYbH4GWxZvFwPs5YMjNJl3SwCQw n79Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=zcxVE09ZpFK6OJ0n+EKFXEht3YuLUol+uDR/H2/qeEg=; b=0RC78qQtc6Lxdz2TIJL20Zzi5Ql/K6kP+XyvwidkOd8TZ8cYdAk3vkZd0rqgvkWvwP Iy1YB7I4XtKO9e/GZ5GfVcS8I39TcCECUSkly4KLUTptbTwwpnINUlcmrOVCxOUAgCrR Z5p8kN321BYhlYtOOTOa1IOPKUXJBiYAu7E191odvUv+nfq+0uxxTOEiu0oLlP27altI k17kxvP7KLuU/pndyoZe+fTnNHIP7OVAMptnS5J9qPveM9C7SkbEr+6ILNY4WQa7gf3b DnjszcOXt6TkLuDVGj9uTnlBTC0zPgVeQeD+qVQLxTdIgH6hwMneuhuS8XdyyY2nTt10 4uKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (dns failure for signature) header.i=@infradead.org header.s=merlin.20170209 header.b="wAzZ/0Dm"; 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 e47si2002388eda.73.2019.11.21.05.17.41; Thu, 21 Nov 2019 05:18:06 -0800 (PST) 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; dkim=temperror (dns failure for signature) header.i=@infradead.org header.s=merlin.20170209 header.b="wAzZ/0Dm"; 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 S1726593AbfKUNPn (ORCPT + 99 others); Thu, 21 Nov 2019 08:15:43 -0500 Received: from merlin.infradead.org ([205.233.59.134]:55452 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726293AbfKUNPm (ORCPT ); Thu, 21 Nov 2019 08:15:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=zcxVE09ZpFK6OJ0n+EKFXEht3YuLUol+uDR/H2/qeEg=; b=wAzZ/0DmM3amgNmGVbMmwDJW2 0wGpPezuqWHmrVECAGZG2FfvvmsJAsPkUPSqIGGq/zCSbtfAF8lEzi8AgM8a5DGBFLV/V0tz2ZpYS IL44hBEWw8zjnxVZk1fn6nyhXSBPzEC75nKm4FtqToGW1FCHNTUohdCrjmAfg1qoayj/krh5p14BC VwULomSnIfg4oavNIeTehYFgKnM3hBImy8Fvt9fvdFYpR5cYjtmeFg7GlU4vhbhkG1R/MmMi+MbKw 11pa6nuBPCa85UyyfGTrkG8ucFD7umgQVhE2iM2IEqz9B5jOv9EcEoPhjpEzuswyxjrvOnvC3vVnt e/5WtVJJQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXmIu-0002UN-Rd; Thu, 21 Nov 2019 13:15:30 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 5E8C730068E; Thu, 21 Nov 2019 14:14:11 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 3C902201DD6AF; Thu, 21 Nov 2019 14:15:22 +0100 (CET) Date: Thu, 21 Nov 2019 14:15:22 +0100 From: Peter Zijlstra To: Ingo Molnar Cc: Fenghua Yu , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , Tony Luck , Ashok Raj , Ravi V Shankar , linux-kernel , x86 Subject: Re: [PATCH v10 6/6] x86/split_lock: Enable split lock detection by kernel parameter Message-ID: <20191121131522.GX5671@hirez.programming.kicks-ass.net> References: <1574297603-198156-1-git-send-email-fenghua.yu@intel.com> <1574297603-198156-7-git-send-email-fenghua.yu@intel.com> <20191121060444.GA55272@gmail.com> <20191121130153.GS4097@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191121130153.GS4097@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 21, 2019 at 02:01:53PM +0100, Peter Zijlstra wrote: > On Thu, Nov 21, 2019 at 07:04:44AM +0100, Ingo Molnar wrote: > > * Fenghua Yu wrote: > > > > + split_lock_detect > > > + [X86] Enable split lock detection > > > + This is a real time or debugging feature. When enabled > > > + (and if hardware support is present), atomic > > > + instructions that access data across cache line > > > + boundaries will result in an alignment check exception. > > > + When triggered in applications the kernel will send > > > + SIGBUS. The kernel will panic for a split lock in > > > + OS code. > > > > It would be really nice to be able to enable/disable this runtime as > > well, has this been raised before, and what was the conclusion? > > It has, previous versions had that. Somehow a lot of things went missing > and we're back to a broken neutered useless mess. > > The problem appears to be that due to hardware design the feature cannot > be virtualized, and instead of then disabling it when a VM runs/exists > they just threw in the towel and went back to useless mode.. :-( > > This feature MUST be default enabled, otherwise everything will > be/remain broken and we'll end up in the situation where you can't use > it even if you wanted to. > > Imagine the BIOS/EFI/firmware containing an #AC exception. At that point > the feature becomes useless, because you cannot enable it without your > machine dying. > > Now, from long and painful experience we all know that if a BIOS can be > wrong, it will be. Therefore this feature will be/is useless as > presented. > > And I can't be arsed to look it up, but we've been making this very same > argument since very early (possible the very first) version. > > So this version goes straight into the bit bucket. Please try again. Also, just to remind everyone why we really want this. Split lock is a potent, unprivileged, DoS vector. It works nicely across guests and everything. Furthermore no sane software should have #AC, because RISC machines have been throwing alignment checks on stupid crap like that forever. And even on x86, where it 'works' it has been a performance nightmare for pretty much ever since we lost the Front Side Bus or something like that.