All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MAX_DMADOM_PFN
@ 2006-01-26  1:19 Isaku Yamahata
  2006-01-26 20:03 ` Jon Mason
  0 siblings, 1 reply; 4+ messages in thread
From: Isaku Yamahata @ 2006-01-26  1:19 UTC (permalink / raw)
  To: xen-devel; +Cc: xen-ia64-devel

[-- Attachment #1: Type: text/plain, Size: 1139 bytes --]


made MAX_DMADOM_PFN page size aware.
4K page size was assumed, however it is not true for xen/ia64.
It should also be possible for arch dependent code to override it.

# HG changeset patch
# User yamahata@valinux.co.jp
# Node ID 0c2b703c79333c01e4cccef1fbac1d01c6c7daa7
# Parent  5b004f4e76cf90ef6f7155a4822e63b9e33cf7d8
made MAX_DMADOM_PFN aware of page size.
4K page size was assumed. It is not true for xen/ia64 by default.
It should also be possible for arch dependent code to override it.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>

diff -r 5b004f4e76cf -r 0c2b703c7933 xen/common/page_alloc.c
--- a/xen/common/page_alloc.c	Wed Jan 25 23:35:22 2006 +0100
+++ b/xen/common/page_alloc.c	Thu Jan 26 10:09:39 2006 +0900
@@ -216,7 +216,9 @@
 #define NR_ZONES    3
 
 
-#define MAX_DMADOM_PFN 0x7FFFFUL /* 31 addressable bits */
+#ifndef MAX_DMADOM_PFN /* arch-depedent code can override */
+#define MAX_DMADOM_PFN (0x7FFFFFFFUL >> PAGE_SHIFT) /* 31 addressable bits */
+#endif
 #define pfn_dom_zone_type(_pfn)                                 \
     (((_pfn) <= MAX_DMADOM_PFN) ? MEMZONE_DMADOM : MEMZONE_DOM)
 

-- 
yamahata

[-- Attachment #2: max_domain_pfn.patch --]
[-- Type: text/plain, Size: 956 bytes --]

# HG changeset patch
# User yamahata@valinux.co.jp
# Node ID 0c2b703c79333c01e4cccef1fbac1d01c6c7daa7
# Parent  5b004f4e76cf90ef6f7155a4822e63b9e33cf7d8
made MAX_DMADOM_PFN aware of page size.
4K page size was assumed. It is not true for xen/ia64 by default.
It should also be possible for arch dependent code to override it.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>

diff -r 5b004f4e76cf -r 0c2b703c7933 xen/common/page_alloc.c
--- a/xen/common/page_alloc.c	Wed Jan 25 23:35:22 2006 +0100
+++ b/xen/common/page_alloc.c	Thu Jan 26 10:09:39 2006 +0900
@@ -216,7 +216,9 @@
 #define NR_ZONES    3
 
 
-#define MAX_DMADOM_PFN 0x7FFFFUL /* 31 addressable bits */
+#ifndef MAX_DMADOM_PFN /* arch-depedent code can override */
+#define MAX_DMADOM_PFN (0x7FFFFFFFUL >> PAGE_SHIFT) /* 31 addressable bits */
+#endif
 #define pfn_dom_zone_type(_pfn)                                 \
     (((_pfn) <= MAX_DMADOM_PFN) ? MEMZONE_DMADOM : MEMZONE_DOM)
 

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] MAX_DMADOM_PFN
  2006-01-26  1:19 [PATCH] MAX_DMADOM_PFN Isaku Yamahata
@ 2006-01-26 20:03 ` Jon Mason
  2006-01-30  3:07   ` Isaku Yamahata
  0 siblings, 1 reply; 4+ messages in thread
From: Jon Mason @ 2006-01-26 20:03 UTC (permalink / raw)
  To: Isaku Yamahata; +Cc: xen-devel, xen-ia64-devel

On Thu, Jan 26, 2006 at 10:19:20AM +0900, Isaku Yamahata wrote:
> 
> made MAX_DMADOM_PFN page size aware.
> 4K page size was assumed, however it is not true for xen/ia64.
> It should also be possible for arch dependent code to override it.
> 
> # HG changeset patch
> # User yamahata@valinux.co.jp
> # Node ID 0c2b703c79333c01e4cccef1fbac1d01c6c7daa7
> # Parent  5b004f4e76cf90ef6f7155a4822e63b9e33cf7d8
> made MAX_DMADOM_PFN aware of page size.
> 4K page size was assumed. It is not true for xen/ia64 by default.
> It should also be possible for arch dependent code to override it.
> 
> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
> 
> diff -r 5b004f4e76cf -r 0c2b703c7933 xen/common/page_alloc.c
> --- a/xen/common/page_alloc.c	Wed Jan 25 23:35:22 2006 +0100
> +++ b/xen/common/page_alloc.c	Thu Jan 26 10:09:39 2006 +0900
> @@ -216,7 +216,9 @@
>  #define NR_ZONES    3
>  
>  
> -#define MAX_DMADOM_PFN 0x7FFFFUL /* 31 addressable bits */
> +#ifndef MAX_DMADOM_PFN /* arch-depedent code can override */
> +#define MAX_DMADOM_PFN (0x7FFFFFFFUL >> PAGE_SHIFT) /* 31 addressable bits */
> +#endif
>  #define pfn_dom_zone_type(_pfn)                                 \
>      (((_pfn) <= MAX_DMADOM_PFN) ? MEMZONE_DMADOM : MEMZONE_DOM)

Why only 31bits?

Also, wouldn't it be better to define this in <asm/dma.h>?  x86-64 added
similar #defines to include/asm-x86_64/dma.h relatively recently (see
MAX_DMA32_PFN).  This would be a good model to follow.

Thanks,
Jon

>  
> 
> -- 
> yamahata

> # HG changeset patch
> # User yamahata@valinux.co.jp
> # Node ID 0c2b703c79333c01e4cccef1fbac1d01c6c7daa7
> # Parent  5b004f4e76cf90ef6f7155a4822e63b9e33cf7d8
> made MAX_DMADOM_PFN aware of page size.
> 4K page size was assumed. It is not true for xen/ia64 by default.
> It should also be possible for arch dependent code to override it.
> 
> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
> 
> diff -r 5b004f4e76cf -r 0c2b703c7933 xen/common/page_alloc.c
> --- a/xen/common/page_alloc.c	Wed Jan 25 23:35:22 2006 +0100
> +++ b/xen/common/page_alloc.c	Thu Jan 26 10:09:39 2006 +0900
> @@ -216,7 +216,9 @@
>  #define NR_ZONES    3
>  
>  
> -#define MAX_DMADOM_PFN 0x7FFFFUL /* 31 addressable bits */
> +#ifndef MAX_DMADOM_PFN /* arch-depedent code can override */
> +#define MAX_DMADOM_PFN (0x7FFFFFFFUL >> PAGE_SHIFT) /* 31 addressable bits */
> +#endif
>  #define pfn_dom_zone_type(_pfn)                                 \
>      (((_pfn) <= MAX_DMADOM_PFN) ? MEMZONE_DMADOM : MEMZONE_DOM)
>  

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] MAX_DMADOM_PFN
  2006-01-26 20:03 ` Jon Mason
