Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Mar 2019 17:26:31 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r344847 - in stable/12/sys/amd64: amd64 include
Message-ID:  <201903061726.x26HQV1C073715@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Wed Mar  6 17:26:30 2019
New Revision: 344847
URL: https://svnweb.freebsd.org/changeset/base/344847

Log:
  MFC r344352:
  amd64: add defines and decode protection keys and SGX page faults reasons.

Modified:
  stable/12/sys/amd64/amd64/trap.c
  stable/12/sys/amd64/include/pmap.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/amd64/amd64/trap.c
==============================================================================
--- stable/12/sys/amd64/amd64/trap.c	Wed Mar  6 17:25:11 2019	(r344846)
+++ stable/12/sys/amd64/amd64/trap.c	Wed Mar  6 17:26:30 2019	(r344847)
@@ -885,10 +885,12 @@ trap_fatal(frame, eva)
 #endif
 	if (type == T_PAGEFLT) {
 		printf("fault virtual address	= 0x%lx\n", eva);
-		printf("fault code		= %s %s %s, %s\n",
+		printf("fault code		= %s %s %s%s%s, %s\n",
 			code & PGEX_U ? "user" : "supervisor",
 			code & PGEX_W ? "write" : "read",
 			code & PGEX_I ? "instruction" : "data",
+			code & PGEX_PK ? " prot key" : " ",
+			code & PGEX_SGX ? " SGX" : " ",
 			code & PGEX_RSV ? "reserved bits in PTE" :
 			code & PGEX_P ? "protection violation" : "page not present");
 	}

Modified: stable/12/sys/amd64/include/pmap.h
==============================================================================
--- stable/12/sys/amd64/include/pmap.h	Wed Mar  6 17:25:11 2019	(r344846)
+++ stable/12/sys/amd64/include/pmap.h	Wed Mar  6 17:26:30 2019	(r344847)
@@ -131,6 +131,8 @@
 #define PGEX_U		0x04	/* access from User mode (UPL) */
 #define PGEX_RSV	0x08	/* reserved PTE field is non-zero */
 #define PGEX_I		0x10	/* during an instruction fetch */
+#define	PGEX_PK		0x20	/* protection key violation */
+#define	PGEX_SGX	0x40	/* SGX-related */
 
 /* 
  * undef the PG_xx macros that define bits in the regular x86 PTEs that



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201903061726.x26HQV1C073715>