svn commit: r338627 - head/sys/x86/xen

Roger Pau Monné royger at FreeBSD.org
Thu Sep 13 07:09:42 UTC 2018


Author: royger
Date: Thu Sep 13 07:09:41 2018
New Revision: 338627
URL: https://svnweb.freebsd.org/changeset/base/338627

Log:
  xen: fix initial kenv setup for legacy PVH
  
  When adding support for the new PVH mode the kenv handling was
  switched to use a boot time allocated scratch space, however the
  legacy PVH early boot code was not modified to allocate such space.
  
  Approved by:		re (gjb)
  Sponsored by:		Citrix Systems R&D

Modified:
  head/sys/x86/xen/pv.c

Modified: head/sys/x86/xen/pv.c
==============================================================================
--- head/sys/x86/xen/pv.c	Thu Sep 13 07:08:31 2018	(r338626)
+++ head/sys/x86/xen/pv.c	Thu Sep 13 07:09:41 2018	(r338627)
@@ -204,6 +204,7 @@ hammer_time_xen_legacy(start_info_t *si, uint64_t xens
 	uint64_t *PT3 = (u_int64_t *)(xenstack + PAGE_SIZE);
 	uint64_t *PT2 = (u_int64_t *)(xenstack + 2 * PAGE_SIZE);
 	int i;
+	char *kenv;
 
 	xen_domain_type = XEN_PV_DOMAIN;
 	vm_guest = VM_GUEST_XEN;
@@ -251,6 +252,15 @@ hammer_time_xen_legacy(start_info_t *si, uint64_t xens
 		PT2[i] |= PG_V | PG_RW | PG_PS | PG_U;
 	}
 	load_cr3(((uint64_t)&PT4[0]) - KERNBASE);
+
+	/*
+	 * Init an empty static kenv using a free page. The contents will be
+	 * filled from the parse_preload_data hook.
+	 */
+	kenv = (void *)(physfree + KERNBASE);
+	physfree += PAGE_SIZE;
+	bzero(kenv, PAGE_SIZE);
+	init_static_kenv(kenv, PAGE_SIZE);
 
 	/* Set the hooks for early functions that diverge from bare metal */
 	init_ops = xen_legacy_init_ops;


More information about the svn-src-head mailing list