ia64/xen-unstable

changeset 18363:1d565c0429cb

[IA64] introduce XEN_EFI_RR6 and XEN_EFI_RR7

for firmware rr6 is used for uncacned region
and rr7 is used for cachable region.
So rid must be different.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Mon Aug 25 19:04:37 2008 +0900 (2008-08-25)
parents 6607624285b2
children 5a61dba2cf0a
files xen/arch/ia64/xen/ivt.S xen/include/asm-ia64/linux-xen/linux/efi.h
line diff
     1.1 --- a/xen/arch/ia64/xen/ivt.S	Mon Aug 25 19:04:37 2008 +0900
     1.2 +++ b/xen/arch/ia64/xen/ivt.S	Mon Aug 25 19:04:37 2008 +0900
     1.3 @@ -206,26 +206,31 @@ late_alt_dtlb_miss:
     1.4  	cmp.eq p8,p0=((VIRT_FRAME_TABLE_ADDR>>56)&0xff)-0x100,r22
     1.5  (p8)	br.cond.sptk frametable_miss ;;
     1.6  #endif
     1.7 -	// If it is not a Xen address, handle it via page_fault.
     1.8 -	//    !( ((r22 == 0x18 || r22 == 0x1c) && rr7 == XEN_EFI_RR) ||
     1.9 -	//	 r22 == 0x1e )
    1.10 -	// Note that rr7 == XEN_EFI_RR implies rr6 == XEN_EFI_RR
    1.11 +	//    !( (r22 == 0x18 && rr6 == XEN_EFI_RR6) ||
    1.12 +	//	 (r22 == 0x1c && rr7 == XEN_EFI_RR7) ||
    1.13 +	//	 r22 == 0x1e)
    1.14 +
    1.15  	extr.u r22=r16,59,5
    1.16  	;;
    1.17  	dep r20=0,r20,IA64_ITIR_KEY,IA64_ITIR_KEY_LEN	// clear the key
    1.18 +	movl r24=6 << 61
    1.19  	movl r23=7 << 61
    1.20  	;;
    1.21 +	mov r24=rr[r24]
    1.22  	mov r23=rr[r23]
    1.23  	;;
    1.24 -	mov r25=XEN_EFI_RR
    1.25 +	movl r26=XEN_EFI_RR6
    1.26 +	movl r25=XEN_EFI_RR7
    1.27 +
    1.28  	cmp.eq p8,p0=0x18,r22		// 0xc...
    1.29 +	cmp.eq p9,p0=0x1c,r22		// 0xe...
    1.30  	;;
    1.31 -	cmp.eq.or p8,p0=0x1c,r22	// 0xe...
    1.32 +	cmp.eq.and p8,p0=r26,r24	// rr6 == XEN_EFI_RR6
    1.33 +	cmp.eq.and p9,p0=r25,r23	// rr7 == XEN_EFI_RR7
    1.34  	;;
    1.35 -	cmp.eq.and p8,p0=r25,r23	// rr7 == XEN_EFI_RR
    1.36 -	;;
    1.37 -	cmp.eq.or p8,p0=0x1e,r22	// 0xf...
    1.38 +	cmp.eq.or p9,p0=0x1e,r22	// 0xf...
    1.39  (p8)	br.cond.spnt alt_dtlb_miss_identity_map
    1.40 +(p9)	br.cond.spnt alt_dtlb_miss_identity_map
    1.41  	br.cond.spnt page_fault
    1.42  	;;
    1.43  alt_dtlb_miss_identity_map:
     2.1 --- a/xen/include/asm-ia64/linux-xen/linux/efi.h	Mon Aug 25 19:04:37 2008 +0900
     2.2 +++ b/xen/include/asm-ia64/linux-xen/linux/efi.h	Mon Aug 25 19:04:37 2008 +0900
     2.3 @@ -439,7 +439,7 @@ struct efi_generic_dev_path {
     2.4   * e: bits 3-N:  IA64_REGION_ID_KERNEL (1)
     2.5   * f: bits N-53: reserved (0)
     2.6   *
     2.7 - * + Only 0 is used as we only need one RID. Its not really important
     2.8 + * + Only 6 and 7 are used as we only need two RIDs. Its not really important
     2.9   *   what this number is, so long as its between 0 and 7.
    2.10   *
    2.11   * The nice thing about this is that we are only using 4 bits of RID
    2.12 @@ -464,7 +464,7 @@ struct efi_generic_dev_path {
    2.13   * E: bits N-53: reserved (0)
    2.14   */
    2.15  
    2.16 -/* rr7 (and rr6) may already be set to XEN_EFI_RR, which
    2.17 +/* rr7 (and rr6) may already be set to XEN_EFI_RR7 (and XEN_EFI_RR6), which
    2.18   * would indicate a nested EFI, SAL or PAL call, such
    2.19   * as from an MCA. This may have occured during a call
    2.20   * to set_one_rr_efi(). To be safe, repin everything anyway.
    2.21 @@ -473,8 +473,8 @@ struct efi_generic_dev_path {
    2.22  #define XEN_EFI_RR_ENTER(rr6, rr7) do {			\
    2.23  	rr6 = ia64_get_rr(6UL << 61);			\
    2.24  	rr7 = ia64_get_rr(7UL << 61);			\
    2.25 -	set_one_rr_efi(6UL << 61, XEN_EFI_RR);		\
    2.26 -	set_one_rr_efi(7UL << 61, XEN_EFI_RR);		\
    2.27 +	set_one_rr_efi(6UL << 61, XEN_EFI_RR6);		\
    2.28 +	set_one_rr_efi(7UL << 61, XEN_EFI_RR7);		\
    2.29  	efi_map_pal_code();				\
    2.30  } while (0)
    2.31  
    2.32 @@ -485,7 +485,7 @@ struct efi_generic_dev_path {
    2.33   */
    2.34  
    2.35  #define XEN_EFI_RR_LEAVE(rr6, rr7) do {			\
    2.36 -	if (rr7 != XEN_EFI_RR) {			\
    2.37 +	if (rr7 != XEN_EFI_RR7) {			\
    2.38  		efi_unmap_pal_code();			\
    2.39  		set_one_rr_efi_restore(6UL << 61, rr6);	\
    2.40  		set_one_rr_efi_restore(7UL << 61, rr7);	\
    2.41 @@ -507,10 +507,25 @@ struct efi_generic_dev_path {
    2.42  #ifdef XEN
    2.43  #include <asm/mmu_context.h> /* For IA64_REGION_ID_EFI and ia64_rid() */
    2.44  #include <asm/pgtable.h>     /* IA64_GRANULE_SHIFT */
    2.45 -#define XEN_EFI_REGION_NO __IA64_UL_CONST(0)
    2.46 -#define XEN_EFI_RR ((ia64_rid(XEN_IA64_REGION_ID_EFI,			\
    2.47 -			      XEN_EFI_REGION_NO) << 8) |		\
    2.48 -		    (IA64_GRANULE_SHIFT << 2))
    2.49 +
    2.50 +/* macro version of vmMangleRID() */
    2.51 +#define XEN_EFI_VM_MANGLE_RRVAL(rrval)		\
    2.52 +	((((rrval) & 0xff000000) >> 16) |	\
    2.53 +	 ((rrval) & 0x00ff0000) |		\
    2.54 +	 (((rrval) & 0x0000ff00) << 16 ) |	\
    2.55 +	 ((rrval) & 0x000000ff))
    2.56 +
    2.57 +#define XEN_EFI_REGION6 __IA64_UL_CONST(6)
    2.58 +#define XEN_EFI_REGION7 __IA64_UL_CONST(7)
    2.59 +#define _XEN_EFI_RR6 ((ia64_rid(XEN_IA64_REGION_ID_EFI,			\
    2.60 +				XEN_EFI_REGION6) << 8) |		\
    2.61 +		      (IA64_GRANULE_SHIFT << 2))
    2.62 +#define _XEN_EFI_RR7 ((ia64_rid(XEN_IA64_REGION_ID_EFI,			\
    2.63 +				XEN_EFI_REGION7) << 8) |		\
    2.64 +		      (IA64_GRANULE_SHIFT << 2))
    2.65 +#define XEN_EFI_RR6 XEN_EFI_VM_MANGLE_RRVAL(_XEN_EFI_RR6)
    2.66 +#define XEN_EFI_RR7 XEN_EFI_VM_MANGLE_RRVAL(_XEN_EFI_RR7)
    2.67 +
    2.68  #endif /* XEN */
    2.69  
    2.70  #endif /* _LINUX_EFI_H */