Source-Changes-HG archive

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

[src/trunk]: src/lib/libnvmm Remove the PSE check in the 32bit-PAE MMU. Setti...



details:   https://anonhg.NetBSD.org/src/rev/22cfe48d7ce0
branches:  trunk
changeset: 996969:22cfe48d7ce0
user:      maxv <maxv%NetBSD.org@localhost>
date:      Fri Feb 15 16:42:27 2019 +0000

description:
Remove the PSE check in the 32bit-PAE MMU. Setting CR4.PAE automatically
enables PSE regardless of whether CR4.PSE is set or not, so we should just
ignore it.

With this in place I can boot Windows 8.1 on NVMM.

diffstat:

 lib/libnvmm/libnvmm_x86.c |  9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diffs (37 lines):

diff -r 74ef29288a4f -r 22cfe48d7ce0 lib/libnvmm/libnvmm_x86.c
--- a/lib/libnvmm/libnvmm_x86.c Fri Feb 15 16:37:54 2019 +0000
+++ b/lib/libnvmm/libnvmm_x86.c Fri Feb 15 16:42:27 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: libnvmm_x86.c,v 1.22 2019/02/14 14:30:20 maxv Exp $    */
+/*     $NetBSD: libnvmm_x86.c,v 1.23 2019/02/15 16:42:27 maxv Exp $    */
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -188,7 +188,7 @@
 
 static int
 x86_gva_to_gpa_32bit_pae(struct nvmm_machine *mach, uint64_t cr3,
-    gvaddr_t gva, gpaddr_t *gpa, bool has_pse, nvmm_prot_t *prot)
+    gvaddr_t gva, gpaddr_t *gpa, nvmm_prot_t *prot)
 {
        gpaddr_t L3gpa, L2gpa, L1gpa;
        uintptr_t L3hva, L2hva, L1hva;
@@ -224,8 +224,6 @@
                *prot &= ~NVMM_PROT_WRITE;
        if (pte & PG_NX)
                *prot &= ~NVMM_PROT_EXEC;
-       if ((pte & PG_PS) && !has_pse)
-               return -1;
        if (pte & PG_PS) {
                *gpa = (pte & PTE32_PAE_L2_FRAME);
                *gpa = *gpa + (gva & PTE32_PAE_L1_MASK);
@@ -408,8 +406,7 @@
                ret = x86_gva_to_gpa_64bit(mach, cr3, gva, gpa, prot);
        } else if (is_pae && !is_lng) {
                /* 32bit PAE */
-               ret = x86_gva_to_gpa_32bit_pae(mach, cr3, gva, gpa, has_pse,
-                   prot);
+               ret = x86_gva_to_gpa_32bit_pae(mach, cr3, gva, gpa, prot);
        } else if (!is_pae && !is_lng) {
                /* 32bit */
                ret = x86_gva_to_gpa_32bit(mach, cr3, gva, gpa, has_pse, prot);



Home | Main Index | Thread Index | Old Index