Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp111956img; Wed, 20 Mar 2019 15:23:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqwa3ux9kO/n6SdpGRezR+cBq4a0dwsdEenEZsq2xoF5l31AI2WKqUfnlBdV5vX4QGTlCzLj X-Received: by 2002:a17:902:bb90:: with SMTP id m16mr147869pls.49.1553120619478; Wed, 20 Mar 2019 15:23:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553120619; cv=none; d=google.com; s=arc-20160816; b=BFDbFYUZFadFEQRpkLEAt8GI1K3wsUYZ8LfW3vaAS+4XZVh88nOSyGDH6w/e9iM4GQ TEBuYCAKqH6HMfeD6eJX5yzYxtVTQcpW6LaWP2xrtwjHxgdDWhp4L+GoC5H3ftgMk4Uo Ox3BsAF9jrgrkEMt9h8suy8CIlZNdHi6HMma5wEfl5iiNgDCA0ft/9jli3bd09SqlA30 1RQSGAbn14Prq1DjddpRcqUxuINfRlcyggFy/JZYjgV9NCVDoXwXg0rADUM683rxPI3e vRo/LzfiRy76Y0MbLCnUckzTQtixvgW0vu0CY3y/Scnd+6NFkHegHHZSmcfwzGHOS/r1 47MQ== 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=BYzz+wefXr4lloqI93uXDNGiX+SSPf7icG7IRc4Yt04=; b=GAo+0k3pQrUVSpsAsIC20x+8NPAjanJsZ8NxCzsTd8ib3uKmuWbrGVhPfsjM+fRnd8 NuJ16ct0w4MwQ1xrTk7nucTs+5cW/3RV2ljKmyX3TrJH5qZFthx1ed2gJMpGHvPuVcgd zUjgXxSoj5Mr3FgE5jCrBwPMJwBemlQODo/BzjwWycQvAeZaZMgquaBa5aqtD+tQYH9B AasqAkgMKgGk9CUHW1ZLTwxKYz4lUOL7eOwF6GMDt0E7lcc9RzZa8kSromQ39prbgUnJ kLKDYekvBLUhK+s1EyAoGYKV8K2ELBJJrBQejPYw4ZA3hHShoCBIk/skwmkOk2vDaOx6 aUtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=W8uI6sdX; 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 128si2639723pfd.19.2019.03.20.15.23.22; Wed, 20 Mar 2019 15:23:39 -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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=W8uI6sdX; 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 S1727605AbfCTWWf (ORCPT + 99 others); Wed, 20 Mar 2019 18:22:35 -0400 Received: from merlin.infradead.org ([205.233.59.134]:56380 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727437AbfCTWWf (ORCPT ); Wed, 20 Mar 2019 18:22:35 -0400 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=BYzz+wefXr4lloqI93uXDNGiX+SSPf7icG7IRc4Yt04=; b=W8uI6sdXml3fAevCDrWwImtHG fw27fYYpuql/HGmotiTsTisODfKQkxqg2wPPIx0Mbg6Zh/GLXGNOiGPblPryAXvx5viQ152N2gxKY X3ygJiAZGjzfy3Nz7TIE72mvDVbp1lANpWZYK6fGKPd+XNC4eYgQ0iBsnBg10ox9DGC91PcCHqP1H Gn7MXCZqHCjtp4Z3wFej6xchuOHrN28Gc3kPhfckj0z1wznaxt83uiOYROXL1oSQbDF632woyqzBh BeTLxeR/QW6G68NlFMoKkz3WVYn2yE/6T6lEXbqPEJMyv7am9Avr+qzt4ndMkYRTIHBu9S/0LsA2P BlAVDPP7Q==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6jbK-0002LJ-IW; Wed, 20 Mar 2019 22:22:23 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 93BA8984EED; Wed, 20 Mar 2019 23:22:20 +0100 (CET) Date: Wed, 20 Mar 2019 23:22:20 +0100 From: Peter Zijlstra To: Stephane Eranian Cc: Ingo Molnar , Jiri Olsa , LKML , tonyj@suse.com, nelson.dsouza@intel.com Subject: Re: [PATCH 1/8] perf/x86/intel: Fix memory corruption Message-ID: <20190320222220.GA2490@worktop.programming.kicks-ass.net> References: <20190314130113.919278615@infradead.org> <20190314130705.441549378@infradead.org> <20190319110549.GC5996@hirez.programming.kicks-ass.net> <20190319182041.GO5996@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Wed, Mar 20, 2019 at 01:47:28PM -0700, Stephane Eranian wrote: > Right now, if I do: > > echo 0 > /sys/bus/event_source/devices/cpu/allow_tsx_force_abort > > Then I don't have the guarantee on when there will be no abort when I > return from the echo. the MSR is accessed only on PMU scheduling. I > would expect a sysadmin to want some guarantee if this is to be > switched on/off at runtime. If not, then having a boot time option is > better in my opinion. Something like cycling the nmi watchdog or: perf stat -a -e cycles sleep 1 should be enough to force reschedule the events on every CPU. Again, I'm not adverse to 'fixing' this if it can be done with limited LoC. But I don't really see this as critical. > This other bit I noticed is that cpuc->tfa_shadow is used to avoid the > wrmsr(), but I don't see the code that makes sure the init value (0) > matches the value of the MSR. Is this MSR guarantee to be zero on > reset? That was my understanding. > How about on kexec()? Good point, we might want to fix that.