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

[Xen-changelog] [xen-unstable] [POWERPC][XEN] Introduce "platform" abstraction to describe the IO hole.



# HG changeset patch
# User Hollis Blanchard <hollisb@xxxxxxxxxx>
# Date 1172876810 21600
# Node ID eceb9ccd84a8de9e4e3c8ced4b68e60b335b8a95
# Parent  07066db94d89ad477b5baa16eeb76dd85575e80b
[POWERPC][XEN] Introduce "platform" abstraction to describe the IO hole.
Signed-off-by: Ryan Harper <ryanh@xxxxxxxxxx>
Signed-off-by: Hollis Blanchard <hollisb@xxxxxxxxxx>
---
 xen/arch/powerpc/Makefile           |    1 
 xen/arch/powerpc/mm.c               |    5 ++--
 xen/arch/powerpc/papr/xlate.c       |    3 +-
 xen/arch/powerpc/platform.c         |   43 ++++++++++++++++++++++++++++++++++++
 xen/arch/powerpc/powerpc64/ppc970.c |   12 ----------
 xen/include/asm-powerpc/processor.h |    1 
 xen/include/asm/platform.h          |   28 +++++++++++++++++++++++
 7 files changed, 77 insertions(+), 16 deletions(-)

diff -r 07066db94d89 -r eceb9ccd84a8 xen/arch/powerpc/Makefile
--- a/xen/arch/powerpc/Makefile Thu Mar 01 15:04:45 2007 -0600
+++ b/xen/arch/powerpc/Makefile Fri Mar 02 17:06:50 2007 -0600
@@ -33,6 +33,7 @@ obj-y += ofd_fixup.o
 obj-y += ofd_fixup.o
 obj-y += ofd_fixup_memory.o
 obj-y += physdev.o
+obj-y += platform.o
 obj-y += rtas.o
 obj-y += setup.o
 obj-y += shadow.o
diff -r 07066db94d89 -r eceb9ccd84a8 xen/arch/powerpc/mm.c
--- a/xen/arch/powerpc/mm.c     Thu Mar 01 15:04:45 2007 -0600
+++ b/xen/arch/powerpc/mm.c     Fri Mar 02 17:06:50 2007 -0600
@@ -27,6 +27,7 @@
 #include <xen/perfc.h>
 #include <asm/init.h>
 #include <asm/page.h>
+#include <asm/platform.h>
 #include <asm/string.h>
 #include <public/arch-powerpc.h>
 
