direct-io.hg

changeset 6442:5f1ed597f107

Ensure percpu data area not used before the TR is set.
author fred@xuni-t01.sc.intel.com
date Tue Aug 23 18:43:18 2005 -0800 (2005-08-23)
parents 1ec2225aa8c6
children 8799d14bef77
files xen/arch/ia64/ivt.S xen/arch/ia64/linux-xen/head.S xen/arch/ia64/linux-xen/setup.c xen/arch/ia64/xensetup.c
line diff
     1.1 --- a/xen/arch/ia64/ivt.S	Fri Aug 19 21:19:39 2005 -0800
     1.2 +++ b/xen/arch/ia64/ivt.S	Tue Aug 23 18:43:18 2005 -0800
     1.3 @@ -136,7 +136,11 @@ ENTRY(vhpt_miss)
     1.4  	;;
     1.5  	rsm psr.dt				// use physical addressing for data
     1.6  	mov r31=pr				// save the predicate registers
     1.7 +#ifdef XEN
     1.8 +	movl r19=THIS_CPU(cpu_kr)+IA64_KR_PT_BASE_OFFSET;;
     1.9 +#else
    1.10  	mov r19=IA64_KR(PT_BASE)		// get page table base address
    1.11 +#endif
    1.12  	shl r21=r16,3				// shift bit 60 into sign bit
    1.13  	shr.u r17=r16,61			// get the region number into r17
    1.14  	;;
    1.15 @@ -503,7 +507,11 @@ ENTRY(nested_dtlb_miss)
    1.16  	 * Clobbered:	b0, r18, r19, r21, psr.dt (cleared)
    1.17  	 */
    1.18  	rsm psr.dt				// switch to using physical data addressing
    1.19 +#ifdef XEN
    1.20 +	movl r19=THIS_CPU(cpu_kr)+IA64_KR_PT_BASE_OFFSET;;
    1.21 +#else
    1.22  	mov r19=IA64_KR(PT_BASE)		// get the page table base address
    1.23 +#endif
    1.24  	shl r21=r16,3				// shift bit 60 into sign bit
    1.25  	;;
    1.26  	shr.u r17=r16,61			// get the region number into r17
     2.1 --- a/xen/arch/ia64/linux-xen/head.S	Fri Aug 19 21:19:39 2005 -0800
     2.2 +++ b/xen/arch/ia64/linux-xen/head.S	Tue Aug 23 18:43:18 2005 -0800
     2.3 @@ -226,6 +226,8 @@ 1:	// now we are in virtual mode
     2.4  	bsw.1
     2.5  	;;
     2.6  #else // CONFIG_VTI
     2.7 +	mov IA64_KR(CURRENT)=r2
     2.8 +	mov IA64_KR(CURRENT_STACK)=r16
     2.9  #endif // CONFIG_VTI
    2.10  	mov r13=r2
    2.11  	/*
     3.1 --- a/xen/arch/ia64/linux-xen/setup.c	Fri Aug 19 21:19:39 2005 -0800
     3.2 +++ b/xen/arch/ia64/linux-xen/setup.c	Tue Aug 23 18:43:18 2005 -0800
     3.3 @@ -260,9 +260,9 @@ io_port_init (void)
     3.4  	phys_iobase = efi_get_iobase();
     3.5  	if (phys_iobase)
     3.6  		/* set AR.KR0 since this is all we use it for anyway */
     3.7 -		__get_cpu_var(cpu_kr)._kr[IA64_KR_IO_BASE]=phys_iobase;
     3.8 +		ia64_set_kr(IA64_KR_IO_BASE, phys_iobase);
     3.9  	else {
    3.10 -		phys_iobase=__get_cpu_var(cpu_kr)._kr[IA64_KR_IO_BASE];
    3.11 +		phys_iobase = ia64_get_kr(IA64_KR_IO_BASE);
    3.12  		printk(KERN_INFO "No I/O port range found in EFI memory map, falling back "
    3.13  		       "to AR.KR0\n");
    3.14  		printk(KERN_INFO "I/O port base = 0x%lx\n", phys_iobase);
    3.15 @@ -609,8 +609,6 @@ void
    3.16  setup_per_cpu_areas (void)
    3.17  {
    3.18  	/* start_kernel() requires this... */
    3.19 -	__get_cpu_var(cpu_kr)._kr[IA64_KR_CURRENT] = current;
    3.20 -	__get_cpu_var(cpu_kr)._kr[IA64_KR_CURRENT_STACK] = -1;
    3.21  }
    3.22  
    3.23  static void
    3.24 @@ -668,8 +666,8 @@ cpu_init (void)
    3.25  	 * physical addresses of per cpu variables with a simple:
    3.26  	 *   phys = ar.k3 + &per_cpu_var
    3.27  	 */
    3.28 -//	ia64_set_kr(IA64_KR_PER_CPU_DATA,
    3.29 -//		    ia64_tpa(cpu_data) - (long) __per_cpu_start);
    3.30 +	ia64_set_kr(IA64_KR_PER_CPU_DATA,
    3.31 +		    ia64_tpa(cpu_data) - (long) __per_cpu_start);
    3.32  
    3.33  	get_max_cacheline_size();
    3.34  
    3.35 @@ -699,7 +697,7 @@ cpu_init (void)
    3.36  	/* Clear the stack memory reserved for pt_regs: */
    3.37  	memset(ia64_task_regs(current), 0, sizeof(struct pt_regs));
    3.38  
    3.39 -	__get_cpu_var(cpu_kr)._kr[IA64_KR_FPU_OWNER] = 0;
    3.40 +	ia64_set_kr(IA64_KR_FPU_OWNER, 0);
    3.41  
    3.42  	/*
    3.43  	 * Initialize default control register to defer all speculative faults.  The
     4.1 --- a/xen/arch/ia64/xensetup.c	Fri Aug 19 21:19:39 2005 -0800
     4.2 +++ b/xen/arch/ia64/xensetup.c	Tue Aug 23 18:43:18 2005 -0800
     4.3 @@ -261,6 +261,14 @@ printk("About to call ac_timer_init()\n"
     4.4  printk("About to call sort_main_extable()\n");
     4.5      sort_main_extable();
     4.6  
     4.7 +    /* surrender usage of kernel registers to domain, use percpu area instead */
     4.8 +    __get_cpu_var(cpu_kr)._kr[IA64_KR_IO_BASE] = ia64_get_kr(IA64_KR_IO_BASE);
     4.9 +    __get_cpu_var(cpu_kr)._kr[IA64_KR_PER_CPU_DATA] = ia64_get_kr(IA64_KR_PER_CPU_DATA);
    4.10 +    __get_cpu_var(cpu_kr)._kr[IA64_KR_CURRENT_STACK] = ia64_get_kr(IA64_KR_CURRENT_STACK);
    4.11 +    __get_cpu_var(cpu_kr)._kr[IA64_KR_FPU_OWNER] = ia64_get_kr(IA64_KR_FPU_OWNER);
    4.12 +    __get_cpu_var(cpu_kr)._kr[IA64_KR_CURRENT] = ia64_get_kr(IA64_KR_CURRENT);
    4.13 +    __get_cpu_var(cpu_kr)._kr[IA64_KR_PT_BASE] = ia64_get_kr(IA64_KR_PT_BASE);
    4.14 +
    4.15      /* Create initial domain 0. */
    4.16  printk("About to call do_createdomain()\n");
    4.17      dom0 = do_createdomain(0, 0);