ia64/xen-unstable
changeset 14237:eceb9ccd84a8
[POWERPC][XEN] Introduce "platform" abstraction to describe the IO hole.
Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author | Hollis Blanchard <hollisb@us.ibm.com> |
---|---|
date | Fri Mar 02 17:06:50 2007 -0600 (2007-03-02) |
parents | 07066db94d89 |
children | f56981f78d73 |
files | xen/arch/powerpc/Makefile xen/arch/powerpc/mm.c xen/arch/powerpc/papr/xlate.c xen/arch/powerpc/platform.c xen/arch/powerpc/powerpc64/ppc970.c xen/include/asm-powerpc/processor.h xen/include/asm/platform.h |
line diff
1.1 --- a/xen/arch/powerpc/Makefile Thu Mar 01 15:04:45 2007 -0600 1.2 +++ b/xen/arch/powerpc/Makefile Fri Mar 02 17:06:50 2007 -0600 1.3 @@ -33,6 +33,7 @@ obj-y += of-devwalk.o 1.4 obj-y += ofd_fixup.o 1.5 obj-y += ofd_fixup_memory.o 1.6 obj-y += physdev.o 1.7 +obj-y += platform.o 1.8 obj-y += rtas.o 1.9 obj-y += setup.o 1.10 obj-y += shadow.o
2.1 --- a/xen/arch/powerpc/mm.c Thu Mar 01 15:04:45 2007 -0600 2.2 +++ b/xen/arch/powerpc/mm.c Fri Mar 02 17:06:50 2007 -0600 2.3 @@ -27,6 +27,7 @@ 2.4 #include <xen/perfc.h> 2.5 #include <asm/init.h> 2.6 #include <asm/page.h> 2.7 +#include <asm/platform.h> 2.8 #include <asm/string.h> 2.9 #include <public/arch-powerpc.h> 2.10 2.11 @@ -426,7 +427,7 @@ ulong pfn2mfn(struct domain *d, ulong pf 2.12 /* Its a grant table access */ 2.13 t = PFN_TYPE_GNTTAB; 2.14 mfn = gnttab_shared_mfn(d, d->grant_table, (pfn - max_page)); 2.15 - } else if (d->is_privileged && cpu_io_mfn(pfn)) { 2.16 + } else if (d->is_privileged && platform_io_mfn(pfn)) { 2.17 t = PFN_TYPE_IO; 2.18 mfn = pfn; 2.19 } else { 2.20 @@ -512,7 +513,7 @@ unsigned long mfn_to_gmfn(struct domain 2.21 return max_page + (mfn - gnttab_mfn); 2.22 2.23 /* IO? */ 2.24 - if (d->is_privileged && cpu_io_mfn(mfn)) 2.25 + if (d->is_privileged && platform_io_mfn(mfn)) 2.26 return mfn; 2.27 2.28 rma_mfn = page_to_mfn(d->arch.rma_page);
3.1 --- a/xen/arch/powerpc/papr/xlate.c Thu Mar 01 15:04:45 2007 -0600 3.2 +++ b/xen/arch/powerpc/papr/xlate.c Fri Mar 02 17:06:50 2007 -0600 3.3 @@ -29,6 +29,7 @@ 3.4 #include <asm/current.h> 3.5 #include <asm/papr.h> 3.6 #include <asm/hcalls.h> 3.7 +#include <asm/platform.h> 3.8 3.9 #ifdef DEBUG 3.10 #define DBG(fmt...) printk(fmt) 3.11 @@ -536,7 +537,7 @@ long pte_remove(ulong flags, ulong ptex, 3.12 3.13 if (lpte.bits.v) { 3.14 ulong mfn = lpte.bits.rpn; 3.15 - if (!cpu_io_mfn(mfn)) { 3.16 + if (!platform_io_mfn(mfn)) { 3.17 struct page_info *pg = mfn_to_page(mfn); 3.18 struct domain *f = page_get_owner(pg); 3.19
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 4.2 +++ b/xen/arch/powerpc/platform.c Fri Mar 02 17:06:50 2007 -0600 4.3 @@ -0,0 +1,43 @@ 4.4 +/* 4.5 + * This program is free software; you can redistribute it and/or modify 4.6 + * it under the terms of the GNU General Public License as published by 4.7 + * the Free Software Foundation; either version 2 of the License, or 4.8 + * (at your option) any later version. 4.9 + * 4.10 + * This program is distributed in the hope that it will be useful, 4.11 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 4.12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 4.13 + * GNU General Public License for more details. 4.14 + * 4.15 + * You should have received a copy of the GNU General Public License 4.16 + * along with this program; if not, write to the Free Software 4.17 + * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 4.18 + * 4.19 + * Copyright IBM Corp. 2007 4.20 + * 4.21 + * Authors: Ryan Harper <ryanh@us.ibm.com> 4.22 + * Hollis Blanchard <hollisb@us.ibm.com> 4.23 + */ 4.24 + 4.25 +#include <asm/page.h> 4.26 +#include <asm/platform.h> 4.27 + 4.28 +#define IO_RANGE_START (2UL << 30) 4.29 +#define IO_RANGE_END (4UL << 30) 4.30 +#define IO_SIZE (IO_RANGE_END - IO_RANGE_START) 4.31 + 4.32 +unsigned long platform_iohole_base(void) 4.33 +{ 4.34 + return IO_RANGE_START; 4.35 +} 4.36 + 4.37 +unsigned long platform_iohole_size(void) 4.38 +{ 4.39 + return IO_SIZE; 4.40 +} 4.41 + 4.42 +int platform_io_mfn(unsigned long mfn) 4.43 +{ 4.44 + unsigned long maddr = mfn << PAGE_SHIFT; 4.45 + return maddr > IO_RANGE_START && maddr < IO_RANGE_END; 4.46 +}
5.1 --- a/xen/arch/powerpc/powerpc64/ppc970.c Thu Mar 01 15:04:45 2007 -0600 5.2 +++ b/xen/arch/powerpc/powerpc64/ppc970.c Fri Mar 02 17:06:50 2007 -0600 5.3 @@ -129,18 +129,6 @@ unsigned int cpu_extent_order(void) 5.4 return log_large_page_sizes[0] - PAGE_SHIFT; 5.5 } 5.6 5.7 -/* This is more a platform thing than a CPU thing, but we only have 5.8 - * one platform now */ 5.9 -int cpu_io_mfn(ulong mfn) 5.10 -{ 5.11 - /* totally cheating */ 5.12 - if (mfn >= (2UL << (30 - PAGE_SHIFT)) && /* 2GiB */ 5.13 - mfn < (4UL << (30 - PAGE_SHIFT))) /* 4GiB */ 5.14 - return 1; 5.15 - 5.16 - return 0; 5.17 -} 5.18 - 5.19 int cpu_threads(int cpuid) 5.20 { 5.21 return 1;
6.1 --- a/xen/include/asm-powerpc/processor.h Thu Mar 01 15:04:45 2007 -0600 6.2 +++ b/xen/include/asm-powerpc/processor.h Fri Mar 02 17:06:50 2007 -0600 6.3 @@ -124,7 +124,6 @@ extern int cpu_rma_valid(unsigned int or 6.4 extern uint cpu_large_page_orders(uint *sizes, uint max); 6.5 extern void cpu_initialize(int cpuid); 6.6 extern void cpu_init_vcpu(struct vcpu *); 6.7 -extern int cpu_io_mfn(ulong mfn); 6.8 extern int cpu_threads(int cpuid); 6.9 extern void save_cpu_sprs(struct vcpu *); 6.10 extern void load_cpu_sprs(struct vcpu *);
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 7.2 +++ b/xen/include/asm/platform.h Fri Mar 02 17:06:50 2007 -0600 7.3 @@ -0,0 +1,28 @@ 7.4 +/* 7.5 + * This program is free software; you can redistribute it and/or modify 7.6 + * it under the terms of the GNU General Public License as published by 7.7 + * the Free Software Foundation; either version 2 of the License, or 7.8 + * (at your option) any later version. 7.9 + * 7.10 + * This program is distributed in the hope that it will be useful, 7.11 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 7.12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 7.13 + * GNU General Public License for more details. 7.14 + * 7.15 + * You should have received a copy of the GNU General Public License 7.16 + * along with this program; if not, write to the Free Software 7.17 + * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 7.18 + * 7.19 + * Copyright IBM Corp. 2007 7.20 + * 7.21 + * Authors: Ryan Harper <ryanh@us.ibm.com> 7.22 + */ 7.23 + 7.24 +#ifndef _ASM_PLATFORM_H_ 7.25 +#define _ASM_PLATFORM_H_ 7.26 + 7.27 +extern unsigned long platform_iohole_base(void); 7.28 +extern unsigned long platform_iohole_size(void); 7.29 +extern int platform_io_mfn(unsigned long mfn); 7.30 + 7.31 +#endif