[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-ia64-devel] simplify hw_irq.h



Alex Williamson wrote:
> Hi Isaku,
> 
>    Here's some cleanup to arch/ia64/kernel/time.c.  I removed
> time_resume() since it's not called from anywhere.  I think this file
> still needs some work; any PV guest is going to need something like
> this, so it would be nice to isolate the Xen specific parts and have
> everything else in PARAVIRT_GUEST code instead of XEN.  This might be
> an opportunity for another pv_ops structure.  Maybe we should also
> create a is_paravirt_guest() macro to clearly distinguish Xen-isms
> from things we think apply to all PV guests.  This should probably
> live in asm/paravirt.h and include asm/xen/hypervisor.h so we can
> just include one file and get both is_paravirt_guest() and
> is_running_on_xen(). Thanks,
> 
>       Alex
> 
> Signed-off-by: Alex Williamson <alex.williamson@xxxxxx>
> ---
> 
>  time.c |   58
>  +++++++--------------------------------------------------- 1 file
> changed, 7 insertions(+), 51 deletions(-) 
> 
> diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c
> index 1bb0362..cae777e 100644
> --- a/arch/ia64/kernel/time.c
> +++ b/arch/ia64/kernel/time.c
> @@ -31,10 +31,10 @@
> 
>  #include <asm/xen/hypervisor.h>
>  #ifdef CONFIG_XEN
> +#include <asm/percpu.h>
>  #include <linux/kernel_stat.h>
>  #include <linux/posix-timers.h>
>  #include <xen/interface/vcpu.h>
> -#include <asm/percpu.h>
>  #endif
> 
>  #include "fsyscall_gtod_data.h"
> @@ -283,7 +283,7 @@ __setup("nojitter", nojitter_setup);
> 
>  #ifdef CONFIG_XEN
>  /* taken from i386/kernel/time-xen.c */
> -static void init_missing_ticks_accounting(int cpu)
> +static void xen_init_missing_ticks_accounting(int cpu)
>  {
>       struct vcpu_register_runstate_memory_area area;
>       struct vcpu_runstate_info *runstate = &per_cpu(runstate, cpu);
> @@ -301,63 +301,19 @@ static void init_missing_ticks_accounting(int
>                                           cpu) +
runstate->time[RUNSTATE_offline];
>  }
> 
> -static int xen_ia64_settimefoday_after_resume;
> +static int xen_ia64_settimeofday_after_resume;
> 
>  static int __init __xen_ia64_settimeofday_after_resume(char *str)
>  {
> -     xen_ia64_settimefoday_after_resume = 1;
> +     xen_ia64_settimeofday_after_resume = 1;
>       return 1;
>  }
> 
> -__setup("xen_ia64_settimefoday_after_resume",
> +__setup("xen_ia64_settimeofday_after_resume",
>        __xen_ia64_settimeofday_after_resume);
> 
> -/* Called after suspend, to resume time.  */
> -void
> -time_resume(void)
> -{
> -     unsigned int cpu;
> -
> -     /* Just trigger a tick.  */
> -     ia64_cpu_local_tick();
> -
> -     if (xen_ia64_settimefoday_after_resume) {
> -             /* do_settimeofday() resets timer interplator */
> -             struct timespec xen_time;
> -             int ret;
> -             efi_gettimeofday(&xen_time);
> -
> -             ret = do_settimeofday(&xen_time);
> -             WARN_ON(ret);
> -     } else {
> -#if 0
> -             /* adjust EFI time */
> -             struct timespec my_time = CURRENT_TIME;
> -             struct timespec xen_time;
> -             static timespec diff;
> -             struct xen_domctl domctl;
> -             int ret;
> -
> -             efi_gettimeofday(&xen_time);
> -             diff = timespec_sub(&xen_time, &my_time);
> -             domctl.cmd = XEN_DOMCTL_settimeoffset;
> -             domctl.domain = DOMID_SELF;
> -             domctl.u.settimeoffset.timeoffset_seconds = diff.tv_sec;
> -             ret = HYPERVISOR_domctl_op(&domctl);
> -             WARN_ON(ret);
> -#endif
> -             /* itc_clocksource remembers the last timer status in
> -              * itc_jitter_data. Forget it */
> -             clocksource_resume();
> -     }
> -
> -     for_each_online_cpu(cpu)
> -             init_missing_ticks_accounting(cpu);
> -
> -     touch_softlockup_watchdog();
> -}
>  #else
> -#define init_missing_ticks_accounting(cpu) do {} while (0)
> +#define xen_init_missing_ticks_accounting(cpu) do {} while (0)
>  #endif
> 
>  void __devinit
> @@ -455,7 +411,7 @@ ia64_init_itm (void)
>               clocksource_itc.rating = 50;
> 
>       if (is_running_on_xen())
> -             init_missing_ticks_accounting(smp_processor_id());
> +             xen_init_missing_ticks_accounting(smp_processor_id());
> 
>       /* avoid softlock up message when cpu is unplug and plugged
again.
>       */ touch_softlockup_watchdog();
> 
> 
> 
> _______________________________________________
> Xen-ia64-devel mailing list
> Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-ia64-devel

This one should be safe and easy to be accepted to remove
CONFIG_XEN.


    Signed-off-by: Yaozu (Eddie) Dong <eddie.dong@xxxxxxxxx>

diff --git a/include/asm-ia64/hw_irq.h b/include/asm-ia64/hw_irq.h
index 80009cd..f670433 100644
--- a/include/asm-ia64/hw_irq.h
+++ b/include/asm-ia64/hw_irq.h
@@ -15,11 +15,7 @@
 #include <asm/ptrace.h>
 #include <asm/smp.h>

-#ifndef CONFIG_XEN
-typedef u8 ia64_vector;
-#else
 typedef u16 ia64_vector;
-#endif

 /*
  * 0 special

Attachment: x1
Description: x1

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.