@ 2006-01-30  3:07   ` Isaku Yamahata
  2006-01-30 10:27     ` Keir Fraser
  0 siblings, 1 reply; 4+ messages in thread
From: Isaku Yamahata @ 2006-01-30  3:07 UTC (permalink / raw)
  To: Jon Mason; +Cc: xen-devel, xen-ia64-devel

[-- Attachment #1: Type: text/plain, Size: 5375 bytes --]

On Thu, Jan 26, 2006 at 02:03:46PM -0600, Jon Mason wrote:
> On Thu, Jan 26, 2006 at 10:19:20AM +0900, Isaku Yamahata wrote:
> > 
> > made MAX_DMADOM_PFN page size aware.
> > 4K page size was assumed, however it is not true for xen/ia64.
> > It should also be possible for arch dependent code to override it.
> > 
> > # HG changeset patch
> > # User yamahata@valinux.co.jp
> > # Node ID 0c2b703c79333c01e4cccef1fbac1d01c6c7daa7
> > # Parent  5b004f4e76cf90ef6f7155a4822e63b9e33cf7d8
> > made MAX_DMADOM_PFN aware of page size.
> > 4K page size was assumed. It is not true for xen/ia64 by default.
> > It should also be possible for arch dependent code to override it.
> > 
> > Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
> > 
> > diff -r 5b004f4e76cf -r 0c2b703c7933 xen/common/page_alloc.c
> > --- a/xen/common/page_alloc.c	Wed Jan 25 23:35:22 2006 +0100
> > +++ b/xen/common/page_alloc.c	Thu Jan 26 10:09:39 2006 +0900
> > @@ -216,7 +216,9 @@
> >  #define NR_ZONES    3
> >  
> >  
> > -#define MAX_DMADOM_PFN 0x7FFFFUL /* 31 addressable bits */
> > +#ifndef MAX_DMADOM_PFN /* arch-depedent code can override */
> > +#define MAX_DMADOM_PFN (0x7FFFFFFFUL >> PAGE_SHIFT) /* 31 addressable bits */
> > +#endif
> >  #define pfn_dom_zone_type(_pfn)                                 \
> >      (((_pfn) <= MAX_DMADOM_PFN) ? MEMZONE_DMADOM : MEMZONE_DOM)
> 
> Why only 31bits?
> 
> Also, wouldn't it be better to define this in <asm/dma.h>?  x86-64 added
> similar #defines to include/asm-x86_64/dma.h relatively recently (see
> MAX_DMA32_PFN).  This would be a good model to follow.

