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

RE: [Xen-ia64-devel][PATCH][VTD] add head files and helper functions for VTD/ia64


  • To: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
  • From: "Xu, Anthony" <anthony.xu@xxxxxxxxx>
  • Date: Tue, 21 Oct 2008 18:17:00 +0800
  • Accept-language: en-US
  • Acceptlanguage: en-US
  • Cc: xen-ia64-devel <xen-ia64-devel@xxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 21 Oct 2008 03:17:20 -0700
  • List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
  • Thread-index: AckzYMHmM+gtiVv0SES+r5bhwyiAqQABST0A
  • Thread-topic: [Xen-ia64-devel][PATCH][VTD] add head files and helper functions for VTD/ia64

Updated one per your comments

Thanks,
Anthony

Isaku Yamahata wrote:
> On Tue, Oct 21, 2008 at 11:02:08AM +0800, Xu, Anthony wrote:
>> Add head files and helper functions for VTD/ia64.
>>
>> Signed-off-by; Anthony Xu < anthony.xu@xxxxxxxxx >
>>
>>
>> #Cset 18649 -- 18653 in xen-devel tree are needed.
>> So you may need to pull from xen-devel, then apply this patch.
>>
>> Thanks,
>> Anthony
>>
>>
>>
>
> This looks mostly good. Except hvm_{pci, isa}_xxx() should be
> defined under xen/arch/ia64/vmx/.
>
> thanks,
>
>> Add head files and helper functions for VTD/ia64
>>
>> Signed-off-by; Anthony Xu < anthony.xu@xxxxxxxxx >
>>
>>
>>
>>
>>
>>
>> diff -r fc74f8f81e1e xen/arch/ia64/linux-xen/irq_ia64.c
>> --- a/xen/arch/ia64/linux-xen/irq_ia64.c      Tue Oct 21 10:20:39
>> 2008 +0800 +++ b/xen/arch/ia64/linux-xen/irq_ia64.c      Tue Oct 21
>> 10:37:33 2008 +0800 @@ -334,3 +334,49 @@
>>
>>       writeq(ipi_data, ipi_addr);
>>  }
>> +
>> +void hvm_pci_intx_assert(
>> +             struct domain *d, unsigned int device, unsigned int
>> intx) +{ +     struct hvm_irq *hvm_irq = &d->arch.hvm_domain.irq; +
>> unsigned int gsi; +
>> +     ASSERT((device <= 31) && (intx <= 3));
>> +
>> +     if ( __test_and_set_bit(device*4 + intx, &hvm_irq->pci_intx.i)
>> ) +             return; +     gsi = hvm_pci_intx_gsi(device, intx);
>> +     if ( ++hvm_irq->gsi_assert_count[gsi] == 1 ){
>> +             viosapic_set_irq(d, gsi, 1);
>> +     }
>> +}
>> +
>> +void hvm_pci_intx_deassert(
>> +             struct domain *d, unsigned int device, unsigned int
>> intx) +{ +     struct hvm_irq *hvm_irq = &d->arch.hvm_domain.irq; +
>> unsigned int gsi; +
>> +     ASSERT((device <= 31) && (intx <= 3));
>> +
>> +     if ( !__test_and_clear_bit(device*4 + intx,
>> &hvm_irq->pci_intx.i) ) +             return; +
>> +    gsi = hvm_pci_intx_gsi(device, intx);
>> +
>> +     if (--hvm_irq->gsi_assert_count[gsi] == 0)
>> +             viosapic_set_irq(d, gsi, 0);
>> +}
>> +
>> +void hvm_isa_irq_assert(
>> +             struct domain *d, unsigned int isa_irq) +{
>> +     /* dummy */
>> +}
>> +
>> +
>> +void hvm_isa_irq_deassert(
>> +             struct domain *d, unsigned int isa_irq) +{
>> +     /* dummy */
>> +}
>> diff -r fc74f8f81e1e xen/arch/ia64/vmx/viosapic.c
>> --- a/xen/arch/ia64/vmx/viosapic.c    Tue Oct 21 10:20:39 2008 +0800
>> +++ b/xen/arch/ia64/vmx/viosapic.c    Tue Oct 21 10:37:33 2008 +0800
>>  @@ -314,10 +314,6 @@ out:
>>      spin_unlock(&viosapic->lock);
>>  }
>> -
>> -#define hvm_pci_intx_gsi(dev, intx)  \
>> -    (((((dev) << 2) + ((dev) >> 3) + (intx)) & 31) + 16) -
>>
>>  void viosapic_set_pci_irq(struct domain *d, int device, int intx,
>> int level)  {
>> diff -r fc74f8f81e1e xen/arch/ia64/xen/mm.c
>> --- a/xen/arch/ia64/xen/mm.c  Tue Oct 21 10:20:39 2008 +0800
>> +++ b/xen/arch/ia64/xen/mm.c  Tue Oct 21 10:37:33 2008 +0800 @@
>>      -3414,18 +3414,6 @@ __xencomm_mark_dirty(current->domain, addr,
>> len);  }
>>
>> -int iommu_map_page(struct domain *d, unsigned long gfn, unsigned
>> long mfn) -{
>> -    /* STUB to compile */
>> -    return -ENOSYS;
>> -}
>> -
>> -int iommu_unmap_page(struct domain *d, unsigned long gfn) -{
>> -    /* STUB to compile */
>> -    return -ENOSYS;
>> -}
>> -
>>  /*
>>   * Local variables:
>>   * mode: C
>> diff -r fc74f8f81e1e xen/arch/ia64/xen/xensetup.c
>> --- a/xen/arch/ia64/xen/xensetup.c    Tue Oct 21 10:20:39 2008 +0800
>> +++ b/xen/arch/ia64/xen/xensetup.c    Tue Oct 21 10:37:33 2008 +0800
>>      @@ -740,3 +740,15 @@ }
>>  }
>>
>> +int xen_in_range(paddr_t start, paddr_t end)
>> +{
>> +    start = max_t(paddr_t, start, xen_pstart);
>> +    end = min_t(paddr_t, end, xen_pstart + XENHEAP_DEFAULT_SIZE); +
>> +    return start < end;
>> +}
>> +
>> +int tboot_in_range(paddr_t start, paddr_t end)
>> +{
>> +    return 0;
>> +}
>> diff -r fc74f8f81e1e xen/include/asm-ia64/domain.h
>> --- a/xen/include/asm-ia64/domain.h   Tue Oct 21 10:20:39 2008 +0800
>> +++ b/xen/include/asm-ia64/domain.h   Tue Oct 21 10:37:33 2008 +0800
>>  @@ -42,6 +42,8 @@ /* Cleanly crash the current domain with a
>>  message.  */ extern void panic_domain(struct pt_regs *, const char
>>       *, ...) __attribute__ ((noreturn, format (printf, 2, 3))); +
>> +#define has_arch_pdevs(d)    (!list_empty(&(d)->arch.pdev_list))
>>
>>  struct mm_struct {
>>       volatile pgd_t * pgd;
>> @@ -166,6 +168,7 @@
>>      unsigned char rid_bits;          /* number of virtual rid bits
>>      (default: 18) */ int breakimm;               /* The imm value
>> for hypercalls.  */
>>
>> +    struct list_head pdev_list;
>>      struct virtual_platform_def     vmx_platform;
>>  #define      hvm_domain vmx_platform /* platform defs are not vmx
>> specific */
>>
>> diff -r fc74f8f81e1e xen/include/asm-ia64/linux-xen/asm/iosapic.h
>> --- a/xen/include/asm-ia64/linux-xen/asm/iosapic.h    Tue Oct 21
>> 10:20:39 2008 +0800 +++
>>  b/xen/include/asm-ia64/linux-xen/asm/iosapic.h    Tue Oct 21
>>  10:37:33 2008 +0800 @@ -175,5 +175,8 @@ extern unsigned long
>> ia64_xen_vector[]; #endif /* XEN */
>>
>> +#define IO_APIC_BASE(idx) ((unsigned int *)iosapic_lists[idx].addr)
>> +#define IO_APIC_ID(idx)   (iosapic_lists[idx].id)
>> +
>>  # endif /* !__ASSEMBLY__ */
>>  #endif /* __ASM_IA64_IOSAPIC_H */
>> diff -r fc74f8f81e1e xen/include/asm-ia64/linux/asm/hw_irq.h
>> --- a/xen/include/asm-ia64/linux/asm/hw_irq.h Tue Oct 21 10:20:39
>> 2008 +0800 +++ b/xen/include/asm-ia64/linux/asm/hw_irq.h Tue Oct 21
>>       10:37:33 2008 +0800 @@ -124,13 +124,6 @@ return irq_desc + irq;
>>  }
>>
>> -/* Extract the IA-64 vector that corresponds to IRQ.  */
>> -static inline ia64_vector
>> -irq_to_vector (int irq)
>> -{
>> -     return (ia64_vector) irq;
>> -}
>> -
>>  /*
>>   * Convert the local IA-64 vector to the corresponding irq number.
>> This translation is
>>   * done in the context of the interrupt domain that the currently
>> executing CPU belongs diff -r fc74f8f81e1e
>> xen/include/asm-ia64/vmx_platform.h ---
>> a/xen/include/asm-ia64/vmx_platform.h     Tue Oct 21 10:20:39 2008
>> +0800 +++ b/xen/include/asm-ia64/vmx_platform.h     Tue Oct 21
>> 10:37:33 2008 +0800 @@ -21,8 +21,10 @@
>>
>>  #include <public/xen.h>
>>  #include <public/hvm/params.h>
>> +#include <asm/hvm/irq.h>
>>  #include <asm/viosapic.h>
>>  #include <asm/hvm/vacpi.h>
>> +#include <xen/hvm/iommu.h>
>>
>>  struct vmx_ioreq_page {
>>      spinlock_t          lock;
>> @@ -41,6 +43,9 @@
>>      /* One IOSAPIC now... */
>>      struct viosapic             viosapic;
>>      struct vacpi                vacpi;
>> +    /* Pass-throgh VT-d */
>> +    struct hvm_irq              irq;
>> +    struct hvm_iommu            hvm_iommu;
>>  } vir_plat_t;
>>
>>  static inline int __fls(uint32_t word)

Attachment: add_head_file_for_VTD2.patch
Description: add_head_file_for_VTD2.patch

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

 


Rackspace

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