ia64/xen-unstable

changeset 18326:da236d7f59b9

merge with xen-unstable.hg
author Isaku Yamahata <yamahata@valinux.co.jp>
date Wed Aug 13 22:22:21 2008 +0900 (2008-08-13)
parents fa8be8a6cb74 c6402709acc8
children 3ad6ad720f90
files
line diff
     1.1 --- a/.hgtags	Wed Aug 13 13:18:06 2008 +0900
     1.2 +++ b/.hgtags	Wed Aug 13 22:22:21 2008 +0900
     1.3 @@ -28,3 +28,4 @@ 9facc624a238f2b9437b07fa28ff65884aa867f2
     1.4  c3494402098e26507fc61a6579832c0149351d6a 3.3.0-rc1
     1.5  dde12ff94c96331668fe38a7b09506fa94d03c34 3.3.0-rc2
     1.6  57fca3648f25dcc085ee380954342960a7979987 3.3.0-rc3
     1.7 +96d0a48e87ee46ba7b73e8c906a7e2e0baf60e2e 3.3.0-rc4
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/docs/misc/kexec_and_kdump.txt	Wed Aug 13 22:22:21 2008 +0900
     3.3 @@ -0,0 +1,213 @@
     3.4 +
     3.5 +=======================
     3.6 +Kexec and Kdump for Xen
     3.7 +=======================
     3.8 +
     3.9 +This is a breif guide to using Kexec and Kdump in conjunction with Xen.
    3.10 +This functionaly works at the level of the hypervisor and dom0 kernel.
    3.11 +And will thus affect all guests running on a machine.
    3.12 +
    3.13 +At this stage it does not work in conjunction with domU kernels.
    3.14 +
    3.15 +This document should be read in conjunction with
    3.16 +Documentation/kdump/kdump.txt from the Linux kernel source.
    3.17 +Some of the information in this document has been
    3.18 +sourced from that document.
    3.19 +
    3.20 +
    3.21 +Kexec
    3.22 +=====
    3.23 +
    3.24 +It is possible to kexec from Xen or Linux to either Xen or Linux.
    3.25 +
    3.26 +Pattern        | Before Kexec       | After Kexec
    3.27 +---------------+--------------------+--------------------
    3.28 +Xen -> Xen     | first hypervisor & | second hypervisor &
    3.29 +               | dom0 kernel        | dom0 kernel
    3.30 +---------------+--------------------+--------------------
    3.31 +Xen   -> Linux | first hypervisor & | second kernel
    3.32 +               | dom0 kernel        |
    3.33 +---------------+--------------------+--------------------
    3.34 +Linux -> Xen   | first kernel       | second hypervisor &
    3.35 +               |                    | dom0 kernel
    3.36 +---------------+--------------------+--------------------
    3.37 +Linux -> Linux | first kernel       | second kernel
    3.38 +
    3.39 +If you are kexecing to Xen then you will also need to preapare the second
    3.40 +hypervisor and dom0 kernel that will run after kexec. These may be the same
    3.41 +as the first hypervisor and dom0 kernel that are used before kexec if you
    3.42 +are kexecing from Xen to Xen.
    3.43 +
    3.44 +If you are kexecing to Linux then you will need to prepare the second Linux
    3.45 +kernel that will run after kexec. In the case that you are kexecing from
    3.46 +Linux, it may be the same as the first kernel image that that runs before
    3.47 +kexec.
    3.48 +
    3.49 +Regardless of which kexec pattern you wish to run, you will
    3.50 +need to have kexec-tools installed. This provides the kexec command.
    3.51 +
    3.52 +1. Load
    3.53 +-------
    3.54 +
    3.55 +Before kexecing the second kernel or hypervisor & dom0 kernel
    3.56 +need to be loaded into the running hypervisor or kernel using
    3.57 +the kexec command.
    3.58 +
    3.59 +  a. To kexec to Xen (Xen->Xen or Linux->Xen)
    3.60 +
    3.61 +  kexec -l --append="XEN_ARGS -- DOM0_ARGS" \
    3.62 +	--vmm="XEN_IMAGE" "DOM0_IMAGE" KEXEC_ARGS
    3.63 +
    3.64 +  where:
    3.65 +    XEN_ARGS: command line arguments to the xen hypervisor
    3.66 +              On x86 the no-real-mode argument should be included
    3.67 +    DOM0_ARGS: command line arguments to the dom0 kernel
    3.68 +    XEN_IMAGE: xen hypervisor image
    3.69 +    DOM0_IMAGE: dom0 kernel image
    3.70 +    KEXEC_ARGS: additional kexec-tools command line arguments
    3.71 +
    3.72 +  e.g. kexec -l --append "no-real-mode" --vmm="/boot/xen.gz" /boot/vmlinuz.gz
    3.73 +
    3.74 +  OR
    3.75 +
    3.76 +  b. To kexec to Linux (Xen->Linux or Linux->Linux)
    3.77 +
    3.78 +  kexec -l LINUX_IMAGE --append "$LINUX_ARGS" KEXEC_ARGS
    3.79 +
    3.80 +  where:
    3.81 +    LINUX_IMAGE: the second linux kernel image
    3.82 +    LINUX_ARGS: command line arguments to the second linux kernel
    3.83 +    KEXEC_ARGS: additional kexec-tools command line arguments
    3.84 +
    3.85 +  e.g. kexec -l /boot/second-vmlinuz.gz
    3.86 +
    3.87 +2. Execute
    3.88 +----------
    3.89 +
    3.90 +Once the second kernel is loaded, it can be executed at any time.
    3.91 +If you don't see the second kernel booting within a second or so,
    3.92 +you are in trouble :(
    3.93 +
    3.94 +   kexec -e
    3.95 +
    3.96 +Kdump
    3.97 +=====
    3.98 +
    3.99 +It is possible to kdump from Xen or Linux to a Linux crash kernel.
   3.100 +It is not possible to use xen as a crash kernel.
   3.101 +
   3.102 +Pattern        | Before Kexec       | After Kexec
   3.103 +---------------+--------------------+--------------------
   3.104 +Xen -> Linux   | first hypervisor & | crash kernel
   3.105 +               | dom0 kernel        |
   3.106 +---------------+--------------------+--------------------
   3.107 +Linux -> Linux | first kernel       | crash kernel
   3.108 +
   3.109 +Regardless of if you are kdumping from Xen or Linux you will need to
   3.110 +prepare a linux crash kernel.  You will also need to have kexec-tools
   3.111 +installed. This provides the kexec command.
   3.112 +
   3.113 +0. Set-Up The Crash Kernel Region
   3.114 +---------------------------------
   3.115 +
   3.116 +In order to use kdump an area of memory has to be reserved at boot time.
   3.117 +This is the area of memory that the crash kernel will use, thus allowing it
   3.118 +to run without disrupting the memory used by the first kernel. This area is
   3.119 +called the crash kernel region and is reserved using the crashkernel
   3.120 +command line parameter to the Xen hypervisor. It has two forms:
   3.121 +
   3.122 +  i) crashkernel=size
   3.123 +
   3.124 +     This is the simplest and recommended way to reserve the crash kernel
   3.125 +     region. Just specify how large the region should be and the hypervisor
   3.126 +     will find a good location for it. A good size to start with is 128Mb
   3.127 +
   3.128 +     e.g.
   3.129 +
   3.130 +     crashkernel=128M
   3.131 +
   3.132 +  ii) crashkernel=size@base
   3.133 +
   3.134 +      In this form the base address is provided in addition to
   3.135 +      the size. Use this if auto-placement doesn't work for some reason.
   3.136 +      It is strongly recommended that the base address be aligned
   3.137 +      to 64Mb, else memory below the alignment point will not
   3.138 +      be usable.
   3.139 +
   3.140 +      e.g. crashkernel=128M@256M
   3.141 +
   3.142 +   Regardless of which of the two forms of the crashkernel command line you
   3.143 +   use, the crash kernel region should appear in /proc/iomem on x86 or
   3.144 +   /proc/iomem_machine on ia64. If it doesn't then either the crashkernel
   3.145 +   parameter is missing, or for some reason the region couldn't be placed -
   3.146 +   for instance because it is too large.
   3.147 +
   3.148 +   # cat /proc/iomem
   3.149 +   ...
   3.150 +   00100000-07feffff : System RAM
   3.151 +     00100000-00bfffff : Hypervisor code and data
   3.152 +     0533f000-0733efff : Crash kernel
   3.153 +   ...
   3.154 +
   3.155 +
   3.156 +1. Load
   3.157 +-------
   3.158 +
   3.159 +Once you are running in a kexec-enabled hypervisor and dom0,
   3.160 +you can prepare to kdump by loading the crash kernel into the
   3.161 +running kernel.
   3.162 +
   3.163 +  kexec -p CRASH_KERNEL_IMAGE --append "$CRASH_KERNEL_ARGS" KEXEC_ARGS
   3.164 +
   3.165 +  where:
   3.166 +    CRASH_KERNEL_IMAGE: the crash kernel image
   3.167 +    CRASH_KERNEL_ARGS: command line arguments to the crash kernel
   3.168 +		       init 1 is strongly recommended
   3.169 +		       irqpoll is strongly recommended
   3.170 +		       maxcpus=1 is required if the crash kernel is SMP
   3.171 +		       reset_devices is strongly recommended
   3.172 +    KEXEC_ARGS: additional kexec-tools command line arguments
   3.173 +                On x86 --args-linux should be supplied if an uncompressed
   3.174 +		vmlinux image is used as the crash kernel
   3.175 +
   3.176 +  e.g. kexec -p /boot/crash-vmlinuz \
   3.177 +        --append "init 1 irqpoll maxcpus=1 reset_devices" --args-linux
   3.178 +
   3.179 +On x86 systems the crash kernel may be either
   3.180 +- A uncompressed vmlinux image if the kernel is not relocatable
   3.181 +- A compressed bzImage or vmlinuz image if the kernel is relocatable
   3.182 +- Relocatability is crontroled by the CONFIG_RELOCATABLE kernel
   3.183 +  compile configuration parameter. This option may not be available
   3.184 +  depending on the kernel version
   3.185 +On ia64
   3.186 +  Either a vmlinuz or vmlinux.gz image may be used
   3.187 +
   3.188 +
   3.189 +2. Execute
   3.190 +----------
   3.191 +
   3.192 +Once the second kernel is loaded, the crash kernel will be executed if the
   3.193 +hypervisor panics. It will also be executed if dom0 panics or if dom0
   3.194 +oopses and /proc/sys/kernel/panic_on_oops is set to a non-zero value
   3.195 +
   3.196 +echo 1 > /proc/sys/kernel/panic_on_oops
   3.197 +
   3.198 +Kdump may also be triggered (for testing)
   3.199 +
   3.200 +  a. From Domain 0
   3.201 +
   3.202 +  echo c > /proc/sysrq-trigger
   3.203 +
   3.204 +  b. From Xen
   3.205 +
   3.206 +     Enter the xen console
   3.207 +
   3.208 +     ctrl^a ctrl^a  (may be bound to a different key, this is the default)
   3.209 +
   3.210 +     Select C for "trigger a crashdump"
   3.211 +
   3.212 +     C
   3.213 +
   3.214 +If you don't see the crash kernel booting within a second or so,
   3.215 +you are in trouble :(
   3.216 +
     4.1 --- a/extras/mini-os/include/lwipopts.h	Wed Aug 13 13:18:06 2008 +0900
     4.2 +++ b/extras/mini-os/include/lwipopts.h	Wed Aug 13 22:22:21 2008 +0900
     4.3 @@ -15,6 +15,7 @@
     4.4  #define LWIP_DHCP 1
     4.5  #define LWIP_COMPAT_SOCKETS 0
     4.6  #define LWIP_IGMP 1
     4.7 +#define LWIP_USE_HEAP_FROM_INTERRUPT 1
     4.8  #define MEMP_NUM_SYS_TIMEOUT 10
     4.9  #define TCP_SND_BUF 3000
    4.10  #define TCP_MSS 1500
     5.1 --- a/tools/Makefile	Wed Aug 13 13:18:06 2008 +0900
     5.2 +++ b/tools/Makefile	Wed Aug 13 22:22:21 2008 +0900
     5.3 @@ -38,8 +38,10 @@ endif
     5.4  
     5.5  # For the sake of linking, set the sys-root
     5.6  ifneq ($(CROSS_COMPILE),)
     5.7 +CROSS_BIN_PATH ?= /usr/$(CROSS_COMPILE:-=)/bin
     5.8  CROSS_SYS_ROOT ?= /usr/$(CROSS_COMPILE:-=)/sys-root
     5.9 -export CROSS_SYS_ROOT
    5.10 +export CROSS_SYS_ROOT # exported for check/funcs.sh
    5.11 +export CROSS_BIN_PATH # exported for cross-install.sh
    5.12  endif
    5.13  
    5.14  .PHONY: all
    5.15 @@ -57,7 +59,8 @@ clean distclean: subdirs-clean
    5.16  ifneq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
    5.17  IOEMU_CONFIGURE_CROSS ?= --cpu=$(XEN_TARGET_ARCH) \
    5.18  			 --cross-prefix=$(CROSS_COMPILE) \
    5.19 -			 --interp-prefix=$(CROSS_SYS_ROOT)
    5.20 +			 --interp-prefix=$(CROSS_SYS_ROOT) \
    5.21 +			 --install=$(CURDIR)/cross-install
    5.22  endif
    5.23  
    5.24  ioemu/config-host.mak:
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/tools/cross-install	Wed Aug 13 22:22:21 2008 +0900
     6.3 @@ -0,0 +1,8 @@
     6.4 +#!/bin/sh
     6.5 +
     6.6 +# prepend CROSS_BIN_PATH to find the right "strip"
     6.7 +if [ -n "$CROSS_BIN_PATH" ]; then
     6.8 +    PATH="$CROSS_BIN_PATH:$PATH"
     6.9 +fi
    6.10 +
    6.11 +exec install "$@"
     7.1 --- a/tools/ioemu/hw/pass-through.h	Wed Aug 13 13:18:06 2008 +0900
     7.2 +++ b/tools/ioemu/hw/pass-through.h	Wed Aug 13 22:22:21 2008 +0900
     7.3 @@ -120,6 +120,7 @@ struct pt_msix_info {
     7.4      int enabled;
     7.5      int total_entries;
     7.6      int bar_index;
     7.7 +    uint64_t table_base;
     7.8      uint32_t table_off;
     7.9      uint64_t mmio_base_addr;
    7.10      int mmio_index;
     8.1 --- a/tools/ioemu/hw/pt-msi.c	Wed Aug 13 13:18:06 2008 +0900
     8.2 +++ b/tools/ioemu/hw/pt-msi.c	Wed Aug 13 22:22:21 2008 +0900
     8.3 @@ -38,8 +38,8 @@ int pt_msi_setup(struct pt_dev *dev)
     8.4      }
     8.5  
     8.6      if ( xc_physdev_map_pirq_msi(xc_handle, domid, AUTO_ASSIGN, &pirq,
     8.7 -							dev->pci_dev->dev << 3 | dev->pci_dev->func,
     8.8 -							dev->pci_dev->bus, 0, 1) )
     8.9 +                                 dev->pci_dev->dev << 3 | dev->pci_dev->func,
    8.10 +                                 dev->pci_dev->bus, 0, 0) )
    8.11      {
    8.12          PT_LOG("error map msi\n");
    8.13          return -1;
    8.14 @@ -121,7 +121,8 @@ static int pt_msix_update_one(struct pt_
    8.15      {
    8.16          ret = xc_physdev_map_pirq_msi(xc_handle, domid, AUTO_ASSIGN, &pirq,
    8.17                                  dev->pci_dev->dev << 3 | dev->pci_dev->func,
    8.18 -                                dev->pci_dev->bus, entry_nr, 0);
    8.19 +                                dev->pci_dev->bus, entry_nr,
    8.20 +                                dev->msix->table_base);
    8.21          if ( ret )
    8.22          {
    8.23              PT_LOG("error map msix entry %x\n", entry_nr);
    8.24 @@ -183,7 +184,7 @@ static void pci_msix_writel(void *opaque
    8.25      entry = &msix->msix_entry[entry_nr];
    8.26      offset = ((addr - msix->mmio_base_addr) % 16) / 4;
    8.27  
    8.28 -    if ( offset != 3 && msix->enabled && entry->io_mem[3] & 0x1 )
    8.29 +    if ( offset != 3 && msix->enabled && !(entry->io_mem[3] & 0x1) )
    8.30      {
    8.31          PT_LOG("can not update msix entry %d since MSI-X is already \
    8.32                  function now.\n", entry_nr);
    8.33 @@ -196,7 +197,7 @@ static void pci_msix_writel(void *opaque
    8.34  
    8.35      if ( offset == 3 )
    8.36      {
    8.37 -        if ( !(val & 0x1) )
    8.38 +        if ( msix->enabled && !(val & 0x1) )
    8.39              pt_msix_update_one(dev, entry_nr);
    8.40          mask_physical_msix_entry(dev, entry_nr, entry->io_mem[3] & 0x1);
    8.41      }
    8.42 @@ -280,7 +281,6 @@ int pt_msix_init(struct pt_dev *dev, int
    8.43      uint8_t id;
    8.44      uint16_t control;
    8.45      int i, total_entries, table_off, bar_index;
    8.46 -    uint64_t bar_base;
    8.47      struct pci_dev *pd = dev->pci_dev;
    8.48  
    8.49      id = pci_read_byte(pd, pos + PCI_CAP_LIST_ID);
    8.50 @@ -314,18 +314,14 @@ int pt_msix_init(struct pt_dev *dev, int
    8.51      table_off = pci_read_long(pd, pos + PCI_MSIX_TABLE);
    8.52      bar_index = dev->msix->bar_index = table_off & PCI_MSIX_BIR;
    8.53      table_off &= table_off & ~PCI_MSIX_BIR;
    8.54 -    bar_base = pci_read_long(pd, 0x10 + 4 * bar_index);
    8.55 -    if ( (bar_base & 0x6) == 0x4 )
    8.56 -    {
    8.57 -        bar_base &= ~0xf;
    8.58 -        bar_base += (uint64_t)pci_read_long(pd, 0x10 + 4 * (bar_index + 1)) << 32;
    8.59 -    }
    8.60 -    PT_LOG("get MSI-X table bar base %lx\n", bar_base);
    8.61 +    dev->msix->table_base = dev->pci_dev->base_addr[bar_index];
    8.62 +    PT_LOG("get MSI-X table bar base %llx\n",
    8.63 +           (unsigned long long)dev->msix->table_base);
    8.64  
    8.65      dev->msix->fd = open("/dev/mem", O_RDWR);
    8.66      dev->msix->phys_iomem_base = mmap(0, total_entries * 16,
    8.67                            PROT_WRITE | PROT_READ, MAP_SHARED | MAP_LOCKED,
    8.68 -                          dev->msix->fd, bar_base + table_off);
    8.69 +                          dev->msix->fd, dev->msix->table_base + table_off);
    8.70      PT_LOG("mapping physical MSI-X table to %lx\n",
    8.71             (unsigned long)dev->msix->phys_iomem_base);
    8.72      return 0;
     9.1 --- a/tools/libxc/xc_physdev.c	Wed Aug 13 13:18:06 2008 +0900
     9.2 +++ b/tools/libxc/xc_physdev.c	Wed Aug 13 22:22:21 2008 +0900
     9.3 @@ -51,7 +51,7 @@ int xc_physdev_map_pirq_msi(int xc_handl
     9.4                              int devfn,
     9.5                              int bus,
     9.6                              int entry_nr,
     9.7 -                            int msi_type)
     9.8 +                            uint64_t table_base)
     9.9  {
    9.10      int rc;
    9.11      struct physdev_map_pirq map;
    9.12 @@ -63,10 +63,10 @@ int xc_physdev_map_pirq_msi(int xc_handl
    9.13      map.type = MAP_PIRQ_TYPE_MSI;
    9.14      map.index = index;
    9.15      map.pirq = *pirq;
    9.16 -    map.msi_info.devfn = devfn;
    9.17 -    map.msi_info.bus = bus;
    9.18 -    map.msi_info.entry_nr = entry_nr;
    9.19 -    map.msi_info.msi = msi_type;
    9.20 +    map.bus = bus;
    9.21 +    map.devfn = devfn;
    9.22 +    map.entry_nr = entry_nr;
    9.23 +    map.table_base = table_base;
    9.24  
    9.25      rc = do_physdev_op(xc_handle, PHYSDEVOP_map_pirq, &map);
    9.26  
    10.1 --- a/tools/libxc/xenctrl.h	Wed Aug 13 13:18:06 2008 +0900
    10.2 +++ b/tools/libxc/xenctrl.h	Wed Aug 13 22:22:21 2008 +0900
    10.3 @@ -917,7 +917,7 @@ int xc_physdev_map_pirq_msi(int xc_handl
    10.4                              int devfn,
    10.5                              int bus,
    10.6                              int entry_nr,
    10.7 -                            int msi_type);
    10.8 +                            uint64_t table_base);
    10.9  
   10.10  int xc_physdev_unmap_pirq(int xc_handle,
   10.11                            int domid,
    11.1 --- a/tools/misc/xend	Wed Aug 13 13:18:06 2008 +0900
    11.2 +++ b/tools/misc/xend	Wed Aug 13 22:22:21 2008 +0900
    11.3 @@ -77,6 +77,10 @@ def check_user():
    11.4          hline()
    11.5          raise CheckError("invalid user")
    11.6  
    11.7 +def start_daemon(daemon, *args):
    11.8 +    if os.fork() == 0:
    11.9 +        os.execvp(daemon, (daemon,) + args)
   11.10 +
   11.11  def start_xenstored():
   11.12      pidfname = "/var/run/xenstore.pid"
   11.13      try:
   11.14 @@ -102,13 +106,15 @@ def start_xenstored():
   11.15      s,o = commands.getstatusoutput(cmd)
   11.16  
   11.17  def start_consoled():
   11.18 -    if os.fork() == 0:
   11.19 -        os.execvp('xenconsoled', ['xenconsoled'])
   11.20 +    XENCONSOLED_TRACE = os.getenv("XENCONSOLED_TRACE")
   11.21 +    args = ""
   11.22 +    if XENCONSOLED_TRACE:
   11.23 +        args += "--log=" + XENCONSOLED_TRACE
   11.24 +    start_daemon("xenconsoled", args)
   11.25  
   11.26  def start_blktapctrl():
   11.27 -    if os.fork() == 0:
   11.28 -        os.execvp('blktapctrl', ['blktapctrl'])
   11.29 -            
   11.30 +    start_daemon("blktapctrl", "")
   11.31 +
   11.32  def main():
   11.33      try:
   11.34          check_logging()
    12.1 --- a/tools/python/xen/xend/XendAPI.py	Wed Aug 13 13:18:06 2008 +0900
    12.2 +++ b/tools/python/xen/xend/XendAPI.py	Wed Aug 13 22:22:21 2008 +0900
    12.3 @@ -2265,7 +2265,8 @@ class XendAPI(object):
    12.4              'type': image.type,
    12.5              'sharable': image.sharable,
    12.6              'read_only': image.read_only,
    12.7 -            'other_config': image.other_config
    12.8 +            'other_config': image.other_config,
    12.9 +            'security_label' : image.get_security_label()
   12.10              })
   12.11  
   12.12      # Class Functions    
    13.1 --- a/tools/python/xen/xend/XendConfig.py	Wed Aug 13 13:18:06 2008 +0900
    13.2 +++ b/tools/python/xen/xend/XendConfig.py	Wed Aug 13 22:22:21 2008 +0900
    13.3 @@ -448,7 +448,7 @@ class XendConfig(dict):
    13.4                  self['platform']['hpet'] = 0
    13.5              if 'loader' not in self['platform']:
    13.6                  # Old configs may have hvmloader set as PV_kernel param
    13.7 -                if self.has_key('PV_kernel') and re.search('hvmloader', self['PV_kernel']):
    13.8 +                if self.has_key('PV_kernel') and self['PV_kernel'] != '':
    13.9                      self['platform']['loader'] = self['PV_kernel']
   13.10                      self['PV_kernel'] = ''
   13.11                  else:
    14.1 --- a/tools/python/xen/xend/XendPIF.py	Wed Aug 13 13:18:06 2008 +0900
    14.2 +++ b/tools/python/xen/xend/XendPIF.py	Wed Aug 13 22:22:21 2008 +0900
    14.3 @@ -95,6 +95,22 @@ def linux_set_mtu(iface, mtu):
    14.4      except ValueError:
    14.5          return False
    14.6  
    14.7 +def linux_get_mtu(device):
    14.8 +    return _linux_get_pif_param(device, 'mtu')
    14.9 +
   14.10 +def linux_get_mac(device):
   14.11 +    return _linux_get_pif_param(device, 'link/ether')
   14.12 +
   14.13 +def _linux_get_pif_parm(device, param_name):
   14.14 +    ip_get_dev_data = 'ip link show %s' % device
   14.15 +    rc, output = commands.getstatusoutput(ip_get_dev_data)
   14.16 +    if rc == 0:
   14.17 +        params = output.split(' ')
   14.18 +        for i in xrange(len(params)):
   14.19 +            if params[i] == param_name:
   14.20 +                return params[i+1]
   14.21 +    return ''
   14.22 +
   14.23  def _create_VLAN(dev, vlan):
   14.24      rc, _ = commands.getstatusoutput('vconfig add %s %d' %
   14.25                                       (dev, vlan))
   14.26 @@ -259,8 +275,8 @@ class XendPIF(XendBase):
   14.27          # Create the record
   14.28          record = {
   14.29              "device":  device,
   14.30 -            "MAC":     '',
   14.31 -            "MTU":     '',
   14.32 +            "MAC":     linux_get_mac('%s.%d' % (device, vlan)),
   14.33 +            "MTU":     linux_get_mtu('%s.%d' % (device, vlan)),
   14.34              "network": network_uuid,
   14.35              "VLAN":    vlan
   14.36              }
    15.1 --- a/xen/Makefile	Wed Aug 13 13:18:06 2008 +0900
    15.2 +++ b/xen/Makefile	Wed Aug 13 22:22:21 2008 +0900
    15.3 @@ -2,7 +2,7 @@
    15.4  # All other places this is stored (eg. compile.h) should be autogenerated.
    15.5  export XEN_VERSION       = 3
    15.6  export XEN_SUBVERSION    = 3
    15.7 -export XEN_EXTRAVERSION ?= .0-rc4-pre$(XEN_VENDORVERSION)
    15.8 +export XEN_EXTRAVERSION ?= .0-rc5-pre$(XEN_VENDORVERSION)
    15.9  export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
   15.10  -include xen-version
   15.11  
    16.1 --- a/xen/arch/x86/cpu/mcheck/mce.h	Wed Aug 13 13:18:06 2008 +0900
    16.2 +++ b/xen/arch/x86/cpu/mcheck/mce.h	Wed Aug 13 22:22:21 2008 +0900
    16.3 @@ -26,5 +26,5 @@ int x86_mcinfo_add(struct mc_info *mi, v
    16.4  void x86_mcinfo_dump(struct mc_info *mi);
    16.5  
    16.6  /* Global variables */
    16.7 -extern int mce_disabled __initdata;
    16.8 +extern int mce_disabled;
    16.9  extern unsigned int nr_mce_banks;
    17.1 --- a/xen/arch/x86/mm/shadow/common.c	Wed Aug 13 13:18:06 2008 +0900
    17.2 +++ b/xen/arch/x86/mm/shadow/common.c	Wed Aug 13 22:22:21 2008 +0900
    17.3 @@ -3357,23 +3357,45 @@ shadow_write_p2m_entry(struct vcpu *v, u
    17.4          }
    17.5      }
    17.6  
    17.7 -    /* If we're removing a superpage mapping from the p2m, remove all the
    17.8 -     * MFNs covered by it from the shadows too. */
    17.9 +    /* If we're removing a superpage mapping from the p2m, we need to check 
   17.10 +     * all the pages covered by it.  If they're still there in the new 
   17.11 +     * scheme, that's OK, but otherwise they must be unshadowed. */
   17.12      if ( level == 2 && (l1e_get_flags(*p) & _PAGE_PRESENT) &&
   17.13           (l1e_get_flags(*p) & _PAGE_PSE) )
   17.14      {
   17.15          unsigned int i;
   17.16 -        mfn_t mfn = _mfn(l1e_get_pfn(*p));
   17.17 +        cpumask_t flushmask;
   17.18 +        mfn_t omfn = _mfn(l1e_get_pfn(*p));
   17.19 +        mfn_t nmfn = _mfn(l1e_get_pfn(new));
   17.20 +        l1_pgentry_t *npte = NULL;
   17.21          p2m_type_t p2mt = p2m_flags_to_type(l1e_get_flags(*p));
   17.22 -        if ( p2m_is_valid(p2mt) && mfn_valid(mfn) )
   17.23 +        if ( p2m_is_valid(p2mt) && mfn_valid(omfn) )
   17.24          {
   17.25 +            cpus_clear(flushmask);
   17.26 +
   17.27 +            /* If we're replacing a superpage with a normal L1 page, map it */
   17.28 +            if ( (l1e_get_flags(new) & _PAGE_PRESENT)
   17.29 +                 && !(l1e_get_flags(new) & _PAGE_PSE) 
   17.30 +                 && mfn_valid(nmfn) )
   17.31 +                npte = map_domain_page(mfn_x(nmfn));
   17.32 +            
   17.33              for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
   17.34              {
   17.35 -                sh_remove_all_shadows_and_parents(v, mfn);
   17.36 -                if ( sh_remove_all_mappings(v, mfn) )
   17.37 -                    flush_tlb_mask(d->domain_dirty_cpumask);
   17.38 -                mfn = _mfn(mfn_x(mfn) + 1);
   17.39 +                if ( !npte 
   17.40 +                     || !p2m_is_ram(p2m_flags_to_type(l1e_get_flags(npte[i])))
   17.41 +                     || l1e_get_pfn(npte[i]) != mfn_x(omfn) )
   17.42 +                {
   17.43 +                    /* This GFN->MFN mapping has gone away */
   17.44 +                    sh_remove_all_shadows_and_parents(v, omfn);
   17.45 +                    if ( sh_remove_all_mappings(v, omfn) )
   17.46 +                        cpus_or(flushmask, flushmask, d->domain_dirty_cpumask);
   17.47 +                }
   17.48 +                omfn = _mfn(mfn_x(omfn) + 1);
   17.49              }
   17.50 +            flush_tlb_mask(flushmask);
   17.51 +            
   17.52 +            if ( npte )
   17.53 +                unmap_domain_page(npte);
   17.54          }
   17.55      }
   17.56  
    18.1 --- a/xen/arch/x86/mm/shadow/multi.c	Wed Aug 13 13:18:06 2008 +0900
    18.2 +++ b/xen/arch/x86/mm/shadow/multi.c	Wed Aug 13 22:22:21 2008 +0900
    18.3 @@ -3181,14 +3181,9 @@ static int sh_page_fault(struct vcpu *v,
    18.4      rc = guest_walk_tables(v, va, &gw, regs->error_code);
    18.5  
    18.6  #if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC)
    18.7 +    regs->error_code &= ~PFEC_page_present;
    18.8      if ( !(rc & _PAGE_PRESENT) )
    18.9          regs->error_code |= PFEC_page_present;
   18.10 -    else if ( regs->error_code & PFEC_page_present )
   18.11 -    {
   18.12 -            SHADOW_ERROR("OOS paranoia: Something is wrong in guest TLB"
   18.13 -                         " flushing. Have fun debugging it.\n");
   18.14 -            regs->error_code &= ~PFEC_page_present;
   18.15 -    }
   18.16  #endif
   18.17  
   18.18      if ( rc != 0 )
    19.1 --- a/xen/arch/x86/mm/shadow/private.h	Wed Aug 13 13:18:06 2008 +0900
    19.2 +++ b/xen/arch/x86/mm/shadow/private.h	Wed Aug 13 22:22:21 2008 +0900
    19.3 @@ -213,15 +213,14 @@ struct shadow_page_info
    19.4      };
    19.5  };
    19.6  
    19.7 -/* The structure above *must* be the same size as a struct page_info
    19.8 +/* The structure above *must* be no larger than a struct page_info
    19.9   * from mm.h, since we'll be using the same space in the frametable. 
   19.10   * Also, the mbz field must line up with the owner field of normal 
   19.11   * pages, so they look properly like anonymous/xen pages. */
   19.12  static inline void shadow_check_page_struct_offsets(void) {
   19.13 -    BUILD_BUG_ON(sizeof (struct shadow_page_info) 
   19.14 -                 != sizeof (struct page_info));
   19.15 -    BUILD_BUG_ON(offsetof(struct shadow_page_info, mbz) 
   19.16 -                 != offsetof(struct page_info, u.inuse._domain));
   19.17 +    BUILD_BUG_ON(sizeof (struct shadow_page_info) > sizeof (struct page_info));
   19.18 +    BUILD_BUG_ON(offsetof(struct shadow_page_info, mbz) !=
   19.19 +                 offsetof(struct page_info, u.inuse._domain));
   19.20  };
   19.21  
   19.22  /* Shadow type codes */
    20.1 --- a/xen/arch/x86/msi.c	Wed Aug 13 13:18:06 2008 +0900
    20.2 +++ b/xen/arch/x86/msi.c	Wed Aug 13 22:22:21 2008 +0900
    20.3 @@ -490,28 +490,6 @@ static int msi_capability_init(struct pc
    20.4      return 0;
    20.5  }
    20.6  
    20.7 -static u64 pci_resource_start(struct pci_dev *dev, u8 bar_index)
    20.8 -{
    20.9 -    u64 bar_base;
   20.10 -    u32 reg_val;
   20.11 -    u8 bus = dev->bus;
   20.12 -    u8 slot = PCI_SLOT(dev->devfn);
   20.13 -    u8 func = PCI_FUNC(dev->devfn);
   20.14 -
   20.15 -    reg_val = pci_conf_read32(bus, slot, func,
   20.16 -                              PCI_BASE_ADDRESS_0 + 4 * bar_index);
   20.17 -    bar_base = reg_val & PCI_BASE_ADDRESS_MEM_MASK;
   20.18 -    if ( ( reg_val & PCI_BASE_ADDRESS_MEM_TYPE_MASK ) ==
   20.19 -         PCI_BASE_ADDRESS_MEM_TYPE_64 )
   20.20 -    {
   20.21 -        reg_val = pci_conf_read32(bus, slot, func,
   20.22 -                                  PCI_BASE_ADDRESS_0 + 4 * (bar_index + 1));
   20.23 -        bar_base |= ((u64)reg_val) << 32;
   20.24 -    }
   20.25 -
   20.26 -    return bar_base;
   20.27 -}
   20.28 -
   20.29  /**
   20.30   * msix_capability_init - configure device's MSI-X capability
   20.31   * @dev: pointer to the pci_dev data structure of MSI-X device function
   20.32 @@ -522,7 +500,7 @@ static u64 pci_resource_start(struct pci
   20.33   * single MSI-X irq. A return of zero indicates the successful setup of
   20.34   * requested MSI-X entries with allocated irqs or non-zero for otherwise.
   20.35   **/
   20.36 -static int msix_capability_init(struct pci_dev *dev, int vector, int entry_nr)
   20.37 +static int msix_capability_init(struct pci_dev *dev, struct msi_info *msi)
   20.38  {
   20.39      struct msi_desc *entry;
   20.40      int pos;
   20.41 @@ -549,7 +527,7 @@ static int msix_capability_init(struct p
   20.42      table_offset = pci_conf_read32(bus, slot, func, msix_table_offset_reg(pos));
   20.43      bir = (u8)(table_offset & PCI_MSIX_FLAGS_BIRMASK);
   20.44      table_offset &= ~PCI_MSIX_FLAGS_BIRMASK;
   20.45 -    phys_addr = pci_resource_start(dev, bir) + table_offset;
   20.46 +    phys_addr = msi->table_base + table_offset;
   20.47      idx = msix_fixmap_alloc();
   20.48      if ( idx < 0 )
   20.49      {
   20.50 @@ -561,11 +539,11 @@ static int msix_capability_init(struct p
   20.51  
   20.52      entry->msi_attrib.type = PCI_CAP_ID_MSIX;
   20.53      entry->msi_attrib.is_64 = 1;
   20.54 -    entry->msi_attrib.entry_nr = entry_nr;
   20.55 +    entry->msi_attrib.entry_nr = msi->entry_nr;
   20.56      entry->msi_attrib.maskbit = 1;
   20.57      entry->msi_attrib.masked = 1;
   20.58      entry->msi_attrib.pos = pos;
   20.59 -    entry->vector = vector;
   20.60 +    entry->vector = msi->vector;
   20.61      entry->dev = dev;
   20.62      entry->mask_base = base;
   20.63  
   20.64 @@ -589,24 +567,25 @@ static int msix_capability_init(struct p
   20.65   * indicates the successful setup of an entry zero with the new MSI
   20.66   * irq or non-zero for otherwise.
   20.67   **/
   20.68 -static int __pci_enable_msi(u8 bus, u8 devfn, int vector)
   20.69 +static int __pci_enable_msi(struct msi_info *msi)
   20.70  {
   20.71      int status;
   20.72      struct pci_dev *pdev;
   20.73  
   20.74 -    pdev = pci_lock_pdev(bus, devfn);
   20.75 +    pdev = pci_lock_pdev(msi->bus, msi->devfn);
   20.76      if ( !pdev )
   20.77  	return -ENODEV;
   20.78  
   20.79 -    if ( find_msi_entry(pdev, vector, PCI_CAP_ID_MSI) )
   20.80 +    if ( find_msi_entry(pdev, msi->vector, PCI_CAP_ID_MSI) )
   20.81      {
   20.82  	spin_unlock(&pdev->lock);
   20.83 -        dprintk(XENLOG_WARNING, "vector %d has already mapped to MSI on device \
   20.84 -            %02x:%02x.%01x.\n", vector, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
   20.85 +        dprintk(XENLOG_WARNING, "vector %d has already mapped to MSI on "
   20.86 +            "device %02x:%02x.%01x.\n", msi->vector, msi->bus,
   20.87 +            PCI_SLOT(msi->devfn), PCI_FUNC(msi->devfn));
   20.88          return 0;
   20.89      }
   20.90  
   20.91 -    status = msi_capability_init(pdev, vector);
   20.92 +    status = msi_capability_init(pdev, msi->vector);
   20.93      spin_unlock(&pdev->lock);
   20.94      return status;
   20.95  }
   20.96 @@ -659,37 +638,37 @@ static void __pci_disable_msi(int vector
   20.97   * of irqs available. Driver should use the returned value to re-send
   20.98   * its request.
   20.99   **/
  20.100 -static int __pci_enable_msix(u8 bus, u8 devfn, int vector, int entry_nr)
  20.101 +static int __pci_enable_msix(struct msi_info *msi)
  20.102  {
  20.103      int status, pos, nr_entries;
  20.104      struct pci_dev *pdev;
  20.105      u16 control;
  20.106 -    u8 slot = PCI_SLOT(devfn);
  20.107 -    u8 func = PCI_FUNC(devfn);
  20.108 +    u8 slot = PCI_SLOT(msi->devfn);
  20.109 +    u8 func = PCI_FUNC(msi->devfn);
  20.110  
  20.111 -    pdev = pci_lock_pdev(bus, devfn);
  20.112 +    pdev = pci_lock_pdev(msi->bus, msi->devfn);
  20.113      if ( !pdev )
  20.114  	return -ENODEV;
  20.115  
  20.116 -    pos = pci_find_cap_offset(bus, slot, func, PCI_CAP_ID_MSIX);
  20.117 -    control = pci_conf_read16(bus, slot, func, msi_control_reg(pos));
  20.118 +    pos = pci_find_cap_offset(msi->bus, slot, func, PCI_CAP_ID_MSIX);
  20.119 +    control = pci_conf_read16(msi->bus, slot, func, msi_control_reg(pos));
  20.120      nr_entries = multi_msix_capable(control);
  20.121 -    if (entry_nr > nr_entries)
  20.122 +    if (msi->entry_nr > nr_entries)
  20.123      {
  20.124  	spin_unlock(&pdev->lock);
  20.125          return -EINVAL;
  20.126      }
  20.127  
  20.128 -    if ( find_msi_entry(pdev, vector, PCI_CAP_ID_MSIX) )
  20.129 +    if ( find_msi_entry(pdev, msi->vector, PCI_CAP_ID_MSIX) )
  20.130      {
  20.131  	spin_unlock(&pdev->lock);
  20.132 -        dprintk(XENLOG_WARNING, "vector %d has already mapped to MSIX on \
  20.133 -                device %02x:%02x.%01x.\n", vector, bus,
  20.134 -                PCI_SLOT(devfn), PCI_FUNC(devfn));
  20.135 +        dprintk(XENLOG_WARNING, "vector %d has already mapped to MSIX on "
  20.136 +                "device %02x:%02x.%01x.\n", msi->vector, msi->bus,
  20.137 +                PCI_SLOT(msi->devfn), PCI_FUNC(msi->devfn));
  20.138          return 0;
  20.139      }
  20.140  
  20.141 -    status = msix_capability_init(pdev, vector, entry_nr);
  20.142 +    status = msix_capability_init(pdev, msi);
  20.143      spin_unlock(&pdev->lock);
  20.144      return status;
  20.145  }
  20.146 @@ -727,13 +706,12 @@ static void __pci_disable_msix(int vecto
  20.147      spin_unlock(&dev->lock);
  20.148  }
  20.149  
  20.150 -int pci_enable_msi(u8 bus, u8 devfn, int vector, int entry_nr, int msi)
  20.151 +int pci_enable_msi(struct msi_info *msi)
  20.152  {
  20.153 -    ASSERT(spin_is_locked(&irq_desc[vector].lock));
  20.154 -    if ( msi )
  20.155 -        return __pci_enable_msi(bus, devfn, vector);
  20.156 -    else
  20.157 -        return __pci_enable_msix(bus, devfn, vector, entry_nr);
  20.158 +    ASSERT(spin_is_locked(&irq_desc[msi->vector].lock));
  20.159 +
  20.160 +    return  msi->table_base ? __pci_enable_msix(msi) :
  20.161 +                              __pci_enable_msi(msi);
  20.162  }
  20.163  
  20.164  void pci_disable_msi(int vector)
    21.1 --- a/xen/arch/x86/oprofile/nmi_int.c	Wed Aug 13 13:18:06 2008 +0900
    21.2 +++ b/xen/arch/x86/oprofile/nmi_int.c	Wed Aug 13 22:22:21 2008 +0900
    21.3 @@ -296,24 +296,40 @@ static int __init ppro_init(char ** cpu_
    21.4  {
    21.5  	__u8 cpu_model = current_cpu_data.x86_model;
    21.6  
    21.7 -	if (cpu_model == 15 || cpu_model == 23) {
    21.8 +	switch (cpu_model) {
    21.9 +	case 0 ... 2:
   21.10 +		*cpu_type = "i386/ppro";
   21.11 +		break;
   21.12 +	case 3 ... 5:
   21.13 +		*cpu_type = "i386/pii";
   21.14 +		break;
   21.15 +	case 6 ... 8:
   21.16 +		*cpu_type = "i386/piii";
   21.17 +		break;
   21.18 +	case 9:
   21.19 +		*cpu_type = "i386/p6_mobile";
   21.20 +		break;
   21.21 +	case 10 ... 13:
   21.22 +		*cpu_type = "i386/p6";
   21.23 +		break;
   21.24 +	case 14:
   21.25 +		*cpu_type = "i386/core";
   21.26 +		break;
   21.27 +	case 15: case 23:
   21.28  		*cpu_type = "i386/core_2";
   21.29  		ppro_has_global_ctrl = 1;
   21.30 -	} else if (cpu_model == 14)
   21.31 -		*cpu_type = "i386/core";
   21.32 -	else if (cpu_model > 13) {
   21.33 +		break;
   21.34 +	case 26:
   21.35 +		*cpu_type = "i386/core_2";
   21.36 +		ppro_has_global_ctrl = 1;
   21.37 +		break;
   21.38 +	default:
   21.39 +		/* Unknown */
   21.40  		printk("xenoprof: Initialization failed. "
   21.41  		       "Intel processor model %d for P6 class family is not "
   21.42  		       "supported\n", cpu_model);
   21.43  		return 0;
   21.44 -	} else if (cpu_model == 9)
   21.45 -		*cpu_type = "i386/p6_mobile";
   21.46 -	else if (cpu_model > 5)
   21.47 -		*cpu_type = "i386/piii";
   21.48 -	else if (cpu_model > 2)
   21.49 -		*cpu_type = "i386/pii";
   21.50 -	else
   21.51 -		*cpu_type = "i386/ppro";
   21.52 +	}
   21.53  
   21.54  	model = &op_ppro_spec;
   21.55  	return 1;
    22.1 --- a/xen/arch/x86/physdev.c	Wed Aug 13 13:18:06 2008 +0900
    22.2 +++ b/xen/arch/x86/physdev.c	Wed Aug 13 22:22:21 2008 +0900
    22.3 @@ -66,6 +66,7 @@ static int map_domain_pirq(struct domain
    22.4  {
    22.5      int ret = 0;
    22.6      int old_vector, old_pirq;
    22.7 +    struct msi_info msi;
    22.8  
    22.9      if ( d == NULL )
   22.10          return -EINVAL;
   22.11 @@ -115,10 +116,14 @@ static int map_domain_pirq(struct domain
   22.12                       vector);
   22.13          desc->handler = &pci_msi_type;
   22.14  
   22.15 -        ret = pci_enable_msi(map->msi_info.bus,
   22.16 -		                     map->msi_info.devfn, vector,
   22.17 -							 map->msi_info.entry_nr,
   22.18 -							 map->msi_info.msi);
   22.19 +        msi.bus = map->bus;
   22.20 +        msi.devfn = map->devfn;
   22.21 +        msi.entry_nr = map->entry_nr;
   22.22 +        msi.table_base = map->table_base;
   22.23 +        msi.vector = vector;
   22.24 +
   22.25 +        ret = pci_enable_msi(&msi);
   22.26 +
   22.27          spin_unlock_irqrestore(&desc->lock, flags);
   22.28          if ( ret )
   22.29              goto done;
   22.30 @@ -139,7 +144,7 @@ static int unmap_domain_pirq(struct doma
   22.31      int ret = 0;
   22.32      int vector;
   22.33  
   22.34 -    if ( d == NULL || pirq < 0 || pirq > NR_PIRQS )
   22.35 +    if ( d == NULL || pirq < 0 || pirq >= NR_PIRQS )
   22.36          return -EINVAL;
   22.37  
   22.38      if ( !IS_PRIV(current->domain) )
    23.1 --- a/xen/common/page_alloc.c	Wed Aug 13 13:18:06 2008 +0900
    23.2 +++ b/xen/common/page_alloc.c	Wed Aug 13 22:22:21 2008 +0900
    23.3 @@ -950,6 +950,14 @@ static void page_scrub_softirq(void)
    23.4      void             *p;
    23.5      int               i;
    23.6      s_time_t          start = NOW();
    23.7 +    static spinlock_t serialise_lock = SPIN_LOCK_UNLOCKED;
    23.8 +
    23.9 +    /* free_heap_pages() does not parallelise well. Serialise this function. */
   23.10 +    if ( !spin_trylock(&serialise_lock) )
   23.11 +    {
   23.12 +        set_timer(&this_cpu(page_scrub_timer), NOW() + MILLISECS(1));
   23.13 +        return;
   23.14 +    }
   23.15  
   23.16      /* Aim to do 1ms of work every 10ms. */
   23.17      do {
   23.18 @@ -958,7 +966,7 @@ static void page_scrub_softirq(void)
   23.19          if ( unlikely((ent = page_scrub_list.next) == &page_scrub_list) )
   23.20          {
   23.21              spin_unlock(&page_scrub_lock);
   23.22 -            return;
   23.23 +            goto out;
   23.24          }
   23.25          
   23.26          /* Peel up to 16 pages from the list. */
   23.27 @@ -989,6 +997,9 @@ static void page_scrub_softirq(void)
   23.28      } while ( (NOW() - start) < MILLISECS(1) );
   23.29  
   23.30      set_timer(&this_cpu(page_scrub_timer), NOW() + MILLISECS(10));
   23.31 +
   23.32 + out:
   23.33 +    spin_unlock(&serialise_lock);
   23.34  }
   23.35  
   23.36  static void page_scrub_timer_fn(void *unused)
    24.1 --- a/xen/drivers/passthrough/io.c	Wed Aug 13 13:18:06 2008 +0900
    24.2 +++ b/xen/drivers/passthrough/io.c	Wed Aug 13 22:22:21 2008 +0900
    24.3 @@ -75,6 +75,9 @@ int pt_irq_create_bind_vtd(
    24.4      {
    24.5          int pirq = pt_irq_bind->machine_irq;
    24.6  
    24.7 +        if ( pirq < 0 || pirq >= NR_IRQS )
    24.8 +            return -EINVAL;
    24.9 +
   24.10          if ( !(hvm_irq_dpci->mirq[pirq].flags & HVM_IRQ_DPCI_VALID ) )
   24.11          {
   24.12              hvm_irq_dpci->mirq[pirq].flags |= HVM_IRQ_DPCI_VALID |
    25.1 --- a/xen/drivers/passthrough/vtd/iommu.c	Wed Aug 13 13:18:06 2008 +0900
    25.2 +++ b/xen/drivers/passthrough/vtd/iommu.c	Wed Aug 13 22:22:21 2008 +0900
    25.3 @@ -1789,7 +1789,8 @@ int intel_vtd_setup(void)
    25.4      memset(domid_bitmap, 0, domid_bitmap_size / 8);
    25.5      set_bit(0, domid_bitmap);
    25.6  
    25.7 -    init_vtd_hw();
    25.8 +    if ( init_vtd_hw() )
    25.9 +        goto error;
   25.10  
   25.11      register_keyhandler('V', dump_iommu_info, "dump iommu info");
   25.12  
    26.1 --- a/xen/include/asm-x86/event.h	Wed Aug 13 13:18:06 2008 +0900
    26.2 +++ b/xen/include/asm-x86/event.h	Wed Aug 13 22:22:21 2008 +0900
    26.3 @@ -69,12 +69,7 @@ static inline void local_event_delivery_
    26.4  /* No arch specific virq definition now. Default to global. */
    26.5  static inline int arch_virq_is_global(int virq)
    26.6  {
    26.7 -    switch (virq) {
    26.8 -    case VIRQ_MCA:
    26.9 -        return 1;
   26.10 -    default:
   26.11 -        return 1;
   26.12 -    }
   26.13 +    return 1;
   26.14  }
   26.15  
   26.16  #endif
    27.1 --- a/xen/include/asm-x86/msi.h	Wed Aug 13 13:18:06 2008 +0900
    27.2 +++ b/xen/include/asm-x86/msi.h	Wed Aug 13 22:22:21 2008 +0900
    27.3 @@ -54,6 +54,14 @@
    27.4  #define MAX_MSIX_PAGES              32
    27.5  #endif
    27.6  
    27.7 +struct msi_info {
    27.8 +    int bus;
    27.9 +    int devfn;
   27.10 +    int vector;
   27.11 +    int entry_nr;
   27.12 +    uint64_t table_base;
   27.13 +};
   27.14 +
   27.15  struct msi_msg {
   27.16  	u32	address_lo;	/* low 32 bits of msi message address */
   27.17  	u32	address_hi;	/* high 32 bits of msi message address */
   27.18 @@ -64,7 +72,7 @@ struct msi_msg {
   27.19  extern void mask_msi_irq(unsigned int irq);
   27.20  extern void unmask_msi_irq(unsigned int irq);
   27.21  extern void set_msi_irq_affinity(unsigned int irq, cpumask_t mask);
   27.22 -extern int pci_enable_msi(u8 bus, u8 devfn, int vector, int entry_nr, int msi);
   27.23 +extern int pci_enable_msi(struct msi_info *msi);
   27.24  extern void pci_disable_msi(int vector);
   27.25  extern void pci_cleanup_msi(struct pci_dev *pdev);
   27.26  
    28.1 --- a/xen/include/public/physdev.h	Wed Aug 13 13:18:06 2008 +0900
    28.2 +++ b/xen/include/public/physdev.h	Wed Aug 13 22:22:21 2008 +0900
    28.3 @@ -136,10 +136,13 @@ struct physdev_map_pirq {
    28.4      /* IN or OUT */
    28.5      int pirq;
    28.6      /* IN */
    28.7 -    struct {
    28.8 -        int bus, devfn, entry_nr;
    28.9 -		int msi;  /* 0 - MSIX    1 - MSI */
   28.10 -    } msi_info;
   28.11 +    int bus;
   28.12 +    /* IN */
   28.13 +    int devfn;
   28.14 +    /* IN */
   28.15 +    int entry_nr;
   28.16 +    /* IN */
   28.17 +    uint64_t table_base;
   28.18  };
   28.19  typedef struct physdev_map_pirq physdev_map_pirq_t;
   28.20  DEFINE_XEN_GUEST_HANDLE(physdev_map_pirq_t);