I added asm-xxx/dma.h to each archs and moved
MAX_DMADOM_PFN definition to these files.
But I left the value as it was.
(I only did compile tests for x86_32 and ia64.)

Is this patch acceptable or should I refine more?

# HG changeset patch
# User yamahata@valinux.co.jp
# Node ID 322423fd19f90adeea2dfe248b794d53de3cbb81
# Parent  2add7a26253079c1d9d6ba87a37aa72c89358a06
made MAX_DMADOM_PFN page size aware and arch dependent.
4K page size was assumed, however it is not true for xen/ia64.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>

diff -r 2add7a262530 -r 322423fd19f9 xen/common/page_alloc.c
--- a/xen/common/page_alloc.c	Fri Jan 27 16:17:38 2006 +0100
+++ b/xen/common/page_alloc.c	Mon Jan 30 11:56:52 2006 +0900
@@ -33,6 +33,7 @@
 #include <xen/shadow.h>
 #include <xen/domain_page.h>
 #include <asm/page.h>
+#include <asm/dma.h>
 
 /*
  * Comma-separated list of hexadecimal page numbers containing bad bytes.
@@ -216,7 +217,6 @@
 #define NR_ZONES    3
 
 
-#define MAX_DMADOM_PFN 0x7FFFFUL /* 31 addressable bits */
 #define pfn_dom_zone_type(_pfn)                                 \
     (((_pfn) <= MAX_DMADOM_PFN) ? MEMZONE_DMADOM : MEMZONE_DOM)
 
diff -r 2add7a262530 -r 322423fd19f9 xen/include/asm-ia64/linux-xen/asm/dma.h
--- /dev/null	Thu Jan  1 00:00:00 1970 +0000
+++ b/xen/include/asm-ia64/linux-xen/asm/dma.h	Mon Jan 30 11:56:52 2006 +0900
@@ -0,0 +1,25 @@
+#ifndef _ASM_IA64_DMA_H
+#define _ASM_IA64_DMA_H
+
+/*
+ * Copyright (C) 1998-2002 Hewlett-Packard Co
+ *	David Mosberger-Tang <davidm@hpl.hp.com>
+ */
+
+#include <linux/config.h>
+
+#include <asm/io.h>		/* need byte IO */
+
+extern unsigned long MAX_DMA_ADDRESS;
+
+#ifdef CONFIG_PCI
+  extern int isa_dma_bridge_buggy;
+#else
+# define isa_dma_bridge_buggy 	(0)
+#endif
+
+#define free_dma(x)
+
+#define MAX_DMADOM_PFN (0x7FFFFFFFUL >> PAGE_SHIFT) /* 31 addressable bits */
+
+#endif /* _ASM_IA64_DMA_H */
diff -r 2add7a262530 -r 322423fd19f9 xen/include/asm-x86/dma.h
--- /dev/null	Thu Jan  1 00:00:00 1970 +0000
+++ b/xen/include/asm-x86/dma.h	Mon Jan 30 11:56:52 2006 +0900
@@ -0,0 +1,16 @@
+/*
+ * dma.h
+ */
+
+#ifndef _ASM_X86_DMA_H
+#define _ASM_X86_DMA_H
+
+#include <asm/page.h>
+
+#if defined(__i386__)
+# include <asm/x86_32/dma.h>
+#elif defined(__x86_64__)
+# include <asm/x86_64/dma.h>
+#endif
+
+#endif /* _ASM_X86_DMA_H */
diff -r 2add7a262530 -r 322423fd19f9 xen/include/asm-x86/x86_32/dma.h
--- /dev/null	Thu Jan  1 00:00:00 1970 +0000
+++ b/xen/include/asm-x86/x86_32/dma.h	Mon Jan 30 11:56:52 2006 +0900
@@ -0,0 +1,10 @@
+/*
+ * x86_32/dma.h
+ */
+
+#ifndef _ASM_X86_32_DMA_H
+#define _ASM_X86_32_DMA_H
+
+#define MAX_DMADOM_PFN (0x7FFFFFFFUL >> PAGE_SHIFT) /* 31 addressable bits */
+
+#endif /* _ASM_X86_32_DMA_H */
diff -r 2add7a262530 -r 322423fd19f9 xen/include/asm-x86/x86_64/dma.h
--- /dev/null	Thu Jan  1 00:00:00 1970 +0000
+++ b/xen/include/asm-x86/x86_64/dma.h	Mon Jan 30 11:56:52 2006 +0900
@@ -0,0 +1,10 @@
+/*
+ * x86_64/dma.h
+ */
+
+#ifndef _ASM_X86_64_DMA_H
+#define _ASM_X86_64_DMA_H
+
+#define MAX_DMADOM_PFN (0x7FFFFFFFUL >> PAGE_SHIFT) /* 31 addressable bits */
+
+#endif /* _ASM_X86_64_DMA_H */
diff -r 2add7a262530 -r 322423fd19f9 xen/include/asm-ia64/linux/asm/dma.h
--- a/xen/include/asm-ia64/linux/asm/dma.h	Fri Jan 27 16:17:38 2006 +0100
+++ /dev/null	Thu Jan  1 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-#ifndef _ASM_IA64_DMA_H
-#define _ASM_IA64_DMA_H
-
-/*
- * Copyright (C) 1998-2002 Hewlett-Packard Co
- *	David Mosberger-Tang <davidm@hpl.hp.com>
- */
-
-#include <linux/config.h>
-
-#include <asm/io.h>		/* need byte IO */
-
-extern unsigned long MAX_DMA_ADDRESS;
-
-#ifdef CONFIG_PCI
-  extern int isa_dma_bridge_buggy;
-#else
-# define isa_dma_bridge_buggy 	(0)
-#endif
-
-#define free_dma(x)
-
-#endif /* _ASM_IA64_DMA_H */


