# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID c3a0f492644cf3288e4144d85d73efc831d7333f
# Parent 899f7b4b19fc364a83650b1e2466393a7bb08ba6
Work around internal error in some versions of x86/64 gcc
by manually hoisting gdt address calculation outside loop.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
diff -r 899f7b4b19fc -r c3a0f492644c xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c Fri Oct 21 09:46:30 2005
+++ b/xen/arch/x86/domain.c Fri Oct 21 10:29:51 2005
@@ -254,6 +254,7 @@
void arch_do_createdomain(struct vcpu *v)
{
struct domain *d = v->domain;
+ l1_pgentry_t gdt_l1e;
int vcpuid;
if ( is_idle_task(d) )
@@ -282,12 +283,10 @@
* GDT, and the old VCPU# is invalid in the new domain, we would otherwise
* try to load CS from an invalid table.
*/
+ gdt_l1e = l1e_from_page(virt_to_page(gdt_table), PAGE_HYPERVISOR);
for ( vcpuid = 0; vcpuid < MAX_VIRT_CPUS; vcpuid++ )
- {
d->arch.mm_perdomain_pt[
- (vcpuid << PDPT_VCPU_SHIFT) + FIRST_RESERVED_GDT_PAGE] =
- l1e_from_page(virt_to_page(gdt_table), PAGE_HYPERVISOR);
- }
+ (vcpuid << PDPT_VCPU_SHIFT) + FIRST_RESERVED_GDT_PAGE] = gdt_l1e;
v->arch.guest_vtable = __linear_l2_table;
v->arch.shadow_vtable = __shadow_linear_l2_table;
diff -r 899f7b4b19fc -r c3a0f492644c xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c Fri Oct 21 09:46:30 2005
+++ b/xen/arch/x86/setup.c Fri Oct 21 10:29:51 2005
@@ -141,7 +141,7 @@
static void __init start_of_day(void)
{
int i;
- unsigned long vgdt;
+ unsigned long vgdt, gdt_pfn;
early_cpu_init();
@@ -164,10 +164,10 @@
* noted in arch_do_createdomain(), we must map for every possible VCPU#.
*/
vgdt = GDT_VIRT_START(current) + FIRST_RESERVED_GDT_BYTE;
+ gdt_pfn = virt_to_phys(gdt_table) >> PAGE_SHIFT;
for ( i = 0; i < MAX_VIRT_CPUS; i++ )
{
- map_pages_to_xen(
- vgdt, virt_to_phys(gdt_table) >> PAGE_SHIFT, 1, PAGE_HYPERVISOR);
+ map_pages_to_xen(vgdt, gdt_pfn, 1, PAGE_HYPERVISOR);
vgdt += 1 << PDPT_VCPU_VA_SHIFT;
}
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|