direct-io.hg

changeset 8474:9fc306e40a7c

Move public hvm interfaces into xen/include/public/hvm.
Add new header hvm_info_table.h for defining location and
contents of acpi-style hvm_info_table. Remove duplicate
definition in vmxassist/acpi_madt.c.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue Jan 03 14:58:34 2006 +0100 (2006-01-03)
parents 399c68937d59
children 09e752a1a04a
files tools/Rules.mk tools/firmware/vmxassist/acpi_madt.c tools/firmware/vmxassist/vm86.h tools/ioemu/hw/i8254.c tools/ioemu/hw/i8259.c tools/ioemu/hw/i8259_stub.c tools/ioemu/target-i386-dm/helper2.c tools/libxc/xc_ia64_stubs.c tools/libxc/xc_vmx_build.c xen/arch/ia64/vmx/mmio.c xen/arch/ia64/vmx/vmx_init.c xen/arch/ia64/vmx/vmx_support.c xen/arch/ia64/xen/domain.c xen/arch/x86/dm/i8259.c xen/arch/x86/dm/vmx_vioapic.c xen/arch/x86/vmx.c xen/arch/x86/vmx_intercept.c xen/arch/x86/vmx_io.c xen/arch/x86/vmx_platform.c xen/arch/x86/vmx_vlapic.c xen/arch/x86/vmx_vmcs.c xen/include/asm-ia64/vmx.h xen/include/asm-x86/vmx.h xen/include/asm-x86/vmx_intercept.h xen/include/asm-x86/vmx_vlapic.h xen/include/asm-x86/vmx_vmcs.h xen/include/public/hvm/hvm_info_table.h xen/include/public/hvm/ioreq.h xen/include/public/hvm/vmx_assist.h
line diff
     1.1 --- a/tools/Rules.mk	Tue Jan 03 14:36:56 2006 +0100
     1.2 +++ b/tools/Rules.mk	Tue Jan 03 14:58:34 2006 +0100
     1.3 @@ -35,6 +35,8 @@ mk-symlinks: LINUX_ROOT=$(XEN_ROOT)/linu
     1.4  mk-symlinks:
     1.5  	mkdir -p xen
     1.6  	( cd xen && ln -sf ../$(XEN_ROOT)/xen/include/public/*.h . )
     1.7 +	mkdir -p xen/hvm
     1.8 +	( cd xen/hvm && ln -sf ../../$(XEN_ROOT)/xen/include/public/hvm/*.h . )
     1.9  	mkdir -p xen/io
    1.10  	( cd xen/io && ln -sf ../../$(XEN_ROOT)/xen/include/public/io/*.h . )
    1.11  	mkdir -p xen/linux
     2.1 --- a/tools/firmware/vmxassist/acpi_madt.c	Tue Jan 03 14:36:56 2006 +0100
     2.2 +++ b/tools/firmware/vmxassist/acpi_madt.c	Tue Jan 03 14:58:34 2006 +0100
     2.3 @@ -17,26 +17,16 @@
     2.4   * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
     2.5   * Place - Suite 330, Boston, MA 02111-1307 USA.
     2.6   */
     2.7 +
     2.8  #include "../acpi/acpi2_0.h"
     2.9  #include "../acpi/acpi_madt.h"
    2.10  
    2.11 +#include <xen/hvm/hvm_info_table.h>
    2.12 +
    2.13  #define NULL ((void*)0)
    2.14  
    2.15  extern int puts(const char *s);
    2.16  
    2.17 -#define HVM_INFO_PAGE	0x0009F000
    2.18 -#define HVM_INFO_OFFSET	0x00000800
    2.19 -
    2.20 -struct hvm_info_table {
    2.21 -	char     signature[8]; /* "HVM INFO" */
    2.22 -	uint32_t length;
    2.23 -	uint8_t  checksum;
    2.24 -	uint8_t  acpi_enabled;
    2.25 -	uint8_t  apic_enabled;
    2.26 -	uint8_t  pad[1];
    2.27 -	uint32_t nr_vcpus;
    2.28 -};
    2.29 -
    2.30  static struct hvm_info_table *table = NULL;
    2.31  
    2.32  static int validate_hvm_info(struct hvm_info_table *t)
    2.33 @@ -70,7 +60,7 @@ get_hvm_info_table(void)
    2.34  	if (table != NULL)
    2.35  		return table;
    2.36  
    2.37 -	t = (struct hvm_info_table *)(HVM_INFO_PAGE + HVM_INFO_OFFSET);
    2.38 +	t = (struct hvm_info_table *)HVM_INFO_PADDR;
    2.39  
    2.40  	if (!validate_hvm_info(t)) {
    2.41  		puts("Bad hvm info table\n");
     3.1 --- a/tools/firmware/vmxassist/vm86.h	Tue Jan 03 14:36:56 2006 +0100
     3.2 +++ b/tools/firmware/vmxassist/vm86.h	Tue Jan 03 14:58:34 2006 +0100
     3.3 @@ -24,7 +24,7 @@
     3.4  #include <stdint.h>
     3.5  #endif
     3.6  
     3.7 -#include <xen/vmx_assist.h>
     3.8 +#include <xen/hvm/vmx_assist.h>
     3.9  
    3.10  #define	NR_EXCEPTION_HANDLER	32
    3.11  #define	NR_INTERRUPT_HANDLERS	16
     4.1 --- a/tools/ioemu/hw/i8254.c	Tue Jan 03 14:36:56 2006 +0100
     4.2 +++ b/tools/ioemu/hw/i8254.c	Tue Jan 03 14:58:34 2006 +0100
     4.3 @@ -23,7 +23,7 @@
     4.4   */
     4.5  #include "vl.h"
     4.6  #include <xenctrl.h>
     4.7 -#include <xen/io/ioreq.h>
     4.8 +#include <xen/hvm/ioreq.h>
     4.9  
    4.10  //#define DEBUG_PIT
    4.11  
     5.1 --- a/tools/ioemu/hw/i8259.c	Tue Jan 03 14:36:56 2006 +0100
     5.2 +++ b/tools/ioemu/hw/i8259.c	Tue Jan 03 14:58:34 2006 +0100
     5.3 @@ -23,7 +23,7 @@
     5.4   */
     5.5  #include "vl.h"
     5.6  #include <xenctrl.h>
     5.7 -#include <xen/io/ioreq.h>
     5.8 +#include <xen/hvm/ioreq.h>
     5.9  
    5.10  /* debug PIC */
    5.11  //#define DEBUG_PIC
     6.1 --- a/tools/ioemu/hw/i8259_stub.c	Tue Jan 03 14:36:56 2006 +0100
     6.2 +++ b/tools/ioemu/hw/i8259_stub.c	Tue Jan 03 14:58:34 2006 +0100
     6.3 @@ -22,7 +22,7 @@
     6.4   * THE SOFTWARE.
     6.5   */
     6.6  #include "xenctrl.h"
     6.7 -#include <xen/io/ioreq.h>
     6.8 +#include <xen/hvm/ioreq.h>
     6.9  #include <stdio.h>
    6.10  #include "cpu.h"
    6.11  #include "cpu-all.h"
     7.1 --- a/tools/ioemu/target-i386-dm/helper2.c	Tue Jan 03 14:36:56 2006 +0100
     7.2 +++ b/tools/ioemu/target-i386-dm/helper2.c	Tue Jan 03 14:58:34 2006 +0100
     7.3 @@ -48,7 +48,7 @@
     7.4  #include <sys/ioctl.h>
     7.5  
     7.6  #include <xenctrl.h>
     7.7 -#include <xen/io/ioreq.h>
     7.8 +#include <xen/hvm/ioreq.h>
     7.9  #include <xen/linux/evtchn.h>
    7.10  
    7.11  #include "cpu.h"
     8.1 --- a/tools/libxc/xc_ia64_stubs.c	Tue Jan 03 14:36:56 2006 +0100
     8.2 +++ b/tools/libxc/xc_ia64_stubs.c	Tue Jan 03 14:58:34 2006 +0100
     8.3 @@ -5,7 +5,7 @@
     8.4  #include <stdlib.h>
     8.5  #include <zlib.h>
     8.6  #include "xen/arch-ia64.h"
     8.7 -#include <xen/io/ioreq.h>
     8.8 +#include <xen/hvm/ioreq.h>
     8.9  
    8.10  /* this is a very ugly way of getting FPSR_DEFAULT.  struct ia64_fpreg is
    8.11   * mysteriously declared in two places: /usr/include/asm/fpu.h and
     9.1 --- a/tools/libxc/xc_vmx_build.c	Tue Jan 03 14:36:56 2006 +0100
     9.2 +++ b/tools/libxc/xc_vmx_build.c	Tue Jan 03 14:58:34 2006 +0100
     9.3 @@ -9,7 +9,8 @@
     9.4  #include <stdlib.h>
     9.5  #include <unistd.h>
     9.6  #include <zlib.h>
     9.7 -#include <xen/io/ioreq.h>
     9.8 +#include <xen/hvm/hvm_info_table.h>
     9.9 +#include <xen/hvm/ioreq.h>
    9.10  
    9.11  #define VMX_LOADER_ENTR_ADDR  0x00100000
    9.12  
    9.13 @@ -141,9 +142,13 @@ static int set_hvm_info(int xc_handle, u
    9.14      char *va_map;
    9.15      struct hvm_info_table *va_hvm;
    9.16  
    9.17 -    va_map = xc_map_foreign_range(xc_handle, dom,
    9.18 -                                  PAGE_SIZE, PROT_READ|PROT_WRITE,
    9.19 -                                  pfn_list[HVM_INFO_PAGE >> PAGE_SHIFT]);
    9.20 +    va_map = xc_map_foreign_range(
    9.21 +        xc_handle,
    9.22 +        dom,
    9.23 +        PAGE_SIZE,
    9.24 +        PROT_READ|PROT_WRITE,
    9.25 +        pfn_list[HVM_INFO_PFN]);
    9.26 +    
    9.27      if ( va_map == NULL )
    9.28          return -1;
    9.29  
    10.1 --- a/xen/arch/ia64/vmx/mmio.c	Tue Jan 03 14:36:56 2006 +0100
    10.2 +++ b/xen/arch/ia64/vmx/mmio.c	Tue Jan 03 14:58:34 2006 +0100
    10.3 @@ -29,7 +29,7 @@
    10.4  #include <asm/vmx_vcpu.h>
    10.5  #include <asm/privop.h>
    10.6  #include <asm/types.h>
    10.7 -#include <public/io/ioreq.h>
    10.8 +#include <public/hvm/ioreq.h>
    10.9  #include <asm/mm.h>
   10.10  #include <asm/vmx.h>
   10.11  
    11.1 --- a/xen/arch/ia64/vmx/vmx_init.c	Tue Jan 03 14:36:56 2006 +0100
    11.2 +++ b/xen/arch/ia64/vmx/vmx_init.c	Tue Jan 03 14:58:34 2006 +0100
    11.3 @@ -42,7 +42,7 @@
    11.4  #include <xen/lib.h>
    11.5  #include <asm/vmmu.h>
    11.6  #include <public/arch-ia64.h>
    11.7 -#include <public/io/ioreq.h>
    11.8 +#include <public/hvm/ioreq.h>
    11.9  #include <asm/vmx_phy_mode.h>
   11.10  #include <asm/processor.h>
   11.11  #include <asm/vmx.h>
    12.1 --- a/xen/arch/ia64/vmx/vmx_support.c	Tue Jan 03 14:36:56 2006 +0100
    12.2 +++ b/xen/arch/ia64/vmx/vmx_support.c	Tue Jan 03 14:58:34 2006 +0100
    12.3 @@ -21,7 +21,7 @@
    12.4   */
    12.5  #include <xen/config.h>
    12.6  #include <xen/sched.h>
    12.7 -#include <public/io/ioreq.h>
    12.8 +#include <public/hvm/ioreq.h>
    12.9  #include <asm/vmx.h>
   12.10  #include <asm/vmx_vcpu.h>
   12.11  
    13.1 --- a/xen/arch/ia64/xen/domain.c	Tue Jan 03 14:36:56 2006 +0100
    13.2 +++ b/xen/arch/ia64/xen/domain.c	Tue Jan 03 14:58:34 2006 +0100
    13.3 @@ -45,7 +45,7 @@
    13.4  #include <asm/vmx_vcpu.h>
    13.5  #include <asm/vmx_vpd.h>
    13.6  #include <asm/pal.h>
    13.7 -#include <public/io/ioreq.h>
    13.8 +#include <public/hvm/ioreq.h>
    13.9  
   13.10  #define CONFIG_DOMAIN0_CONTIGUOUS
   13.11  unsigned long dom0_start = -1L;
    14.1 --- a/xen/arch/x86/dm/i8259.c	Tue Jan 03 14:36:56 2006 +0100
    14.2 +++ b/xen/arch/x86/dm/i8259.c	Tue Jan 03 14:58:34 2006 +0100
    14.3 @@ -29,7 +29,7 @@
    14.4  #include <xen/lib.h>
    14.5  #include <xen/errno.h>
    14.6  #include <xen/sched.h>
    14.7 -#include <public/io/ioreq.h>
    14.8 +#include <public/hvm/ioreq.h>
    14.9  #include <asm/vmx.h>
   14.10  #include <asm/vmx_vpic.h>
   14.11  #include <asm/current.h>
    15.1 --- a/xen/arch/x86/dm/vmx_vioapic.c	Tue Jan 03 14:36:56 2006 +0100
    15.2 +++ b/xen/arch/x86/dm/vmx_vioapic.c	Tue Jan 03 14:58:34 2006 +0100
    15.3 @@ -37,7 +37,7 @@
    15.4  #include <xen/lib.h>
    15.5  #include <xen/errno.h>
    15.6  #include <xen/sched.h>
    15.7 -#include <public/io/ioreq.h>
    15.8 +#include <public/hvm/ioreq.h>
    15.9  #include <asm/vmx.h>
   15.10  #include <asm/vmx_vpic.h>
   15.11  #include <asm/current.h>
    16.1 --- a/xen/arch/x86/vmx.c	Tue Jan 03 14:36:56 2006 +0100
    16.2 +++ b/xen/arch/x86/vmx.c	Tue Jan 03 14:58:34 2006 +0100
    16.3 @@ -42,7 +42,7 @@
    16.4  #include <asm/shadow_64.h>
    16.5  #endif
    16.6  #include <public/sched.h>
    16.7 -#include <public/io/ioreq.h>
    16.8 +#include <public/hvm/ioreq.h>
    16.9  #include <asm/vmx_vpic.h>
   16.10  #include <asm/vmx_vlapic.h>
   16.11  
    17.1 --- a/xen/arch/x86/vmx_intercept.c	Tue Jan 03 14:36:56 2006 +0100
    17.2 +++ b/xen/arch/x86/vmx_intercept.c	Tue Jan 03 14:58:34 2006 +0100
    17.3 @@ -24,7 +24,7 @@
    17.4  #include <asm/vmx_vpit.h>
    17.5  #include <asm/vmx_intercept.h>
    17.6  #include <asm/vmx_vlapic.h>
    17.7 -#include <public/io/ioreq.h>
    17.8 +#include <public/hvm/ioreq.h>
    17.9  #include <xen/lib.h>
   17.10  #include <xen/sched.h>
   17.11  #include <asm/current.h>
    18.1 --- a/xen/arch/x86/vmx_io.c	Tue Jan 03 14:36:56 2006 +0100
    18.2 +++ b/xen/arch/x86/vmx_io.c	Tue Jan 03 14:58:34 2006 +0100
    18.3 @@ -37,7 +37,7 @@
    18.4  #include <asm/shadow.h>
    18.5  #include <asm/vmx_vpic.h>
    18.6  #include <asm/vmx_vlapic.h>
    18.7 -#include <public/io/ioreq.h>
    18.8 +#include <public/hvm/ioreq.h>
    18.9  
   18.10  #ifdef CONFIG_VMX
   18.11  #if defined (__i386__)
    19.1 --- a/xen/arch/x86/vmx_platform.c	Tue Jan 03 14:36:56 2006 +0100
    19.2 +++ b/xen/arch/x86/vmx_platform.c	Tue Jan 03 14:58:34 2006 +0100
    19.3 @@ -27,7 +27,7 @@
    19.4  #include <xen/trace.h>
    19.5  #include <asm/vmx.h>
    19.6  #include <asm/vmx_platform.h>
    19.7 -#include <public/io/ioreq.h>
    19.8 +#include <public/hvm/ioreq.h>
    19.9  
   19.10  #include <xen/lib.h>
   19.11  #include <xen/sched.h>
    20.1 --- a/xen/arch/x86/vmx_vlapic.c	Tue Jan 03 14:36:56 2006 +0100
    20.2 +++ b/xen/arch/x86/vmx_vlapic.c	Tue Jan 03 14:58:34 2006 +0100
    20.3 @@ -32,7 +32,7 @@
    20.4  #include <xen/lib.h>
    20.5  #include <xen/sched.h>
    20.6  #include <asm/current.h>
    20.7 -#include <public/io/ioreq.h>
    20.8 +#include <public/hvm/ioreq.h>
    20.9  
   20.10  #ifdef CONFIG_VMX
   20.11  
    21.1 --- a/xen/arch/x86/vmx_vmcs.c	Tue Jan 03 14:36:56 2006 +0100
    21.2 +++ b/xen/arch/x86/vmx_vmcs.c	Tue Jan 03 14:58:34 2006 +0100
    21.3 @@ -32,7 +32,7 @@
    21.4  #include <asm/flushtlb.h>
    21.5  #include <xen/event.h>
    21.6  #include <xen/kernel.h>
    21.7 -#include <public/io/ioreq.h>
    21.8 +#include <public/hvm/hvm_info_table.h>
    21.9  #if CONFIG_PAGING_LEVELS >= 4
   21.10  #include <asm/shadow_64.h>
   21.11  #endif
   21.12 @@ -233,7 +233,7 @@ static void vmx_get_hvm_info(struct doma
   21.13      unsigned long mpfn;
   21.14      struct hvm_info_table *t;
   21.15  
   21.16 -    mpfn = get_mfn_from_pfn(HVM_INFO_PAGE >> PAGE_SHIFT);
   21.17 +    mpfn = get_mfn_from_pfn(HVM_INFO_PFN);
   21.18      if ( mpfn == INVALID_MFN ) {
   21.19          printk("Can not get hvm info page mfn for VMX domain.\n");
   21.20          domain_crash_synchronous();
    22.1 --- a/xen/include/asm-ia64/vmx.h	Tue Jan 03 14:36:56 2006 +0100
    22.2 +++ b/xen/include/asm-ia64/vmx.h	Tue Jan 03 14:58:34 2006 +0100
    22.3 @@ -23,7 +23,7 @@
    22.4  #define _ASM_IA64_VT_H
    22.5  
    22.6  #define RR7_SWITCH_SHIFT	12	/* 4k enough */
    22.7 -#include <public/io/ioreq.h>
    22.8 +#include <public/hvm/ioreq.h>
    22.9  
   22.10  extern void identify_vmx_feature(void);
   22.11  extern unsigned int vmx_enabled;
    23.1 --- a/xen/include/asm-x86/vmx.h	Tue Jan 03 14:36:56 2006 +0100
    23.2 +++ b/xen/include/asm-x86/vmx.h	Tue Jan 03 14:58:34 2006 +0100
    23.3 @@ -26,7 +26,7 @@
    23.4  #include <asm/vmx_vmcs.h>
    23.5  #include <asm/i387.h>
    23.6  
    23.7 -#include <public/io/ioreq.h>
    23.8 +#include <public/hvm/ioreq.h>
    23.9  
   23.10  extern int hvm_enabled;
   23.11  
    24.1 --- a/xen/include/asm-x86/vmx_intercept.h	Tue Jan 03 14:36:56 2006 +0100
    24.2 +++ b/xen/include/asm-x86/vmx_intercept.h	Tue Jan 03 14:58:34 2006 +0100
    24.3 @@ -6,7 +6,7 @@
    24.4  #include <xen/lib.h>
    24.5  #include <xen/time.h>
    24.6  #include <xen/errno.h>
    24.7 -#include <public/io/ioreq.h>
    24.8 +#include <public/hvm/ioreq.h>
    24.9  
   24.10  #define MAX_IO_HANDLER              8
   24.11  
    25.1 --- a/xen/include/asm-x86/vmx_vlapic.h	Tue Jan 03 14:36:56 2006 +0100
    25.2 +++ b/xen/include/asm-x86/vmx_vlapic.h	Tue Jan 03 14:58:34 2006 +0100
    25.3 @@ -21,7 +21,7 @@
    25.4  #define VMX_VLAPIC_H
    25.5  
    25.6  #include <asm/msr.h>
    25.7 -#include <public/io/ioreq.h>
    25.8 +#include <public/hvm/ioreq.h>
    25.9  
   25.10  #if defined(__i386__) || defined(__x86_64__)
   25.11  static inline int __fls(uint32_t word)
    26.1 --- a/xen/include/asm-x86/vmx_vmcs.h	Tue Jan 03 14:36:56 2006 +0100
    26.2 +++ b/xen/include/asm-x86/vmx_vmcs.h	Tue Jan 03 14:58:34 2006 +0100
    26.3 @@ -23,7 +23,7 @@
    26.4  #include <asm/vmx_cpu.h>
    26.5  #include <asm/vmx_platform.h>
    26.6  #include <asm/vmx_vlapic.h>
    26.7 -#include <public/vmx_assist.h>
    26.8 +#include <public/hvm/vmx_assist.h>
    26.9  
   26.10  extern int start_vmx(void);
   26.11  extern void stop_vmx(void);
    27.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.2 +++ b/xen/include/public/hvm/hvm_info_table.h	Tue Jan 03 14:58:34 2006 +0100
    27.3 @@ -0,0 +1,24 @@
    27.4 +/******************************************************************************
    27.5 + * hvm/hvm_info_table.h
    27.6 + * 
    27.7 + * HVM parameter and information table, written into guest memory map.
    27.8 + */
    27.9 +
   27.10 +#ifndef __XEN_PUBLIC_HVM_HVM_INFO_TABLE_H__
   27.11 +#define __XEN_PUBLIC_HVM_HVM_INFO_TABLE_H__
   27.12 +
   27.13 +#define HVM_INFO_PFN         0x09F
   27.14 +#define HVM_INFO_OFFSET      0x800
   27.15 +#define HVM_INFO_PADDR       ((HVM_INFO_PFN << 12) + HVM_INFO_OFFSET)
   27.16 +
   27.17 +struct hvm_info_table {
   27.18 +    char        signature[8]; /* "HVM INFO" */
   27.19 +    uint32_t    length;
   27.20 +    uint8_t     checksum;
   27.21 +    uint8_t     acpi_enabled;
   27.22 +    uint8_t     apic_enabled;
   27.23 +    uint8_t     pad[1];
   27.24 +    uint32_t    nr_vcpus;
   27.25 +};
   27.26 +
   27.27 +#endif /* __XEN_PUBLIC_HVM_HVM_INFO_TABLE_H__ */
    28.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.2 +++ b/xen/include/public/hvm/ioreq.h	Tue Jan 03 14:58:34 2006 +0100
    28.3 @@ -0,0 +1,90 @@
    28.4 +/*
    28.5 + * ioreq.h: I/O request definitions for device models
    28.6 + * Copyright (c) 2004, Intel Corporation.
    28.7 + *
    28.8 + * This program is free software; you can redistribute it and/or modify it
    28.9 + * under the terms and conditions of the GNU General Public License,
   28.10 + * version 2, as published by the Free Software Foundation.
   28.11 + *
   28.12 + * This program is distributed in the hope it will be useful, but WITHOUT
   28.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   28.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   28.15 + * more details.
   28.16 + *
   28.17 + * You should have received a copy of the GNU General Public License along with
   28.18 + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
   28.19 + * Place - Suite 330, Boston, MA 02111-1307 USA.
   28.20 + *
   28.21 + */
   28.22 +
   28.23 +#ifndef _IOREQ_H_
   28.24 +#define _IOREQ_H_
   28.25 +
   28.26 +#define IOREQ_READ      1
   28.27 +#define IOREQ_WRITE     0
   28.28 +
   28.29 +#define STATE_INVALID           0
   28.30 +#define STATE_IOREQ_READY       1
   28.31 +#define STATE_IOREQ_INPROCESS   2
   28.32 +#define STATE_IORESP_READY      3
   28.33 +#define STATE_IORESP_HOOK       4
   28.34 +
   28.35 +#define IOREQ_TYPE_PIO          0 /* pio */
   28.36 +#define IOREQ_TYPE_COPY         1 /* mmio ops */
   28.37 +#define IOREQ_TYPE_AND          2
   28.38 +#define IOREQ_TYPE_OR           3
   28.39 +#define IOREQ_TYPE_XOR          4
   28.40 +
   28.41 +/*
   28.42 + * VMExit dispatcher should cooperate with instruction decoder to
   28.43 + * prepare this structure and notify service OS and DM by sending
   28.44 + * virq
   28.45 + */
   28.46 +typedef struct {
   28.47 +    uint64_t addr;          /*  physical address            */
   28.48 +    uint64_t size;          /*  size in bytes               */
   28.49 +    uint64_t count;         /*  for rep prefixes            */
   28.50 +    union {
   28.51 +        uint64_t data;      /*  data                        */
   28.52 +        void    *pdata;     /*  pointer to data             */
   28.53 +    } u;
   28.54 +    uint8_t state:4;
   28.55 +    uint8_t pdata_valid:1;  /* if 1, use pdata above        */
   28.56 +    uint8_t dir:1;          /*  1=read, 0=write             */
   28.57 +    uint8_t df:1;
   28.58 +    uint8_t type;           /* I/O type                     */
   28.59 +} ioreq_t;
   28.60 +
   28.61 +#define MAX_VECTOR      256
   28.62 +#define BITS_PER_BYTE   8
   28.63 +#define INTR_LEN        (MAX_VECTOR/(BITS_PER_BYTE * sizeof(uint64_t)))
   28.64 +#define INTR_LEN_32     (MAX_VECTOR/(BITS_PER_BYTE * sizeof(uint32_t)))
   28.65 +
   28.66 +typedef struct {
   28.67 +    uint16_t    pic_elcr;
   28.68 +    uint16_t    pic_irr;
   28.69 +    uint16_t    pic_last_irr;
   28.70 +    uint16_t    pic_clear_irr;
   28.71 +    int         eport; /* Event channel port */
   28.72 +} global_iodata_t;
   28.73 +
   28.74 +typedef struct {
   28.75 +    ioreq_t     vp_ioreq;
   28.76 +} vcpu_iodata_t;
   28.77 +
   28.78 +typedef struct {
   28.79 +    global_iodata_t sp_global;
   28.80 +    vcpu_iodata_t   vcpu_iodata[1];
   28.81 +} shared_iopage_t;
   28.82 +
   28.83 +#endif /* _IOREQ_H_ */
   28.84 +
   28.85 +/*
   28.86 + * Local variables:
   28.87 + * mode: C
   28.88 + * c-set-style: "BSD"
   28.89 + * c-basic-offset: 4
   28.90 + * tab-width: 4
   28.91 + * indent-tabs-mode: nil
   28.92 + * End:
   28.93 + */
    29.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.2 +++ b/xen/include/public/hvm/vmx_assist.h	Tue Jan 03 14:58:34 2006 +0100
    29.3 @@ -0,0 +1,97 @@
    29.4 +/*
    29.5 + * vmx_assist.h: Context definitions for the VMXASSIST world switch.
    29.6 + *
    29.7 + * Leendert van Doorn, leendert@watson.ibm.com
    29.8 + * Copyright (c) 2005, International Business Machines Corporation.
    29.9 + */
   29.10 +
   29.11 +#ifndef _VMX_ASSIST_H_
   29.12 +#define _VMX_ASSIST_H_
   29.13 +
   29.14 +#define VMXASSIST_BASE         0xD0000
   29.15 +#define VMXASSIST_MAGIC        0x17101966
   29.16 +#define VMXASSIST_MAGIC_OFFSET (VMXASSIST_BASE+8)
   29.17 +
   29.18 +#define VMXASSIST_NEW_CONTEXT (VMXASSIST_BASE + 12)
   29.19 +#define VMXASSIST_OLD_CONTEXT (VMXASSIST_NEW_CONTEXT + 4)
   29.20 +
   29.21 +#ifndef __ASSEMBLY__
   29.22 +
   29.23 +union vmcs_arbytes {
   29.24 +    struct arbyte_fields {
   29.25 +        unsigned int seg_type : 4,
   29.26 +            s         : 1,
   29.27 +            dpl       : 2,
   29.28 +            p         : 1, 
   29.29 +            reserved0 : 4,
   29.30 +            avl       : 1,
   29.31 +            reserved1 : 1,     
   29.32 +            default_ops_size: 1,
   29.33 +            g         : 1,
   29.34 +            null_bit  : 1, 
   29.35 +            reserved2 : 15;
   29.36 +    } fields;
   29.37 +    unsigned int bytes;
   29.38 +};
   29.39 +
   29.40 +/*
   29.41 + * World switch state
   29.42 + */
   29.43 +typedef struct vmx_assist_context {
   29.44 +    uint32_t  eip;        /* execution pointer */
   29.45 +    uint32_t  esp;        /* stack pointer */
   29.46 +    uint32_t  eflags;     /* flags register */
   29.47 +    uint32_t  cr0;
   29.48 +    uint32_t  cr3;        /* page table directory */
   29.49 +    uint32_t  cr4;
   29.50 +    uint32_t  idtr_limit; /* idt */
   29.51 +    uint32_t  idtr_base;
   29.52 +    uint32_t  gdtr_limit; /* gdt */
   29.53 +    uint32_t  gdtr_base;
   29.54 +    uint32_t  cs_sel;     /* cs selector */
   29.55 +    uint32_t  cs_limit;
   29.56 +    uint32_t  cs_base;
   29.57 +    union vmcs_arbytes cs_arbytes;
   29.58 +    uint32_t  ds_sel;     /* ds selector */
   29.59 +    uint32_t  ds_limit;
   29.60 +    uint32_t  ds_base;
   29.61 +    union vmcs_arbytes ds_arbytes;
   29.62 +    uint32_t  es_sel;     /* es selector */
   29.63 +    uint32_t  es_limit;
   29.64 +    uint32_t  es_base;
   29.65 +    union vmcs_arbytes es_arbytes;
   29.66 +    uint32_t  ss_sel;     /* ss selector */
   29.67 +    uint32_t  ss_limit;
   29.68 +    uint32_t  ss_base;
   29.69 +    union vmcs_arbytes ss_arbytes;
   29.70 +    uint32_t  fs_sel;     /* fs selector */
   29.71 +    uint32_t  fs_limit;
   29.72 +    uint32_t  fs_base;
   29.73 +    union vmcs_arbytes fs_arbytes;
   29.74 +    uint32_t  gs_sel;     /* gs selector */
   29.75 +    uint32_t  gs_limit;
   29.76 +    uint32_t  gs_base;
   29.77 +    union vmcs_arbytes gs_arbytes;
   29.78 +    uint32_t  tr_sel;     /* task selector */
   29.79 +    uint32_t  tr_limit;
   29.80 +    uint32_t  tr_base;
   29.81 +    union vmcs_arbytes tr_arbytes;
   29.82 +    uint32_t  ldtr_sel;   /* ldtr selector */
   29.83 +    uint32_t  ldtr_limit;
   29.84 +    uint32_t  ldtr_base;
   29.85 +    union vmcs_arbytes ldtr_arbytes;
   29.86 +} vmx_assist_context_t;
   29.87 +
   29.88 +#endif /* __ASSEMBLY__ */
   29.89 +
   29.90 +#endif /* _VMX_ASSIST_H_ */
   29.91 +
   29.92 +/*
   29.93 + * Local variables:
   29.94 + * mode: C
   29.95 + * c-set-style: "BSD"
   29.96 + * c-basic-offset: 4
   29.97 + * tab-width: 4
   29.98 + * indent-tabs-mode: nil
   29.99 + * End:
  29.100 + */
    30.1 --- a/xen/include/public/io/ioreq.h	Tue Jan 03 14:36:56 2006 +0100
    30.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    30.3 @@ -1,103 +0,0 @@
    30.4 -/*
    30.5 - * ioreq.h: I/O request definitions for device models
    30.6 - * Copyright (c) 2004, Intel Corporation.
    30.7 - *
    30.8 - * This program is free software; you can redistribute it and/or modify it
    30.9 - * under the terms and conditions of the GNU General Public License,
   30.10 - * version 2, as published by the Free Software Foundation.
   30.11 - *
   30.12 - * This program is distributed in the hope it will be useful, but WITHOUT
   30.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   30.14 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   30.15 - * more details.
   30.16 - *
   30.17 - * You should have received a copy of the GNU General Public License along with
   30.18 - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
   30.19 - * Place - Suite 330, Boston, MA 02111-1307 USA.
   30.20 - *
   30.21 - */
   30.22 -
   30.23 -#ifndef _IOREQ_H_
   30.24 -#define _IOREQ_H_
   30.25 -
   30.26 -#define IOREQ_READ      1
   30.27 -#define IOREQ_WRITE     0
   30.28 -
   30.29 -#define STATE_INVALID           0
   30.30 -#define STATE_IOREQ_READY       1
   30.31 -#define STATE_IOREQ_INPROCESS   2
   30.32 -#define STATE_IORESP_READY      3
   30.33 -#define STATE_IORESP_HOOK       4
   30.34 -
   30.35 -#define IOREQ_TYPE_PIO          0 /* pio */
   30.36 -#define IOREQ_TYPE_COPY         1 /* mmio ops */
   30.37 -#define IOREQ_TYPE_AND          2
   30.38 -#define IOREQ_TYPE_OR           3
   30.39 -#define IOREQ_TYPE_XOR          4
   30.40 -
   30.41 -/*
   30.42 - * VMExit dispatcher should cooperate with instruction decoder to
   30.43 - * prepare this structure and notify service OS and DM by sending
   30.44 - * virq
   30.45 - */
   30.46 -typedef struct {
   30.47 -    uint64_t addr;          /*  physical address            */
   30.48 -    uint64_t size;          /*  size in bytes               */
   30.49 -    uint64_t count;         /*  for rep prefixes            */
   30.50 -    union {
   30.51 -        uint64_t data;      /*  data                        */
   30.52 -        void    *pdata;     /*  pointer to data             */
   30.53 -    } u;
   30.54 -    uint8_t state:4;
   30.55 -    uint8_t pdata_valid:1;  /* if 1, use pdata above        */
   30.56 -    uint8_t dir:1;          /*  1=read, 0=write             */
   30.57 -    uint8_t df:1;
   30.58 -    uint8_t type;           /* I/O type                     */
   30.59 -} ioreq_t;
   30.60 -
   30.61 -#define MAX_VECTOR      256
   30.62 -#define BITS_PER_BYTE   8
   30.63 -#define INTR_LEN        (MAX_VECTOR/(BITS_PER_BYTE * sizeof(uint64_t)))
   30.64 -#define INTR_LEN_32     (MAX_VECTOR/(BITS_PER_BYTE * sizeof(uint32_t)))
   30.65 -
   30.66 -typedef struct {
   30.67 -    uint16_t    pic_elcr;
   30.68 -    uint16_t    pic_irr;
   30.69 -    uint16_t    pic_last_irr;
   30.70 -    uint16_t    pic_clear_irr;
   30.71 -    int         eport; /* Event channel port */
   30.72 -} global_iodata_t;
   30.73 -
   30.74 -typedef struct {
   30.75 -    ioreq_t     vp_ioreq;
   30.76 -} vcpu_iodata_t;
   30.77 -
   30.78 -typedef struct {
   30.79 -    global_iodata_t sp_global;
   30.80 -    vcpu_iodata_t   vcpu_iodata[1];
   30.81 -} shared_iopage_t;
   30.82 -
   30.83 -#define HVM_INFO_PAGE        0x0009F000
   30.84 -#define HVM_INFO_OFFSET      0x00000800
   30.85 -
   30.86 -struct hvm_info_table {
   30.87 -    char        signature[8]; /* "HVM INFO" */
   30.88 -    uint32_t    length;
   30.89 -    uint8_t     checksum;
   30.90 -    uint8_t     acpi_enabled;
   30.91 -    uint8_t     apic_enabled;
   30.92 -    uint8_t     pad[1];
   30.93 -    uint32_t    nr_vcpus;
   30.94 -};
   30.95 -
   30.96 -#endif /* _IOREQ_H_ */
   30.97 -
   30.98 -/*
   30.99 - * Local variables:
  30.100 - * mode: C
  30.101 - * c-set-style: "BSD"
  30.102 - * c-basic-offset: 4
  30.103 - * tab-width: 4
  30.104 - * indent-tabs-mode: nil
  30.105 - * End:
  30.106 - */
    31.1 --- a/xen/include/public/vmx_assist.h	Tue Jan 03 14:36:56 2006 +0100
    31.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.3 @@ -1,97 +0,0 @@
    31.4 -/*
    31.5 - * vmx_assist.h: Context definitions for the VMXASSIST world switch.
    31.6 - *
    31.7 - * Leendert van Doorn, leendert@watson.ibm.com
    31.8 - * Copyright (c) 2005, International Business Machines Corporation.
    31.9 - */
   31.10 -
   31.11 -#ifndef _VMX_ASSIST_H_
   31.12 -#define _VMX_ASSIST_H_
   31.13 -
   31.14 -#define VMXASSIST_BASE         0xD0000
   31.15 -#define VMXASSIST_MAGIC        0x17101966
   31.16 -#define VMXASSIST_MAGIC_OFFSET (VMXASSIST_BASE+8)
   31.17 -
   31.18 -#define VMXASSIST_NEW_CONTEXT (VMXASSIST_BASE + 12)
   31.19 -#define VMXASSIST_OLD_CONTEXT (VMXASSIST_NEW_CONTEXT + 4)
   31.20 -
   31.21 -#ifndef __ASSEMBLY__
   31.22 -
   31.23 -union vmcs_arbytes {
   31.24 -    struct arbyte_fields {
   31.25 -        unsigned int seg_type : 4,
   31.26 -            s         : 1,
   31.27 -            dpl       : 2,
   31.28 -            p         : 1, 
   31.29 -            reserved0 : 4,
   31.30 -            avl       : 1,
   31.31 -            reserved1 : 1,     
   31.32 -            default_ops_size: 1,
   31.33 -            g         : 1,
   31.34 -            null_bit  : 1, 
   31.35 -            reserved2 : 15;
   31.36 -    } fields;
   31.37 -    unsigned int bytes;
   31.38 -};
   31.39 -
   31.40 -/*
   31.41 - * World switch state
   31.42 - */
   31.43 -typedef struct vmx_assist_context {
   31.44 -    uint32_t  eip;        /* execution pointer */
   31.45 -    uint32_t  esp;        /* stack pointer */
   31.46 -    uint32_t  eflags;     /* flags register */
   31.47 -    uint32_t  cr0;
   31.48 -    uint32_t  cr3;        /* page table directory */
   31.49 -    uint32_t  cr4;
   31.50 -    uint32_t  idtr_limit; /* idt */
   31.51 -    uint32_t  idtr_base;
   31.52 -    uint32_t  gdtr_limit; /* gdt */
   31.53 -    uint32_t  gdtr_base;
   31.54 -    uint32_t  cs_sel;     /* cs selector */
   31.55 -    uint32_t  cs_limit;
   31.56 -    uint32_t  cs_base;
   31.57 -    union vmcs_arbytes cs_arbytes;
   31.58 -    uint32_t  ds_sel;     /* ds selector */
   31.59 -    uint32_t  ds_limit;
   31.60 -    uint32_t  ds_base;
   31.61 -    union vmcs_arbytes ds_arbytes;
   31.62 -    uint32_t  es_sel;     /* es selector */
   31.63 -    uint32_t  es_limit;
   31.64 -    uint32_t  es_base;
   31.65 -    union vmcs_arbytes es_arbytes;
   31.66 -    uint32_t  ss_sel;     /* ss selector */
   31.67 -    uint32_t  ss_limit;
   31.68 -    uint32_t  ss_base;
   31.69 -    union vmcs_arbytes ss_arbytes;
   31.70 -    uint32_t  fs_sel;     /* fs selector */
   31.71 -    uint32_t  fs_limit;
   31.72 -    uint32_t  fs_base;
   31.73 -    union vmcs_arbytes fs_arbytes;
   31.74 -    uint32_t  gs_sel;     /* gs selector */
   31.75 -    uint32_t  gs_limit;
   31.76 -    uint32_t  gs_base;
   31.77 -    union vmcs_arbytes gs_arbytes;
   31.78 -    uint32_t  tr_sel;     /* task selector */
   31.79 -    uint32_t  tr_limit;
   31.80 -    uint32_t  tr_base;
   31.81 -    union vmcs_arbytes tr_arbytes;
   31.82 -    uint32_t  ldtr_sel;   /* ldtr selector */
   31.83 -    uint32_t  ldtr_limit;
   31.84 -    uint32_t  ldtr_base;
   31.85 -    union vmcs_arbytes ldtr_arbytes;
   31.86 -} vmx_assist_context_t;
   31.87 -
   31.88 -#endif /* __ASSEMBLY__ */
   31.89 -
   31.90 -#endif /* _VMX_ASSIST_H_ */
   31.91 -
   31.92 -/*
   31.93 - * Local variables:
   31.94 - * mode: C
   31.95 - * c-set-style: "BSD"
   31.96 - * c-basic-offset: 4
   31.97 - * tab-width: 4
   31.98 - * indent-tabs-mode: nil
   31.99 - * End:
  31.100 - */