From owner-svn-src-projects@FreeBSD.ORG Sun Sep 21 06:36:17 2014 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8F2F9B; Sun, 21 Sep 2014 06:36:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8AB4FF6; Sun, 21 Sep 2014 06:36:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8L6aHhb091868; Sun, 21 Sep 2014 06:36:17 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8L6aHOQ091867; Sun, 21 Sep 2014 06:36:17 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201409210636.s8L6aHOQ091867@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Sun, 21 Sep 2014 06:36:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r271922 - projects/bhyve_svm/sys/amd64/amd64 X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2014 06:36:17 -0000 Author: neel Date: Sun Sep 21 06:36:17 2014 New Revision: 271922 URL: http://svnweb.freebsd.org/changeset/base/271922 Log: The memory type bits (PAT, PCD, PWT) associated with a nested PTE or PDE are identical to the traditional x86 page tables. Modified: projects/bhyve_svm/sys/amd64/amd64/pmap.c Modified: projects/bhyve_svm/sys/amd64/amd64/pmap.c ============================================================================== --- projects/bhyve_svm/sys/amd64/amd64/pmap.c Sun Sep 21 05:03:04 2014 (r271921) +++ projects/bhyve_svm/sys/amd64/amd64/pmap.c Sun Sep 21 06:36:17 2014 (r271922) @@ -1115,6 +1115,7 @@ pmap_swap_pat(pmap_t pmap, pt_entry_t en switch (pmap->pm_type) { case PT_X86: + case PT_RVI: /* Verify that both PAT bits are not set at the same time */ KASSERT((entry & x86_pat_bits) != x86_pat_bits, ("Invalid PAT bits in entry %#lx", entry)); @@ -1123,9 +1124,6 @@ pmap_swap_pat(pmap_t pmap, pt_entry_t en if ((entry & x86_pat_bits) != 0) entry ^= x86_pat_bits; break; - case PT_RVI: - /* XXX: PAT support. */ - break; case PT_EPT: /* * Nothing to do - the memory attributes are represented @@ -1153,6 +1151,7 @@ pmap_cache_bits(pmap_t pmap, int mode, b switch (pmap->pm_type) { case PT_X86: + case PT_RVI: /* The PAT bit is different for PTE's and PDE's. */ pat_flag = is_pde ? X86_PG_PDE_PAT : X86_PG_PTE_PAT; @@ -1169,11 +1168,6 @@ pmap_cache_bits(pmap_t pmap, int mode, b cache_bits |= PG_NC_PWT; break; - case PT_RVI: - /* XXX: PAT support. */ - cache_bits = 0; - break; - case PT_EPT: cache_bits = EPT_PG_IGNORE_PAT | EPT_PG_MEMORY_TYPE(mode); break; @@ -1192,11 +1186,8 @@ pmap_cache_mask(pmap_t pmap, boolean_t i switch (pmap->pm_type) { case PT_X86: - mask = is_pde ? X86_PG_PDE_CACHE : X86_PG_PTE_CACHE; - break; case PT_RVI: - /* XXX: PAT support. */ - mask = 0; + mask = is_pde ? X86_PG_PDE_CACHE : X86_PG_PTE_CACHE; break; case PT_EPT: mask = EPT_PG_IGNORE_PAT | EPT_PG_MEMORY_TYPE(0x7); @@ -1260,7 +1251,7 @@ pmap_update_pde_invalidate(pmap_t pmap, if (pmap_type_guest(pmap)) return; - + KASSERT(pmap->pm_type == PT_X86, ("pmap_update_pde_invalidate: invalid type %d", pmap->pm_type)); @@ -1376,7 +1367,7 @@ pmap_invalidate_page(pmap_t pmap, vm_off pmap_invalidate_ept(pmap); return; } - + KASSERT(pmap->pm_type == PT_X86, ("pmap_invalidate_page: invalid type %d", pmap->pm_type));