Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1234349

[PATCH 17/25] x86, pkeys: dump PKRU with other kernel registers

Path csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!weretis.net!feeder1.news.weretis.net!newsfeed.CARNet.hr!news.spin.it!bofh.it!news.nic.it!robomod
From Dave Hansen <dave@sr71.net>
Newsgroups linux.kernel
Subject [PATCH 17/25] x86, pkeys: dump PKRU with other kernel registers
Date Mon, 28 Sep 2015 21:20:01 +0200
Message-ID <qdM7T-59-1@gated-at.bofh.it> (permalink)
References <qdM7T-59-3@gated-at.bofh.it>
X-Original-To dave@sr71.net
X-Extloop1 1
X-Ironport-Av E=Sophos;i="5.17,604,1437462000"; d="scan'208";a="814722978"
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 35
Organization linux.* mail to news gateway
X-Original-Cc borntraeger@de.ibm.com, x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, dave.hansen@linux.intel.com
X-Original-Date Mon, 28 Sep 2015 12:18:24 -0700
X-Original-Message-ID <20150928191824.88E91D56@viggo.jf.intel.com>
X-Original-References <20150928191817.035A64E2@viggo.jf.intel.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1234349

Show key headers only | View raw


From: Dave Hansen <dave.hansen@linux.intel.com>

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.

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
---

 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-28 11:39:48.695307824 -0700
+++ b/arch/x86/kernel/process_64.c	2015-09-28 11:39:48.698307960 -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)
_
--
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/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 17/25] x86, pkeys: dump PKRU with other kernel registers Dave Hansen <dave@sr71.net> - 2015-09-28 21:20 +0200

csiph-web