ia64/xen-unstable

changeset 9483:434c8412e54e

[IA64] vcpu_match_tr_entry

cpu_match_tr_entry moved from vcpu.h to vcpu.c, is now an inlined function
and its range check is fixed.

Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
author awilliam@xenbuild.aw
date Fri Mar 31 14:03:07 2006 -0700 (2006-03-31)
parents 0665256a7a53
children ddc279c91502
files xen/arch/ia64/xen/vcpu.c xen/include/asm-ia64/vcpu.h
line diff
     1.1 --- a/xen/arch/ia64/xen/vcpu.c	Thu Mar 30 12:47:45 2006 -0700
     1.2 +++ b/xen/arch/ia64/xen/vcpu.c	Fri Mar 31 14:03:07 2006 -0700
     1.3 @@ -1273,6 +1273,14 @@ unsigned long recover_to_break_fault_cou
     1.4  
     1.5  int warn_region0_address = 0; // FIXME later: tie to a boot parameter?
     1.6  
     1.7 +// FIXME: also need to check && (!trp->key || vcpu_pkr_match(trp->key))
     1.8 +static inline int vcpu_match_tr_entry(TR_ENTRY *trp, UINT64 ifa, UINT64 rid)
     1.9 +{
    1.10 +	return trp->p && trp->rid == rid 
    1.11 +		&& ifa >= trp->vadr
    1.12 +		&& ifa <= (trp->vadr + (1L << trp->ps) - 1);
    1.13 +}
    1.14 +
    1.15  IA64FAULT vcpu_translate(VCPU *vcpu, UINT64 address, BOOLEAN is_data, BOOLEAN in_tpa, UINT64 *pteval, UINT64 *itir, UINT64 *iha)
    1.16  {
    1.17  	unsigned long region = address >> 61;
     2.1 --- a/xen/include/asm-ia64/vcpu.h	Thu Mar 30 12:47:45 2006 -0700
     2.2 +++ b/xen/include/asm-ia64/vcpu.h	Fri Mar 31 14:03:07 2006 -0700
     2.3 @@ -16,6 +16,7 @@ typedef	struct vcpu VCPU;
     2.4  typedef cpu_user_regs_t REGS;
     2.5  
     2.6  
     2.7 +/* Note: PSCB stands for Privilegied State Communication Block.  */
     2.8  #define VCPU(_v,_x)	(_v->arch.privregs->_x)
     2.9  #define PSCB(_v,_x) VCPU(_v,_x)
    2.10  #define PSCBX(_v,_x) (_v->arch._x)
    2.11 @@ -185,10 +186,5 @@ itir_mask(UINT64 itir)
    2.12  #define vcpu_quick_region_set(_tr_regions,_ifa)             \
    2.13      do {_tr_regions |= (1 << ((unsigned long)_ifa >> 61)); } while (0)
    2.14  
    2.15 -// FIXME: also need to check && (!trp->key || vcpu_pkr_match(trp->key))
    2.16 -#define vcpu_match_tr_entry(_trp,_ifa,_rid)             \
    2.17 -    ((_trp->p && (_trp->rid==_rid) && (_ifa >= _trp->vadr) &&   \
    2.18 -    (_ifa < (_trp->vadr + (1L<< _trp->ps)) - 1)))
    2.19 -
    2.20  
    2.21  #endif