Alex Williamson write on 2007年1月17日 1:02:
> On Mon, 2007-01-15 at 13:33 +0800, Xu, Anthony wrote:
>>
>> Remove duplicate check is_running_on_xen
>
> Hi Anthony,
>
> I'm not sure I understand why the xen functions, for example
> xen_get_psr(), need to support both bare metal and paravirtualized
> since the caller always checks for is_running_on_xen. The current
> code seems overly paranoid. Would is make more sense to rename these
> to __xen_get_psr() and eliminate the running_on_xen check in the
> assembly? Then we could still use the native bare metal calls when
> running a Xen kernel on bare metal. Am I missing some reason why
> xen_get_psr() would ever get called on bare metal? Thanks,
There are two duplicate checks as below, so there are two way to eliminate one
check.
1. eliminate check in xen_get_tpr, then xen_get_tpr will never be called on
bare metal,
but it's a little perfomance impact, due to there is another switch inside
__ia64_getreg.
2. eliminate check in xen_ia64_getreg, then xen_get_tpr will be called both on
para platform
or bare metal, it can produce better performance than option 1. so I prefer
this.
Anthony
#define xen_ia64_getreg(regnum) \
case _IA64_REG_CR_IVR: \
ia64_intri_res = (is_running_on_xen()) ?
\
xen_get_ivr() : \
__ia64_getreg(regnum); \
break; \
GLOBAL_ENTRY(xen_get_tpr)
movl r8=running_on_xen;;
ld4 r8=[r8];;
cmp.eq p7,p0=r8,r0;;
(p7) mov r8=cr.tpr;;
(p7) br.ret.sptk.many rp
;;
XEN_CLEAR_PSR_IC
;;
XEN_HYPER_GET_TPR
;;
XEN_RESTORE_PSR_IC
;;
br.ret.sptk.many rp
;;
END(xen_get_tpr)
>
> Alex
>
>> diff -r 29780963b34f linux-2.6-xen-sparse/arch/ia64/xen/hypercall.S
>> --- a/linux-2.6-xen-sparse/arch/ia64/xen/hypercall.S Mon Jan 15
>> 04:27:37 2007 +0800 +++
>> b/linux-2.6-xen-sparse/arch/ia64/xen/hypercall.S Mon Jan 15
>> 05:02:05 2007 +0800 @@ -11,12 +11,9 @@ GLOBAL_ENTRY(xen_get_psr)
>> GLOBAL_ENTRY(xen_get_psr) movl r8=running_on_xen;;
>> ld4 r8=[r8];;
>> - cmp.eq p7,p0=r8,r0;;
>> -(p7) mov r8=psr;;
>> -(p7) br.ret.sptk.many rp
>> - ;;
>> - XEN_HYPER_GET_PSR
>> - ;;
>> + cmp.eq p7,p6=r8,r0;;
>> +(p7) mov r8=psr
>> +(p6) XEN_HYPER_GET_PSR
>> br.ret.sptk.many rp
>> ;;
>> END(xen_get_psr)
> ...
>> linux-2.6-xen-sparse/include/asm-ia64/xen/privop.h
>> --- a/linux-2.6-xen-sparse/include/asm-ia64/xen/privop.h Mon
>> Jan 15 04:27:37 2007 +0800
>> +++ b/linux-2.6-xen-sparse/include/asm-ia64/xen/privop.h Mon
>> Jan 15 05:08:12 2007 +0800
>> @@ -203,24 +203,16 @@ extern void xen_ptcga(unsigned long addr
>>
>> \ switch(regnum) {
>> \ case
>> _IA64_REG_PSR: \
>> - ia64_intri_res =
>> (is_running_on_xen()) ? \
>> - xen_get_psr() :
>> \
>> - __ia64_getreg(regnum);
>> \ + ia64_intri_res =
>> xen_get_psr(); \
>> break;
>> \
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
|