Module Name: src Committed By: maxv Date: Fri Feb 15 16:42:27 UTC 2019
Modified Files: src/lib/libnvmm: libnvmm_x86.c Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/lib/libnvmm/libnvmm_x86.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libnvmm/libnvmm_x86.c diff -u src/lib/libnvmm/libnvmm_x86.c:1.22 src/lib/libnvmm/libnvmm_x86.c:1.23 --- src/lib/libnvmm/libnvmm_x86.c:1.22 Thu Feb 14 14:30:20 2019 +++ src/lib/libnvmm/libnvmm_x86.c Fri Feb 15 16:42:27 2019 @@ -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 @@ typedef uint64_t pte_32bit_pae_t; 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 @@ x86_gva_to_gpa_32bit_pae(struct nvmm_mac *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 @@ x86_gva_to_gpa(struct nvmm_machine *mach 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);