Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Sep 2018 07:09:41 +0000 (UTC)
From:      =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <royger@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r338627 - head/sys/x86/xen
Message-ID:  <201809130709.w8D79fKN022951@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



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