direct-io.hg

changeset 8489:f7c2cbb5368f

Marge with xen-ia64-unstable.hg
author kaf24@firebug.cl.cam.ac.uk
date Tue Jan 03 19:03:56 2006 +0100 (2006-01-03)
parents 71c61c288171 9bf5a3b24318
children f22ea989389d
files tools/libxc/xc_ia64_stubs.c xen/arch/ia64/xen/domain.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c	Tue Jan 03 10:20:05 2006 -0600
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c	Tue Jan 03 19:03:56 2006 +0100
     1.3 @@ -540,6 +540,9 @@ static int __init blkif_init(void)
     1.4  	pending_vaddrs        = kmalloc(sizeof(pending_vaddrs[0]) *
     1.5  					mmap_pages, GFP_KERNEL);
     1.6  	if (!pending_reqs || !pending_grant_handles || !pending_vaddrs) {
     1.7 +		kfree(pending_reqs);
     1.8 +		kfree(pending_grant_handles);
     1.9 +		kfree(pending_vaddrs);
    1.10  		printk("%s: out of memory\n", __FUNCTION__);
    1.11  		return -1;
    1.12  	}
     2.1 --- a/linux-2.6-xen-sparse/drivers/xen/blktap/blktap.c	Tue Jan 03 10:20:05 2006 -0600
     2.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blktap/blktap.c	Tue Jan 03 19:03:56 2006 +0100
     2.3 @@ -225,7 +225,7 @@ static int blktap_open(struct inode *ino
     2.4  	/* Allocate the fe ring. */
     2.5  	sring = (blkif_sring_t *)get_zeroed_page(GFP_KERNEL);
     2.6  	if (sring == NULL)
     2.7 -		goto fail_nomem;
     2.8 +		return -ENOMEM;
     2.9  
    2.10  	SetPageReserved(virt_to_page(sring));
    2.11      
    2.12 @@ -233,9 +233,6 @@ static int blktap_open(struct inode *ino
    2.13  	FRONT_RING_INIT(&blktap_ufe_ring, sring, PAGE_SIZE);
    2.14  
    2.15  	return 0;
    2.16 -
    2.17 - fail_nomem:
    2.18 -	return -ENOMEM;
    2.19  }
    2.20  
    2.21  static int blktap_release(struct inode *inode, struct file *filp)
    2.22 @@ -391,12 +388,12 @@ void blktap_kick_user(void)
    2.23  }
    2.24  
    2.25  static struct file_operations blktap_fops = {
    2.26 -	owner:    THIS_MODULE,
    2.27 -	poll:     blktap_poll,
    2.28 -	ioctl:    blktap_ioctl,
    2.29 -	open:     blktap_open,
    2.30 -	release:  blktap_release,
    2.31 -	mmap:     blktap_mmap,
    2.32 +	.owner   = THIS_MODULE,
    2.33 +	.poll    = blktap_poll,
    2.34 +	.ioctl   = blktap_ioctl,
    2.35 +	.open    = blktap_open,
    2.36 +	.release = blktap_release,
    2.37 +	.mmap    = blktap_mmap,
    2.38  };
    2.39  
    2.40  
     3.1 --- a/linux-2.6-xen-sparse/drivers/xen/console/console.c	Tue Jan 03 10:20:05 2006 -0600
     3.2 +++ b/linux-2.6-xen-sparse/drivers/xen/console/console.c	Tue Jan 03 19:03:56 2006 +0100
     3.3 @@ -314,39 +314,31 @@ static void __xencons_tx_flush(void)
     3.4  {
     3.5  	int sent, sz, work_done = 0;
     3.6  
     3.7 -	if (xen_start_info->flags & SIF_INITDOMAIN) {
     3.8 -		if (x_char) {
     3.9 +	if (x_char) {
    3.10 +		if (xen_start_info->flags & SIF_INITDOMAIN)
    3.11  			kcons_write_dom0(NULL, &x_char, 1);
    3.12 -			x_char = 0;
    3.13 -			work_done = 1;
    3.14 -		}
    3.15 +		else
    3.16 +			while (x_char)
    3.17 +				if (xencons_ring_send(&x_char, 1) == 1)
    3.18 +					break;
    3.19 +		x_char = 0;
    3.20 +		work_done = 1;
    3.21 +	}
    3.22  
    3.23 -		while (wc != wp) {
    3.24 -			sz = wp - wc;
    3.25 -			if (sz > (wbuf_size - WBUF_MASK(wc)))
    3.26 -				sz = wbuf_size - WBUF_MASK(wc);
    3.27 +	while (wc != wp) {
    3.28 +		sz = wp - wc;
    3.29 +		if (sz > (wbuf_size - WBUF_MASK(wc)))
    3.30 +			sz = wbuf_size - WBUF_MASK(wc);
    3.31 +		if (xen_start_info->flags & SIF_INITDOMAIN) {
    3.32  			kcons_write_dom0(NULL, &wbuf[WBUF_MASK(wc)], sz);
    3.33  			wc += sz;
    3.34 -			work_done = 1;
    3.35 -		}
    3.36 -	} else {
    3.37 -		while (x_char) {
    3.38 -			if (xencons_ring_send(&x_char, 1) == 1) {
    3.39 -				x_char = 0;
    3.40 -				work_done = 1;
    3.41 -			}
    3.42 -		}
    3.43 -
    3.44 -		while (wc != wp) {
    3.45 -			sz = wp - wc;
    3.46 -			if (sz > (wbuf_size - WBUF_MASK(wc)))
    3.47 -				sz = wbuf_size - WBUF_MASK(wc);
    3.48 +		} else {
    3.49  			sent = xencons_ring_send(&wbuf[WBUF_MASK(wc)], sz);
    3.50  			if (sent == 0)
    3.51  				break;
    3.52  			wc += sent;
    3.53 -			work_done = 1;
    3.54  		}
    3.55 +		work_done = 1;
    3.56  	}
    3.57  
    3.58  	if (work_done && (xencons_tty != NULL)) {
     4.1 --- a/linux-2.6-xen-sparse/drivers/xen/netback/interface.c	Tue Jan 03 10:20:05 2006 -0600
     4.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/interface.c	Tue Jan 03 19:03:56 2006 +0100
     4.3 @@ -183,7 +183,7 @@ static void unmap_frontend_pages(netif_t
     4.4  int netif_map(netif_t *netif, unsigned long tx_ring_ref,
     4.5  	      unsigned long rx_ring_ref, unsigned int evtchn)
     4.6  {
     4.7 -	int err;
     4.8 +	int err = -ENOMEM;
     4.9  	netif_tx_sring_t *txs;
    4.10  	netif_rx_sring_t *rxs;
    4.11  	evtchn_op_t op = {
    4.12 @@ -199,25 +199,16 @@ int netif_map(netif_t *netif, unsigned l
    4.13  	if (netif->tx_comms_area == NULL)
    4.14  		return -ENOMEM;
    4.15  	netif->rx_comms_area = alloc_vm_area(PAGE_SIZE);
    4.16 -	if (netif->rx_comms_area == NULL) {
    4.17 -		free_vm_area(netif->tx_comms_area);
    4.18 -		return -ENOMEM;
    4.19 -	}
    4.20 +	if (netif->rx_comms_area == NULL)
    4.21 +		goto err_rx;
    4.22  
    4.23  	err = map_frontend_pages(netif, tx_ring_ref, rx_ring_ref);
    4.24 -	if (err) {
    4.25 -		free_vm_area(netif->tx_comms_area);
    4.26 -		free_vm_area(netif->rx_comms_area);
    4.27 -		return err;
    4.28 -	}
    4.29 +	if (err)
    4.30 +		goto err_map;
    4.31  
    4.32  	err = HYPERVISOR_event_channel_op(&op);
    4.33 -	if (err) {
    4.34 -		unmap_frontend_pages(netif);
    4.35 -		free_vm_area(netif->tx_comms_area);
    4.36 -		free_vm_area(netif->rx_comms_area);
    4.37 -		return err;
    4.38 -	}
    4.39 +	if (err)
    4.40 +		goto err_hypervisor;
    4.41  
    4.42  	netif->evtchn = op.u.bind_interdomain.local_port;
    4.43  
    4.44 @@ -245,6 +236,13 @@ int netif_map(netif_t *netif, unsigned l
    4.45  	rtnl_unlock();
    4.46  
    4.47  	return 0;
    4.48 +err_hypervisor:
    4.49 +	unmap_frontend_pages(netif);
    4.50 +err_map:
    4.51 +	free_vm_area(netif->rx_comms_area);
    4.52 +err_rx:
    4.53 +	free_vm_area(netif->tx_comms_area);
    4.54 +	return err;
    4.55  }
    4.56  
    4.57  static void free_netif_callback(void *arg)
     5.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c	Tue Jan 03 10:20:05 2006 -0600
     5.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c	Tue Jan 03 19:03:56 2006 +0100
     5.3 @@ -542,14 +542,6 @@ static int xenbus_probe_node(struct xen_
     5.4  			     const char *type,
     5.5  			     const char *nodename)
     5.6  {
     5.7 -#define CHECK_FAIL				\
     5.8 -	do {					\
     5.9 -		if (err)			\
    5.10 -			goto fail;		\
    5.11 -	}					\
    5.12 -	while (0)				\
    5.13 -
    5.14 -
    5.15  	int err;
    5.16  	struct xenbus_device *xendev;
    5.17  	size_t stringlen;
    5.18 @@ -584,19 +576,18 @@ static int xenbus_probe_node(struct xen_
    5.19  	xendev->dev.release = xenbus_dev_release;
    5.20  
    5.21  	err = bus->get_bus_id(xendev->dev.bus_id, xendev->nodename);
    5.22 -	CHECK_FAIL;
    5.23 +	if (err)
    5.24 +		goto fail;
    5.25  
    5.26  	/* Register with generic device framework. */
    5.27  	err = device_register(&xendev->dev);
    5.28 -	CHECK_FAIL;
    5.29 +	if (err)
    5.30 +		goto fail;
    5.31  
    5.32  	device_create_file(&xendev->dev, &dev_attr_nodename);
    5.33  	device_create_file(&xendev->dev, &dev_attr_devtype);
    5.34  
    5.35  	return 0;
    5.36 -
    5.37 -#undef CHECK_FAIL
    5.38 -
    5.39  fail:
    5.40  	xenbus_dev_free(xendev);
    5.41  	return err;
     6.1 --- a/tools/Rules.mk	Tue Jan 03 10:20:05 2006 -0600
     6.2 +++ b/tools/Rules.mk	Tue Jan 03 19:03:56 2006 +0100
     6.3 @@ -35,6 +35,8 @@ mk-symlinks: LINUX_ROOT=$(XEN_ROOT)/linu
     6.4  mk-symlinks:
     6.5  	mkdir -p xen
     6.6  	( cd xen && ln -sf ../$(XEN_ROOT)/xen/include/public/*.h . )
     6.7 +	mkdir -p xen/hvm
     6.8 +	( cd xen/hvm && ln -sf ../../$(XEN_ROOT)/xen/include/public/hvm/*.h . )
     6.9  	mkdir -p xen/io
    6.10  	( cd xen/io && ln -sf ../../$(XEN_ROOT)/xen/include/public/io/*.h . )
    6.11  	mkdir -p xen/linux
     7.1 --- a/tools/examples/xmexample.vmx	Tue Jan 03 10:20:05 2006 -0600
     7.2 +++ b/tools/examples/xmexample.vmx	Tue Jan 03 19:03:56 2006 +0100
     7.3 @@ -28,11 +28,14 @@ name = "ExampleVMXDomain"
     7.4  
     7.5  #-----------------------------------------------------------------------------
     7.6  # the number of cpus guest platform has, default=1
     7.7 -vcpus=1
     7.8 +#vcpus=1
     7.9  
    7.10  # enable/disalbe vmx guest ACPI, default=0 (disabled)
    7.11  #acpi=0
    7.12  
    7.13 +# enable/disalbe vmx guest APIC, default=0 (disabled)
    7.14 +#apic=0
    7.15 +
    7.16  # List of which CPUS this domain is allowed to use, default Xen picks
    7.17  #cpus = ""         # leave to Xen to pick
    7.18  #cpus = "0"        # all vcpus run on CPU0
     8.1 --- a/tools/firmware/vmxassist/acpi_madt.c	Tue Jan 03 10:20:05 2006 -0600
     8.2 +++ b/tools/firmware/vmxassist/acpi_madt.c	Tue Jan 03 19:03:56 2006 +0100
     8.3 @@ -17,34 +17,34 @@
     8.4   * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
     8.5   * Place - Suite 330, Boston, MA 02111-1307 USA.
     8.6   */
     8.7 +
     8.8  #include "../acpi/acpi2_0.h"
     8.9  #include "../acpi/acpi_madt.h"
    8.10  
    8.11 +#include <xen/hvm/hvm_info_table.h>
    8.12 +
    8.13  #define NULL ((void*)0)
    8.14  
    8.15  extern int puts(const char *s);
    8.16  
    8.17 -#define HVM_INFO_PAGE	0x0009F000
    8.18 -#define HVM_INFO_OFFSET	0x00000800
    8.19 -
    8.20 -struct hvm_info_table {
    8.21 -	char     signature[8]; /* "HVM INFO" */
    8.22 -	uint32_t length;
    8.23 -	uint8_t  checksum;
    8.24 -	uint8_t  acpi_enabled;
    8.25 -	uint8_t  pad[2];
    8.26 -	uint32_t nr_vcpus;
    8.27 -};
    8.28 -
    8.29  static struct hvm_info_table *table = NULL;
    8.30  
    8.31 -static int
    8.32 -checksum_valid(uint8_t *ptr, int len)
    8.33 +static int validate_hvm_info(struct hvm_info_table *t)
    8.34  {
    8.35 -	uint8_t sum=0;
    8.36 +	char signature[] = "HVM INFO";
    8.37 +	uint8_t *ptr = (uint8_t *)t;
    8.38 +	uint8_t sum = 0;
    8.39  	int i;
    8.40  
    8.41 -	for (i = 0; i < len; i++)
    8.42 +	/* strncmp(t->signature, "HVM INFO", 8) */
    8.43 +	for (i = 0; i < 8; i++) {
    8.44 +		if (signature[i] != t->signature[i]) {
    8.45 +			puts("Bad hvm info signature\n");
    8.46 +			return 0;
    8.47 +		}
    8.48 +	}
    8.49 +
    8.50 +	for (i = 0; i < t->length; i++)
    8.51  		sum += ptr[i];
    8.52  
    8.53  	return (sum == 0);
    8.54 @@ -55,24 +55,15 @@ static struct hvm_info_table *
    8.55  get_hvm_info_table(void)
    8.56  {
    8.57  	struct hvm_info_table *t;
    8.58 -	char signature[] = "HVM INFO";
    8.59  	int i;
    8.60  
    8.61  	if (table != NULL)
    8.62  		return table;
    8.63  
    8.64 -	t = (struct hvm_info_table *)(HVM_INFO_PAGE + HVM_INFO_OFFSET);
    8.65 +	t = (struct hvm_info_table *)HVM_INFO_PADDR;
    8.66  
    8.67 -	/* strncmp(t->signature, "HVM INFO", 8) */
    8.68 -	for (i = 0; i < 8; i++) {
    8.69 -		if (signature[i] != t->signature[i]) {
    8.70 -			puts("Bad hvm info signature\n");
    8.71 -			return NULL;
    8.72 -		}
    8.73 -	}
    8.74 -
    8.75 -	if (!checksum_valid((uint8_t *)t, t->length)) {
    8.76 -		puts("Bad hvm info checksum\n");
    8.77 +	if (!validate_hvm_info(t)) {
    8.78 +		puts("Bad hvm info table\n");
    8.79  		return NULL;
    8.80  	}
    8.81  
    8.82 @@ -126,10 +117,10 @@ acpi_madt_get_madt(unsigned char *acpi_s
    8.83  	return madt;
    8.84  }
    8.85  
    8.86 -static void 
    8.87 +static void
    8.88  set_checksum(void *start, int checksum_offset, int len)
    8.89  {
    8.90 -	unsigned char sum = 0;  
    8.91 +	unsigned char sum = 0;
    8.92  	unsigned char *ptr;
    8.93  
    8.94  	ptr = start;
    8.95 @@ -141,9 +132,9 @@ set_checksum(void *start, int checksum_o
    8.96  	ptr[checksum_offset] = -sum;
    8.97  }
    8.98  
    8.99 -static int 
   8.100 +static int
   8.101  acpi_madt_set_local_apics(
   8.102 -	int nr_vcpu, 
   8.103 +	int nr_vcpu,
   8.104  	ACPI_MULTIPLE_APIC_DESCRIPTION_TABLE *madt)
   8.105  {
   8.106  	int i;
   8.107 @@ -156,14 +147,14 @@ acpi_madt_set_local_apics(
   8.108  		madt->LocalApic[i].Length          = sizeof (ACPI_LOCAL_APIC_STRUCTURE);
   8.109  		madt->LocalApic[i].AcpiProcessorId = i;
   8.110  		madt->LocalApic[i].ApicId          = i;
   8.111 -		madt->LocalApic[i].Flags           = 1; 
   8.112 +		madt->LocalApic[i].Flags           = 1;
   8.113  	}
   8.114  
   8.115  	madt->Header.Header.Length =
   8.116 -		sizeof(ACPI_MULTIPLE_APIC_DESCRIPTION_TABLE) - 
   8.117 +		sizeof(ACPI_MULTIPLE_APIC_DESCRIPTION_TABLE) -
   8.118  		(MAX_VIRT_CPUS - nr_vcpu)* sizeof(ACPI_LOCAL_APIC_STRUCTURE);
   8.119  
   8.120 -	return 0;                            
   8.121 +	return 0;
   8.122  }
   8.123  
   8.124  #define FIELD_OFFSET(TYPE,Field) ((unsigned int)(&(((TYPE *) 0)->Field)))
   8.125 @@ -185,7 +176,7 @@ int acpi_madt_update(unsigned char *acpi
   8.126  		madt, FIELD_OFFSET(ACPI_TABLE_HEADER, Checksum),
   8.127  		madt->Header.Header.Length);
   8.128  
   8.129 -	return 0;              
   8.130 +	return 0;
   8.131  }
   8.132  
   8.133  /*
     9.1 --- a/tools/firmware/vmxassist/vm86.h	Tue Jan 03 10:20:05 2006 -0600
     9.2 +++ b/tools/firmware/vmxassist/vm86.h	Tue Jan 03 19:03:56 2006 +0100
     9.3 @@ -24,7 +24,7 @@
     9.4  #include <stdint.h>
     9.5  #endif
     9.6  
     9.7 -#include <xen/vmx_assist.h>
     9.8 +#include <xen/hvm/vmx_assist.h>
     9.9  
    9.10  #define	NR_EXCEPTION_HANDLER	32
    9.11  #define	NR_INTERRUPT_HANDLERS	16
    10.1 --- a/tools/ioemu/hw/i8254.c	Tue Jan 03 10:20:05 2006 -0600
    10.2 +++ b/tools/ioemu/hw/i8254.c	Tue Jan 03 19:03:56 2006 +0100
    10.3 @@ -23,7 +23,7 @@
    10.4   */
    10.5  #include "vl.h"
    10.6  #include <xenctrl.h>
    10.7 -#include <xen/io/ioreq.h>
    10.8 +#include <xen/hvm/ioreq.h>
    10.9  
   10.10  //#define DEBUG_PIT
   10.11  
    11.1 --- a/tools/ioemu/hw/i8259.c	Tue Jan 03 10:20:05 2006 -0600
    11.2 +++ b/tools/ioemu/hw/i8259.c	Tue Jan 03 19:03:56 2006 +0100
    11.3 @@ -23,7 +23,7 @@
    11.4   */
    11.5  #include "vl.h"
    11.6  #include <xenctrl.h>
    11.7 -#include <xen/io/ioreq.h>
    11.8 +#include <xen/hvm/ioreq.h>
    11.9  
   11.10  /* debug PIC */
   11.11  //#define DEBUG_PIC
    12.1 --- a/tools/ioemu/hw/i8259_stub.c	Tue Jan 03 10:20:05 2006 -0600
    12.2 +++ b/tools/ioemu/hw/i8259_stub.c	Tue Jan 03 19:03:56 2006 +0100
    12.3 @@ -22,7 +22,7 @@
    12.4   * THE SOFTWARE.
    12.5   */
    12.6  #include "xenctrl.h"
    12.7 -#include <xen/io/ioreq.h>
    12.8 +#include <xen/hvm/ioreq.h>
    12.9  #include <stdio.h>
   12.10  #include "cpu.h"
   12.11  #include "cpu-all.h"
    13.1 --- a/tools/ioemu/target-i386-dm/helper2.c	Tue Jan 03 10:20:05 2006 -0600
    13.2 +++ b/tools/ioemu/target-i386-dm/helper2.c	Tue Jan 03 19:03:56 2006 +0100
    13.3 @@ -48,7 +48,7 @@
    13.4  #include <sys/ioctl.h>
    13.5  
    13.6  #include <xenctrl.h>
    13.7 -#include <xen/io/ioreq.h>
    13.8 +#include <xen/hvm/ioreq.h>
    13.9  #include <xen/linux/evtchn.h>
   13.10  
   13.11  #include "cpu.h"
    14.1 --- a/tools/libxc/xc_ia64_stubs.c	Tue Jan 03 10:20:05 2006 -0600
    14.2 +++ b/tools/libxc/xc_ia64_stubs.c	Tue Jan 03 19:03:56 2006 +0100
    14.3 @@ -5,7 +5,7 @@
    14.4  #include <stdlib.h>
    14.5  #include <zlib.h>
    14.6  #include "xen/arch-ia64.h"
    14.7 -#include <xen/io/ioreq.h>
    14.8 +#include <xen/hvm/ioreq.h>
    14.9  
   14.10  /* this is a very ugly way of getting FPSR_DEFAULT.  struct ia64_fpreg is
   14.11   * mysteriously declared in two places: /usr/include/asm/fpu.h and
    15.1 --- a/tools/libxc/xc_vmx_build.c	Tue Jan 03 10:20:05 2006 -0600
    15.2 +++ b/tools/libxc/xc_vmx_build.c	Tue Jan 03 19:03:56 2006 +0100
    15.3 @@ -9,7 +9,8 @@
    15.4  #include <stdlib.h>
    15.5  #include <unistd.h>
    15.6  #include <zlib.h>
    15.7 -#include <xen/io/ioreq.h>
    15.8 +#include <xen/hvm/hvm_info_table.h>
    15.9 +#include <xen/hvm/ioreq.h>
   15.10  
   15.11  #define VMX_LOADER_ENTR_ADDR  0x00100000
   15.12  
   15.13 @@ -33,18 +34,6 @@
   15.14  #define E820_MAP_NR_OFFSET  0x000001E8
   15.15  #define E820_MAP_OFFSET     0x000002D0
   15.16  
   15.17 -#define HVM_INFO_PAGE        0x0009F000
   15.18 -#define HVM_INFO_OFFSET      0x00000800
   15.19 -
   15.20 -struct hvm_info_table {
   15.21 -    char     signature[8]; /* "HVM INFO" */
   15.22 -    uint32_t length;
   15.23 -    uint8_t  checksum;
   15.24 -    uint8_t  acpi_enabled;
   15.25 -    uint8_t  pad[2];
   15.26 -    uint32_t nr_vcpus;
   15.27 -};
   15.28 -
   15.29  struct e820entry {
   15.30      uint64_t addr;
   15.31      uint64_t size;
   15.32 @@ -128,7 +117,7 @@ static unsigned char build_e820map(void 
   15.33      return (*(((unsigned char *)e820_page) + E820_MAP_NR_OFFSET) = nr_map);
   15.34  }
   15.35  
   15.36 -static void 
   15.37 +static void
   15.38  set_hvm_info_checksum(struct hvm_info_table *t)
   15.39  {
   15.40      uint8_t *ptr = (uint8_t *)t, sum = 0;
   15.41 @@ -148,14 +137,18 @@ set_hvm_info_checksum(struct hvm_info_ta
   15.42   */
   15.43  static int set_hvm_info(int xc_handle, uint32_t dom,
   15.44                          unsigned long *pfn_list, unsigned int vcpus,
   15.45 -                        unsigned int acpi)
   15.46 +                        unsigned int acpi, unsigned int apic)
   15.47  {
   15.48      char *va_map;
   15.49      struct hvm_info_table *va_hvm;
   15.50  
   15.51 -    va_map = xc_map_foreign_range(xc_handle, dom,
   15.52 -                                  PAGE_SIZE, PROT_READ|PROT_WRITE,
   15.53 -                                  pfn_list[HVM_INFO_PAGE >> PAGE_SHIFT]);
   15.54 +    va_map = xc_map_foreign_range(
   15.55 +        xc_handle,
   15.56 +        dom,
   15.57 +        PAGE_SIZE,
   15.58 +        PROT_READ|PROT_WRITE,
   15.59 +        pfn_list[HVM_INFO_PFN]);
   15.60 +    
   15.61      if ( va_map == NULL )
   15.62          return -1;
   15.63  
   15.64 @@ -164,8 +157,9 @@ static int set_hvm_info(int xc_handle, u
   15.65      strncpy(va_hvm->signature, "HVM INFO", 8);
   15.66      va_hvm->length       = sizeof(struct hvm_info_table);
   15.67      va_hvm->acpi_enabled = acpi;
   15.68 +    va_hvm->apic_enabled = apic;
   15.69      va_hvm->nr_vcpus     = vcpus;
   15.70 -    
   15.71 +
   15.72      set_hvm_info_checksum(va_hvm);
   15.73  
   15.74      munmap(va_map, PAGE_SIZE);
   15.75 @@ -307,9 +301,9 @@ static int setup_guest(int xc_handle,
   15.76                         vcpu_guest_context_t *ctxt,
   15.77                         unsigned long shared_info_frame,
   15.78                         unsigned int control_evtchn,
   15.79 -                       unsigned int lapic,
   15.80                         unsigned int vcpus,
   15.81                         unsigned int acpi,
   15.82 +                       unsigned int apic,
   15.83                         unsigned int store_evtchn,
   15.84                         unsigned long *store_mfn)
   15.85  {
   15.86 @@ -519,20 +513,14 @@ static int setup_guest(int xc_handle,
   15.87              goto error_out;
   15.88      }
   15.89  
   15.90 -    if (set_hvm_info(xc_handle, dom, page_array, vcpus, acpi)) {
   15.91 +    if ( set_hvm_info(xc_handle, dom, page_array, vcpus, acpi, apic) ) {
   15.92          fprintf(stderr, "Couldn't set hvm info for VMX guest.\n");
   15.93          goto error_out;
   15.94      }
   15.95  
   15.96 -    *store_mfn = page_array[(v_end-2) >> PAGE_SHIFT];
   15.97 -    if ( xc_clear_domain_page(xc_handle, dom, *store_mfn) )
   15.98 -        goto error_out;
   15.99 -
  15.100 -    shared_page_frame = (v_end - PAGE_SIZE) >> PAGE_SHIFT;
  15.101 -
  15.102 -    if ((e820_page = xc_map_foreign_range(
  15.103 -        xc_handle, dom, PAGE_SIZE, PROT_READ|PROT_WRITE,
  15.104 -        page_array[E820_MAP_PAGE >> PAGE_SHIFT])) == 0)
  15.105 +    if ( (e820_page = xc_map_foreign_range(
  15.106 +         xc_handle, dom, PAGE_SIZE, PROT_READ|PROT_WRITE,
  15.107 +         page_array[E820_MAP_PAGE >> PAGE_SHIFT])) == 0 )
  15.108          goto error_out;
  15.109      memset(e820_page, 0, PAGE_SIZE);
  15.110      e820_map_nr = build_e820map(e820_page, v_end);
  15.111 @@ -547,26 +535,30 @@ static int setup_guest(int xc_handle,
  15.112      munmap(e820_page, PAGE_SIZE);
  15.113  
  15.114      /* shared_info page starts its life empty. */
  15.115 -    if ((shared_info = xc_map_foreign_range(
  15.116 -        xc_handle, dom, PAGE_SIZE, PROT_READ|PROT_WRITE,
  15.117 -        shared_info_frame)) == 0)
  15.118 +    if ( (shared_info = xc_map_foreign_range(
  15.119 +         xc_handle, dom, PAGE_SIZE, PROT_READ|PROT_WRITE,
  15.120 +         shared_info_frame)) == 0 )
  15.121          goto error_out;
  15.122      memset(shared_info, 0, sizeof(shared_info_t));
  15.123      /* Mask all upcalls... */
  15.124      for ( i = 0; i < MAX_VIRT_CPUS; i++ )
  15.125          shared_info->vcpu_info[i].evtchn_upcall_mask = 1;
  15.126 -
  15.127      munmap(shared_info, PAGE_SIZE);
  15.128  
  15.129      /* Populate the event channel port in the shared page */
  15.130 -    if ((sp = (shared_iopage_t *) xc_map_foreign_range(
  15.131 -        xc_handle, dom, PAGE_SIZE, PROT_READ|PROT_WRITE,
  15.132 -        page_array[shared_page_frame])) == 0)
  15.133 +    shared_page_frame = page_array[(v_end >> PAGE_SHIFT) - 1];
  15.134 +    if ( (sp = (shared_iopage_t *) xc_map_foreign_range(
  15.135 +         xc_handle, dom, PAGE_SIZE, PROT_READ|PROT_WRITE,
  15.136 +         shared_page_frame)) == 0 )
  15.137          goto error_out;
  15.138      memset(sp, 0, PAGE_SIZE);
  15.139      sp->sp_global.eport = control_evtchn;
  15.140      munmap(sp, PAGE_SIZE);
  15.141  
  15.142 +    *store_mfn = page_array[(v_end >> PAGE_SHIFT) - 2];
  15.143 +    if ( xc_clear_domain_page(xc_handle, dom, *store_mfn) )
  15.144 +        goto error_out;
  15.145 +
  15.146      /* Send the page update requests down to the hypervisor. */
  15.147      if ( xc_finish_mmu_updates(xc_handle, mmu) )
  15.148          goto error_out;
  15.149 @@ -588,7 +580,7 @@ static int setup_guest(int xc_handle,
  15.150      ctxt->user_regs.eax = 0;
  15.151      ctxt->user_regs.esp = 0;
  15.152      ctxt->user_regs.ebx = 0; /* startup_32 expects this to be 0 to signal boot cpu */
  15.153 -    ctxt->user_regs.ecx = lapic;
  15.154 +    ctxt->user_regs.ecx = 0;
  15.155      ctxt->user_regs.esi = 0;
  15.156      ctxt->user_regs.edi = 0;
  15.157      ctxt->user_regs.ebp = 0;
  15.158 @@ -608,9 +600,9 @@ int xc_vmx_build(int xc_handle,
  15.159                   int memsize,
  15.160                   const char *image_name,
  15.161                   unsigned int control_evtchn,
  15.162 -                 unsigned int lapic,
  15.163                   unsigned int vcpus,
  15.164                   unsigned int acpi,
  15.165 +                 unsigned int apic,
  15.166                   unsigned int store_evtchn,
  15.167                   unsigned long *store_mfn)
  15.168  {
  15.169 @@ -674,7 +666,7 @@ int xc_vmx_build(int xc_handle,
  15.170  
  15.171      if ( setup_guest(xc_handle, domid, memsize, image, image_size, nr_pages,
  15.172                       ctxt, op.u.getdomaininfo.shared_info_frame, control_evtchn,
  15.173 -                     lapic, vcpus, acpi, store_evtchn, store_mfn) < 0)
  15.174 +                     vcpus, acpi, apic, store_evtchn, store_mfn) < 0)
  15.175      {
  15.176          ERROR("Error constructing guest OS");
  15.177          goto error_out;
    16.1 --- a/tools/libxc/xenguest.h	Tue Jan 03 10:20:05 2006 -0600
    16.2 +++ b/tools/libxc/xenguest.h	Tue Jan 03 19:03:56 2006 +0100
    16.3 @@ -56,9 +56,9 @@ int xc_vmx_build(int xc_handle,
    16.4                   int memsize,
    16.5                   const char *image_name,
    16.6                   unsigned int control_evtchn,
    16.7 -                 unsigned int lapic,
    16.8                   unsigned int vcpus,
    16.9                   unsigned int acpi,
   16.10 +                 unsigned int apic,
   16.11                   unsigned int store_evtchn,
   16.12                   unsigned long *store_mfn);
   16.13  
    17.1 --- a/tools/python/xen/lowlevel/xc/xc.c	Tue Jan 03 10:20:05 2006 -0600
    17.2 +++ b/tools/python/xen/lowlevel/xc/xc.c	Tue Jan 03 19:03:56 2006 +0100
    17.3 @@ -362,22 +362,23 @@ static PyObject *pyxc_vmx_build(XcObject
    17.4      uint32_t dom;
    17.5      char *image;
    17.6      int control_evtchn, store_evtchn;
    17.7 +    int memsize;
    17.8      int vcpus = 1;
    17.9 -    int lapic = 0;
   17.10      int acpi = 0;
   17.11 -    int memsize;
   17.12 +    int apic = 0;
   17.13      unsigned long store_mfn = 0;
   17.14  
   17.15      static char *kwd_list[] = { "dom", "control_evtchn", "store_evtchn",
   17.16 -                                "memsize", "image", "lapic", "vcpus", "acpi",NULL };
   17.17 +                                "memsize", "image", "vcpus", "acpi", "apic",
   17.18 +                                NULL };
   17.19  
   17.20      if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiiisiii", kwd_list,
   17.21                                        &dom, &control_evtchn, &store_evtchn,
   17.22 -                                      &memsize, &image, &lapic, &vcpus,&acpi) )
   17.23 +                                      &memsize, &image, &vcpus, &acpi, &apic) )
   17.24          return NULL;
   17.25  
   17.26      if ( xc_vmx_build(self->xc_handle, dom, memsize, image, control_evtchn,
   17.27 -                      lapic, vcpus, acpi, store_evtchn, &store_mfn) != 0 )
   17.28 +                      vcpus, acpi, apic, store_evtchn, &store_mfn) != 0 )
   17.29          return PyErr_SetFromErrno(xc_error);
   17.30  
   17.31      return Py_BuildValue("{s:i}", "store_mfn", store_mfn);
    18.1 --- a/tools/python/xen/xend/image.py	Tue Jan 03 10:20:05 2006 -0600
    18.2 +++ b/tools/python/xen/xend/image.py	Tue Jan 03 19:03:56 2006 +0100
    18.3 @@ -209,13 +209,9 @@ class VmxImageHandler(ImageHandler):
    18.4  
    18.5          self.dmargs += self.configVNC(imageConfig)
    18.6  
    18.7 -        self.lapic = 0
    18.8 -        lapic = sxp.child_value(imageConfig, 'lapic')
    18.9 -        if not lapic is None:
   18.10 -            self.lapic = int(lapic)
   18.11 +        self.acpi = int(sxp.child_value(imageConfig, 'acpi', 0))
   18.12 +        self.apic = int(sxp.child_value(imageConfig, 'apic', 0))
   18.13  
   18.14 -        self.acpi = int(sxp.child_value(imageConfig, 'acpi', 0))
   18.15 -        
   18.16      def buildDomain(self):
   18.17          # Create an event channel
   18.18          self.device_channel = xc.evtchn_alloc_unbound(dom=self.vm.getDomid(),
   18.19 @@ -229,18 +225,18 @@ class VmxImageHandler(ImageHandler):
   18.20          log.debug("control_evtchn = %d", self.device_channel)
   18.21          log.debug("store_evtchn   = %d", store_evtchn)
   18.22          log.debug("memsize        = %d", self.vm.getMemoryTarget() / 1024)
   18.23 -        log.debug("lapic          = %d", self.lapic)
   18.24          log.debug("vcpus          = %d", self.vm.getVCpuCount())
   18.25          log.debug("acpi           = %d", self.acpi)
   18.26 +        log.debug("apic           = %d", self.apic)
   18.27  
   18.28          return xc.vmx_build(dom            = self.vm.getDomid(),
   18.29                              image          = self.kernel,
   18.30                              control_evtchn = self.device_channel,
   18.31                              store_evtchn   = store_evtchn,
   18.32                              memsize        = self.vm.getMemoryTarget() / 1024,
   18.33 -                            lapic          = self.lapic,
   18.34 +                            vcpus          = self.vm.getVCpuCount(),
   18.35                              acpi           = self.acpi,
   18.36 -                            vcpus          = self.vm.getVCpuCount())
   18.37 +                            apic           = self.apic)
   18.38  
   18.39      # Return a list of cmd line args to the device models based on the
   18.40      # xm config file
    19.1 --- a/tools/python/xen/xm/create.py	Tue Jan 03 10:20:05 2006 -0600
    19.2 +++ b/tools/python/xen/xm/create.py	Tue Jan 03 19:03:56 2006 +0100
    19.3 @@ -160,14 +160,14 @@ gopts.var('cpus', val='CPUS',
    19.4            fn=set_int, default=None,
    19.5            use="CPUS to run the domain on.")
    19.6  
    19.7 -gopts.var('lapic', val='LAPIC',
    19.8 -          fn=set_int, default=0,
    19.9 -          use="Disable or enable local APIC of VMX domain.")
   19.10 -
   19.11  gopts.var('acpi', val='ACPI',
   19.12            fn=set_int, default=0,
   19.13            use="Disable or enable ACPI of VMX domain.")
   19.14  
   19.15 +gopts.var('apic', val='APIC',
   19.16 +          fn=set_int, default=0,
   19.17 +          use="Disable or enable APIC of VMX domain.")
   19.18 +
   19.19  gopts.var('vcpus', val='VCPUS',
   19.20            fn=set_int, default=1,
   19.21            use="# of Virtual CPUS in domain.")
   19.22 @@ -534,8 +534,8 @@ def configure_vmx(config_image, vals):
   19.23      """
   19.24      args = [ 'device_model', 'vcpus', 'cdrom', 'boot', 'fda', 'fdb',
   19.25               'localtime', 'serial', 'stdvga', 'isa', 'nographic', 'audio',
   19.26 -             'vnc', 'vncviewer', 'sdl', 'display', 'ne2000', 'lapic',
   19.27 -             'xauthority', 'acpi' ]
   19.28 +             'vnc', 'vncviewer', 'sdl', 'display', 'ne2000', 'acpi', 'apic',
   19.29 +             'xauthority' ]
   19.30      for a in args:
   19.31          if (vals.__dict__[a]):
   19.32              config_image.append([a, vals.__dict__[a]])
    20.1 --- a/tools/python/xen/xm/main.py	Tue Jan 03 10:20:05 2006 -0600
    20.2 +++ b/tools/python/xen/xm/main.py	Tue Jan 03 19:03:56 2006 +0100
    20.3 @@ -390,7 +390,6 @@ def xm_brief_list(doms):
    20.4  
    20.5  
    20.6  def xm_vcpu_list(args):
    20.7 -    print 'Name                              ID  VCPU  CPU  State  Time(s)  CPU Affinity'
    20.8  
    20.9      from xen.xend.XendClient import server
   20.10      if args:
   20.11 @@ -401,6 +400,8 @@ def xm_vcpu_list(args):
   20.12              lambda x: server.xend_domain_vcpuinfo(sxp.child_value(x, 'name')),
   20.13              doms)
   20.14  
   20.15 +    print 'Name                              ID  VCPU  CPU  State  Time(s)  CPU Affinity'
   20.16 +
   20.17      for dom in dominfo:
   20.18          def get_info(n):
   20.19              return sxp.child_value(dom, n)
   20.20 @@ -625,6 +626,8 @@ def xm_sched_sedf(args):
   20.21      server.xend_domain_cpu_sedf_set(dom, *v)
   20.22  
   20.23  def xm_info(args):
   20.24 +    arg_check(args, "info", 0)
   20.25 +
   20.26      from xen.xend.XendClient import server
   20.27      info = server.xend_node()
   20.28      
   20.29 @@ -645,9 +648,12 @@ def xm_console(args):
   20.30  
   20.31  
   20.32  def xm_top(args):
   20.33 +    arg_check(args, "top", 0)
   20.34 +
   20.35      os.execvp('xentop', ['xentop'])
   20.36  
   20.37  def xm_dmesg(args):
   20.38 +    arg_check(args, "dmesg", 0)
   20.39      
   20.40      gopts = Opts(use="""[-c|--clear]
   20.41  
    21.1 --- a/tools/xm-test/tests/network-attach/Makefile.am	Tue Jan 03 10:20:05 2006 -0600
    21.2 +++ b/tools/xm-test/tests/network-attach/Makefile.am	Tue Jan 03 19:03:56 2006 +0100
    21.3 @@ -6,7 +6,7 @@ TESTS = 01_network_attach_pos.test \
    21.4  	03_network_attach_detach_multiple_pos.test  \
    21.5  	04_network_attach_baddomain_neg.test
    21.6  
    21.7 -XFAIL_TESTS = 03_network_attach_detach_multiple_pos.test
    21.8 +XFAIL_TESTS = 
    21.9  
   21.10  EXTRA_DIST = $(TESTS) $(XFAIL_TESTS) network_utils.py
   21.11  
    22.1 --- a/xen/arch/ia64/vmx/mmio.c	Tue Jan 03 10:20:05 2006 -0600
    22.2 +++ b/xen/arch/ia64/vmx/mmio.c	Tue Jan 03 19:03:56 2006 +0100
    22.3 @@ -29,7 +29,7 @@
    22.4  #include <asm/vmx_vcpu.h>
    22.5  #include <asm/privop.h>
    22.6  #include <asm/types.h>
    22.7 -#include <public/io/ioreq.h>
    22.8 +#include <public/hvm/ioreq.h>
    22.9  #include <asm/mm.h>
   22.10  #include <asm/vmx.h>
   22.11  
    23.1 --- a/xen/arch/ia64/vmx/vmx_init.c	Tue Jan 03 10:20:05 2006 -0600
    23.2 +++ b/xen/arch/ia64/vmx/vmx_init.c	Tue Jan 03 19:03:56 2006 +0100
    23.3 @@ -42,7 +42,7 @@
    23.4  #include <xen/lib.h>
    23.5  #include <asm/vmmu.h>
    23.6  #include <public/arch-ia64.h>
    23.7 -#include <public/io/ioreq.h>
    23.8 +#include <public/hvm/ioreq.h>
    23.9  #include <asm/vmx_phy_mode.h>
   23.10  #include <asm/processor.h>
   23.11  #include <asm/vmx.h>
    24.1 --- a/xen/arch/ia64/vmx/vmx_support.c	Tue Jan 03 10:20:05 2006 -0600
    24.2 +++ b/xen/arch/ia64/vmx/vmx_support.c	Tue Jan 03 19:03:56 2006 +0100
    24.3 @@ -21,7 +21,7 @@
    24.4   */
    24.5  #include <xen/config.h>
    24.6  #include <xen/sched.h>
    24.7 -#include <public/io/ioreq.h>
    24.8 +#include <public/hvm/ioreq.h>
    24.9  #include <asm/vmx.h>
   24.10  #include <asm/vmx_vcpu.h>
   24.11  
    25.1 --- a/xen/arch/ia64/xen/domain.c	Tue Jan 03 10:20:05 2006 -0600
    25.2 +++ b/xen/arch/ia64/xen/domain.c	Tue Jan 03 19:03:56 2006 +0100
    25.3 @@ -46,7 +46,7 @@
    25.4  #include <asm/vmx_vcpu.h>
    25.5  #include <asm/vmx_vpd.h>
    25.6  #include <asm/pal.h>
    25.7 -#include <public/io/ioreq.h>
    25.8 +#include <public/hvm/ioreq.h>
    25.9  
   25.10  #define CONFIG_DOMAIN0_CONTIGUOUS
   25.11  unsigned long dom0_start = -1L;
    26.1 --- a/xen/arch/x86/dm/i8259.c	Tue Jan 03 10:20:05 2006 -0600
    26.2 +++ b/xen/arch/x86/dm/i8259.c	Tue Jan 03 19:03:56 2006 +0100
    26.3 @@ -29,7 +29,7 @@
    26.4  #include <xen/lib.h>
    26.5  #include <xen/errno.h>
    26.6  #include <xen/sched.h>
    26.7 -#include <public/io/ioreq.h>
    26.8 +#include <public/hvm/ioreq.h>
    26.9  #include <asm/vmx.h>
   26.10  #include <asm/vmx_vpic.h>
   26.11  #include <asm/current.h>
    27.1 --- a/xen/arch/x86/dm/vmx_vioapic.c	Tue Jan 03 10:20:05 2006 -0600
    27.2 +++ b/xen/arch/x86/dm/vmx_vioapic.c	Tue Jan 03 19:03:56 2006 +0100
    27.3 @@ -37,7 +37,7 @@
    27.4  #include <xen/lib.h>
    27.5  #include <xen/errno.h>
    27.6  #include <xen/sched.h>
    27.7 -#include <public/io/ioreq.h>
    27.8 +#include <public/hvm/ioreq.h>
    27.9  #include <asm/vmx.h>
   27.10  #include <asm/vmx_vpic.h>
   27.11  #include <asm/current.h>
    28.1 --- a/xen/arch/x86/vmx.c	Tue Jan 03 10:20:05 2006 -0600
    28.2 +++ b/xen/arch/x86/vmx.c	Tue Jan 03 19:03:56 2006 +0100
    28.3 @@ -42,7 +42,7 @@
    28.4  #include <asm/shadow_64.h>
    28.5  #endif
    28.6  #include <public/sched.h>
    28.7 -#include <public/io/ioreq.h>
    28.8 +#include <public/hvm/ioreq.h>
    28.9  #include <asm/vmx_vpic.h>
   28.10  #include <asm/vmx_vlapic.h>
   28.11  
   28.12 @@ -66,11 +66,6 @@ void vmx_final_setup_guest(struct vcpu *
   28.13          struct domain *d = v->domain;
   28.14          struct vcpu *vc;
   28.15  
   28.16 -        d->arch.vmx_platform.lapic_enable = v->arch.guest_context.user_regs.ecx;
   28.17 -        v->arch.guest_context.user_regs.ecx = 0;
   28.18 -        VMX_DBG_LOG(DBG_LEVEL_VLAPIC, "lapic enable is %d.\n",
   28.19 -                    d->arch.vmx_platform.lapic_enable);
   28.20 -
   28.21          /* Initialize monitor page table */
   28.22          for_each_vcpu(d, vc)
   28.23              vc->arch.monitor_table = mk_pagetable(0);
   28.24 @@ -95,7 +90,7 @@ void vmx_final_setup_guest(struct vcpu *
   28.25  void vmx_relinquish_resources(struct vcpu *v)
   28.26  {
   28.27      struct vmx_virpit *vpit;
   28.28 -    
   28.29 +
   28.30      if ( !VMX_DOMAIN(v) )
   28.31          return;
   28.32  
    29.1 --- a/xen/arch/x86/vmx_intercept.c	Tue Jan 03 10:20:05 2006 -0600
    29.2 +++ b/xen/arch/x86/vmx_intercept.c	Tue Jan 03 19:03:56 2006 +0100
    29.3 @@ -24,7 +24,7 @@
    29.4  #include <asm/vmx_vpit.h>
    29.5  #include <asm/vmx_intercept.h>
    29.6  #include <asm/vmx_vlapic.h>
    29.7 -#include <public/io/ioreq.h>
    29.8 +#include <public/hvm/ioreq.h>
    29.9  #include <xen/lib.h>
   29.10  #include <xen/sched.h>
   29.11  #include <asm/current.h>
    30.1 --- a/xen/arch/x86/vmx_io.c	Tue Jan 03 10:20:05 2006 -0600
    30.2 +++ b/xen/arch/x86/vmx_io.c	Tue Jan 03 19:03:56 2006 +0100
    30.3 @@ -37,7 +37,7 @@
    30.4  #include <asm/shadow.h>
    30.5  #include <asm/vmx_vpic.h>
    30.6  #include <asm/vmx_vlapic.h>
    30.7 -#include <public/io/ioreq.h>
    30.8 +#include <public/hvm/ioreq.h>
    30.9  
   30.10  #ifdef CONFIG_VMX
   30.11  #if defined (__i386__)
    31.1 --- a/xen/arch/x86/vmx_platform.c	Tue Jan 03 10:20:05 2006 -0600
    31.2 +++ b/xen/arch/x86/vmx_platform.c	Tue Jan 03 19:03:56 2006 +0100
    31.3 @@ -27,7 +27,7 @@
    31.4  #include <xen/trace.h>
    31.5  #include <asm/vmx.h>
    31.6  #include <asm/vmx_platform.h>
    31.7 -#include <public/io/ioreq.h>
    31.8 +#include <public/hvm/ioreq.h>
    31.9  
   31.10  #include <xen/lib.h>
   31.11  #include <xen/sched.h>
    32.1 --- a/xen/arch/x86/vmx_vlapic.c	Tue Jan 03 10:20:05 2006 -0600
    32.2 +++ b/xen/arch/x86/vmx_vlapic.c	Tue Jan 03 19:03:56 2006 +0100
    32.3 @@ -32,7 +32,7 @@
    32.4  #include <xen/lib.h>
    32.5  #include <xen/sched.h>
    32.6  #include <asm/current.h>
    32.7 -#include <public/io/ioreq.h>
    32.8 +#include <public/hvm/ioreq.h>
    32.9  
   32.10  #ifdef CONFIG_VMX
   32.11  
   32.12 @@ -62,7 +62,7 @@ int vlapic_find_highest_irr(struct vlapi
   32.13  
   32.14  int vmx_apic_support(struct domain *d)
   32.15  {
   32.16 -    return d->arch.vmx_platform.lapic_enable;
   32.17 +    return d->arch.vmx_platform.apic_enabled;
   32.18  }
   32.19  
   32.20  s_time_t get_apictime_scheduled(struct vcpu *v)
    33.1 --- a/xen/arch/x86/vmx_vmcs.c	Tue Jan 03 10:20:05 2006 -0600
    33.2 +++ b/xen/arch/x86/vmx_vmcs.c	Tue Jan 03 19:03:56 2006 +0100
    33.3 @@ -32,7 +32,7 @@
    33.4  #include <asm/flushtlb.h>
    33.5  #include <xen/event.h>
    33.6  #include <xen/kernel.h>
    33.7 -#include <public/io/ioreq.h>
    33.8 +#include <public/hvm/hvm_info_table.h>
    33.9  #if CONFIG_PAGING_LEVELS >= 4
   33.10  #include <asm/shadow_64.h>
   33.11  #endif
   33.12 @@ -206,36 +206,56 @@ static void vmx_map_io_shared_page(struc
   33.13                &d->shared_info->evtchn_mask[0]);
   33.14  }
   33.15  
   33.16 -#define VCPU_NR_PAGE        0x0009F000
   33.17 -#define VCPU_NR_OFFSET      0x00000800
   33.18 -#define VCPU_MAGIC          0x76637075  /* "vcpu" */
   33.19 +static int validate_hvm_info(struct hvm_info_table *t)
   33.20 +{
   33.21 +    char signature[] = "HVM INFO";
   33.22 +    uint8_t *ptr = (uint8_t *)t;
   33.23 +    uint8_t sum = 0;
   33.24 +    int i;
   33.25  
   33.26 -static void vmx_set_vcpu_nr(struct domain *d)
   33.27 +    /* strncmp(t->signature, "HVM INFO", 8) */
   33.28 +    for ( i = 0; i < 8; i++ ) {
   33.29 +        if ( signature[i] != t->signature[i] ) {
   33.30 +            printk("Bad hvm info signature\n");
   33.31 +            return 0;
   33.32 +        }
   33.33 +    }
   33.34 +
   33.35 +    for ( i = 0; i < t->length; i++ )
   33.36 +        sum += ptr[i];
   33.37 +
   33.38 +    return (sum == 0);
   33.39 +}
   33.40 +
   33.41 +static void vmx_get_hvm_info(struct domain *d)
   33.42  {
   33.43      unsigned char *p;
   33.44      unsigned long mpfn;
   33.45 -    unsigned int *vcpus;
   33.46 +    struct hvm_info_table *t;
   33.47  
   33.48 -    mpfn = get_mfn_from_pfn(VCPU_NR_PAGE >> PAGE_SHIFT);
   33.49 -    if (mpfn == INVALID_MFN) {
   33.50 -        printk("Can not get vcpu number page mfn for VMX domain.\n");
   33.51 +    mpfn = get_mfn_from_pfn(HVM_INFO_PFN);
   33.52 +    if ( mpfn == INVALID_MFN ) {
   33.53 +        printk("Can not get hvm info page mfn for VMX domain.\n");
   33.54          domain_crash_synchronous();
   33.55      }
   33.56  
   33.57      p = map_domain_page(mpfn);
   33.58 -    if (p == NULL) {
   33.59 -        printk("Can not map vcpu number page for VMX domain.\n");
   33.60 +    if ( p == NULL ) {
   33.61 +        printk("Can not map hvm info page for VMX domain.\n");
   33.62          domain_crash_synchronous();
   33.63      }
   33.64  
   33.65 -    vcpus = (unsigned int *)(p + VCPU_NR_OFFSET);
   33.66 -    if (vcpus[0] != VCPU_MAGIC) {
   33.67 -        printk("Bad vcpus magic, set vcpu number to 1 by default.\n");
   33.68 -        d->arch.vmx_platform.nr_vcpu = 1;
   33.69 +    t = (struct hvm_info_table *)(p + HVM_INFO_OFFSET);
   33.70 +
   33.71 +    if ( validate_hvm_info(t) ) {
   33.72 +        d->arch.vmx_platform.nr_vcpus = t->nr_vcpus;
   33.73 +        d->arch.vmx_platform.apic_enabled = t->apic_enabled;
   33.74 +    } else {
   33.75 +        printk("Bad hvm info table\n");
   33.76 +        d->arch.vmx_platform.nr_vcpus = 1;
   33.77 +        d->arch.vmx_platform.apic_enabled = 0;
   33.78      }
   33.79  
   33.80 -    d->arch.vmx_platform.nr_vcpu = vcpus[1];
   33.81 -
   33.82      unmap_domain_page(p);
   33.83  }
   33.84  
   33.85 @@ -244,10 +264,10 @@ static void vmx_setup_platform(struct do
   33.86      struct vmx_platform *platform;
   33.87  
   33.88      vmx_map_io_shared_page(d);
   33.89 -    vmx_set_vcpu_nr(d);
   33.90 +    vmx_get_hvm_info(d);
   33.91  
   33.92      platform = &d->arch.vmx_platform;
   33.93 -    pic_init(&platform->vmx_pic,  pic_irq_request, 
   33.94 +    pic_init(&platform->vmx_pic,  pic_irq_request,
   33.95               &platform->interrupt_request);
   33.96      register_pic_io_hook();
   33.97  
    34.1 --- a/xen/include/asm-ia64/vmx.h	Tue Jan 03 10:20:05 2006 -0600
    34.2 +++ b/xen/include/asm-ia64/vmx.h	Tue Jan 03 19:03:56 2006 +0100
    34.3 @@ -23,7 +23,7 @@
    34.4  #define _ASM_IA64_VT_H
    34.5  
    34.6  #define RR7_SWITCH_SHIFT	12	/* 4k enough */
    34.7 -#include <public/io/ioreq.h>
    34.8 +#include <public/hvm/ioreq.h>
    34.9  
   34.10  extern void identify_vmx_feature(void);
   34.11  extern unsigned int vmx_enabled;
    35.1 --- a/xen/include/asm-x86/vmx.h	Tue Jan 03 10:20:05 2006 -0600
    35.2 +++ b/xen/include/asm-x86/vmx.h	Tue Jan 03 19:03:56 2006 +0100
    35.3 @@ -26,7 +26,7 @@
    35.4  #include <asm/vmx_vmcs.h>
    35.5  #include <asm/i387.h>
    35.6  
    35.7 -#include <public/io/ioreq.h>
    35.8 +#include <public/hvm/ioreq.h>
    35.9  
   35.10  extern int hvm_enabled;
   35.11  
   35.12 @@ -506,7 +506,7 @@ static inline int vmx_reflect_exception(
   35.13  
   35.14  static inline unsigned int vmx_get_vcpu_nr(struct domain *d)
   35.15  {
   35.16 -    return d->arch.vmx_platform.nr_vcpu;
   35.17 +    return d->arch.vmx_platform.nr_vcpus;
   35.18  }
   35.19  
   35.20  static inline shared_iopage_t *get_sp(struct domain *d)
    36.1 --- a/xen/include/asm-x86/vmx_intercept.h	Tue Jan 03 10:20:05 2006 -0600
    36.2 +++ b/xen/include/asm-x86/vmx_intercept.h	Tue Jan 03 19:03:56 2006 +0100
    36.3 @@ -6,7 +6,7 @@
    36.4  #include <xen/lib.h>
    36.5  #include <xen/time.h>
    36.6  #include <xen/errno.h>
    36.7 -#include <public/io/ioreq.h>
    36.8 +#include <public/hvm/ioreq.h>
    36.9  
   36.10  #define MAX_IO_HANDLER              8
   36.11  
    37.1 --- a/xen/include/asm-x86/vmx_platform.h	Tue Jan 03 10:20:05 2006 -0600
    37.2 +++ b/xen/include/asm-x86/vmx_platform.h	Tue Jan 03 19:03:56 2006 +0100
    37.3 @@ -33,10 +33,10 @@
    37.4      (((size_reg) << 24) | ((index) << 16) | ((seg) << 8) | (flag))
    37.5  
    37.6  #define operand_size(operand)   \
    37.7 -      ((operand >> 24) & 0xFF)
    37.8 +    ((operand >> 24) & 0xFF)
    37.9  
   37.10  #define operand_index(operand)  \
   37.11 -      ((operand >> 16) & 0xFF)
   37.12 +    ((operand >> 16) & 0xFF)
   37.13  
   37.14  /* for instruction.operand[].size */
   37.15  #define BYTE    1
   37.16 @@ -81,13 +81,13 @@ struct instruction {
   37.17  
   37.18  struct vmx_platform {
   37.19      unsigned long          shared_page_va;
   37.20 -    unsigned int           nr_vcpu;
   37.21 -    unsigned int           lapic_enable;
   37.22 +    unsigned int           nr_vcpus;
   37.23 +    unsigned int           apic_enabled;
   37.24  
   37.25      struct vmx_virpit      vmx_pit;
   37.26      struct vmx_io_handler  vmx_io_handler;
   37.27      struct vmx_virpic      vmx_pic;
   37.28 -    struct vmx_vioapic      vmx_vioapic;
   37.29 +    struct vmx_vioapic     vmx_vioapic;
   37.30      unsigned char          round_info[256];
   37.31      spinlock_t             round_robin_lock;
   37.32      int                    interrupt_request;
    38.1 --- a/xen/include/asm-x86/vmx_vlapic.h	Tue Jan 03 10:20:05 2006 -0600
    38.2 +++ b/xen/include/asm-x86/vmx_vlapic.h	Tue Jan 03 19:03:56 2006 +0100
    38.3 @@ -21,7 +21,7 @@
    38.4  #define VMX_VLAPIC_H
    38.5  
    38.6  #include <asm/msr.h>
    38.7 -#include <public/io/ioreq.h>
    38.8 +#include <public/hvm/ioreq.h>
    38.9  
   38.10  #if defined(__i386__) || defined(__x86_64__)
   38.11  static inline int __fls(uint32_t word)
    39.1 --- a/xen/include/asm-x86/vmx_vmcs.h	Tue Jan 03 10:20:05 2006 -0600
    39.2 +++ b/xen/include/asm-x86/vmx_vmcs.h	Tue Jan 03 19:03:56 2006 +0100
    39.3 @@ -23,7 +23,7 @@
    39.4  #include <asm/vmx_cpu.h>
    39.5  #include <asm/vmx_platform.h>
    39.6  #include <asm/vmx_vlapic.h>
    39.7 -#include <public/vmx_assist.h>
    39.8 +#include <public/hvm/vmx_assist.h>
    39.9  
   39.10  extern int start_vmx(void);
   39.11  extern void stop_vmx(void);
    40.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    40.2 +++ b/xen/include/public/hvm/hvm_info_table.h	Tue Jan 03 19:03:56 2006 +0100
    40.3 @@ -0,0 +1,24 @@
    40.4 +/******************************************************************************
    40.5 + * hvm/hvm_info_table.h
    40.6 + * 
    40.7 + * HVM parameter and information table, written into guest memory map.
    40.8 + */
    40.9 +
   40.10 +#ifndef __XEN_PUBLIC_HVM_HVM_INFO_TABLE_H__
   40.11 +#define __XEN_PUBLIC_HVM_HVM_INFO_TABLE_H__
   40.12 +
   40.13 +#define HVM_INFO_PFN         0x09F
   40.14 +#define HVM_INFO_OFFSET      0x800
   40.15 +#define HVM_INFO_PADDR       ((HVM_INFO_PFN << 12) + HVM_INFO_OFFSET)
   40.16 +
   40.17 +struct hvm_info_table {
   40.18 +    char        signature[8]; /* "HVM INFO" */
   40.19 +    uint32_t    length;
   40.20 +    uint8_t     checksum;
   40.21 +    uint8_t     acpi_enabled;
   40.22 +    uint8_t     apic_enabled;
   40.23 +    uint8_t     pad[1];
   40.24 +    uint32_t    nr_vcpus;
   40.25 +};
   40.26 +
   40.27 +#endif /* __XEN_PUBLIC_HVM_HVM_INFO_TABLE_H__ */
    41.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    41.2 +++ b/xen/include/public/hvm/ioreq.h	Tue Jan 03 19:03:56 2006 +0100
    41.3 @@ -0,0 +1,90 @@
    41.4 +/*
    41.5 + * ioreq.h: I/O request definitions for device models
    41.6 + * Copyright (c) 2004, Intel Corporation.
    41.7 + *
    41.8 + * This program is free software; you can redistribute it and/or modify it
    41.9 + * under the terms and conditions of the GNU General Public License,
   41.10 + * version 2, as published by the Free Software Foundation.
   41.11 + *
   41.12 + * This program is distributed in the hope it will be useful, but WITHOUT
   41.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   41.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   41.15 + * more details.
   41.16 + *
   41.17 + * You should have received a copy of the GNU General Public License along with
   41.18 + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
   41.19 + * Place - Suite 330, Boston, MA 02111-1307 USA.
   41.20 + *
   41.21 + */
   41.22 +
   41.23 +#ifndef _IOREQ_H_
   41.24 +#define _IOREQ_H_
   41.25 +
   41.26 +#define IOREQ_READ      1
   41.27 +#define IOREQ_WRITE     0
   41.28 +
   41.29 +#define STATE_INVALID           0
   41.30 +#define STATE_IOREQ_READY       1
   41.31 +#define STATE_IOREQ_INPROCESS   2
   41.32 +#define STATE_IORESP_READY      3
   41.33 +#define STATE_IORESP_HOOK       4
   41.34 +
   41.35 +#define IOREQ_TYPE_PIO          0 /* pio */
   41.36 +#define IOREQ_TYPE_COPY         1 /* mmio ops */
   41.37 +#define IOREQ_TYPE_AND          2
   41.38 +#define IOREQ_TYPE_OR           3
   41.39 +#define IOREQ_TYPE_XOR          4
   41.40 +
   41.41 +/*
   41.42 + * VMExit dispatcher should cooperate with instruction decoder to
   41.43 + * prepare this structure and notify service OS and DM by sending
   41.44 + * virq
   41.45 + */
   41.46 +typedef struct {
   41.47 +    uint64_t addr;          /*  physical address            */
   41.48 +    uint64_t size;          /*  size in bytes               */
   41.49 +    uint64_t count;         /*  for rep prefixes            */
   41.50 +    union {
   41.51 +        uint64_t data;      /*  data                        */
   41.52 +        void    *pdata;     /*  pointer to data             */
   41.53 +    } u;
   41.54 +    uint8_t state:4;
   41.55 +    uint8_t pdata_valid:1;  /* if 1, use pdata above        */
   41.56 +    uint8_t dir:1;          /*  1=read, 0=write             */
   41.57 +    uint8_t df:1;
   41.58 +    uint8_t type;           /* I/O type                     */
   41.59 +} ioreq_t;
   41.60 +
   41.61 +#define MAX_VECTOR      256
   41.62 +#define BITS_PER_BYTE   8
   41.63 +#define INTR_LEN        (MAX_VECTOR/(BITS_PER_BYTE * sizeof(uint64_t)))
   41.64 +#define INTR_LEN_32     (MAX_VECTOR/(BITS_PER_BYTE * sizeof(uint32_t)))
   41.65 +
   41.66 +typedef struct {
   41.67 +    uint16_t    pic_elcr;
   41.68 +    uint16_t    pic_irr;
   41.69 +    uint16_t    pic_last_irr;
   41.70 +    uint16_t    pic_clear_irr;
   41.71 +    int         eport; /* Event channel port */
   41.72 +} global_iodata_t;
   41.73 +
   41.74 +typedef struct {
   41.75 +    ioreq_t     vp_ioreq;
   41.76 +} vcpu_iodata_t;
   41.77 +
   41.78 +typedef struct {
   41.79 +    global_iodata_t sp_global;
   41.80 +    vcpu_iodata_t   vcpu_iodata[1];
   41.81 +} shared_iopage_t;
   41.82 +
   41.83 +#endif /* _IOREQ_H_ */
   41.84 +
   41.85 +/*
   41.86 + * Local variables:
   41.87 + * mode: C
   41.88 + * c-set-style: "BSD"
   41.89 + * c-basic-offset: 4
   41.90 + * tab-width: 4
   41.91 + * indent-tabs-mode: nil
   41.92 + * End:
   41.93 + */
    42.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    42.2 +++ b/xen/include/public/hvm/vmx_assist.h	Tue Jan 03 19:03:56 2006 +0100
    42.3 @@ -0,0 +1,97 @@
    42.4 +/*
    42.5 + * vmx_assist.h: Context definitions for the VMXASSIST world switch.
    42.6 + *
    42.7 + * Leendert van Doorn, leendert@watson.ibm.com
    42.8 + * Copyright (c) 2005, International Business Machines Corporation.
    42.9 + */
   42.10 +
   42.11 +#ifndef _VMX_ASSIST_H_
   42.12 +#define _VMX_ASSIST_H_
   42.13 +
   42.14 +#define VMXASSIST_BASE         0xD0000
   42.15 +#define VMXASSIST_MAGIC        0x17101966
   42.16 +#define VMXASSIST_MAGIC_OFFSET (VMXASSIST_BASE+8)
   42.17 +
   42.18 +#define VMXASSIST_NEW_CONTEXT (VMXASSIST_BASE + 12)
   42.19 +#define VMXASSIST_OLD_CONTEXT (VMXASSIST_NEW_CONTEXT + 4)
   42.20 +
   42.21 +#ifndef __ASSEMBLY__
   42.22 +
   42.23 +union vmcs_arbytes {
   42.24 +    struct arbyte_fields {
   42.25 +        unsigned int seg_type : 4,
   42.26 +            s         : 1,
   42.27 +            dpl       : 2,
   42.28 +            p         : 1, 
   42.29 +            reserved0 : 4,
   42.30 +            avl       : 1,
   42.31 +            reserved1 : 1,     
   42.32 +            default_ops_size: 1,
   42.33 +            g         : 1,
   42.34 +            null_bit  : 1, 
   42.35 +            reserved2 : 15;
   42.36 +    } fields;
   42.37 +    unsigned int bytes;
   42.38 +};
   42.39 +
   42.40 +/*
   42.41 + * World switch state
   42.42 + */
   42.43 +typedef struct vmx_assist_context {
   42.44 +    uint32_t  eip;        /* execution pointer */
   42.45 +    uint32_t  esp;        /* stack pointer */
   42.46 +    uint32_t  eflags;     /* flags register */
   42.47 +    uint32_t  cr0;
   42.48 +    uint32_t  cr3;        /* page table directory */
   42.49 +    uint32_t  cr4;
   42.50 +    uint32_t  idtr_limit; /* idt */
   42.51 +    uint32_t  idtr_base;
   42.52 +    uint32_t  gdtr_limit; /* gdt */
   42.53 +    uint32_t  gdtr_base;
   42.54 +    uint32_t  cs_sel;     /* cs selector */
   42.55 +    uint32_t  cs_limit;
   42.56 +    uint32_t  cs_base;
   42.57 +    union vmcs_arbytes cs_arbytes;
   42.58 +    uint32_t  ds_sel;     /* ds selector */
   42.59 +    uint32_t  ds_limit;
   42.60 +    uint32_t  ds_base;
   42.61 +    union vmcs_arbytes ds_arbytes;
   42.62 +    uint32_t  es_sel;     /* es selector */
   42.63 +    uint32_t  es_limit;
   42.64 +    uint32_t  es_base;
   42.65 +    union vmcs_arbytes es_arbytes;
   42.66 +    uint32_t  ss_sel;     /* ss selector */
   42.67 +    uint32_t  ss_limit;
   42.68 +    uint32_t  ss_base;
   42.69 +    union vmcs_arbytes ss_arbytes;
   42.70 +    uint32_t  fs_sel;     /* fs selector */
   42.71 +    uint32_t  fs_limit;
   42.72 +    uint32_t  fs_base;
   42.73 +    union vmcs_arbytes fs_arbytes;
   42.74 +    uint32_t  gs_sel;     /* gs selector */
   42.75 +    uint32_t  gs_limit;
   42.76 +    uint32_t  gs_base;
   42.77 +    union vmcs_arbytes gs_arbytes;
   42.78 +    uint32_t  tr_sel;     /* task selector */
   42.79 +    uint32_t  tr_limit;
   42.80 +    uint32_t  tr_base;
   42.81 +    union vmcs_arbytes tr_arbytes;
   42.82 +    uint32_t  ldtr_sel;   /* ldtr selector */
   42.83 +    uint32_t  ldtr_limit;
   42.84 +    uint32_t  ldtr_base;
   42.85 +    union vmcs_arbytes ldtr_arbytes;
   42.86 +} vmx_assist_context_t;
   42.87 +
   42.88 +#endif /* __ASSEMBLY__ */
   42.89 +
   42.90 +#endif /* _VMX_ASSIST_H_ */
   42.91 +
   42.92 +/*
   42.93 + * Local variables:
   42.94 + * mode: C
   42.95 + * c-set-style: "BSD"
   42.96 + * c-basic-offset: 4
   42.97 + * tab-width: 4
   42.98 + * indent-tabs-mode: nil
   42.99 + * End:
  42.100 + */
    43.1 --- a/xen/include/public/io/ioreq.h	Tue Jan 03 10:20:05 2006 -0600
    43.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    43.3 @@ -1,91 +0,0 @@
    43.4 -/*
    43.5 - * ioreq.h: I/O request definitions for device models
    43.6 - * Copyright (c) 2004, Intel Corporation.
    43.7 - *
    43.8 - * This program is free software; you can redistribute it and/or modify it
    43.9 - * under the terms and conditions of the GNU General Public License,
   43.10 - * version 2, as published by the Free Software Foundation.
   43.11 - *
   43.12 - * This program is distributed in the hope it will be useful, but WITHOUT
   43.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   43.14 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   43.15 - * more details.
   43.16 - *
   43.17 - * You should have received a copy of the GNU General Public License along with
   43.18 - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
   43.19 - * Place - Suite 330, Boston, MA 02111-1307 USA.
   43.20 - *
   43.21 - */
   43.22 -
   43.23 -#ifndef _IOREQ_H_
   43.24 -#define _IOREQ_H_
   43.25 -
   43.26 -#define IOREQ_READ      1
   43.27 -#define IOREQ_WRITE     0
   43.28 -
   43.29 -#define STATE_INVALID           0
   43.30 -#define STATE_IOREQ_READY       1
   43.31 -#define STATE_IOREQ_INPROCESS   2
   43.32 -#define STATE_IORESP_READY      3
   43.33 -#define STATE_IORESP_HOOK       4
   43.34 -
   43.35 -#define IOREQ_TYPE_PIO          0 /* pio */
   43.36 -#define IOREQ_TYPE_COPY         1 /* mmio ops */
   43.37 -#define IOREQ_TYPE_AND          2
   43.38 -#define IOREQ_TYPE_OR           3
   43.39 -#define IOREQ_TYPE_XOR          4
   43.40 -
   43.41 -/*
   43.42 - * VMExit dispatcher should cooperate with instruction decoder to
   43.43 - * prepare this structure and notify service OS and DM by sending
   43.44 - * virq 
   43.45 - */
   43.46 -typedef struct {
   43.47 -    uint64_t addr;   /*  physical address            */
   43.48 -    uint64_t size;   /*  size in bytes               */
   43.49 -    uint64_t count;  /*  for rep prefixes            */
   43.50 -    union {
   43.51 -        uint64_t data;           /*  data                        */
   43.52 -        void    *pdata;          /*  pointer to data             */
   43.53 -    } u;
   43.54 -    uint8_t state:4;
   43.55 -    uint8_t pdata_valid:1; /* if 1, use pdata above  */
   43.56 -    uint8_t dir:1;   /*  1=read, 0=write             */
   43.57 -    uint8_t df:1;
   43.58 -    uint8_t type;    /* I/O type                     */
   43.59 -} ioreq_t;
   43.60 -
   43.61 -#define MAX_VECTOR      256
   43.62 -#define BITS_PER_BYTE   8
   43.63 -#define INTR_LEN        (MAX_VECTOR/(BITS_PER_BYTE * sizeof(uint64_t)))
   43.64 -#define INTR_LEN_32     (MAX_VECTOR/(BITS_PER_BYTE * sizeof(uint32_t)))
   43.65 -
   43.66 -typedef struct {
   43.67 -    uint16_t  pic_elcr;
   43.68 -    uint16_t   pic_irr;
   43.69 -    uint16_t   pic_last_irr;
   43.70 -    uint16_t   pic_clear_irr;
   43.71 -    int      eport; /* Event channel port */
   43.72 -} global_iodata_t;
   43.73 -
   43.74 -typedef struct {
   43.75 -    ioreq_t       vp_ioreq;
   43.76 -    unsigned long vp_intr[INTR_LEN];
   43.77 -} vcpu_iodata_t;
   43.78 -
   43.79 -typedef struct {
   43.80 -    global_iodata_t sp_global;
   43.81 -    vcpu_iodata_t   vcpu_iodata[1];
   43.82 -} shared_iopage_t;
   43.83 -
   43.84 -#endif /* _IOREQ_H_ */
   43.85 -
   43.86 -/*
   43.87 - * Local variables:
   43.88 - * mode: C
   43.89 - * c-set-style: "BSD"
   43.90 - * c-basic-offset: 4
   43.91 - * tab-width: 4
   43.92 - * indent-tabs-mode: nil
   43.93 - * End:
   43.94 - */
    44.1 --- a/xen/include/public/vmx_assist.h	Tue Jan 03 10:20:05 2006 -0600
    44.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    44.3 @@ -1,97 +0,0 @@
    44.4 -/*
    44.5 - * vmx_assist.h: Context definitions for the VMXASSIST world switch.
    44.6 - *
    44.7 - * Leendert van Doorn, leendert@watson.ibm.com
    44.8 - * Copyright (c) 2005, International Business Machines Corporation.
    44.9 - */
   44.10 -
   44.11 -#ifndef _VMX_ASSIST_H_
   44.12 -#define _VMX_ASSIST_H_
   44.13 -
   44.14 -#define VMXASSIST_BASE         0xD0000
   44.15 -#define VMXASSIST_MAGIC        0x17101966
   44.16 -#define VMXASSIST_MAGIC_OFFSET (VMXASSIST_BASE+8)
   44.17 -
   44.18 -#define VMXASSIST_NEW_CONTEXT (VMXASSIST_BASE + 12)
   44.19 -#define VMXASSIST_OLD_CONTEXT (VMXASSIST_NEW_CONTEXT + 4)
   44.20 -
   44.21 -#ifndef __ASSEMBLY__
   44.22 -
   44.23 -union vmcs_arbytes {
   44.24 -    struct arbyte_fields {
   44.25 -        unsigned int seg_type : 4,
   44.26 -            s         : 1,
   44.27 -            dpl       : 2,
   44.28 -            p         : 1, 
   44.29 -            reserved0 : 4,
   44.30 -            avl       : 1,
   44.31 -            reserved1 : 1,     
   44.32 -            default_ops_size: 1,
   44.33 -            g         : 1,
   44.34 -            null_bit  : 1, 
   44.35 -            reserved2 : 15;
   44.36 -    } fields;
   44.37 -    unsigned int bytes;
   44.38 -};
   44.39 -
   44.40 -/*
   44.41 - * World switch state
   44.42 - */
   44.43 -typedef struct vmx_assist_context {
   44.44 -    uint32_t  eip;        /* execution pointer */
   44.45 -    uint32_t  esp;        /* stack pointer */
   44.46 -    uint32_t  eflags;     /* flags register */
   44.47 -    uint32_t  cr0;
   44.48 -    uint32_t  cr3;        /* page table directory */
   44.49 -    uint32_t  cr4;
   44.50 -    uint32_t  idtr_limit; /* idt */
   44.51 -    uint32_t  idtr_base;
   44.52 -    uint32_t  gdtr_limit; /* gdt */
   44.53 -    uint32_t  gdtr_base;
   44.54 -    uint32_t  cs_sel;     /* cs selector */
   44.55 -    uint32_t  cs_limit;
   44.56 -    uint32_t  cs_base;
   44.57 -    union vmcs_arbytes cs_arbytes;
   44.58 -    uint32_t  ds_sel;     /* ds selector */
   44.59 -    uint32_t  ds_limit;
   44.60 -    uint32_t  ds_base;
   44.61 -    union vmcs_arbytes ds_arbytes;
   44.62 -    uint32_t  es_sel;     /* es selector */
   44.63 -    uint32_t  es_limit;
   44.64 -    uint32_t  es_base;
   44.65 -    union vmcs_arbytes es_arbytes;
   44.66 -    uint32_t  ss_sel;     /* ss selector */
   44.67 -    uint32_t  ss_limit;
   44.68 -    uint32_t  ss_base;
   44.69 -    union vmcs_arbytes ss_arbytes;
   44.70 -    uint32_t  fs_sel;     /* fs selector */
   44.71 -    uint32_t  fs_limit;
   44.72 -    uint32_t  fs_base;
   44.73 -    union vmcs_arbytes fs_arbytes;
   44.74 -    uint32_t  gs_sel;     /* gs selector */
   44.75 -    uint32_t  gs_limit;
   44.76 -    uint32_t  gs_base;
   44.77 -    union vmcs_arbytes gs_arbytes;
   44.78 -    uint32_t  tr_sel;     /* task selector */
   44.79 -    uint32_t  tr_limit;
   44.80 -    uint32_t  tr_base;
   44.81 -    union vmcs_arbytes tr_arbytes;
   44.82 -    uint32_t  ldtr_sel;   /* ldtr selector */
   44.83 -    uint32_t  ldtr_limit;
   44.84 -    uint32_t  ldtr_base;
   44.85 -    union vmcs_arbytes ldtr_arbytes;
   44.86 -} vmx_assist_context_t;
   44.87 -
   44.88 -#endif /* __ASSEMBLY__ */
   44.89 -
   44.90 -#endif /* _VMX_ASSIST_H_ */
   44.91 -
   44.92 -/*
   44.93 - * Local variables:
   44.94 - * mode: C
   44.95 - * c-set-style: "BSD"
   44.96 - * c-basic-offset: 4
   44.97 - * tab-width: 4
   44.98 - * indent-tabs-mode: nil
   44.99 - * End:
  44.100 - */