ia64/xen-unstable

view xen/include/public/arch-ia64/hvm/save.h @ 16171:e7d7a4adf357

[IA64] vti domain save/restore: implement hvm_save/load. work in progress.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Alex Williamson <alex.williamson@hp.com>
date Sun Oct 21 14:39:07 2007 -0600 (2007-10-21)
parents
children e6acebec04a2
line source
1 /******************************************************************************
2 * save_types.h
3 *
4 * Copyright (c) 2007 Isaku Yamahata <yamahata at valinux co jp>
5 * VA Linux Systems Japan K.K.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 */
23 #ifndef __XEN_PUBLIC_HVM_SAVE_IA64_H__
24 #define __XEN_PUBLIC_HVM_SAVE_IA64_H__
26 #include <public/hvm/save.h>
27 #include <public/arch-ia64.h>
29 /*
30 * Save/restore header: general info about the save file.
31 */
33 /* x86 uses 0x54381286 */
34 #define HVM_FILE_MAGIC 0x343641492f6e6558UL /* "Xen/IA64" */
35 #define HVM_FILE_VERSION 0x0000000000000001UL
37 struct hvm_save_header {
38 uint64_t magic; /* Must be HVM_FILE_MAGIC */
39 uint64_t version; /* File format version */
40 uint64_t changeset; /* Version of Xen that saved this file */
41 uint64_t cpuid[5]; /* CPUID[0x01][%eax] on the saving machine */
42 };
44 DECLARE_HVM_SAVE_TYPE(HEADER, 1, struct hvm_save_header);
46 /*
47 * CPU
48 */
49 struct hvm_hw_ia64_cpu {
50 uint64_t ipsr;
51 };
52 DECLARE_HVM_SAVE_TYPE(CPU, 2, struct hvm_hw_ia64_cpu);
54 /*
55 * CPU
56 */
57 struct hvm_hw_ia64_vpd {
58 struct vpd vpd;
59 };
60 DECLARE_HVM_SAVE_TYPE(VPD, 3, struct hvm_hw_ia64_vpd);
62 /*
63 * device dependency
64 * vacpi => viosapic => vlsapic
65 */
66 /*
67 * vlsapic
68 */
69 struct hvm_hw_ia64_vlsapic {
70 uint64_t insvc[4];
71 uint64_t vhpi; // ??? should this be saved in vpd
72 uint8_t xtp;
73 uint8_t pal_init_pending;
74 uint8_t pad[2];
75 };
76 DECLARE_HVM_SAVE_TYPE(VLSAPIC, 4, struct hvm_hw_ia64_vlsapic);
77 // unconditionaly set v->arch.irq_new_peding = 1
78 // unconditionaly set v->arch.irq_new_condition = 0
80 /*
81 * vtime
82 */
83 // itc, itm, itv are saved by arch vcpu context
84 struct hvm_hw_ia64_vtime {
85 uint64_t itc;
86 uint64_t itm;
88 uint64_t last_itc;
89 uint64_t pending;
90 };
91 DECLARE_HVM_SAVE_TYPE(VTIME, 5, struct hvm_hw_ia64_vtime);
92 // calculate v->vtm.vtm_offset
93 // ??? Or should vtm_offset be set by leave_hypervisor_tail()?
94 // start vtm_timer if necessary by vtm_set_itm().
95 // ??? Or should vtm_timer be set by leave_hypervisor_tail()?
96 //
97 // ??? or should be done by schedule_tail()
98 // => schedule_tail() should do.
100 /*
101 * viosapic
102 */
103 #define VIOSAPIC_NUM_PINS 48
105 union viosapic_rte
106 {
107 uint64_t bits;
108 struct {
109 uint8_t vector;
111 uint8_t delivery_mode : 3;
112 uint8_t reserve1 : 1;
113 uint8_t delivery_status: 1;
114 uint8_t polarity : 1;
115 uint8_t reserve2 : 1;
116 uint8_t trig_mode : 1;
118 uint8_t mask : 1;
119 uint8_t reserve3 : 7;
121 uint8_t reserved[3];
122 uint16_t dest_id;
123 };
124 };
126 struct hvm_hw_ia64_viosapic {
127 uint64_t irr;
128 uint64_t isr;
129 uint32_t ioregsel;
130 uint32_t pad;
131 uint64_t lowest_vcpu_id;
132 uint64_t base_address;
133 union viosapic_rte redirtbl[VIOSAPIC_NUM_PINS];
134 };
135 DECLARE_HVM_SAVE_TYPE(VIOSAPIC, 6, struct hvm_hw_ia64_viosapic);
137 /*
138 * vacpi
139 * PM timer
140 */
141 #if 0
142 struct hvm_hw_ia64_pmtimer {
143 uint32_t tmr_val; /* PM_TMR_BLK.TMR_VAL: 32bit free-running counter */
144 uint16_t pm1a_sts; /* PM1a_EVT_BLK.PM1a_STS: status register */
145 uint16_t pm1a_en; /* PM1a_EVT_BLK.PM1a_EN: enable register */
146 };
147 DECLARE_HVM_SAVE_TYPE(PMTIMER, 7, struct hvm_hw_ia64_pmtimer);
148 #else
149 struct vacpi_regs {
150 union {
151 struct {
152 uint32_t pm1a_sts:16;
153 uint32_t pm1a_en:16;
154 };
155 uint32_t evt_blk;
156 };
157 uint32_t tmr_val;
158 };
160 struct hvm_hw_ia64_vacpi {
161 struct vacpi_regs regs;
162 };
163 DECLARE_HVM_SAVE_TYPE(VACPI, 7, struct hvm_hw_ia64_vacpi);
164 // update last_gtime and setup timer of struct vacpi
165 #endif
167 #if 0
168 /*
169 * guest os type
170 * XXX Xen guest os specific optimization
171 * This isn't hvm specific so this should be addressed genericly
172 * including paravirtualized domain.
173 */
174 struct hvm_hw_ia64_gos {
175 uint64_t gos_type;
176 };
177 DECLARE_HVM_SAVE_TYPE(GOS_TYPE, 8, struct hvm_hw_ia64_gos);
178 #endif
180 /*
181 * Largest type-code in use
182 */
183 #define HVM_SAVE_CODE_MAX 7
185 #endif /* __XEN_PUBLIC_HVM_SAVE_IA64_H__ */
187 /*
188 * Local variables:
189 * mode: C
190 * c-set-style: "BSD"
191 * c-basic-offset: 4
192 * tab-width: 4
193 * indent-tabs-mode: nil
194 * End:
195 */