-- 
yamahata

[-- Attachment #2: 8681:322423fd19f9.patch --]
[-- Type: text/plain, Size: 3550 bytes --]

# HG changeset patch
# User yamahata@valinux.co.jp
# Node ID 322423fd19f90adeea2dfe248b794d53de3cbb81
# Parent  2add7a26253079c1d9d6ba87a37aa72c89358a06
made MAX_DMADOM_PFN page size aware and arch dependent.
4K page size was assumed, however it is not true for xen/ia64.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>

diff -r 2add7a262530 -r 322423fd19f9 xen/common/page_alloc.c
--- a/xen/common/page_alloc.c	Fri Jan 27 16:17:38 2006 +0100
+++ b/xen/common/page_alloc.c	Mon Jan 30 11:56:52 2006 +0900
@@ -33,6 +33,7 @@
 #include <xen/shadow.h>
 #include <xen/domain_page.h>
 #include <asm/page.h>
+#include <asm/dma.h>
 
 /*
  * Comma-separated list of hexadecimal page numbers containing bad bytes.
@@ -216,7 +217,6 @@
 #define NR_ZONES    3
 
 
-#define MAX_DMADOM_PFN 0x7FFFFUL /* 31 addressable bits */
 #define pfn_dom_zone_type(_pfn)                                 \
     (((_pfn) <= MAX_DMADOM_PFN) ? MEMZONE_DMADOM : MEMZONE_DOM)
 
diff -r 2add7a262530 -r 322423fd19f9 xen/include/asm-ia64/linux-xen/asm/dma.h
--- /dev/null	Thu Jan  1 00:00:00 1970 +0000
+++ b/xen/include/asm-ia64/linux-xen/asm/dma.h	Mon Jan 30 11:56:52 2006 +0900
@@ -0,0 +1,25 @@
+#ifndef _ASM_IA64_DMA_H
+#define _ASM_IA64_DMA_H
+
+/*
+ * Copyright (C) 1998-2002 Hewlett-Packard Co
+ *	David Mosberger-Tang <davidm@hpl.hp.com>
+ */
+
+#include <linux/config.h>
+
+#include <asm/io.h>		/* need byte IO */
+
+extern unsigned long MAX_DMA_ADDRESS;
+
+#ifdef CONFIG_PCI
+  extern int isa_dma_bridge_buggy;
+#else
+# define isa_dma_bridge_buggy 	(0)
+#endif
+
+#define free_dma(x)
+
+#define MAX_DMADOM_PFN (0x7FFFFFFFUL >> PAGE_SHIFT) /* 31 addressable bits */
+
+#endif /* _ASM_IA64_DMA_H */
diff -r 2add7a262530 -r 322423fd19f9 xen/include/asm-x86/dma.h
--- /dev/null	Thu Jan  1 00:00:00 1970 +0000
+++ b/xen/include/asm-x86/dma.h	Mon Jan 30 11:56:52 2006 +0900
@@ -0,0 +1,16 @@
+/*
+ * dma.h
+ */
+
+#ifndef _ASM_X86_DMA_H
+#define _ASM_X86_DMA_H
+
+#include <asm/page.h>
+
+#if defined(__i386__)
+# include <asm/x86_32/dma.h>
+#elif defined(__x86_64__)
+# include <asm/x86_64/dma.h>
+#endif
+
+#endif /* _ASM_X86_DMA_H */
diff -r 2add7a262530 -r 322423fd19f9 xen/include/asm-x86/x86_32/dma.h
--- /dev/null	Thu Jan  1 00:00:00 1970 +0000
+++ b/xen/include/asm-x86/x86_32/dma.h	Mon Jan 30 11:56:52 2006 +0900
@@ -0,0 +1,10 @@
+/*
+ * x86_32/dma.h
+ */
+
+#ifndef _ASM_X86_32_DMA_H
+#define _ASM_X86_32_DMA_H
+
+#define MAX_DMADOM_PFN (0x7FFFFFFFUL >> PAGE_SHIFT) /* 31 addressable bits */
+
+#endif /* _ASM_X86_32_DMA_H */
diff -r 2add7a262530 -r 322423fd19f9 xen/include/asm-x86/x86_64/dma.h
--- /dev/null	Thu Jan  1 00:00:00 1970 +0000
+++ b/xen/include/asm-x86/x86_64/dma.h	Mon Jan 30 11:56:52 2006 +0900
@@ -0,0 +1,10 @@
+/*
+ * x86_64/dma.h
+ */
+
+#ifndef _ASM_X86_64_DMA_H
+#define _ASM_X86_64_DMA_H
+
+#define MAX_DMADOM_PFN (0x7FFFFFFFUL >> PAGE_SHIFT) /* 31 addressable bits */
+
+#endif /* _ASM_X86_64_DMA_H */
diff -r 2add7a262530 -r 322423fd19f9 xen/include/asm-ia64/linux/asm/dma.h
--- a/xen/include/asm-ia64/linux/asm/dma.h	Fri Jan 27 16:17:38 2006 +0100
+++ /dev/null	Thu Jan  1 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-#ifndef _ASM_IA64_DMA_H
-#define _ASM_IA64_DMA_H
-
-/*
- * Copyright (C) 1998-2002 Hewlett-Packard Co
- *	David Mosberger-Tang <davidm@hpl.hp.com>
- */
-
-#include <linux/config.h>
-
-#include <asm/io.h>		/* need byte IO */
-
-extern unsigned long MAX_DMA_ADDRESS;
-
-#ifdef CONFIG_PCI
-  extern int isa_dma_bridge_buggy;
-#else
-# define isa_dma_bridge_buggy 	(0)
-#endif
-
-#define free_dma(x)
-
-#endif /* _ASM_IA64_DMA_H */

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] MAX_DMADOM_PFN
  2006-01-30  3:07   ` Isaku Yamahata
@ 2006-01-30 10:27     ` Keir Fraser
  0 siblings, 0 replies; 4+ messages in thread
From: Keir Fraser @ 2006-01-30 10:27 UTC (permalink / raw)
  To: Isaku Yamahata; +Cc: xen-ia64-devel, xen-devel, Jon Mason


On 30 Jan 2006, at 03:07, Isaku Yamahata wrote:

> I added asm-xxx/dma.h to each archs and moved
> MAX_DMADOM_PFN definition to these files.
> But I left the value as it was.
> (I only did compile tests for x86_32 and ia64.)
>
> Is this patch acceptable or should I refine more?

I don't want Linux-style dma.h in Xen, since Xen really knows nothing 
about DMA. :-)

I think MAX_DMADOM_PFN has a limited life ahead of it (I'd like to push 
address-width awareness into the core of the allocator at some point). 
So I'll just move MAX_DMADOM_PFN to asm/config.h, then you ia64 guys 
can change it as you wish.

  -- Keir

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-01-30 10:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-26  1:19 [PATCH] MAX_DMADOM_PFN Isaku Yamahata
2006-01-26 20:03 ` Jon Mason
2006-01-30  3:07   ` Isaku Yamahata
2006-01-30 10:27     ` Keir Fraser

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.