ia64/xen-unstable

changeset 18836:ab0c1bdede53

Merge with ia64 tree.
author Keir Fraser <keir.fraser@citrix.com>
date Wed Nov 26 11:14:26 2008 +0000 (2008-11-26)
parents b3265ff6c613 32aecede4626
children a558165cfead
files
line diff
     1.1 --- a/xen/common/timer.c	Wed Nov 26 10:23:49 2008 +0900
     1.2 +++ b/xen/common/timer.c	Wed Nov 26 11:14:26 2008 +0000
     1.3 @@ -494,12 +494,14 @@ static void dump_timerq(unsigned char ke
     1.4          for ( j = 1; j <= GET_HEAP_SIZE(ts->heap); j++ )
     1.5          {
     1.6              t = ts->heap[j];
     1.7 -            printk ("  %d : %p ex=0x%08X%08X %p\n",
     1.8 -                    j, t, (u32)(t->expires>>32), (u32)t->expires, t->data);
     1.9 +            printk ("  %d : %p ex=0x%08X%08X %p %p\n",
    1.10 +                    j, t, (u32)(t->expires>>32), (u32)t->expires,
    1.11 +                    t->data, t->function);
    1.12          }
    1.13          for ( t = ts->list, j = 0; t != NULL; t = t->list_next, j++ )
    1.14 -            printk (" L%d : %p ex=0x%08X%08X %p\n",
    1.15 -                    j, t, (u32)(t->expires>>32), (u32)t->expires, t->data);
    1.16 +            printk (" L%d : %p ex=0x%08X%08X %p %p\n",
    1.17 +                    j, t, (u32)(t->expires>>32), (u32)t->expires,
    1.18 +                    t->data, t->function);
    1.19          spin_unlock_irqrestore(&ts->lock, flags);
    1.20          printk("\n");
    1.21      }
     2.1 --- a/xen/drivers/char/console.c	Wed Nov 26 10:23:49 2008 +0900
     2.2 +++ b/xen/drivers/char/console.c	Wed Nov 26 11:14:26 2008 +0000
     2.3 @@ -927,7 +927,7 @@ void panic(const char *fmt, ...)
     2.4      console_start_sync();
     2.5      printk("\n****************************************\n");
     2.6      printk("Panic on CPU %d:\n", smp_processor_id());
     2.7 -    printk(buf);
     2.8 +    printk("%s", buf);
     2.9      printk("****************************************\n\n");
    2.10      if ( opt_noreboot )
    2.11          printk("Manual reset required ('noreboot' specified)\n");
     3.1 --- a/xen/drivers/passthrough/vtd/dmar.c	Wed Nov 26 10:23:49 2008 +0900
     3.2 +++ b/xen/drivers/passthrough/vtd/dmar.c	Wed Nov 26 11:14:26 2008 +0000
     3.3 @@ -172,6 +172,28 @@ struct acpi_drhd_unit * acpi_find_matche
     3.4      return found ? found : include_all;
     3.5  }
     3.6  
     3.7 +struct acpi_atsr_unit * acpi_find_matched_atsr_unit(u8 bus, u8 devfn)
     3.8 +{
     3.9 +    struct acpi_atsr_unit *atsr;
    3.10 +    struct acpi_atsr_unit *found = NULL, *include_all = NULL;
    3.11 +    int i;
    3.12 +
    3.13 +    list_for_each_entry ( atsr, &acpi_atsr_units, list )
    3.14 +    {
    3.15 +        for (i = 0; i < atsr->scope.devices_cnt; i++)
    3.16 +            if ( atsr->scope.devices[i] == PCI_BDF2(bus, devfn) )
    3.17 +                return atsr;
    3.18 +
    3.19 +        if ( test_bit(bus, atsr->scope.buses) )
    3.20 +            found = atsr;
    3.21 +
    3.22 +        if ( atsr->all_ports )
    3.23 +            include_all = atsr;
    3.24 +    }
    3.25 +
    3.26 +    return found ? found : include_all;
    3.27 +}
    3.28 +
    3.29  /*
    3.30   * Count number of devices in device scope.  Do not include PCI sub
    3.31   * hierarchies.
    3.32 @@ -242,7 +264,6 @@ static int __init acpi_parse_dev_scope(v
    3.33          switch ( acpi_scope->dev_type )
    3.34          {
    3.35          case ACPI_DEV_P2PBRIDGE:
    3.36 -        {
    3.37              sec_bus = pci_conf_read8(
    3.38                  bus, path->dev, path->fn, PCI_SECONDARY_BUS);
    3.39              sub_bus = pci_conf_read8(
    3.40 @@ -253,7 +274,6 @@ static int __init acpi_parse_dev_scope(v
    3.41  
    3.42              dmar_scope_add_buses(scope, sec_bus, sub_bus);
    3.43              break;
    3.44 -        }
    3.45  
    3.46          case ACPI_DEV_MSI_HPET:
    3.47              dprintk(XENLOG_INFO VTDPREFIX, "found MSI HPET: bdf = %x:%x.%x\n",
    3.48 @@ -268,7 +288,6 @@ static int __init acpi_parse_dev_scope(v
    3.49              break;
    3.50  
    3.51          case ACPI_DEV_IOAPIC:
    3.52 -        {
    3.53              dprintk(XENLOG_INFO VTDPREFIX, "found IOAPIC: bdf = %x:%x.%x\n",
    3.54                      bus, path->dev, path->fn);
    3.55  
    3.56 @@ -288,7 +307,6 @@ static int __init acpi_parse_dev_scope(v
    3.57              scope->devices[didx++] = PCI_BDF(bus, path->dev, path->fn);
    3.58              break;
    3.59          }
    3.60 -        }
    3.61  
    3.62          start += acpi_scope->length;
    3.63     }
     4.1 --- a/xen/drivers/passthrough/vtd/dmar.h	Wed Nov 26 10:23:49 2008 +0900
     4.2 +++ b/xen/drivers/passthrough/vtd/dmar.h	Wed Nov 26 11:14:26 2008 +0000
     4.3 @@ -80,6 +80,7 @@ struct acpi_atsr_unit {
     4.4                   idx < rmrr->scope.devices_cnt; idx++)
     4.5  
     4.6  struct acpi_drhd_unit * acpi_find_matched_drhd_unit(u8 bus, u8 devfn);
     4.7 +struct acpi_atsr_unit * acpi_find_matched_atsr_unit(u8 bus, u8 devfn);
     4.8  void dmar_scope_add_buses(struct dmar_scope *scope, u16 sec, u16 sub);
     4.9  void dmar_scope_remove_buses(struct dmar_scope *scope, u16 sec, u16 sub);
    4.10  
     5.1 --- a/xen/drivers/passthrough/vtd/iommu.c	Wed Nov 26 10:23:49 2008 +0900
     5.2 +++ b/xen/drivers/passthrough/vtd/iommu.c	Wed Nov 26 11:14:26 2008 +0000
     5.3 @@ -714,22 +714,22 @@ static void iommu_fault_status(u32 fault
     5.4      if ( fault_status & DMA_FSTS_PFO )
     5.5          dprintk(XENLOG_ERR VTDPREFIX,
     5.6              "iommu_fault_status: Fault Overflow\n");
     5.7 -    else if ( fault_status & DMA_FSTS_PPF )
     5.8 +    if ( fault_status & DMA_FSTS_PPF )
     5.9          dprintk(XENLOG_ERR VTDPREFIX,
    5.10              "iommu_fault_status: Primary Pending Fault\n");
    5.11 -    else if ( fault_status & DMA_FSTS_AFO )
    5.12 +    if ( fault_status & DMA_FSTS_AFO )
    5.13          dprintk(XENLOG_ERR VTDPREFIX,
    5.14              "iommu_fault_status: Advanced Fault Overflow\n");
    5.15 -    else if ( fault_status & DMA_FSTS_APF )
    5.16 +    if ( fault_status & DMA_FSTS_APF )
    5.17          dprintk(XENLOG_ERR VTDPREFIX,
    5.18              "iommu_fault_status: Advanced Pending Fault\n");
    5.19 -    else if ( fault_status & DMA_FSTS_IQE )
    5.20 +    if ( fault_status & DMA_FSTS_IQE )
    5.21          dprintk(XENLOG_ERR VTDPREFIX,
    5.22              "iommu_fault_status: Invalidation Queue Error\n");
    5.23 -    else if ( fault_status & DMA_FSTS_ICE )
    5.24 +    if ( fault_status & DMA_FSTS_ICE )
    5.25          dprintk(XENLOG_ERR VTDPREFIX,
    5.26              "iommu_fault_status: Invalidation Completion Error\n");
    5.27 -    else if ( fault_status & DMA_FSTS_ITE )
    5.28 +    if ( fault_status & DMA_FSTS_ITE )
    5.29          dprintk(XENLOG_ERR VTDPREFIX,
    5.30              "iommu_fault_status: Invalidation Time-out Error\n");
    5.31  }
    5.32 @@ -754,10 +754,11 @@ static void iommu_page_fault(int vector,
    5.33  
    5.34      /* FIXME: ignore advanced fault log */
    5.35      if ( !(fault_status & DMA_FSTS_PPF) )
    5.36 -        return;
    5.37 +        goto clear_overflow;
    5.38 +
    5.39      fault_index = dma_fsts_fault_record_index(fault_status);
    5.40      reg = cap_fault_reg_offset(iommu->cap);
    5.41 -    for ( ; ; )
    5.42 +    while (1)
    5.43      {
    5.44          u8 fault_reason;
    5.45          u16 source_id;
    5.46 @@ -797,8 +798,9 @@ static void iommu_page_fault(int vector,
    5.47          if ( fault_index > cap_num_fault_regs(iommu->cap) )
    5.48              fault_index = 0;
    5.49      }
    5.50 -
    5.51 +clear_overflow:
    5.52      /* clear primary fault overflow */
    5.53 +    fault_status = readl(iommu->reg + DMAR_FSTS_REG);
    5.54      if ( fault_status & DMA_FSTS_PFO )
    5.55      {
    5.56          spin_lock_irqsave(&iommu->register_lock, flags);
     6.1 --- a/xen/drivers/passthrough/vtd/iommu.h	Wed Nov 26 10:23:49 2008 +0900
     6.2 +++ b/xen/drivers/passthrough/vtd/iommu.h	Wed Nov 26 11:14:26 2008 +0000
     6.3 @@ -310,6 +310,10 @@ struct iremap_entry {
     6.4  struct qinval_entry {
     6.5      union {
     6.6          struct {
     6.7 +            u64 lo;
     6.8 +            u64 hi;
     6.9 +        }val;
    6.10 +        struct {
    6.11              struct {
    6.12                  u64 type    : 4,
    6.13                      granu   : 2,
     7.1 --- a/xen/drivers/passthrough/vtd/qinval.c	Wed Nov 26 10:23:49 2008 +0900
     7.2 +++ b/xen/drivers/passthrough/vtd/qinval.c	Wed Nov 26 11:14:26 2008 +0000
     7.3 @@ -34,13 +34,13 @@ static void print_qi_regs(struct iommu *
     7.4      u64 val;
     7.5  
     7.6      val = dmar_readq(iommu->reg, DMAR_IQA_REG);
     7.7 -    printk("DMAR_IAQ_REG = %"PRIx64"\n", val);
     7.8 +    printk("DMAR_IQA_REG = %"PRIx64"\n", val);
     7.9  
    7.10      val = dmar_readq(iommu->reg, DMAR_IQH_REG);
    7.11 -    printk("DMAR_IAH_REG = %"PRIx64"\n", val);
    7.12 +    printk("DMAR_IQH_REG = %"PRIx64"\n", val);
    7.13  
    7.14      val = dmar_readq(iommu->reg, DMAR_IQT_REG);
    7.15 -    printk("DMAR_IAT_REG = %"PRIx64"\n", val);
    7.16 +    printk("DMAR_IQT_REG = %"PRIx64"\n", val);
    7.17  }
    7.18  
    7.19  static int qinval_next_index(struct iommu *iommu)
    7.20 @@ -252,14 +252,15 @@ static int gen_dev_iotlb_inv_dsc(struct 
    7.21      qinval_entry->q.dev_iotlb_inv_dsc.lo.res_3 = 0;
    7.22  
    7.23      qinval_entry->q.dev_iotlb_inv_dsc.hi.size = size;
    7.24 -    qinval_entry->q.dev_iotlb_inv_dsc.hi.addr = addr;
    7.25 +    qinval_entry->q.dev_iotlb_inv_dsc.hi.res_1 = 0;
    7.26 +    qinval_entry->q.dev_iotlb_inv_dsc.hi.addr = addr >> PAGE_SHIFT_4K;
    7.27  
    7.28      unmap_vtd_domain_page(qinval_entries);
    7.29      spin_unlock_irqrestore(&qi_ctrl->qinval_lock, flags);
    7.30      return 0;
    7.31  }
    7.32  
    7.33 -int queue_invalidate_device_iotlb(struct iommu *iommu,
    7.34 +int qinval_device_iotlb(struct iommu *iommu,
    7.35      u32 max_invs_pend, u16 sid, u16 size, u64 addr)
    7.36  {
    7.37      int ret = -1;