[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [qemu-xen-unstable] Merge branch 'pt.multifn'



commit d67e46f6860bfbd8991b7691efc1f67b7bc413bc
Merge: f2e0a24d00b2f0c591719bab088fbe3654955066 
af79b97d1d25bf9412c8fe1ab099ba8674f109d0
Author: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Date:   Thu Jun 25 18:40:33 2009 +0100

    Merge branch 'pt.multifn'
    
    Conflicts:
        hw/piix4acpi.c

 hw/pass-through.c |  230 +++++++++++++++++++++++++++++++++----------------
 hw/pass-through.h |    2 +
 hw/pci.h          |   18 ++--
 hw/piix4acpi.c    |  247 ++++++++++++++++++++++++++++++++++++-----------------
 hw/pt-msi.c       |    8 +-
 xen-vl-extra.c    |   14 ++--
 6 files changed, 346 insertions(+), 173 deletions(-)

diff --cc hw/piix4acpi.c
index dc52b42,996e36a..9c5fdee
--- a/hw/piix4acpi.c
+++ b/hw/piix4acpi.c
@@@ -34,12 -33,8 +34,14 @@@
  #include <xen/hvm/ioreq.h>
  #include <xen/hvm/params.h>
  
 +#define PIIX4ACPI_LOG_ERROR 0
 +#define PIIX4ACPI_LOG_INFO 1
 +#define PIIX4ACPI_LOG_DEBUG 2
 +#define PIIX4ACPI_LOGLEVEL PIIX4ACPI_LOG_INFO
 +#define PIIX4ACPI_LOG(level, fmt, ...) do { if (level <= PIIX4ACPI_LOGLEVEL) 
qemu_log(fmt, ## __VA_ARGS__); } while (0)
 +
+ #include <pci/header.h>
+ 
  /* PM1a_CNT bits, as defined in the ACPI specification. */
  #define SCI_EN            (1 <<  0)
  #define GBL_RLS           (1 <<  2)
@@@ -247,10 -275,10 +279,11 @@@ static uint32_t acpi_php_readb(void *op
          break;
      default:
          num = addr - ACPI_PHP_IO_ADDR - 2;
-         val = hotplug_slots->status[num];
+         val = hotplug_devfn->status[num];
      }
  
-     PIIX4ACPI_LOG(PIIX4ACPI_LOG_DEBUG, "ACPI PCI hotplug: read addr=0x%x, 
val=0x%x.\n",
 -    fprintf(logfile, "ACPI PCI hotplug: read addr=0x%x, val=0x%02x.\n",
++    PIIX4ACPI_LOG(PIIX4ACPI_LOG_DEBUG,
++                   "ACPI PCI hotplug: read addr=0x%x, val=0x%02x.\n",
              addr, val);
  
      return val;
@@@ -258,10 -286,10 +291,11 @@@
  
  static void acpi_php_writeb(void *opaque, uint32_t addr, uint32_t val)
  {
-     PHPSlots *hotplug_slots = opaque;
-     int slot;
+     PHPDevFn *hotplug_devfn = opaque;
+     int devfn, num, func, i;
  
-     PIIX4ACPI_LOG(PIIX4ACPI_LOG_DEBUG, "ACPI PCI hotplug: write addr=0x%x, 
val=0x%x.\n",
 -    fprintf(logfile, "ACPI PCI hotplug: write addr=0x%x, val=0x%02x.\n",
++    PIIX4ACPI_LOG(PIIX4ACPI_LOG_DEBUG,
++                   "ACPI PCI hotplug: write addr=0x%x, val=0x%02x.\n",
              addr, val);
  
      switch (addr)
@@@ -463,14 -513,29 +519,29 @@@ static void acpi_sci_intr(GPEState *s
      }
  }
  
- void acpi_php_del(int slot)
+ void acpi_php_del(int devfn)
  {
      GPEState *s = &gpe_state;
+     int slot, func;
  
-     if ( test_pci_slot(slot) < 0 ) {
-         PIIX4ACPI_LOG(PIIX4ACPI_LOG_ERROR, "hot remove: pci slot %d "
-                 "is not used by a hotplug device.\n", slot);
+     slot = PCI_SLOT(devfn);
+     func = PCI_FUNC(devfn);
  
+     if ( test_pci_devfn(devfn) < 0 ) {
 -        fprintf(logfile, "hot remove: pci slot 0x%02x, function 0x%x "
++        PIIX4ACPI_LOG(PIIX4ACPI_LOG_ERROR,
++              "hot remove: pci slot 0x%02x, function 0x%x "
+                 "is not used by a hotplug device.\n", slot, func);
 -
+         return;
+     }
+ 
+     /* ACPI PHP can only work on slots
+      * So only remove zero-functions -
+      * which will remove all other fucntions of the same device in the
+      * guest.
+      */
+     if ( func ) {
+         fprintf(logfile, "hot remove: Attempt to remove non-zero function "
+                 "slot=0x%02x func=0x%0x.\n", slot, func);
          return;
      }
  
@@@ -486,14 -551,15 +557,16 @@@ void acpi_php_add(int devfn
  {
      GPEState *s = &gpe_state;
      char ret_str[30];
+     int slot, func;
  
-     if ( slot < 0 ) {
-         PIIX4ACPI_LOG(PIIX4ACPI_LOG_ERROR, "hot add pci slot %d exceed.\n", 
slot);
+     if ( devfn < 0 ) {
 -        fprintf(logfile, "hot add pci devfn %d exceed.\n", devfn);
++        PIIX4ACPI_LOG(PIIX4ACPI_LOG_ERROR,
++                       "hot add pci devfn %d exceed.\n", devfn);
  
-         if ( slot == -1 )
-             sprintf(ret_str, "no free hotplug slots");
-         else if ( slot == -2 )
-             sprintf(ret_str, "wrong bdf or vslot");
+         if ( devfn == -1 )
+             sprintf(ret_str, "no free hotplug devfn");
+         else if ( devfn == -2 )
+             sprintf(ret_str, "wrong bdf or vdevfn");
  
          if ( strlen(ret_str) > 0 )
              xenstore_record_dm("parameter", ret_str);
@@@ -580,8 -661,8 +668,9 @@@ i2c_bus *piix4_pm_init(PCIBus *bus, in
  }
  
  void qemu_system_hot_add_init() { }
- void qemu_system_device_hot_add(int bus, int slot, int state) {
-     PIIX4ACPI_LOG(PIIX4ACPI_LOG_ERROR, "qemu-upstream PCI hotplug not 
supported in qemu-dm\n");
+ void qemu_system_device_hot_add(int bus, int devfn, int state) {
 -    fputs("qemu-upstream PCI hotplug not supported in qemu-dm\n",stderr);
++    PIIX4ACPI_LOG(PIIX4ACPI_LOG_ERROR,
++        "qemu-upstream PCI hotplug not supported in qemu-dm\n");
      exit(-1);
  }
  
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.