# HG changeset patch # User tristan.gingold@xxxxxxxx # Node ID d68aa98f80390762aead8ee89aa1a6af391d455a # Parent 0665256a7a5368f3e76366448696aeddb8643bb5 vcpu_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 diff -r 0665256a7a53 -r d68aa98f8039 xen/arch/ia64/xen/vcpu.c --- a/xen/arch/ia64/xen/vcpu.c Thu Mar 30 19:47:45 2006 +++ b/xen/arch/ia64/xen/vcpu.c Fri Mar 31 05:49:25 2006 @@ -1273,6 +1273,14 @@ int warn_region0_address = 0; // FIXME later: tie to a boot parameter? +// FIXME: also need to check && (!trp->key || vcpu_pkr_match(trp->key)) +static inline int vcpu_match_tr_entry(TR_ENTRY *trp, UINT64 ifa, UINT64 rid) +{ + return trp->p && trp->rid == rid + && ifa >= trp->vadr + && ifa <= (trp->vadr + (1L << trp->ps) - 1); +} + IA64FAULT vcpu_translate(VCPU *vcpu, UINT64 address, BOOLEAN is_data, BOOLEAN in_tpa, UINT64 *pteval, UINT64 *itir, UINT64 *iha) { unsigned long region = address >> 61; diff -r 0665256a7a53 -r d68aa98f8039 xen/include/asm-ia64/vcpu.h --- a/xen/include/asm-ia64/vcpu.h Thu Mar 30 19:47:45 2006 +++ b/xen/include/asm-ia64/vcpu.h Fri Mar 31 05:49:25 2006 @@ -16,6 +16,7 @@ typedef cpu_user_regs_t REGS; +/* Note: PSCB stands for Privilegied State Communication Block. */ #define VCPU(_v,_x) (_v->arch.privregs->_x) #define PSCB(_v,_x) VCPU(_v,_x) #define PSCBX(_v,_x) (_v->arch._x) @@ -185,10 +186,5 @@ #define vcpu_quick_region_set(_tr_regions,_ifa) \ do {_tr_regions |= (1 << ((unsigned long)_ifa >> 61)); } while (0) -// FIXME: also need to check && (!trp->key || vcpu_pkr_match(trp->key)) -#define vcpu_match_tr_entry(_trp,_ifa,_rid) \ - ((_trp->p && (_trp->rid==_rid) && (_ifa >= _trp->vadr) && \ - (_ifa < (_trp->vadr + (1L<< _trp->ps)) - 1))) - #endif