From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754830AbbIPSA2 (ORCPT ); Wed, 16 Sep 2015 14:00:28 -0400 Received: from mga02.intel.com ([134.134.136.20]:31106 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753637AbbIPRtK (ORCPT ); Wed, 16 Sep 2015 13:49:10 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,540,1437462000"; d="scan'208";a="806584079" Subject: [PATCH 16/26] x86, pkeys: dump PKRU with other kernel registers To: dave@sr71.net Cc: x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org From: Dave Hansen Date: Wed, 16 Sep 2015 10:49:08 -0700 References: <20150916174903.E112E464@viggo.jf.intel.com> In-Reply-To: <20150916174903.E112E464@viggo.jf.intel.com> Message-Id: <20150916174908.2B86AE47@viggo.jf.intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I'm a bit ambivalent about whether this is needed or not. Protection Keys never affect kernel mappings. But, they can affect whether the kernel will fault when it touches a user mapping. But, the kernel doesn't touch user mappings without some careful choreography and these accesses don't generally result in oopses. Should we dump out PKRU like this in our oopses? --- b/arch/x86/kernel/process_64.c | 2 ++ 1 file changed, 2 insertions(+) diff -puN arch/x86/kernel/process_64.c~pkeys-30-kernel-error-dumps arch/x86/kernel/process_64.c --- a/arch/x86/kernel/process_64.c~pkeys-30-kernel-error-dumps 2015-09-16 10:48:18.424290612 -0700 +++ b/arch/x86/kernel/process_64.c 2015-09-16 10:48:18.427290748 -0700 @@ -116,6 +116,8 @@ void __show_regs(struct pt_regs *regs, i printk(KERN_DEFAULT "DR0: %016lx DR1: %016lx DR2: %016lx\n", d0, d1, d2); printk(KERN_DEFAULT "DR3: %016lx DR6: %016lx DR7: %016lx\n", d3, d6, d7); + if (boot_cpu_has(X86_FEATURE_OSPKE)) + printk(KERN_DEFAULT "PKRU: %08x\n", read_pkru()); } void release_thread(struct task_struct *dead_task) _