ia64/xen-unstable

changeset 8995:4f838d2ac31a

linux-i386: cleanup head.S, sync default_ldt and {new,boot}_cpu_data with native.

Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Fri Feb 24 14:41:45 2006 +0000 (2006-02-24)
parents e0f563e8db9f
children 0807931dfa54
files linux-2.6-xen-sparse/arch/i386/kernel/head-xen.S linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c linux-2.6-xen-sparse/arch/i386/kernel/traps-xen.c linux-2.6-xen-sparse/include/asm-i386/mach-xen/setup_arch_post.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/i386/kernel/head-xen.S	Fri Feb 24 11:05:52 2006 +0000
     1.2 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/head-xen.S	Fri Feb 24 14:41:45 2006 +0000
     1.3 @@ -25,11 +25,6 @@
     1.4  
     1.5  ENTRY(startup_32)
     1.6  	movl %esi,xen_start_info
     1.7 -
     1.8 -#if 0
     1.9 -ENTRY(startup_32_smp)
    1.10 -#endif /* CONFIG_SMP */
    1.11 -
    1.12  	cld
    1.13  
    1.14  	/* Set up the stack pointer */
    1.15 @@ -57,29 +52,42 @@ checkCPUtype:
    1.16  	movb %cl,X86_MASK
    1.17  	movl %edx,X86_CAPABILITY
    1.18  
    1.19 +	movb $1,X86_HARD_MATH
    1.20 +
    1.21  	xorl %eax,%eax			# Clear FS/GS and LDT
    1.22  	movl %eax,%fs
    1.23  	movl %eax,%gs
    1.24  	cld			# gcc2 wants the direction flag cleared at all times
    1.25  
    1.26 -#if 0
    1.27 -	movb ready, %cl
    1.28 -	movb $1, ready
    1.29 -	cmpb $0,%cl
    1.30 -	je 1f			# the first CPU calls start_kernel
    1.31 -				# all other CPUs call initialize_secondary
    1.32 -	call initialize_secondary
    1.33 -	jmp L6
    1.34 -1:
    1.35 -#endif /* CONFIG_SMP */
    1.36  	call start_kernel
    1.37  L6:
    1.38  	jmp L6			# main should never return here, but
    1.39  				# just in case, we know what happens.
    1.40  
    1.41 -	ALIGN
    1.42 +#define HYPERCALL_PAGE_OFFSET 0x1000
    1.43 +.org HYPERCALL_PAGE_OFFSET
    1.44 +ENTRY(hypercall_page)
    1.45 +.skip 0x1000
    1.46 +
    1.47 +/*
    1.48 + * Real beginning of normal "text" segment
    1.49 + */
    1.50 +ENTRY(stext)
    1.51 +ENTRY(_stext)
    1.52  
    1.53 -# boot GDT descriptor (later on used by CPU#0):
    1.54 +/*
    1.55 + * BSS section
    1.56 + */
    1.57 +.section ".bss.page_aligned","w"
    1.58 +ENTRY(empty_zero_page)
    1.59 +	.fill 4096,1,0
    1.60 +
    1.61 +/*
    1.62 + * This starts the data section.
    1.63 + */
    1.64 +.data
    1.65 +
    1.66 +	ALIGN
    1.67  	.word 0				# 32 bit align gdt_desc.address
    1.68  	.globl cpu_gdt_descr
    1.69  cpu_gdt_descr:
    1.70 @@ -88,10 +96,10 @@ cpu_gdt_descr:
    1.71  
    1.72  	.fill NR_CPUS-1,8,0		# space for the other GDT descriptors
    1.73  
    1.74 -.org 0x1000
    1.75 -ENTRY(empty_zero_page)
    1.76 -
    1.77 -.org 0x2000
    1.78 +/*
    1.79 + * The Global Descriptor Table contains 28 quadwords, per-CPU.
    1.80 + */
    1.81 +	.align PAGE_SIZE_asm
    1.82  ENTRY(cpu_gdt_table)
    1.83  	.quad 0x0000000000000000	/* NULL descriptor */
    1.84  	.quad 0x0000000000000000	/* 0x0b reserved */
    1.85 @@ -106,10 +114,10 @@ ENTRY(cpu_gdt_table)
    1.86  	.quad 0x0000000000000000	/* 0x53 reserved */
    1.87  	.quad 0x0000000000000000	/* 0x5b reserved */
    1.88  
    1.89 -	.quad 0x00cf9b000000ffff	/* 0x60 kernel 4GB code at 0x00000000 */
    1.90 -	.quad 0x00cf93000000ffff	/* 0x68 kernel 4GB data at 0x00000000 */
    1.91 -	.quad 0x00cffb000000ffff	/* 0x73 user 4GB code at 0x00000000 */
    1.92 -	.quad 0x00cff3000000ffff	/* 0x7b user 4GB data at 0x00000000 */
    1.93 +	.quad 0x00cf9a000000ffff	/* 0x60 kernel 4GB code at 0x00000000 */
    1.94 +	.quad 0x00cf92000000ffff	/* 0x68 kernel 4GB data at 0x00000000 */
    1.95 +	.quad 0x00cffa000000ffff	/* 0x73 user 4GB code at 0x00000000 */
    1.96 +	.quad 0x00cff2000000ffff	/* 0x7b user 4GB data at 0x00000000 */
    1.97  
    1.98  	.quad 0x0000000000000000	/* 0x80 TSS descriptor */
    1.99  	.quad 0x0000000000000000	/* 0x88 LDT descriptor */
   1.100 @@ -143,20 +151,6 @@ ENTRY(cpu_gdt_table)
   1.101  	/* Be sure this is zeroed to avoid false validations in Xen */
   1.102  	.fill PAGE_SIZE_asm / 8 - GDT_ENTRIES,8,0
   1.103  
   1.104 -.org 0x3000
   1.105 -ENTRY(default_ldt)
   1.106 -
   1.107 -#define HYPERCALL_PAGE_OFFSET 0x4000
   1.108 -.org HYPERCALL_PAGE_OFFSET
   1.109 -ENTRY(hypercall_page)
   1.110 -.skip 0x1000
   1.111 -
   1.112 -/*
   1.113 - * Real beginning of normal "text" segment
   1.114 - */
   1.115 -ENTRY(stext)
   1.116 -ENTRY(_stext)
   1.117 -
   1.118  
   1.119  /*
   1.120   * __xen_guest information
     2.1 --- a/linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c	Fri Feb 24 11:05:52 2006 +0000
     2.2 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c	Fri Feb 24 14:41:45 2006 +0000
     2.3 @@ -94,9 +94,9 @@ EXPORT_SYMBOL(efi_enabled);
     2.4  #endif
     2.5  
     2.6  /* cpu data as detected by the assembly code in head.S */
     2.7 -struct cpuinfo_x86 new_cpu_data __initdata = { 0, 0, 0, 0, -1, 0, 1, 0, -1 };
     2.8 +struct cpuinfo_x86 new_cpu_data __initdata = { 0, 0, 0, 0, -1, 1, 0, 0, -1 };
     2.9  /* common cpu data for all cpus */
    2.10 -struct cpuinfo_x86 boot_cpu_data __read_mostly = { 0, 0, 0, 0, -1, 0, 1, 0, -1 };
    2.11 +struct cpuinfo_x86 boot_cpu_data __read_mostly = { 0, 0, 0, 0, -1, 1, 0, 0, -1 };
    2.12  EXPORT_SYMBOL(boot_cpu_data);
    2.13  
    2.14  unsigned long mmu_cr4_features;
     3.1 --- a/linux-2.6-xen-sparse/arch/i386/kernel/traps-xen.c	Fri Feb 24 11:05:52 2006 +0000
     3.2 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/traps-xen.c	Fri Feb 24 14:41:45 2006 +0000
     3.3 @@ -58,6 +58,9 @@
     3.4  
     3.5  asmlinkage int system_call(void);
     3.6  
     3.7 +struct desc_struct default_ldt[] = { { 0, 0 }, { 0, 0 }, { 0, 0 },
     3.8 +		{ 0, 0 }, { 0, 0 } };
     3.9 +
    3.10  /* Do we ignore FPU interrupts ? */
    3.11  char ignore_fpu_irq = 0;
    3.12  
    3.13 @@ -498,20 +501,6 @@ DO_ERROR_INFO(32, SIGSEGV, "iret excepti
    3.14  fastcall void __kprobes do_general_protection(struct pt_regs * regs,
    3.15  					      long error_code)
    3.16  {
    3.17 -	/*
    3.18 -	 * If we trapped on an LDT access then ensure that the default_ldt is
    3.19 -	 * loaded, if nothing else. We load default_ldt lazily because LDT
    3.20 -	 * switching costs time and many applications don't need it.
    3.21 -	 */
    3.22 -	if (unlikely((error_code & 6) == 4)) {
    3.23 -		unsigned long ldt;
    3.24 -		__asm__ __volatile__ ("sldt %0" : "=r" (ldt));
    3.25 -		if (ldt == 0) {
    3.26 -			xen_set_ldt((unsigned long)&default_ldt[0], 5);
    3.27 -			return;
    3.28 -		}
    3.29 -	}
    3.30 -
    3.31  	current->thread.error_code = error_code;
    3.32  	current->thread.trap_no = 13;
    3.33  
    3.34 @@ -1081,13 +1070,6 @@ void __init trap_init(void)
    3.35  	}
    3.36  
    3.37  	/*
    3.38 -	 * default LDT is a single-entry callgate to lcall7 for iBCS
    3.39 -	 * and a callgate to lcall27 for Solaris/x86 binaries
    3.40 -	 */
    3.41 -	make_lowmem_page_readonly(
    3.42 -		&default_ldt[0], XENFEAT_writable_descriptor_tables);
    3.43 -
    3.44 -	/*
    3.45  	 * Should be a barrier for any external CPU state.
    3.46  	 */
    3.47  	cpu_init();
     4.1 --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/setup_arch_post.h	Fri Feb 24 11:05:52 2006 +0000
     4.2 +++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/setup_arch_post.h	Fri Feb 24 14:41:45 2006 +0000
     4.3 @@ -25,6 +25,7 @@ void __init machine_specific_modify_cpu_
     4.4  	clear_bit(X86_FEATURE_SEP, c->x86_capability);
     4.5  	if (!(xen_start_info->flags & SIF_PRIVILEGED))
     4.6  		clear_bit(X86_FEATURE_MTRR, c->x86_capability);
     4.7 +	c->hlt_works_ok = 0;
     4.8  }
     4.9  
    4.10  extern void hypervisor_callback(void);