@@ -426,7 +427,7 @@ ulong pfn2mfn(struct domain *d, ulong pf
         /* Its a grant table access */
         t = PFN_TYPE_GNTTAB;
         mfn = gnttab_shared_mfn(d, d->grant_table, (pfn - max_page));
-    } else if (d->is_privileged && cpu_io_mfn(pfn)) {
+    } else if (d->is_privileged && platform_io_mfn(pfn)) {
         t = PFN_TYPE_IO;
         mfn = pfn;
     } else {
@@ -512,7 +513,7 @@ unsigned long mfn_to_gmfn(struct domain 
         return max_page + (mfn - gnttab_mfn);
 
     /* IO? */
-    if (d->is_privileged && cpu_io_mfn(mfn))
+    if (d->is_privileged && platform_io_mfn(mfn))
         return mfn;
 
     rma_mfn = page_to_mfn(d->arch.rma_page);
diff -r 07066db94d89 -r eceb9ccd84a8 xen/arch/powerpc/papr/xlate.c
--- a/xen/arch/powerpc/papr/xlate.c     Thu Mar 01 15:04:45 2007 -0600
+++ b/xen/arch/powerpc/papr/xlate.c     Fri Mar 02 17:06:50 2007 -0600
@@ -29,6 +29,7 @@
 #include <asm/current.h>
 #include <asm/papr.h>
 #include <asm/hcalls.h>
+#include <asm/platform.h>
 
 #ifdef DEBUG
 #define DBG(fmt...) printk(fmt)
@@ -536,7 +537,7 @@ long pte_remove(ulong flags, ulong ptex,
 
     if (lpte.bits.v) {
         ulong mfn = lpte.bits.rpn;
-        if (!cpu_io_mfn(mfn)) {
+        if (!platform_io_mfn(mfn)) {
             struct page_info *pg = mfn_to_page(mfn);
             struct domain *f = page_get_owner(pg);
             
diff -r 07066db94d89 -r eceb9ccd84a8 xen/arch/powerpc/platform.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/powerpc/platform.c       Fri Mar 02 17:06:50 2007 -0600
@@ -0,0 +1,43 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that 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, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ * Copyright IBM Corp. 2007
+ *
+ * Authors: Ryan Harper <ryanh@xxxxxxxxxx>
+ *          Hollis Blanchard <hollisb@xxxxxxxxxx>
+ */
+
+#include <asm/page.h>
+#include <asm/platform.h>
+
+#define IO_RANGE_START (2UL << 30)
+#define IO_RANGE_END   (4UL << 30)
+#define IO_SIZE        (IO_RANGE_END - IO_RANGE_START)
+
+unsigned long platform_iohole_base(void)
+{
+    return IO_RANGE_START;
+}
+
+unsigned long platform_iohole_size(void)
+{
+    return IO_SIZE;
+}
+
+int platform_io_mfn(unsigned long mfn)
+{
+    unsigned long maddr = mfn << PAGE_SHIFT;
+    return maddr > IO_RANGE_START && maddr < IO_RANGE_END;
+}
diff -r 07066db94d89 -r eceb9ccd84a8 xen/arch/powerpc/powerpc64/ppc970.c
--- a/xen/arch/powerpc/powerpc64/ppc970.c       Thu Mar 01 15:04:45 2007 -0600
+++ b/xen/arch/powerpc/powerpc64/ppc970.c       Fri Mar 02 17:06:50 2007 -0600
@@ -129,18 +129,6 @@ unsigned int cpu_extent_order(void)
     return log_large_page_sizes[0] - PAGE_SHIFT;
 }
 
-/* This is more a platform thing than a CPU thing, but we only have
- * one platform now */
-int cpu_io_mfn(ulong mfn)
-{
-    /* totally cheating */
-    if (mfn >= (2UL << (30 - PAGE_SHIFT)) && /* 2GiB */
-        mfn < (4UL << (30 - PAGE_SHIFT)))    /* 4GiB */
-        return 1;
-
-    return 0;
-}
-
 int cpu_threads(int cpuid)
 {
     return 1;
diff -r 07066db94d89 -r eceb9ccd84a8 xen/include/asm-powerpc/processor.h
--- a/xen/include/asm-powerpc/processor.h       Thu Mar 01 15:04:45 2007 -0600
+++ b/xen/include/asm-powerpc/processor.h       Fri Mar 02 17:06:50 2007 -0600
@@ -124,7 +124,6 @@ extern uint cpu_large_page_orders(uint *
 extern uint cpu_large_page_orders(uint *sizes, uint max);
 extern void cpu_initialize(int cpuid);
 extern void cpu_init_vcpu(struct vcpu *);
-extern int cpu_io_mfn(ulong mfn);
 extern int cpu_threads(int cpuid);
 extern void save_cpu_sprs(struct vcpu *);
 extern void load_cpu_sprs(struct vcpu *);
diff -r 07066db94d89 -r eceb9ccd84a8 xen/include/asm/platform.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/include/asm/platform.h        Fri Mar 02 17:06:50 2007 -0600
@@ -0,0 +1,28 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that 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, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ * Copyright IBM Corp. 2007
+ *
+ * Authors: Ryan Harper <ryanh@xxxxxxxxxx>
+ */
+
+#ifndef _ASM_PLATFORM_H_
+#define _ASM_PLATFORM_H_
+
+extern unsigned long platform_iohole_base(void);
+extern unsigned long platform_iohole_size(void);
+extern int platform_io_mfn(unsigned long mfn);
+
+#endif

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