Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp750713ybg; Fri, 12 Jun 2020 13:42:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzViXAnQI8zietwLy+WWEyTwmwzUuhLn65WDDvxFWOzjQeeVtF6Y6CDahfkP/fFa1AfutBD X-Received: by 2002:a17:907:b15:: with SMTP id h21mr15298196ejl.450.1591994555597; Fri, 12 Jun 2020 13:42:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591994555; cv=none; d=google.com; s=arc-20160816; b=gF2/ilxQiaQ0oLiuRkz3U6y1f54OmxhgBfJiUAh8+l9qOyavpMISEuY5bttJkbZ0X6 UjFTAknz5psTS7mftz22BeGQajSwPguoztXp2MrEkXSFCFQmECp3IWuPJzZTQF67wI8q MDsmbiK2pEjhJHayZGt3qB8KA4iw4H0LZcoUUk7Lv7BLwmskLGcxxaPG1RhmE+sLD3+M vY9PXIRsLeJFecWJEkhamzEU8tQ1mKQcV3XEpSSyjVJGkKJDBj2t1NJQWHqR4uyDhGh+ K+nLQZWAAz7tYnuYXSXeED1UkbbOsZSnBi3DTbYcjU7zNBP0AX6FQ23tRrn9Q7wiAP0Y fXcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=k9rr+bJa+wvpicmcp96o9dB5/Zk/Wh3kQ8l8EsVqpHg=; b=c34iNvzDyZF9/9demSstg3G0kF9uzfMiT4Uk4DAu742ge3TlnMOl6BrqMEDCydTdof VEhqn7JTSDeZu95aJd+Mebudz+eXa0HkYnK79yafGJIFfDu/dn7VsxMtz8tQdF2j1XjG HsbIWJSFREUQA6Qc58IDbPmM7wIAxDSHYx9z29sXphl1+TOgDP06rf4AsAFi/oKi/U4r w6iOqyvIDLkDqTkGj9UGqrmaO3zHzfe1a0kP+ebCtP4MQC6vYle0vaDLQr+386cRewoT vFXIry062FCCxUTdxsUaxkRwPQRsj5c4XVcQ2qQENG6lgIQsD1NJBqkNZ18nS/FZHxQ0 GwnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=sTrS92pL; 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 a15si4467633edl.138.2020.06.12.13.42.12; Fri, 12 Jun 2020 13:42:35 -0700 (PDT) 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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=sTrS92pL; 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 S1726319AbgFLUjq (ORCPT + 99 others); Fri, 12 Jun 2020 16:39:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726268AbgFLUjq (ORCPT ); Fri, 12 Jun 2020 16:39:46 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EA3CC03E96F for ; Fri, 12 Jun 2020 13:39:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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; bh=k9rr+bJa+wvpicmcp96o9dB5/Zk/Wh3kQ8l8EsVqpHg=; b=sTrS92pLgzia6EgeNkneVXnp7T gteNaeroiO39119L7oHqgt4DnnDUTNJPSE8dHV4M3PT+FsKmhdRqt1KGeRkQMI1HqNRC2KesPoSGe YzzWNcUEfVYnuLGMcuAbbKN+DV/e2KqL8J1wZGa8Tz+A6Bl2x+CynzewhI2AO2u71ZwsqXKP974Dn EhBwvz6cRvJqWdozcUoIdsQo/cIz3ZByrmWHaHycxsjswLZJgvh4snWh8d17XUmAgFO0/gzN35PLM VzCwW6D6svC53e35oxJ3pegnEld+AuMXS97jIwlvhPq5ks7k8PPW64uOIy/0iDcx6FijD4FdcT/fw QRIwKzCA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jjqSg-0002DW-1X; Fri, 12 Jun 2020 20:39:38 +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 B532E300F28; Fri, 12 Jun 2020 22:39:35 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A5FA3213DCC6A; Fri, 12 Jun 2020 22:39:35 +0200 (CEST) Date: Fri, 12 Jun 2020 22:39:35 +0200 From: Peter Zijlstra To: Borislav Petkov Cc: Linus Torvalds , x86-ml , lkml Subject: Re: [RFC PATCH] x86/msr: Filter MSR writes Message-ID: <20200612203935.GH2497@hirez.programming.kicks-ass.net> References: <20200612105026.GA22660@zn.tnic> <20200612174801.GE22660@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200612174801.GE22660@zn.tnic> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 12, 2020 at 07:48:01PM +0200, Borislav Petkov wrote: > On Fri, Jun 12, 2020 at 10:20:03AM -0700, Linus Torvalds wrote: > > Since you already added the filtering, this looks fairly sane. > > > > IOW, what MSR's do we expect people to maybe write to normally? You > > added MSR_IA32_ENERGY_PERF_BIAS as an allowed MST, maybe there are > > others? > > Right, this MSR is being written by cpupower in tools/. My search was > confined within the kernel source only so there very likely are others. So that tool writing to /dev/msr has already caused pain; the direct result is that the intel pstate driver doesn't want to use an MSR shadow variable to avoid RDMSR because that'd loose input. https://lkml.org/lkml/2019/3/25/310 (sorry, that's what google found me) So ideally we'd just disallow it too. It already has a sysfs file (per those patches): Documentation/admin-guide/pm/intel_epb.rst