Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3116047pxk; Mon, 7 Sep 2020 03:47:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnb7Yxmyg9oHMPunzCagR57Uk4XnmCcWlbngcCLz2Ao8Ke2zLyIS277EMEHjTs0lL4DfHq X-Received: by 2002:a17:906:5a83:: with SMTP id l3mr21510618ejq.14.1599475676738; Mon, 07 Sep 2020 03:47:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599475676; cv=none; d=google.com; s=arc-20160816; b=AdMh3Qsf4h/4By809QkwFYyn8MYZP6As+/a0JqP4sl88rRQesGvPynvp4Mm2HQgnXU BLS+4ksMMSsZXCxOZgd/20r9RjuMAAVkN07kDD4o0wc/rnxxZmqVcFzcSeRH1pJLfyTv g5LY555qC9wENv72fuFUaCw6F3bXiGdSm2qGQ/WMTU43RZ5VePrMYzaf5mHRzfIaBVTh otHzaV02FSGstSqg5KE6RoDs+xVT/7COHKJEJJ7CwWLYbP426HZt7irqas2VAs1OSgVM U/ei6iz/2IN6dYSqK7GdPeAZXgiqKUqDbclwoVNqRhscC05g5qXj8ZaW52SJzSpO2xH7 byRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=tSXpC+xNSfHq0tlk2gqT3JwmlQAUt0QuAQLphOyFA6M=; b=KabWHmDApN2HuyqGSgLgGNp6Bt25KTc5yqWqFNCLzjBXcvSGnDGsaZieFh0UPBDZH1 fl4lLlUHJKJxNUtqaXqKwFKHt0ET+tN8svPhU877NL0t+hTg/EOzDHmrtTkHnTd06ftG m4eXLbvSFajvPhhEtlRQOJU/oKY8hUZnpY6YC/M2oTeQznP3fLDeLNIwi/CzrWKDTM7n R4gn9NhrlDq8lL7dr6CNj0bNx34WQHZG4iLRgc9A/FUgJLK2ub4nzPwQ4L8XB5t+9oFh yJ+sK/O8EV2qaXSUYbhVDzg90U5gWxg+1lnynxD2JS5Mwx+gfsQOtUsKLPmM5LD0WPxn ebRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b="s/CTb7+I"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a6si10105942edq.278.2020.09.07.03.47.34; Mon, 07 Sep 2020 03:47:56 -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=pass header.i=@zx2c4.com header.s=mail header.b="s/CTb7+I"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728870AbgIGKqy (ORCPT + 99 others); Mon, 7 Sep 2020 06:46:54 -0400 Received: from mail.zx2c4.com ([192.95.5.64]:47419 "EHLO mail.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728679AbgIGKqt (ORCPT ); Mon, 7 Sep 2020 06:46:49 -0400 Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 4c9a9bfa for ; Mon, 7 Sep 2020 10:18:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=zx2c4.com; h=mime-version :references:in-reply-to:from:date:message-id:subject:to:cc :content-type; s=mail; bh=YRWb63lJVe5k63YRgdeGYsmd2Bk=; b=s/CTb7 +I8bahKDFZBpLm+nJqsHR9ej/3MHQ+HgCyYk/NygA/vnXOKRoS9Jn5iRFWZUr4rK kNVf0Ec8bPrVfub6H/YJhdFWLaoEiThbHxH5y6Mgp+fbFg+uuv0KgdeAlbrJINlO ZcX17dnhwVAgnpt5XI/VDbTS5tUNHpST/B8rkx6Sf+C4d+kOtXfQM13UZEko/RvB bIbiOtF+pGIcWH1l64LtvZlBgvSF6uWwuiKebSVeL3F66t5Nlo9z7fcI0gjS+vAU hICw9obsbSKq+R9JGmoVTZ6HIQZt7jD9PRpX2Lnw5T0dBeLHBqDCEDTiO2XWdbE/ Va0ZqF6tkf/UBbPA== Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id d0ac0383 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Mon, 7 Sep 2020 10:18:02 +0000 (UTC) Received: by mail-io1-f41.google.com with SMTP id h4so13538102ioe.5 for ; Mon, 07 Sep 2020 03:46:46 -0700 (PDT) X-Gm-Message-State: AOAM533jg5R9ArKxTL/G54BptJ2IXuZjNC6+/OZs9G+4LZTnhITWItqc FFHa5moOygB2fg+m3ImeFs/ZiX+zEGRg4tWfYXY= X-Received: by 2002:a02:8802:: with SMTP id r2mr19505406jai.75.1599475605957; Mon, 07 Sep 2020 03:46:45 -0700 (PDT) MIME-Version: 1.0 References: <20200907094843.1949-1-Jason@zx2c4.com> <20200907100647.GB10657@zn.tnic> In-Reply-To: <20200907100647.GB10657@zn.tnic> From: "Jason A. Donenfeld" Date: Mon, 7 Sep 2020 12:46:35 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] x86/msr: do not warn on writes to OC_MAILBOX To: Borislav Petkov Cc: Srinivas Pandruvada , kitsunyan , X86 ML , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Borislav, On Mon, Sep 7, 2020 at 12:06 PM Borislav Petkov wrote: > > + Srinivas. > + kitsunyan. > > On Mon, Sep 07, 2020 at 11:48:43AM +0200, Jason A. Donenfeld wrote: > > Popular tools, like intel-undervolt, use MSR 0x150 to control the CPU > > voltage offset. In fact, evidently the intel_turbo_max_3 driver in-tree > > also uses this MSR. So, teach the kernel's MSR list about this, so that > > intel-undervolt and other such tools don't spew warnings to dmesg, while > > unifying the constant used throughout the kernel. > > > > Fixes: a7e1f67ed29f ("x86/msr: Filter MSR writes") > > Cc: Borislav Petkov > > Signed-off-by: Jason A. Donenfeld > > --- > > arch/x86/include/asm/msr-index.h | 2 ++ > > arch/x86/kernel/msr.c | 5 ++++- > > drivers/platform/x86/intel_turbo_max_3.c | 6 +++--- > > 3 files changed, 9 insertions(+), 4 deletions(-) > > > > diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h > > - if (reg == MSR_IA32_ENERGY_PERF_BIAS) > > + switch (reg) { > > + case MSR_IA32_ENERGY_PERF_BIAS: > > + case MSR_IA32_OC_MAILBOX: > > return 0; > > + } > Actually, we added the filtering to catch exactly such misuses and, Are you sure that intel-undervolt using OC_MAILBOX from userspace is actually a "misuse"? Should the kernel or kernel drivers actually be involved with the task of underclocking? This seems pretty squarely in the realm of "hobbyists poking and prodding at their CPUs" rather than something made for a kernel driver, right? Also, what was the justification for whitelisting MSR_IA32_ENERGY_PERF_BIAS? Jason