Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932582AbbLNTGZ (ORCPT ); Mon, 14 Dec 2015 14:06:25 -0500 Received: from mga04.intel.com ([192.55.52.120]:16378 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932137AbbLNTGS (ORCPT ); Mon, 14 Dec 2015 14:06:18 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,428,1444719600"; d="scan'208";a="871314885" Subject: [PATCH 21/32] x86, pkeys: dump PKRU with other kernel registers To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, x86@kernel.org, Dave Hansen , dave.hansen@linux.intel.com From: Dave Hansen Date: Mon, 14 Dec 2015 11:06:18 -0800 References: <20151214190542.39C4886D@viggo.jf.intel.com> In-Reply-To: <20151214190542.39C4886D@viggo.jf.intel.com> Message-Id: <20151214190618.0C15BFA7@viggo.jf.intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1489 Lines: 35 From: Dave Hansen Protection Keys never affect kernel mappings. But, they can affect whether the kernel will fault when it touches a user mapping. The kernel doesn't touch user mappings without some careful choreography and these accesses don't generally result in oopses. But, if one does, we definitely want to have PKRU available so we can figure out if protection keys played a role. Signed-off-by: Dave Hansen Reviewed-by: Thomas Gleixner --- 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-12-14 10:42:48.373052633 -0800 +++ b/arch/x86/kernel/process_64.c 2015-12-14 10:42:48.376052768 -0800 @@ -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) _ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/