ia64/xen-unstable

view xen/include/asm-ia64/vmx.h @ 13467:9576f09c9eff

[IA64] Avoid dom0 insufficient memory panic when creating guests

When there is not enough memory to create a domain,
we need not panic domain0. Just prevent it from creating.

Signed-off-by: Zhang Xin <xing.z.zhang@intel.com>
author awilliam@xenbuild2.aw
date Tue Jan 23 09:08:03 2007 -0700 (2007-01-23)
parents d54bcabd0624
children 38f7330d4807
line source
1 /* -*- Mode:C; c-basic-offset:4; tab-width:4; indent-tabs-mode:nil -*- */
2 /*
3 * vmx.h: prototype for generial vmx related interface
4 * Copyright (c) 2004, Intel Corporation.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 *
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
17 * Place - Suite 330, Boston, MA 02111-1307 USA.
18 *
19 * Kun Tian (Kevin Tian) (kevin.tian@intel.com)
20 */
22 #ifndef _ASM_IA64_VT_H
23 #define _ASM_IA64_VT_H
25 #define RR7_SWITCH_SHIFT 12 /* 4k enough */
26 #include <public/hvm/ioreq.h>
27 #define vmx_user_mode(regs) (((struct ia64_psr *)&(regs)->cr_ipsr)->vm == 1)
29 #define VCPU_LID(v) (((u64)(v)->vcpu_id)<<24)
31 extern void identify_vmx_feature(void);
32 extern unsigned int vmx_enabled;
33 extern void vmx_init_env(void);
34 extern int vmx_final_setup_guest(struct vcpu *v);
35 extern void vmx_save_state(struct vcpu *v);
36 extern void vmx_load_state(struct vcpu *v);
37 extern void vmx_setup_platform(struct domain *d);
38 extern void vmx_do_launch(struct vcpu *v);
39 extern void vmx_io_assist(struct vcpu *v);
40 extern int ia64_hypercall (struct pt_regs *regs);
41 extern void vmx_save_state(struct vcpu *v);
42 extern void vmx_load_state(struct vcpu *v);
43 extern void show_registers(struct pt_regs *regs);
44 #define show_execution_state show_registers
45 extern unsigned long __gpfn_to_mfn_foreign(struct domain *d, unsigned long gpfn);
46 extern void sync_split_caches(void);
47 extern void set_privileged_operation_isr (struct vcpu *vcpu,int inst);
48 extern void privilege_op (struct vcpu *vcpu);
49 extern void set_ifa_itir_iha (struct vcpu *vcpu, u64 vadr,
50 int set_ifa, int set_itir, int set_iha);
51 extern void inject_guest_interruption(struct vcpu *vcpu, u64 vec);
52 extern void set_illegal_op_isr (struct vcpu *vcpu);
53 extern void illegal_op (struct vcpu *vcpu);
54 extern void vmx_relinquish_guest_resources(struct domain *d);
55 extern void vmx_relinquish_vcpu_resources(struct vcpu *v);
56 extern void vmx_die_if_kernel(char *str, struct pt_regs *regs, long err);
57 extern void vmx_send_assist_req(struct vcpu *v);
59 static inline vcpu_iodata_t *get_vio(struct domain *d, unsigned long cpu)
60 {
61 return &((shared_iopage_t *)d->arch.vmx_platform.shared_page_va)->vcpu_iodata[cpu];
62 }
64 static inline shared_iopage_t *get_sp(struct domain *d)
65 {
66 return (shared_iopage_t *)d->arch.vmx_platform.shared_page_va;
67 }
69 typedef unsigned long (*vmx_mmio_read_t)(struct vcpu *v,
70 unsigned long addr,
71 unsigned long length);
73 typedef void (*vmx_mmio_write_t)(struct vcpu *v,
74 unsigned long addr,
75 unsigned long length,
76 unsigned long val);
78 typedef int (*vmx_mmio_check_t)(struct vcpu *v, unsigned long addr);
80 struct vmx_mmio_handler {
81 vmx_mmio_check_t check_handler;
82 vmx_mmio_read_t read_handler;
83 vmx_mmio_write_t write_handler;
84 };
86 #endif /* _ASM_IA64_VT_H */