Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys x86: rename PGEX_X -> PGEX_I



details:   https://anonhg.NetBSD.org/src/rev/1aa95eee5550
branches:  trunk
changeset: 975712:1aa95eee5550
user:      maxv <maxv%NetBSD.org@localhost>
date:      Sat Sep 05 07:26:37 2020 +0000

description:
x86: rename PGEX_X -> PGEX_I

To match the x86 specification and the other OSes.

diffstat:

 sys/arch/amd64/amd64/trap.c     |  8 ++++----
 sys/arch/i386/i386/trap.c       |  8 ++++----
 sys/arch/x86/include/pte.h      |  4 ++--
 sys/dev/nvmm/x86/nvmm_x86_svm.c |  6 +++---
 4 files changed, 13 insertions(+), 13 deletions(-)

diffs (118 lines):

diff -r 111a93f7944b -r 1aa95eee5550 sys/arch/amd64/amd64/trap.c
--- a/sys/arch/amd64/amd64/trap.c       Sat Sep 05 07:22:25 2020 +0000
+++ b/sys/arch/amd64/amd64/trap.c       Sat Sep 05 07:26:37 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.127 2020/03/09 21:49:26 pgoyette Exp $      */
+/*     $NetBSD: trap.c,v 1.128 2020/09/05 07:26:37 maxv Exp $  */
 
 /*
  * Copyright (c) 1998, 2000, 2017 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.127 2020/03/09 21:49:26 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.128 2020/09/05 07:26:37 maxv Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -450,7 +450,7 @@
 
                cr2 = rcr2();
 
-               if (frame->tf_err & PGEX_X) {
+               if (frame->tf_err & PGEX_I) {
                        /* SMEP might have brought us here */
                        if (cr2 < VM_MAXUSER_ADDRESS) {
                                printf("prevented execution of %p (SMEP)\n",
@@ -503,7 +503,7 @@
                        map = &vm->vm_map;
                if (frame->tf_err & PGEX_W)
                        ftype = VM_PROT_WRITE;
-               else if (frame->tf_err & PGEX_X)
+               else if (frame->tf_err & PGEX_I)
                        ftype = VM_PROT_EXECUTE;
                else
                        ftype = VM_PROT_READ;
diff -r 111a93f7944b -r 1aa95eee5550 sys/arch/i386/i386/trap.c
--- a/sys/arch/i386/i386/trap.c Sat Sep 05 07:22:25 2020 +0000
+++ b/sys/arch/i386/i386/trap.c Sat Sep 05 07:26:37 2020 +0000
@@ -1,5 +1,5 @@
 
-/*     $NetBSD: trap.c,v 1.306 2020/08/11 04:30:16 christos Exp $      */
+/*     $NetBSD: trap.c,v 1.307 2020/09/05 07:26:37 maxv Exp $  */
 
 /*-
  * Copyright (c) 1998, 2000, 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -69,7 +69,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.306 2020/08/11 04:30:16 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.307 2020/09/05 07:26:37 maxv Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -570,7 +570,7 @@
 
                cr2 = rcr2();
 
-               if (frame->tf_err & PGEX_X) {
+               if (frame->tf_err & PGEX_I) {
                        /* SMEP might have brought us here */
                        if (cr2 > VM_MIN_ADDRESS && cr2 <= VM_MAXUSER_ADDRESS) {
                                printf("prevented execution of %p (SMEP)\n",
@@ -620,7 +620,7 @@
                        map = &vm->vm_map;
                if (frame->tf_err & PGEX_W)
                        ftype = VM_PROT_WRITE;
-               else if (frame->tf_err & PGEX_X)
+               else if (frame->tf_err & PGEX_I)
                        ftype = VM_PROT_EXECUTE;
                else
                        ftype = VM_PROT_READ;
diff -r 111a93f7944b -r 1aa95eee5550 sys/arch/x86/include/pte.h
--- a/sys/arch/x86/include/pte.h        Sat Sep 05 07:22:25 2020 +0000
+++ b/sys/arch/x86/include/pte.h        Sat Sep 05 07:26:37 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pte.h,v 1.4 2020/03/14 04:55:14 maxv Exp $     */
+/*     $NetBSD: pte.h,v 1.5 2020/09/05 07:26:37 maxv Exp $     */
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -45,7 +45,7 @@
 #define PGEX_W         0x0002  /* exception during a write cycle */
 #define PGEX_U         0x0004  /* exception while in user mode */
 #define PGEX_RSVD      0x0008  /* a reserved bit was set in the page tables */
-#define PGEX_X         0x0010  /* exception during instruction fetch */
+#define PGEX_I         0x0010  /* exception during instruction fetch */
 #define PGEX_PK                0x0020  /* access disallowed by protection key */
 #define PGEX_SGX       0x8000  /* violation of sgx-specific access rights */
 
diff -r 111a93f7944b -r 1aa95eee5550 sys/dev/nvmm/x86/nvmm_x86_svm.c
--- a/sys/dev/nvmm/x86/nvmm_x86_svm.c   Sat Sep 05 07:22:25 2020 +0000
+++ b/sys/dev/nvmm/x86/nvmm_x86_svm.c   Sat Sep 05 07:26:37 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nvmm_x86_svm.c,v 1.76 2020/09/05 07:22:26 maxv Exp $   */
+/*     $NetBSD: nvmm_x86_svm.c,v 1.77 2020/09/05 07:26:38 maxv Exp $   */
 
 /*
  * Copyright (c) 2018-2020 Maxime Villard, m00nbsd.net
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_svm.c,v 1.76 2020/09/05 07:22:26 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_svm.c,v 1.77 2020/09/05 07:26:38 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1290,7 +1290,7 @@
        exit->reason = NVMM_VCPU_EXIT_MEMORY;
        if (cpudata->vmcb->ctrl.exitinfo1 & PGEX_W)
                exit->u.mem.prot = PROT_WRITE;
-       else if (cpudata->vmcb->ctrl.exitinfo1 & PGEX_X)
+       else if (cpudata->vmcb->ctrl.exitinfo1 & PGEX_I)
                exit->u.mem.prot = PROT_EXEC;
        else
                exit->u.mem.prot = PROT_READ;



Home | Main Index | Thread Index | Old Index