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

[Xen-changelog] [xen-unstable] Add some necessary files to build IA64 VT-d.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1224512119 -3600
# Node ID 6eb23f7ece781a4013fb291217ca2e61756aadcb
# Parent  d752eaa7c1db9d91b141773f177570b0a0e183c7
Add some necessary files to build IA64 VT-d.

Signed-off-by: Anthony Xu <anthony.xu@xxxxxxxxx>
Signed-off-by: Dexuan Cui <dexuan.cui@xxxxxxxxx>
---
 xen/drivers/Makefile                      |    2 
 xen/drivers/passthrough/Makefile          |    1 
 xen/drivers/passthrough/vtd/Makefile      |    1 
 xen/drivers/passthrough/vtd/ia64/Makefile |    1 
 xen/drivers/passthrough/vtd/ia64/vtd.c    |  112 ++++++++++++++++++++++++++++++
 5 files changed, 116 insertions(+), 1 deletion(-)

diff -r d752eaa7c1db -r 6eb23f7ece78 xen/drivers/Makefile
--- a/xen/drivers/Makefile      Mon Oct 20 15:14:55 2008 +0100
+++ b/xen/drivers/Makefile      Mon Oct 20 15:15:19 2008 +0100
@@ -1,6 +1,6 @@ subdir-y += char
 subdir-y += char
 subdir-y += cpufreq
 subdir-y += pci
-subdir-$(x86) += passthrough
+subdir-y += passthrough
 subdir-$(HAS_ACPI) += acpi
 subdir-$(HAS_VGA) += video
diff -r d752eaa7c1db -r 6eb23f7ece78 xen/drivers/passthrough/Makefile
--- a/xen/drivers/passthrough/Makefile  Mon Oct 20 15:14:55 2008 +0100
+++ b/xen/drivers/passthrough/Makefile  Mon Oct 20 15:15:19 2008 +0100
@@ -1,4 +1,5 @@ subdir-$(x86) += vtd
 subdir-$(x86) += vtd
+subdir-$(ia64) += vtd
 subdir-$(x86) += amd
 
 obj-y += iommu.o
diff -r d752eaa7c1db -r 6eb23f7ece78 xen/drivers/passthrough/vtd/Makefile
--- a/xen/drivers/passthrough/vtd/Makefile      Mon Oct 20 15:14:55 2008 +0100
+++ b/xen/drivers/passthrough/vtd/Makefile      Mon Oct 20 15:15:19 2008 +0100
@@ -1,4 +1,5 @@ subdir-$(x86) += x86
 subdir-$(x86) += x86
+subdir-$(ia64) += ia64
 
 obj-y += iommu.o
 obj-y += dmar.o
diff -r d752eaa7c1db -r 6eb23f7ece78 xen/drivers/passthrough/vtd/ia64/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/drivers/passthrough/vtd/ia64/Makefile Mon Oct 20 15:15:19 2008 +0100
@@ -0,0 +1,1 @@
+obj-y += vtd.o
diff -r d752eaa7c1db -r 6eb23f7ece78 xen/drivers/passthrough/vtd/ia64/vtd.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/drivers/passthrough/vtd/ia64/vtd.c    Mon Oct 20 15:15:19 2008 +0100
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 2008, Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place - Suite 330, Boston, MA 02111-1307 USA.
+ *
+ * Copyright (C) Allen Kay <allen.m.kay@xxxxxxxxx>
+ * Copyright (C) Weidong Han <weidong.han@xxxxxxxxx>
+ */
+
+#include <xen/sched.h>
+#include <xen/domain_page.h>
+#include <xen/iommu.h>
+#include <asm/xensystem.h>
+#include <asm/sal.h>
+#include "../iommu.h"
+#include "../dmar.h"
+#include "../vtd.h"
+
+
+int vector_irq[NR_VECTORS] __read_mostly = { [0 ... NR_VECTORS - 1] = -1};
+/* irq_vectors is indexed by the sum of all RTEs in all I/O APICs. */
+u8 irq_vector[NR_IRQ_VECTORS] __read_mostly;
+
+void *map_vtd_domain_page(u64 maddr)
+{
+    return (void *)((u64)map_domain_page(maddr >> PAGE_SHIFT) |
+            (maddr & (PAGE_SIZE - PAGE_SIZE_4K)));
+}
+
+void unmap_vtd_domain_page(void *va)
+{
+    unmap_domain_page(va);
+}
+
+/* Allocate page table, return its machine address */
+u64 alloc_pgtable_maddr(void)
+{
+    struct page_info *pg;
+    u64 *vaddr;
+
+    pg = alloc_domheap_page(NULL, 0);
+    vaddr = map_domain_page(page_to_mfn(pg));
+    if ( !vaddr )
+        return 0;
+    memset(vaddr, 0, PAGE_SIZE);
+
+    iommu_flush_cache_page(vaddr);
+    unmap_domain_page(vaddr);
+
+    return page_to_maddr(pg);
+}
+
+void free_pgtable_maddr(u64 maddr)
+{
+    if ( maddr != 0 )
+        free_domheap_page(maddr_to_page(maddr));
+}
+
+unsigned int get_cache_line_size(void)
+{
+    return L1_CACHE_BYTES;
+}
+
+void cacheline_flush(char * addr)
+{
+    ia64_fc(addr);
+    ia64_sync_i();
+    ia64_srlz_i();
+}
+
+void flush_all_cache()
+{
+    ia64_sal_cache_flush(3);
+}
+
+void * map_to_nocache_virt(int nr_iommus, u64 maddr)
+{
+  return (void *) ( maddr + __IA64_UNCACHED_OFFSET);
+}
+
+struct hvm_irq_dpci *domain_get_irq_dpci(struct domain *domain)
+{
+    if ( !domain )
+        return NULL;
+
+    return domain->arch.hvm_domain.irq.dpci;
+}
+
+int domain_set_irq_dpci(struct domain *domain, struct hvm_irq_dpci *dpci)
+{
+    if ( !domain || !dpci )
+        return 0;
+
+    domain->arch.hvm_domain.irq.dpci = dpci;
+    return 1;
+}
+
+void hvm_dpci_isairq_eoi(struct domain *d, unsigned int isairq)
+{
+    /* dummy */
+}

_______________________________________________
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®.