* [Patch] ARCH_HAS_DEV_MEM patch for Xwindow on IA64 machine
@ 2007-07-04 11:43 Jun Kamada
2007-07-04 12:04 ` [Patch] ARCH_HAS_DEV_MEM patch for Xwindow on IA64machine Jan Beulich
0 siblings, 1 reply; 4+ messages in thread
From: Jun Kamada @ 2007-07-04 11:43 UTC (permalink / raw)
To: xen-devel, xen-ia64-devel
[-- Attachment #1: Type: text/plain, Size: 871 bytes --]
Hi all,
Attached patch modifies common code in files below, so I will post it
to xen-devel and xen-ia64-devel.
- drivers/xen/Kconfig
- drivers/xen/Makefile
- drivers/xen/char/mem.c
This patch makes architecture specific memory operations to be available
only if ARCH_HAS_DEV_MEM is defined.
Background why I posted the patch is as follows.
We would like to support Xwindow on IA64 by remapping machine address to
pseudo physical address at PCI device initialization (pci_acpi_scan_root()
in arch/ia64/pci/pci.c) but at "mmap /dev/mem" systemcall.
With the new scheme, we need no longer the archtecture specific memory
operations described above.
Please see
http://lists.xensource.com/archives/html/xen-ia64-devel/2007-06/msg00167.html
Thanks
-----
Jun Kamada
Virtual Systems Development Div.
Platform Technology Development Unit
Fujitsu Ltd.
kama@jp.fujitsu.com
[-- Attachment #2: ifdef_arch_has_dev_mem.patch --]
[-- Type: application/octet-stream, Size: 1995 bytes --]
# HG changeset patch
# User Jun Kamada <kama@jp.fujitsu.com>
# Date 1182406401 -32400
# Node ID 40489068407c9c5488100a2c8d54d5c64676aba0
# Parent 6d89642c02d490c24fe7ad39dce4f2622f1ef1cb
Add "#ifdef ARCH_HAS_DEV_MEM" to archtecture specific file_operations.
Signed-off-by: Jun Kamada <kama@jp.fujitsu.com>
diff -r 6d89642c02d4 -r 40489068407c drivers/xen/Kconfig
--- a/drivers/xen/Kconfig Thu Jun 21 15:12:20 2007 +0900
+++ b/drivers/xen/Kconfig Thu Jun 21 15:13:21 2007 +0900
@@ -273,4 +273,8 @@ config XEN_SMPBOOT
default y
depends on SMP
+config XEN_DEVMEM
+ bool
+ default y
+
endif
diff -r 6d89642c02d4 -r 40489068407c drivers/xen/Makefile
--- a/drivers/xen/Makefile Thu Jun 21 15:12:20 2007 +0900
+++ b/drivers/xen/Makefile Thu Jun 21 15:13:21 2007 +0900
@@ -5,9 +5,9 @@ obj-y += xenbus/
obj-y += xenbus/
obj-y += gntdev/
obj-y += balloon/
-obj-y += char/
obj-y += util.o
+obj-$(CONFIG_XEN_DEVMEM) += char/
obj-$(CONFIG_XEN_BLKDEV_BACKEND) += blkback/
obj-$(CONFIG_XEN_BLKDEV_TAP) += blktap/
obj-$(CONFIG_XEN_NETDEV_BACKEND) += netback/
diff -r 6d89642c02d4 -r 40489068407c drivers/xen/char/mem.c
--- a/drivers/xen/char/mem.c Thu Jun 21 15:12:20 2007 +0900
+++ b/drivers/xen/char/mem.c Thu Jun 21 15:13:21 2007 +0900
@@ -33,6 +33,7 @@ static inline int valid_phys_addr_range(
}
#endif
+#ifdef ARCH_HAS_DEV_MEM
/*
* This funcion reads the *physical* memory. The f_pos points directly to the
* memory location.
@@ -135,6 +136,7 @@ static ssize_t write_mem(struct file * f
*ppos += written;
return written;
}
+#endif
#ifndef ARCH_HAS_DEV_MEM_MMAP_MEM
static inline int uncached_access(struct file *file)
@@ -194,6 +196,7 @@ static int open_mem(struct inode * inode
return capable(CAP_SYS_RAWIO) ? 0 : -EPERM;
}
+#ifdef ARCH_HAS_DEV_MEM
const struct file_operations mem_fops = {
.llseek = memory_lseek,
.read = read_mem,
@@ -201,3 +204,4 @@ const struct file_operations mem_fops =
.mmap = xen_mmap_mem,
.open = open_mem,
};
+#endif
[-- Attachment #3: Type: text/plain, Size: 152 bytes --]
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@lists.xensource.com
http://lists.xensource.com/xen-ia64-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Patch] ARCH_HAS_DEV_MEM patch for Xwindow on IA64machine
2007-07-04 11:43 [Patch] ARCH_HAS_DEV_MEM patch for Xwindow on IA64 machine Jun Kamada
@ 2007-07-04 12:04 ` Jan Beulich
2007-07-04 12:24 ` [Xen-devel] [Patch] ARCH_HAS_DEV_MEM patch for Xwindow onIA64machine Akio Takebe
2007-07-06 9:46 ` [Patch] ARCH_HAS_DEV_MEM patch for Xwindow on IA64machine Jun Kamada
0 siblings, 2 replies; 4+ messages in thread
From: Jan Beulich @ 2007-07-04 12:04 UTC (permalink / raw)
To: kama; +Cc: xen-devel, xen-ia64-devel
>>> Jun Kamada <kama@jp.fujitsu.com> 04.07.07 13:43 >>>
>We would like to support Xwindow on IA64 by remapping machine address to
>pseudo physical address at PCI device initialization (pci_acpi_scan_root()
>in arch/ia64/pci/pci.c) but at "mmap /dev/mem" systemcall.
>With the new scheme, we need no longer the archtecture specific memory
>operations described above.
You only talk about X - isn't it possible that there are other users of this interface?
Also,
>--- a/drivers/xen/Kconfig Thu Jun 21 15:12:20 2007 +0900
>+++ b/drivers/xen/Kconfig Thu Jun 21 15:13:21 2007 +0900
>@@ -273,4 +273,8 @@ config XEN_SMPBOOT
> default y
> depends on SMP
>
>+config XEN_DEVMEM
>+ bool
>+ default y
>+
> endif
This seems pretty useless unless ia64 doesn't use drivers/xen/Kconfig (which
would be a mistake I think).
>--- a/drivers/xen/Makefile Thu Jun 21 15:12:20 2007 +0900
>+++ b/drivers/xen/Makefile Thu Jun 21 15:13:21 2007 +0900
>@@ -5,9 +5,9 @@ obj-y += xenbus/
> obj-y += xenbus/
> obj-y += gntdev/
> obj-y += balloon/
>-obj-y += char/
>
> obj-y += util.o
>+obj-$(CONFIG_XEN_DEVMEM) += char/
> obj-$(CONFIG_XEN_BLKDEV_BACKEND) += blkback/
> obj-$(CONFIG_XEN_BLKDEV_TAP) += blktap/
> obj-$(CONFIG_XEN_NETDEV_BACKEND) += netback/
This is certainly wrong. Even if driver/xen/char/ currently only has a
single file, you should descend into that directory. The conditional
(if needed at all) should then be in driver/xen/char/Makefile.
Jan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Xen-devel] [Patch] ARCH_HAS_DEV_MEM patch for Xwindow onIA64machine
2007-07-04 12:04 ` [Patch] ARCH_HAS_DEV_MEM patch for Xwindow on IA64machine Jan Beulich
@ 2007-07-04 12:24 ` Akio Takebe
2007-07-06 9:46 ` [Patch] ARCH_HAS_DEV_MEM patch for Xwindow on IA64machine Jun Kamada
1 sibling, 0 replies; 4+ messages in thread
From: Akio Takebe @ 2007-07-04 12:24 UTC (permalink / raw)
To: Jan Beulich, kama; +Cc: xen-devel, xen-ia64-devel
Hi, Jan
>>>> Jun Kamada <kama@jp.fujitsu.com> 04.07.07 13:43 >>>
>>We would like to support Xwindow on IA64 by remapping machine address to
>>pseudo physical address at PCI device initialization (pci_acpi_scan_root()
>>in arch/ia64/pci/pci.c) but at "mmap /dev/mem" systemcall.
>>With the new scheme, we need no longer the archtecture specific memory
>>operations described above.
>
>You only talk about X - isn't it possible that there are other users of this
> interface?
>
Yes, you're right.
But if the following kama's patches are applied,
Xen-ia64 use drivers/char/mem.c.
So drivers/xen/char/mem.c will not be needed by Xen-ia64.
http://lists.xensource.com/archives/html/xen-ia64-devel/2007-06/msg00167.html
>Also,
>
>>--- a/drivers/xen/Kconfig Thu Jun 21 15:12:20 2007 +0900
>>+++ b/drivers/xen/Kconfig Thu Jun 21 15:13:21 2007 +0900
>>@@ -273,4 +273,8 @@ config XEN_SMPBOOT
>> default y
>> depends on SMP
>>
>>+config XEN_DEVMEM
>>+ bool
>>+ default y
>>+
>> endif
>
>This seems pretty useless unless ia64 doesn't use drivers/xen/Kconfig (which
>would be a mistake I think).
Please see the following patch.
http://lists.xensource.com/archives/html/xen-ia64-devel/2007-06/msg00169.html
Currently drviers/xen/char is built by all archtecture.
But if the above kama's patche is applied, it is not built by ia64.
diff -r a55f2df725a2 -r f3d513b91dea linux-2.6-xen-sparse/arch/ia64/Kconfig
--- a/linux-2.6-xen-sparse/arch/ia64/Kconfig Wed Jun 13 12:28:14 2007 +0900
+++ b/linux-2.6-xen-sparse/arch/ia64/Kconfig Wed Jun 13 12:35:24 2007 +0900
@@ -582,6 +582,9 @@ if XEN
if XEN
config XEN_SMPBOOT
default n
+
+config XEN_DEVMEM
+ default n
endif
source "drivers/xen/Kconfig"
Best Regards,
Akio Takebe
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Patch] ARCH_HAS_DEV_MEM patch for Xwindow on IA64machine
2007-07-04 12:04 ` [Patch] ARCH_HAS_DEV_MEM patch for Xwindow on IA64machine Jan Beulich
2007-07-04 12:24 ` [Xen-devel] [Patch] ARCH_HAS_DEV_MEM patch for Xwindow onIA64machine Akio Takebe
@ 2007-07-06 9:46 ` Jun Kamada
1 sibling, 0 replies; 4+ messages in thread
From: Jun Kamada @ 2007-07-06 9:46 UTC (permalink / raw)
To: Jan Beulich; +Cc: kama, xen-devel, xen-ia64-devel
[-- Attachment #1: Type: text/plain, Size: 914 bytes --]
Hi, Jan-san,
On Wed, 04 Jul 2007 13:04:50 +0100
"Jan Beulich" <jbeulich@novell.com> wrote:
> >--- a/drivers/xen/Makefile Thu Jun 21 15:12:20 2007 +0900
> >+++ b/drivers/xen/Makefile Thu Jun 21 15:13:21 2007 +0900
> >@@ -5,9 +5,9 @@ obj-y += xenbus/
> > obj-y += xenbus/
> > obj-y += gntdev/
> > obj-y += balloon/
> >-obj-y += char/
> >
> > obj-y += util.o
> >+obj-$(CONFIG_XEN_DEVMEM) += char/
> > obj-$(CONFIG_XEN_BLKDEV_BACKEND) += blkback/
> > obj-$(CONFIG_XEN_BLKDEV_TAP) += blktap/
> > obj-$(CONFIG_XEN_NETDEV_BACKEND) += netback/
>
> This is certainly wrong. Even if driver/xen/char/ currently only has a
> single file, you should descend into that directory. The conditional
> (if needed at all) should then be in driver/xen/char/Makefile.
I modified the patch acording to your comment.
Thanks,
-----
Jun Kamada
Linux Technology Development Div.
Server Systems Unit
Fujitsu Ltd.
kama@jp.fujitsu.com
[-- Attachment #2: ifdef_arch_has_dev_mem.patch --]
[-- Type: application/octet-stream, Size: 1786 bytes --]
# HG changeset patch
# User Jun Kamada <kama@jp.fujitsu.com>
# Date 1183747330 -32400
# Node ID 2ddfe7a08970b5580ef5b53fa1abe0126b9fdf9e
# Parent e9426682eb0c31a8a4d25363eb2d180f493d01d5
Add "#ifdef ARCH_HAS_DEV_MEM" to archtecture specific file_operations.
Signed-off-by: Jun Kamada <kama@jp.fujitsu.com>
diff -r e9426682eb0c -r 2ddfe7a08970 drivers/xen/Kconfig
--- a/drivers/xen/Kconfig Thu Jul 05 14:36:59 2007 -0600
+++ b/drivers/xen/Kconfig Sat Jul 07 03:42:10 2007 +0900
@@ -274,4 +274,8 @@ config XEN_SMPBOOT
default y
depends on SMP
+config XEN_DEVMEM
+ bool
+ default y
+
endif
diff -r e9426682eb0c -r 2ddfe7a08970 drivers/xen/char/Makefile
--- a/drivers/xen/char/Makefile Thu Jul 05 14:36:59 2007 -0600
+++ b/drivers/xen/char/Makefile Sat Jul 07 03:42:10 2007 +0900
@@ -1,2 +1,1 @@
-
-obj-y := mem.o
+obj-$(CONFIG_XEN_DEVMEM) := mem.o
diff -r e9426682eb0c -r 2ddfe7a08970 drivers/xen/char/mem.c
--- a/drivers/xen/char/mem.c Thu Jul 05 14:36:59 2007 -0600
+++ b/drivers/xen/char/mem.c Sat Jul 07 03:42:10 2007 +0900
@@ -33,6 +33,7 @@ static inline int valid_phys_addr_range(
}
#endif
+#ifdef ARCH_HAS_DEV_MEM
/*
* This funcion reads the *physical* memory. The f_pos points directly to the
* memory location.
@@ -135,6 +136,7 @@ static ssize_t write_mem(struct file * f
*ppos += written;
return written;
}
+#endif
#ifndef ARCH_HAS_DEV_MEM_MMAP_MEM
static inline int uncached_access(struct file *file)
@@ -194,6 +196,7 @@ static int open_mem(struct inode * inode
return capable(CAP_SYS_RAWIO) ? 0 : -EPERM;
}
+#ifdef ARCH_HAS_DEV_MEM
const struct file_operations mem_fops = {
.llseek = memory_lseek,
.read = read_mem,
@@ -201,3 +204,4 @@ const struct file_operations mem_fops =
.mmap = xen_mmap_mem,
.open = open_mem,
};
+#endif
[-- 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
end of thread, other threads:[~2007-07-06 9:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-04 11:43 [Patch] ARCH_HAS_DEV_MEM patch for Xwindow on IA64 machine Jun Kamada
2007-07-04 12:04 ` [Patch] ARCH_HAS_DEV_MEM patch for Xwindow on IA64machine Jan Beulich
2007-07-04 12:24 ` [Xen-devel] [Patch] ARCH_HAS_DEV_MEM patch for Xwindow onIA64machine Akio Takebe
2007-07-06 9:46 ` [Patch] ARCH_HAS_DEV_MEM patch for Xwindow on IA64machine Jun Kamada
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.