WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ia64-devel

Re: [Xen-ia64-devel]PATCH] Remove duplicate check is_running_on_xen

To: "Xu, Anthony" <anthony.xu@xxxxxxxxx>
Subject: Re: [Xen-ia64-devel]PATCH] Remove duplicate check is_running_on_xen
From: Alex Williamson <alex.williamson@xxxxxx>
Date: Tue, 16 Jan 2007 10:02:16 -0700
Cc: xen-ia64-devel <xen-ia64-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 16 Jan 2007 09:08:26 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <51CFAB8CB6883745AE7B93B3E084EBE207DDF8@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: HP OSLO R&D
References: <51CFAB8CB6883745AE7B93B3E084EBE207DDF8@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
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,

        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;                                                  \

-- 
Alex Williamson                             HP Open Source & Linux Org.


_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel