debuggers.hg

view xen/arch/ia64/vmx/save.c @ 16381:c0bdfda5183d

hvm: Clean up buf_ioreq handling.
Also, disable stdvga caching on hvm save/restore, as the shadow vga
state is not preserved.
Signed-off-by: Keir Fraser <keir@xensource.com>
author Keir Fraser <keir@xensource.com>
date Thu Nov 08 14:50:01 2007 +0000 (2007-11-08)
parents e7d7a4adf357
children a8328ea7853d
line source
1 /*
2 * hvm/save.c: Save and restore HVM guest's emulated hardware state.
3 *
4 * Copyright (c) 2007, Isaku Yamahata <yamahata at valinux co jp>
5 * VA Linux Systems Japan K.K.
6 * IA64 support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
23 #include <xen/types.h>
24 #include <xen/hvm/save.h>
26 void arch_hvm_save(struct domain *d, struct hvm_save_header *hdr)
27 {
28 unsigned int i;
30 for (i = 0; i < 5; ++i)
31 hdr->cpuid[i] = ia64_get_cpuid(i);
32 }
34 int arch_hvm_load(struct domain *d, struct hvm_save_header *hdr)
35 {
36 unsigned int i;
37 if (hdr->magic != HVM_FILE_MAGIC) {
38 gdprintk(XENLOG_ERR,
39 "HVM restore: bad magic number %#"PRIx64"\n", hdr->magic);
40 return -1;
41 }
43 if (hdr->version != HVM_FILE_VERSION) {
44 gdprintk(XENLOG_ERR,
45 "HVM restore: unsupported version %"PRIx64"\n", hdr->version);
46 return -1;
47 }
49 for (i = 0; i < 5; ++i) {
50 unsigned long cpuid = ia64_get_cpuid(i);
51 /* TODO: need to define how big a difference is acceptable */
52 if (hdr->cpuid[i] != cpuid)
53 gdprintk(XENLOG_WARNING,
54 "HVM restore: saved CPUID[%d] (%#lx) "
55 "does not match host (%#lx).\n", i, hdr->cpuid[i], cpuid);
56 }
58 return 0;
59 }
61 /*
62 * Local variables:
63 * mode: C
64 * c-set-style: "BSD"
65 * c-basic-offset: 4
66 * tab-width: 4
67 * indent-tabs-mode: nil
68 * End:
69 */