Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Nov 2012 20:23:41 +0000 (UTC)
From:      "Cherry G. Mathew" <cherry@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r242490 - projects/amd64_xen_pv/sys/vm
Message-ID:  <201211022023.qA2KNfeG095264@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cherry
Date: Fri Nov  2 20:23:41 2012
New Revision: 242490
URL: http://svn.freebsd.org/changeset/base/242490

Log:
  Since the current pmap implementation does not use DMAP, we need to
  special case XEN related msgbuf pages, to be pmap_map()ed to relevant
  kernel virtual addresses before registering them in the dump map.
  
  Approved by: gibbs (implicit)

Modified:
  projects/amd64_xen_pv/sys/vm/vm_page.c

Modified: projects/amd64_xen_pv/sys/vm/vm_page.c
==============================================================================
--- projects/amd64_xen_pv/sys/vm/vm_page.c	Fri Nov  2 18:57:38 2012	(r242489)
+++ projects/amd64_xen_pv/sys/vm/vm_page.c	Fri Nov  2 20:23:41 2012	(r242490)
@@ -345,13 +345,17 @@ vm_page_startup(vm_offset_t vaddr)
 	    new_end + vm_page_dump_size, VM_PROT_READ | VM_PROT_WRITE);
 	bzero((void *)vm_page_dump, vm_page_dump_size);
 #endif
-#if defined(__amd64__) && !defined(XEN)
+#if defined(__amd64__)
 	/*
 	 * Request that the physical pages underlying the message buffer be
 	 * included in a crash dump.  Since the message buffer is accessed
 	 * through the direct map, they are not automatically included.
 	 */
+#if defined(XEN)
+	pa = VTOP(msgbufp->msg_ptr);
+#else /* native */
 	pa = DMAP_TO_PHYS((vm_offset_t)msgbufp->msg_ptr);
+#endif
 	last_pa = pa + round_page(msgbufsize);
 	while (pa < last_pa) {
 		dump_add_page(pa);
@@ -395,7 +399,7 @@ vm_page_startup(vm_offset_t vaddr)
 	 */
 	new_end = vm_reserv_startup(&vaddr, new_end, high_water);
 #endif
-#if defined(__amd64__) || defined(__mips__)
+#if defined(__amd64__) && !defined(XEN) || defined(__mips__) 
 	/*
 	 * pmap_map on amd64 and mips can come out of the direct-map, not kvm
 	 * like i386, so the pages must be tracked for a crashdump to include



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