xen-vtx-unstable

annotate xen/include/asm-x86/vmx_platform.h @ 6774:4d899a738d59

merge?
author cl349@firebug.cl.cam.ac.uk
date Tue Sep 13 15:05:49 2005 +0000 (2005-09-13)
parents 3feb7fa331ed b6c98fe62e1a
children e7c7196fa329 8ca0f98ba8e2
rev   line source
iap10@3290 1 /*
iap10@3290 2 * vmx_platform.h: VMX platform support
iap10@3290 3 * Copyright (c) 2004, Intel Corporation.
iap10@3290 4 *
iap10@3290 5 * This program is free software; you can redistribute it and/or modify it
iap10@3290 6 * under the terms and conditions of the GNU General Public License,
iap10@3290 7 * version 2, as published by the Free Software Foundation.
iap10@3290 8 *
iap10@3290 9 * This program is distributed in the hope it will be useful, but WITHOUT
iap10@3290 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
iap10@3290 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
iap10@3290 12 * more details.
iap10@3290 13 *
iap10@3290 14 * You should have received a copy of the GNU General Public License along with
iap10@3290 15 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
iap10@3290 16 * Place - Suite 330, Boston, MA 02111-1307 USA.
iap10@3290 17 *
iap10@3290 18 */
kaf24@6730 19
iap10@3290 20 #ifndef __ASM_X86_VMX_PLATFORM_H__
iap10@3290 21 #define __ASM_X86_VMX_PLATFORM_H__
iap10@3290 22
kaf24@3667 23 #include <public/xen.h>
kaf24@3667 24 #include <asm/e820.h>
iap10@3749 25 #include <asm/vmx_virpit.h>
iap10@3749 26 #include <asm/vmx_intercept.h>
iap10@3569 27
kaf24@6594 28 #define MAX_OPERAND_NUM 2
iap10@3569 29
iap10@3569 30 #define mk_operand(size, index, seg, flag) \
iap10@3569 31 (((size) << 24) | ((index) << 16) | ((seg) << 8) | (flag))
iap10@3569 32
iap10@3569 33 #define operand_size(operand) \
iap10@3569 34 ((operand >> 24) & 0xFF)
iap10@3569 35
iap10@3569 36 #define operand_index(operand) \
iap10@3569 37 ((operand >> 16) & 0xFF)
kaf24@6594 38
kaf24@6594 39 /* for instruction.operand[].size */
iap10@3569 40 #define BYTE 1
iap10@3569 41 #define WORD 2
iap10@3569 42 #define LONG 4
iap10@3569 43 #define QUAD 8
kaf24@5555 44 #define BYTE_64 16
iap10@3569 45
kaf24@6594 46 /* for instruction.operand[].flag */
iap10@3569 47 #define REGISTER 0x1
iap10@3569 48 #define MEMORY 0x2
iap10@3569 49 #define IMMEDIATE 0x4
iap10@3569 50
kaf24@6594 51 /* for instruction.flags */
iap10@3569 52 #define REPZ 0x1
iap10@3569 53 #define REPNZ 0x2
kaf24@6594 54 #define OVERLAP 0x4
kaf24@6594 55
kaf24@6730 56 #define INSTR_PIO 1
kaf24@6730 57 #define INSTR_OR 2
kaf24@6730 58 #define INSTR_AND 3
kaf24@6730 59 #define INSTR_XOR 4
kaf24@6730 60 #define INSTR_CMP 5
kaf24@6730 61 #define INSTR_MOV 6
kaf24@6730 62 #define INSTR_MOVS 7
kaf24@6730 63 #define INSTR_MOVZ 8
kaf24@6730 64 #define INSTR_STOS 9
kaf24@6730 65 #define INSTR_TEST 10
iap10@3569 66
iap10@3569 67 struct instruction {
kaf24@6730 68 __s8 instr; /* instruction type */
kaf24@6594 69 __s16 op_size; /* the operand's bit size, e.g. 16-bit or 32-bit */
iap10@3569 70 __u64 immediate;
kaf24@6594 71 __u16 seg_sel; /* segmentation selector */
kaf24@6594 72 __u32 operand[MAX_OPERAND_NUM]; /* order is AT&T assembly */
kaf24@6594 73 __u32 flags;
iap10@3569 74 };
iap10@3569 75
iap10@3569 76 #define MAX_INST_LEN 32
iap10@3569 77
kaf24@6594 78 struct mi_per_cpu_info {
kaf24@6594 79 int flags;
kaf24@6730 80 int instr; /* instruction */
kaf24@6730 81 unsigned long operand[2]; /* operands */
kaf24@6730 82 unsigned long immediate; /* immediate portion */
kaf24@6730 83 struct cpu_user_regs *inst_decoder_regs; /* current context */
iap10@3569 84 };
iap10@3569 85
arun@5608 86 struct virtual_platform_def {
kaf24@6730 87 unsigned long *real_mode_data; /* E820, etc. */
iap10@3569 88 unsigned long shared_page_va;
iap10@3749 89 struct vmx_virpit_t vmx_pit;
iap10@3749 90 struct vmx_handler_t vmx_handler;
kaf24@6730 91 struct mi_per_cpu_info mpci; /* MMIO */
iap10@3569 92 };
iap10@3569 93
iap10@3756 94 extern void handle_mmio(unsigned long, unsigned long);
arun@5185 95 extern void vmx_wait_io(void);
kaf24@5289 96 extern int vmx_setup_platform(struct vcpu *, struct cpu_user_regs *);
arun@5609 97 extern void vmx_io_assist(struct vcpu *v);
iap10@3569 98
mafetter@4212 99 // XXX - think about this -- maybe use bit 30 of the mfn to signify an MMIO frame.
kaf24@6481 100 #define mmio_space(gpa) (!VALID_MFN(get_mfn_from_pfn((gpa) >> PAGE_SHIFT)))
iap10@3290 101
iap10@3290 102 #endif