Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp6213712ybv; Tue, 18 Feb 2020 12:09:11 -0800 (PST) X-Google-Smtp-Source: APXvYqybJV1TX8c+Rkad+8V1vhx1QF8Y6cB8aUP/Da8pR5Wa1vqcjeEzK0WzNAByM8MPfzmBpUvm X-Received: by 2002:a05:6808:24e:: with SMTP id m14mr2452398oie.168.1582056551414; Tue, 18 Feb 2020 12:09:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582056551; cv=none; d=google.com; s=arc-20160816; b=tvRZDtL7PTMA2u9HzzsHqLfcty9EXrsruu7C1V6LycCVlWIJgT/TQdlj5pg17+nxGo wIByJCXsBqW56myX5Uak3Hx9CsvHXOHC9PLT1gaOtTmqxm4CQMY6kk4jeGlCNk/AeL5n 0Hv42PoVCUXTFaUfpyxiyRV7YzkF/xMuw9093Wf7Q/DCYyiBAcWd/oQTeWdy5P8yF/BA rL61vaazkv3RUaQr8JuWe24KM7hADIjc/vGlBw9aRxBNL1rJEuXtVLUVGUBZniVjQIFZ I/Qlccx0fOhhB/CxL5KWsNACyDivCVAnPwgUcfr/klR23JR5jNXkDwcwbjU/aMZ6X6xP cjyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=WE4VEJguaZNjsMq3EYdwQiIDlpaCmkD0rEFw1HazVx4=; b=dlYzRNYZ2PF4lHHmUvAglSdLdJp8ssOfr5Q0ZVZAtH2G/o1GaKuY+/NQXAaDNyf42I B618tD28D/WyuT0diYxyk3GHjKREkXMhUhUHdXJXG06Wp1wU6iV1ysBmyvpLYseB8e7c xp2TFJd/pyigM1EpBRs/PjZhdHi1TeGWuMMePhMY3Uav0emwVmi67x/eC2TdcAddiIVg FlQ+0XB+69x/G/Z0aS/XHsKlr4Vm2vmKLV+6bjVxl2DWcznJ9xnB8YIAnmQS0mzCZZM6 0YcM0DdLgiNyvsnKEpLf0c3QlZziwCsr5KXXwtkpDl2m88zmvPAI7ivRAR/IdE419GxG zSkA== 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 u16si2280558otq.92.2020.02.18.12.08.59; Tue, 18 Feb 2020 12:09:11 -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; 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 S1728180AbgBRUI5 (ORCPT + 99 others); Tue, 18 Feb 2020 15:08:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:48896 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727601AbgBRUIx (ORCPT ); Tue, 18 Feb 2020 15:08:53 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2A4DC22B48; Tue, 18 Feb 2020 20:08:52 +0000 (UTC) Date: Tue, 18 Feb 2020 15:08:50 -0500 From: Steven Rostedt To: Borislav Petkov Cc: Peter Zijlstra , Andy Lutomirski , Tony Luck , x86-ml , lkml Subject: Re: [RFC] #MC mess Message-ID: <20200218150850.224d9b8e@gandalf.local.home> In-Reply-To: <20200218195035.GN14449@zn.tnic> References: <20200218173150.GK14449@zn.tnic> <20200218131158.693eeefc@gandalf.local.home> <20200218195035.GN14449@zn.tnic> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 18 Feb 2020 20:50:35 +0100 Borislav Petkov wrote: > True story, thanks for that hint! > > static_key_disable() > |-> cpus_read_lock() > |-> percpu_down_read(&cpu_hotplug_lock) > |->might_sleep() > > Yuck. Which means, the #MC handler must switch to __rdmsr()/__wrmsr() > now. > > I wish I could travel back in time and NAK the hell of that MSR > tracepoint crap. Can we create a per_cpu variable that gets set when we enter the MC handler, and not call the msr trace points when that is set? Now, is jump labels bad in these cases (note, it is possible to trigger a breakpoint in them, does an iret disable the MC as well, which means we could get nested MC handlers corrupting the IST stack?). You could have the msr_tracepoint_active() check this per cpu variable? msr reading and writing is rather slow, and I'm sure reading a per_cpu variable is going to be in the noise of it. -- Steve