Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp4165192pxb; Tue, 17 Nov 2020 13:05:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJyJeS2cy2138Xx4HnOzvgaaL3Hc/KwKrO+9nLYCeH+CEXhchdJaAYRfFEpQk10WsqesHIJz X-Received: by 2002:a50:d5dd:: with SMTP id g29mr22809192edj.344.1605647157723; Tue, 17 Nov 2020 13:05:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605647157; cv=none; d=google.com; s=arc-20160816; b=xNuWz8VTbpPL2e8W4r5UXu5CpeY0+zNK02zh+cFBa4mCrkWlwQdWVDiJ0iIQS7mz5q KQxp1NqiF130gPRN6OLfUfwpZ6KGXm3M7PjfgcwtgF3aHU/B4RM8quTYwyRnZY78uFTZ vowe3KDubWiikAme0yYPf9cr0ZYsgXHrcKNh9gXJz/ijSafZSfuc+6SwIuWxHVYYaXIt 0wYw48e5OfOV7L5K7fX6PCKUuw6Kglg2VPTi5vL8daBmezsUQSmgP0SCS7JKRl8c+Q9O 3qJNwZ0ef+A50t1HVZtj+c5EqZAz8382YaN4KQScbo4YjsuNcJEJiNFqVpmktBwKpwhU ATCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date; bh=gYHtGBox9inUolidykiqfeo1C65yKXMrnW8ubAfBUZU=; b=lkgJ0JN+et0tmFWVPZ3D6MztRUENiVV6HYPlF0H54eKyEBfC7XHD595Wkn1Yp6t6Yi nQugCvtuHCPyTLgcHSlXjnWgfdkyJ3560CplWo9pcVvrErXfxhvrxi6FG1LhGXjjRRBS tOJfy/zP8TNJMTAoiQI5+GKplttKUZqtrSG2ukFs1TLy6Ffw3wK5bDx2X1EhPVC+QBG1 9E4hZ6jEJ8/6l1o0MCiPI/Mh1hSSR2GX71z17/8Ohyu4viIZRysp1szrTTT8eQMLrhiZ G3gbte1ejsKxTjHB6EVUuW6/DPVXd46eK+OstKL9WCEYBXib/h/diJNjUHZ0B2/YL5l2 ug3w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a3si15262168ejd.407.2020.11.17.13.05.17; Tue, 17 Nov 2020 13:05:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726544AbgKQVDZ (ORCPT + 99 others); Tue, 17 Nov 2020 16:03:25 -0500 Received: from mslow2.mail.gandi.net ([217.70.178.242]:49812 "EHLO mslow2.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726202AbgKQVDZ (ORCPT ); Tue, 17 Nov 2020 16:03:25 -0500 Received: from relay8-d.mail.gandi.net (unknown [217.70.183.201]) by mslow2.mail.gandi.net (Postfix) with ESMTP id 5D05F3A2217 for ; Tue, 17 Nov 2020 21:00:42 +0000 (UTC) X-Originating-IP: 62.210.143.248 Received: from weirdfishes.localdomain (62-210-143-248.rev.poneytelecom.eu [62.210.143.248]) (Authenticated sender: m@thi.eu.com) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id DA6F61BF208; Tue, 17 Nov 2020 21:00:18 +0000 (UTC) Received: by weirdfishes.localdomain (Postfix, from userid 1000) id 8111872214948; Tue, 17 Nov 2020 22:00:18 +0100 (CET) Date: Tue, 17 Nov 2020 22:00:18 +0100 From: Mathieu Chouquet-Stringer To: Matthew Garrett Cc: Chris Down , Borislav Petkov , Linux Kernel Mailing List , sean.j.christopherson@intel.com, tony.luck@intel.com, Linus Torvalds , the arch/x86 maintainers , kernel-team@fb.com Subject: Re: [PATCH -v2.1] x86/msr: Filter MSR writes Message-ID: <20201117210018.GA4247@weirdfishes> Mail-Followup-To: Mathieu Chouquet-Stringer , Matthew Garrett , Chris Down , Borislav Petkov , Linux Kernel Mailing List , sean.j.christopherson@intel.com, tony.luck@intel.com, Linus Torvalds , the arch/x86 maintainers , kernel-team@fb.com References: <20200615063837.GA14668@zn.tnic> <20200714121955.GA2080@chrisdown.name> <20200714154728.GA3101@nazgul.tnic> <20200714160448.GC2080@chrisdown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello all, On Tue, Jul 14, 2020 at 12:17:50PM -0700, Matthew Garrett wrote: > On Tue, Jul 14, 2020 at 9:04 AM Chris Down wrote: > > Either way, again, this isn't really the point. :-) The point is that there > > _are_ currently widespread cases involving poking MSRs from userspace, however > > sacrilegious or ugly (which I agree with!), and while people should be told > > about that, it's excessive to have the potential to take up 80% of kmsg in the > > default configuration. It doesn't take thousands of messages to get the message > > across, that's what a custom printk ratelimit is for. > Agreed - we should now offer all the necessary interfaces to avoid > userspace having to hit MSRs directly for thermal management, but that > wasn't always the case, and as a result there's tooling that still > behaves this way. I'm late to the party but it seems allowing MSR_IA32_ENERGY_PERF_BIAS has the downside of flagging the kernel as tainted without telling you why if you use something like x86_energy_perf_policy (from tools/power/x86/x86_energy_perf_policy) which itself is used by tuned. I can taint my kernel manually by just running: x86_energy_perf_policy -c all performance The net impact is an OOPS triggered on such kernel won't necessarily be read by anyone nor analyzed by reporting tools as the kernel is now considered tainted. For instance abrt reports the following: ===========8<===========8<===========8<===========8<===========8<===========8< A kernel problem occurred, but your kernel has been tainted (flags:GS). Explanation: S - SMP with CPUs not designed for SMP. Kernel maintainers are unable to diagnose tainted reports. ===========8<===========8<===========8<===========8<===========8<===========8< To add to the confusion, kernel documentation (Documentation/admin-guide/tainted-kernels.rst) is not up to date so while looking for an explanation, one gets to wonder how what used to be a regular average computer can now be classified as something using "an officially SMP incapable processor"... So while both documentation and tools should be updated as to be clearer and to not taint the kernel respectively, there's something that remains to be done to explain why or how the kernel got tainted because of poking into MSRs... -- Mathieu Chouquet-Stringer The sun itself sees not till heaven clears. -- William Shakespeare --