socsvn commit: r287554 - soc2015/mihai/bhyve-on-arm-head/sys/arm/vmm

mihai at FreeBSD.org mihai at FreeBSD.org
Wed Jun 24 22:03:07 UTC 2015


Author: mihai
Date: Wed Jun 24 22:03:05 2015
New Revision: 287554
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287554

Log:
  soc2015: mihai: bhyve-on-arm-head: sys: arm: vmm: remove alloc for the code area because it breaks the global pointers

Modified:
  soc2015/mihai/bhyve-on-arm-head/sys/arm/vmm/arm.c
  soc2015/mihai/bhyve-on-arm-head/sys/arm/vmm/hyp.S

Modified: soc2015/mihai/bhyve-on-arm-head/sys/arm/vmm/arm.c
==============================================================================
--- soc2015/mihai/bhyve-on-arm-head/sys/arm/vmm/arm.c	Wed Jun 24 21:30:35 2015	(r287553)
+++ soc2015/mihai/bhyve-on-arm-head/sys/arm/vmm/arm.c	Wed Jun 24 22:03:05 2015	(r287554)
@@ -30,7 +30,6 @@
 arm_init(int ipinum)
 {
 	char *stack_top;
-	size_t hyp_code_size;
 	uint64_t *phys_hyp_l1pd;
 
 	stack = malloc(PAGE_SIZE, M_HYP);
@@ -39,25 +38,15 @@
 	lpae_vmmmap_set(NULL, stack, ptophys(stack), PAGE_SIZE,
 	    VM_PROT_READ | VM_PROT_WRITE);
 
-	/*
-	 * Allocate a PAGE for the HYP code to be sure it's PAGE_SIZE
-	 * aligned and doesn't cross a page boundary.
-	 */
-	hyp_code_size = _hyp_code_stop - _hyp_code_start;
-	hyp_code_size = (hyp_code_size + PAGE_SIZE) & PAGE_SIZE;
-	hyp_code = contigmalloc(hyp_code_size, M_HYP, 0, 0x0,
-	    0xffffffff, PAGE_SIZE, 0);
-	memcpy(hyp_code, _hyp_code_start, hyp_code_size);
-
-	printf("%s hyp_code_size: %p, _hyp_code_start: %p, hyp_code: %p\n", __func__, (void*) _hyp_code_start, (void*) hyp_code);
+	printf("%s _hyp_code_start: %p\n", __func__, (void*) _hyp_code_start);
 
 	/* Create two mappings:
 	 * - one identity - VA == PA
 	 * - one normal mappings to HYP pagetable
 	 */
-	lpae_vmmmap_set(NULL, hyp_code, ptophys(hyp_code), hyp_code_size,
+	lpae_vmmmap_set(NULL, hyp_code, ptophys(_hyp_code_start), PAGE_SIZE,
 	    VM_PROT_READ | VM_PROT_WRITE);
-	lpae_vmmmap_set(NULL, ptophys(hyp_code), ptophys(hyp_code), hyp_code_size, 
+	lpae_vmmmap_set(NULL, ptophys(_hyp_code_start), ptophys(_hyp_code_start), PAGE_SIZE,
 	    VM_PROT_READ | VM_PROT_WRITE);
 
 	/* 

Modified: soc2015/mihai/bhyve-on-arm-head/sys/arm/vmm/hyp.S
==============================================================================
--- soc2015/mihai/bhyve-on-arm-head/sys/arm/vmm/hyp.S	Wed Jun 24 21:30:35 2015	(r287553)
+++ soc2015/mihai/bhyve-on-arm-head/sys/arm/vmm/hyp.S	Wed Jun 24 22:03:05 2015	(r287554)
@@ -14,6 +14,7 @@
 	.globl	_hyp_vector
 	.globl	_init_hyp_vector
 
+	.p2align 12
 _hyp_code_start:
 
 __semi_call:


More information about the svn-soc-all mailing list