1 /******************************************************************************
4 * Copyright (c) 2007 Isaku Yamahata <yamahata at valinux co jp>
5 * VA Linux Systems Japan K.K.
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to
9 * deal in the Software without restriction, including without limitation the
10 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11 * sell copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23 * DEALINGS IN THE SOFTWARE.
26 #ifndef __XEN_PUBLIC_HVM_SAVE_IA64_H__
27 #define __XEN_PUBLIC_HVM_SAVE_IA64_H__
29 #include "../../hvm/save.h"
30 #include "../../arch-ia64.h"
33 * Save/restore header: general info about the save file.
36 /* x86 uses 0x54381286 */
37 #define HVM_FILE_MAGIC 0x343641492f6e6558UL /* "Xen/IA64" */
38 #define HVM_FILE_VERSION 0x0000000000000001UL
40 struct hvm_save_header {
41 uint64_t magic; /* Must be HVM_FILE_MAGIC */
42 uint64_t version; /* File format version */
43 uint64_t changeset; /* Version of Xen that saved this file */
44 uint64_t cpuid[5]; /* CPUID[0x01][%eax] on the saving machine */
47 DECLARE_HVM_SAVE_TYPE(HEADER, 1, struct hvm_save_header);
52 struct hvm_hw_ia64_cpu {
55 DECLARE_HVM_SAVE_TYPE(CPU, 2, struct hvm_hw_ia64_cpu);
60 struct hvm_hw_ia64_vpd {
63 DECLARE_HVM_SAVE_TYPE(VPD, 3, struct hvm_hw_ia64_vpd);
67 * vacpi => viosapic => vlsapic
72 struct hvm_hw_ia64_vlsapic {
74 uint64_t vhpi; // ??? should this be saved in vpd
76 uint8_t pal_init_pending;
79 DECLARE_HVM_SAVE_TYPE(VLSAPIC, 4, struct hvm_hw_ia64_vlsapic);
81 * unconditionaly set v->arch.irq_new_peding = 1
82 * unconditionaly set v->arch.irq_new_condition = 0
88 /* itc, itm, itv are saved by arch vcpu context */
89 struct hvm_hw_ia64_vtime {
96 DECLARE_HVM_SAVE_TYPE(VTIME, 5, struct hvm_hw_ia64_vtime);
98 * calculate v->vtm.vtm_offset
99 * ??? Or should vtm_offset be set by leave_hypervisor_tail()?
100 * start vtm_timer if necessary by vtm_set_itm().
101 * ??? Or should vtm_timer be set by leave_hypervisor_tail()?
103 * ??? or should be done by schedule_tail()
104 * => schedule_tail() should do.
110 #define VIOSAPIC_NUM_PINS 48
112 /* To share VT-d code which uses vioapic_redir_entry.
113 * Although on ia64 this is for vsapic, but we have to vioapic_redir_entry
114 * instead of viosapic_redir_entry.
116 union vioapic_redir_entry
122 uint8_t delivery_mode : 3;
123 uint8_t reserve1 : 1;
124 uint8_t delivery_status: 1;
125 uint8_t polarity : 1;
126 uint8_t reserve2 : 1;
127 uint8_t trig_mode : 1;
130 uint8_t reserve3 : 7;
137 struct hvm_hw_ia64_viosapic {
142 uint64_t lowest_vcpu_id;
143 uint64_t base_address;
144 union vioapic_redir_entry redirtbl[VIOSAPIC_NUM_PINS];
146 DECLARE_HVM_SAVE_TYPE(VIOSAPIC, 6, struct hvm_hw_ia64_viosapic);
155 uint32_t pm1a_sts:16;/* PM1a_EVT_BLK.PM1a_STS: status register */
156 uint32_t pm1a_en:16; /* PM1a_EVT_BLK.PM1a_EN: enable register */
160 uint32_t tmr_val; /* PM_TMR_BLK.TMR_VAL: 32bit free-running counter */
163 struct hvm_hw_ia64_vacpi {
164 struct vacpi_regs regs;
166 DECLARE_HVM_SAVE_TYPE(VACPI, 7, struct hvm_hw_ia64_vacpi);
167 /* update last_gtime and setup timer of struct vacpi */
170 * opt_feature: identity mapping of region 4, 5 and 7.
171 * With the c/s 16396:d2935f9c217f of xen-ia64-devel.hg,
172 * opt_feature hypercall supports only region 4,5,7 identity mappings.
173 * structure hvm_hw_ia64_identity_mappings only supports them.
174 * The new structure, struct hvm_hw_ia64_identity_mappings, is created to
175 * avoid to keep up with change of the xen/ia64 internal structure, struct
178 * If it is enhanced in the future, new structure will be created.
180 struct hvm_hw_ia64_identity_mapping {
181 uint64_t on; /* on/off */
182 uint64_t pgprot; /* The page protection bit mask of the pte. */
183 uint64_t key; /* A protection key. */
186 struct hvm_hw_ia64_identity_mappings {
187 struct hvm_hw_ia64_identity_mapping im_reg4;/* Region 4 identity mapping */
188 struct hvm_hw_ia64_identity_mapping im_reg5;/* Region 5 identity mapping */
189 struct hvm_hw_ia64_identity_mapping im_reg7;/* Region 7 identity mapping */
191 DECLARE_HVM_SAVE_TYPE(OPT_FEATURE_IDENTITY_MAPPINGS, 8, struct hvm_hw_ia64_identity_mappings);
194 * Largest type-code in use
196 #define HVM_SAVE_CODE_MAX 8
198 #endif /* __XEN_PUBLIC_HVM_SAVE_IA64_H__ */
206 * indent-tabs-mode: nil