direct-io.hg

view xen/include/asm-ia64/vtm.h @ 12431:4816a891b3d6

[IA64] Fix SMP Windows boot failure

Sometime SMP Windows can't boot, the root cause is guest timer interrupt
is lost.

This patch fixes following issues.
1. Windows uses different way to sync itc.
2. Previously when Guest timer fires and guest ITV is masked, XEN will
desert this Guest timer interrupt. It is not correct for windows,
windows may expect this timer interrupt.
3. Windows may use different way to set timer in some situations.
Windows first sets itm (which may be smaller than current itc), and
then sets itc (which is samller than itm).
XEN can support this way to set timer.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
author awilliam@xenbuild.aw
date Fri Nov 10 11:19:57 2006 -0700 (2006-11-10)
parents 911c04274f14
children
line source
2 /* -*- Mode:C; c-basic-offset:4; tab-width:4; indent-tabs-mode:nil -*- */
3 /*
4 * vtm.h: virtual timer head file.
5 * Copyright (c) 2004, Intel Corporation.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms and conditions of the GNU General Public License,
9 * version 2, as published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
18 * Place - Suite 330, Boston, MA 02111-1307 USA.
19 *
20 * Yaozu Dong (Eddie Dong) (Eddie.dong@intel.com)
21 */
23 #ifndef _VTM_H_
24 #define _VTM_H_
26 #include <xen/timer.h>
27 #include <xen/types.h>
29 #define MAX_JUMP_STEP (5000) /* 500ms, max jump step */
30 #define MIN_GUEST_RUNNING_TIME (0) /* 10ms for guest os to run */
31 #define ITV_VECTOR_MASK (0xff)
33 typedef struct vtime {
34 long vtm_offset; // guest ITC = host ITC + vtm_offset
35 uint64_t vtm_local_drift;
36 uint64_t last_itc;
37 uint64_t pending;
38 /*
39 * Local drift (temporary) after guest suspension
40 * In case of long jump amount of ITC after suspension,
41 * guest ITC = host ITC + vtm_offset - vtm_local_drift;
42 * so that the duration passed saw in guest ITC is limited to
43 * cfg_max_jump that will make all kind of device driver happy.
44 */
46 // next all uses ITC tick as unit
47 uint64_t cfg_max_jump; // max jump within one time suspendsion
48 uint64_t cfg_min_grun; // min guest running time since last jump
49 // uint64_t latest_read_itc; // latest guest read ITC
50 struct timer vtm_timer;
51 // int triggered;
54 uint64_t guest_running_time; // guest running time since last switch
55 //uint64_t vtm_last_suspending_time;
56 //uint64_t switch_in_time;
57 //uint64_t switch_out_time;
58 //uint64_t itc_freq;
60 } vtime_t;
62 #define ITV_VECTOR(itv) (itv&0xff)
63 #define ITV_IRQ_MASK(itv) (itv&(1<<16))
65 #define VTM_FIRED(vtm) ((vtm)->triggered)
67 #endif /* _STATS_H_ */