Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936563AbcKWN34 (ORCPT ); Wed, 23 Nov 2016 08:29:56 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:37668 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935133AbcKWN3y (ORCPT ); Wed, 23 Nov 2016 08:29:54 -0500 X-ME-Sender: X-Sasl-enc: 2w8mjQpKaKa4sgLCj1cz4wh8mnY0poKFtC5q7quwMhTr 1479907793 Date: Wed, 23 Nov 2016 11:29:51 -0200 From: Henrique de Moraes Holschuh To: Borislav Petkov Cc: "Luck, Tony" , Andi Kleen , Ashok Raj , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] x86/mce: Include the PPIN in machine check records when it is available Message-ID: <20161123132951.GA9373@khazad-dum.debian.net> References: <878tsg67r3.fsf@tassilo.jf.intel.com> <1479491316-11716-1-git-send-email-tony.luck@intel.com> <20161123114855.njguoaygp3qnbkia@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161123114855.njguoaygp3qnbkia@pd.tnic> X-GPG-Fingerprint1: 4096R/0x0BD9E81139CB4807: C467 A717 507B BAFE D3C1 6092 0BD9 E811 39CB 4807 User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 968 Lines: 25 On Wed, 23 Nov 2016, Borislav Petkov wrote: > + /* if PPIN is disabled, but not locked, try to enable: */ > + if (!(val & 3ul)) { > + wrmsrl_safe(MSR_PPIN_CTL, val | 2ul); > + rdmsrl_safe(MSR_PPIN_CTL, &val); > + } Actually, since this thing is supposed to be opt-in [through UEFI config] for a good reason (privacy), IMHO it would make more sense to: 1. Assuming we can do it, always lock it when it is found to be unlocked at kernel boot. 2. Not attempt to change its state from disabled to enabled *unless* given a command line parameter authorizing it. A kconfig-based solution for default+command line override would also work well IMHO, if it makes more sense. This would keep the feature opt-in as it is supposed to be, while making it "safer" on firmware that leaves it unlocked after boot, and would still allow owners of systems that leave it unlocked to change its state at boot. Everyone ends up happy... -- Henrique Holschuh