Skip to contentSkip to conversation

xen: Improve calculation of beginning of virtual address space

PATCH In review Daniel Kiper 2 participants 3 messages Mar 15, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 xen: Improve calculation of beginning of virtual address space

Xen changeset 26447 (x86: re-introduce map_domain_page() et al) once again altered virtual address space. Current algorithm calculating its start could not cope with that change. New version establishes this value on the base of image start address and is more generic.

xen_hyper.c +8 -4
diff -Npru crash-6.1.4.orig/xen_hyper.c crash-6.1.4/xen_hyper.c
@@ -43,10 +43,14 @@ xen_hyper_init(void)
 #endif
 
 #ifdef X86_64
-	if (xen_major_version() >= 4)
-		xht->xen_virt_start = 0xffff82c480000000;
-	else
-		xht->xen_virt_start = 0xffff828c80000000;
+	xht->xen_virt_start = symbol_value("start");
+
+	/*
+	 * Xen virtual mapping is aligned to 1 GiB boundary.
+	 * Image starts no more than 1 GiB below
+	 * beginning of virtual address space.
+	 */
+	xht->xen_virt_start &= 0xffffffffc0000000;
 #endif
 
 	if (machine_type("X86_64") &&
#1 lore raw
Quoted 4 lines · Daniel Kiper

Xen changeset 26447 (x86: re-introduce map_domain_page() et al) once again altered virtual address space. Current algorithm calculating its start could not cope with that change. New version establishes this value on the base of image start address and is more generic.

And it works with the older (3.4) hypervisors binary image?

Quoted 31 lines

diff -Npru crash-6.1.4.orig/xen_hyper.c crash-6.1.4/xen_hyper.c

xen_hyper.c +8 -4
@@ -43,10 +43,14 @@ xen_hyper_init(void)
 #endif
 
 #ifdef X86_64
-	if (xen_major_version() >= 4)
-		xht->xen_virt_start = 0xffff82c480000000;
-	else
-		xht->xen_virt_start = 0xffff828c80000000;
+	xht->xen_virt_start = symbol_value("start");
+
+	/*
+	 * Xen virtual mapping is aligned to 1 GiB boundary.
+	 * Image starts no more than 1 GiB below
+	 * beginning of virtual address space.
+	 */
+	xht->xen_virt_start &= 0xffffffffc0000000;
 #endif
 
 	if (machine_type("X86_64") &&

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#2 lore raw
Quoted 7 lines · Konrad Rzeszutek Wilk
Quoted 4 lines · Daniel Kiper

Xen changeset 26447 (x86: re-introduce map_domain_page() et al) once again altered virtual address space. Current algorithm calculating its start could not cope with that change. New version establishes this value on the base of image start address and is more generic.

And it works with the older (3.4) hypervisors binary image?

It works without any issue.

Daniel