Skip to contentSkip to conversation

Add "#ifdef ARCH_HAS_DEV_MEM" to archtecture specific file_operations.

Xen-changelog Hollis Blanchard 7 participants 14 messages Jul 6, 2007 – Jul 13, 2007 1 message not in the archive Xen hypervisor interface

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

This is producing warnings for me on PowerPC, which does not define ARCH_HAS_DEV_MEM:

/home/hollisb/source/linux-2.6.18-xen-ppc.hg/drivers/xen/char/mem.c:151:
warning: 'xen_mmap_mem' defined but not used /home/hollisb/source/linux-2.6.18-xen-ppc.hg/drivers/xen/char/mem.c:172:
warning: 'memory_lseek' defined but not used /home/hollisb/source/linux-2.6.18-xen-ppc.hg/drivers/xen/char/mem.c:195:
warning: 'open_mem' defined but not used

As far as I can see, x86 does not define ARCH_HAS_DEV_MEM either, so should see the same problem?

Quoted 69 lines · On Fri, 2007-07-06 at 10:15 -0700, Xen patchbot-linux-2.6.18-xen wrote:

# HG changeset patch
# User [email protected]
# Date 1183728779 -3600
# Node ID 4a08141e62ca189577041d8854bb478e5fbe502f
# Parent 9e66b8728bd3a5d857500117c421051ae7dd0d61
Add "#ifdef ARCH_HAS_DEV_MEM" to archtecture specific file_operations.

---
 drivers/xen/Kconfig       |    4 ++++
 drivers/xen/char/Makefile |    3 +--
 drivers/xen/char/mem.c    |    4 ++++
 3 files changed, 9 insertions(+), 2 deletions(-)

diff -r 9e66b8728bd3 -r 4a08141e62ca drivers/xen/Kconfig

drivers/xen/Kconfig +4 -0
@@ -281,4 +281,8 @@ config XEN_XENCOMM
 config XEN_XENCOMM
 	bool
 
+config XEN_DEVMEM
+	bool
+	default y
+
 endif

diff -r 9e66b8728bd3 -r 4a08141e62ca drivers/xen/char/Makefile

drivers/xen/char/Makefile +1 -2
@@ -1,2 +1,1 @@
-
-obj-y	:= mem.o
+obj-$(CONFIG_XEN_DEVMEM)	:= mem.o

diff -r 9e66b8728bd3 -r 4a08141e62ca drivers/xen/char/mem.c

drivers/xen/char/mem.c +4 -0
@@ -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

_______________________________________________
Xen-changelog mailing list
[email protected]
http://lists.xensource.com/xen-changelog

Signature · 2 lines
Hollis Blanchard
IBM Linux Technology Center
#2 lore raw

We define it in asm/mach-xen/asm/io.h.

However, the patch *is* of questionable value. It guards the only non-static definition in the file with #ifdef ARCH_HAS_DEV_MEM. Which begs the question why you would build the file at all if !ARCH_HAS_DEV_MEM. I'll revert it.

By the way, I wonder how PPC manages to build both drivers/char/mem.c and drivers/xen/char/mem.c without ARCH_HAS_DEV_MEM? The model is supposed to be that mem_fops defined by the Xen file is picked up by the generic file. If !ARCH_HAS_DEV_MEM then that doesn't happen -- so who picks up the Xen mem_fops?

-- Keir

Quoted 84 lines · Hollis Blanchard

This is producing warnings for me on PowerPC, which does not define ARCH_HAS_DEV_MEM:

/home/hollisb/source/linux-2.6.18-xen-ppc.hg/drivers/xen/char/mem.c:151:
warning: 'xen_mmap_mem' defined but not used /home/hollisb/source/linux-2.6.18-xen-ppc.hg/drivers/xen/char/mem.c:172:
warning: 'memory_lseek' defined but not used /home/hollisb/source/linux-2.6.18-xen-ppc.hg/drivers/xen/char/mem.c:195:
warning: 'open_mem' defined but not used

As far as I can see, x86 does not define ARCH_HAS_DEV_MEM either, so should see the same problem?

Quoted 70 lines · On Fri, 2007-07-06 at 10:15 -0700, Xen patchbot-linux-2.6.18-xen wrote:

# HG changeset patch
# User [email protected]
# Date 1183728779 -3600
# Node ID 4a08141e62ca189577041d8854bb478e5fbe502f
# Parent 9e66b8728bd3a5d857500117c421051ae7dd0d61
Add "#ifdef ARCH_HAS_DEV_MEM" to archtecture specific file_operations.

---
 drivers/xen/Kconfig       |    4 ++++
 drivers/xen/char/Makefile |    3 +--
 drivers/xen/char/mem.c    |    4 ++++
 3 files changed, 9 insertions(+), 2 deletions(-)

diff -r 9e66b8728bd3 -r 4a08141e62ca drivers/xen/Kconfig

drivers/xen/Kconfig Fri Jul 06 14:32:59 2007 +0100 renamed from drivers/xen/Kconfig Fri Jul 06 14:01:27 2007 +0100 +0 -0
@@ -281,4 +281,8 @@ config XEN_XENCOMM
 config XEN_XENCOMM

bool

drivers/xen/Kconfig Fri Jul 06 14:32:59 2007 +0100 renamed from drivers/xen/Kconfig Fri Jul 06 14:01:27 2007 +0100 +4 -0
+config XEN_DEVMEM
+ bool
+ default y
+
 endif

diff -r 9e66b8728bd3 -r 4a08141e62ca drivers/xen/char/Makefile

drivers/xen/char/Makefile Fri Jul 06 14:32:59 2007 +0100 renamed from drivers/xen/char/Makefile Fri Jul 06 14:01:27 2007 +0100 +1 -2
@@ -1,2 +1,1 @@
-
-obj-y := mem.o
+obj-$(CONFIG_XEN_DEVMEM) := mem.o

diff -r 9e66b8728bd3 -r 4a08141e62ca drivers/xen/char/mem.c

drivers/xen/char/mem.c Fri Jul 06 14:32:59 2007 +0100 renamed from drivers/xen/char/mem.c Fri Jul 06 14:01:27 2007 +0100 +1 -0
@@ -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.

drivers/xen/char/mem.c Fri Jul 06 14:32:59 2007 +0100 renamed from drivers/xen/char/mem.c Fri Jul 06 14:01:27 2007 +0100 +3 -0
@@ -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

_______________________________________________
Xen-changelog mailing list
[email protected]
http://lists.xensource.com/xen-changelog

#3 lore raw
Quoted 6 lines · Keir Fraser

By the way, I wonder how PPC manages to build both drivers/char/mem.c and drivers/xen/char/mem.c without ARCH_HAS_DEV_MEM? The model is supposed to be that mem_fops defined by the Xen file is picked up by the generic file. If !ARCH_HAS_DEV_MEM then that doesn't happen -- so who picks up the Xen mem_fops?

Hmmm, yeah. Looks like we haven't tested that... :)

Signature · 2 lines
Hollis Blanchard
IBM Linux Technology Center
#4 lore raw
Quoted 7 lines · Hollis Blanchard
Quoted 5 lines

By the way, I wonder how PPC manages to build both drivers/char/mem.c and drivers/xen/char/mem.c without ARCH_HAS_DEV_MEM? The model is supposed to be that mem_fops defined by the Xen file is picked up by the generic file. If !ARCH_HAS_DEV_MEM then that doesn't happen -- so who picks up the Xen mem_fops?

Hmmm, yeah. Looks like we haven't tested that... :)

If you don't need to build both then there is potentially no problem with the Xen file hijacking the xlate_dev_mem() functions.

-- Keir

#5 lore raw
Quoted 8 lines · Keir Fraser
Quoted 6 lines · Hollis Blanchard
Quoted 5 lines

By the way, I wonder how PPC manages to build both drivers/char/mem.c and drivers/xen/char/mem.c without ARCH_HAS_DEV_MEM? The model is supposed to be that mem_fops defined by the Xen file is picked up by the generic file. If !ARCH_HAS_DEV_MEM then that doesn't happen -- so who picks up the Xen mem_fops?

Quoted 4 lines
Quoted 1 line

Hmmm, yeah. Looks like we haven't tested that... :)

If you don't need to build both then there is potentially no problem with the Xen file hijacking the xlate_dev_mem() functions.

PowerPC Linux builds support for multiple platforms, including multiple hypervisors, into a single binary (paravirt_ops was inspired by ppc_md). For the most part our Xen patches continue this model, but because we don't really test our Xen kernel on non-Xen platforms, there are a couple bugs that would need fixing.

So compile-time ifdefs for /dev/mem won't work long-term, but I'm not really worried about it.

Signature · 2 lines
Hollis Blanchard
IBM Linux Technology Center
#6 lore raw
Quoted 10 lines · Hollis Blanchard
Quoted 9 lines · Keir Fraser
Quoted 7 lines · Hollis Blanchard
Quoted 5 lines

By the way, I wonder how PPC manages to build both drivers/char/mem.c and drivers/xen/char/mem.c without ARCH_HAS_DEV_MEM? The model is supposed to be that mem_fops defined by the Xen file is picked up by the generic file. If !ARCH_HAS_DEV_MEM then that doesn't happen -- so who picks up the Xen mem_fops?

Hmmm, yeah. Looks like we haven't tested that... :)

yeah, we have :)
xlate_dev_mem_ptr() works just fine for us, so drivers/char/mem.c just works and the xen version of the ops is never considered.

Actually we should be forcing CONFIG_XEN_DEVMEM, but the Makefile ignores it. -JX

#7 lore raw
Quoted 12 lines · Jimi Xenidis
Quoted 9 lines · Hollis Blanchard
Quoted 8 lines · Keir Fraser
Quoted 6 lines · Hollis Blanchard
Quoted 5 lines

By the way, I wonder how PPC manages to build both drivers/char/mem.c and drivers/xen/char/mem.c without ARCH_HAS_DEV_MEM? The model is supposed to be that mem_fops defined by the Xen file is picked up by the generic file. If !ARCH_HAS_DEV_MEM then that doesn't happen -- so who picks up the Xen mem_fops?

Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

Hmmm, yeah. Looks like we haven't tested that... :)

yeah, we have :)
xlate_dev_mem_ptr() works just fine for us, so drivers/char/mem.c just works and the xen version of the ops is never considered.

Actually we should be forcing CONFIG_XEN_DEVMEM, but the Makefile ignores it.

s/CONFIG_XEN_DEVMEM/CONFIG_XEN_DEVMEM=n/

Quoted 6 lines

-JX

_______________________________________________
Xen-ppc-devel mailing list
[email protected]
http://lists.xensource.com/xen-ppc-devel

#8 lore raw
In reply to Keir Fraser

Keir-san and Hollis-san,

Quoted 5 lines · On Sat, 07 Jul 2007 10:01:31 +0100 Keir Fraser <[email protected]> wrote:

We define it in asm/mach-xen/asm/io.h.

However, the patch *is* of questionable value. It guards the only non-static definition in the file with #ifdef ARCH_HAS_DEV_MEM. Which begs the question why you would build the file at all if !ARCH_HAS_DEV_MEM. I'll revert it.

I'm sorry that I had posted the incomplete patch. I will attach a new one modified. The patch resolves ploblems mentioned above?

Best regards,

-----
Jun Kamada
Linux Technology Development Div.
Server Systems Unit
Fujitsu Ltd.
[email protected]

# HG changeset patch
# User Jun Kamada <[email protected]>
# Date 1184125315 -32400
# Node ID d427a098231e8aba4c930d9b54fce4be52952a53
# Parent 86ac3059ab675a1c80ab02be513afb57b5e63efa ARCH_HAS_DEV_MEM for read_mem() and write_mem() in drivers/xen/char/mem.c

drivers/xen/char/mem.c +4 -0
diff -r 86ac3059ab67 -r d427a098231e drivers/xen/char/mem.c
@@ -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)
@@ -196,8 +198,10 @@ static int open_mem(struct inode * inode
 
 const struct file_operations mem_fops = {
 	.llseek		= memory_lseek,
+#ifdef ARCH_HAS_DEV_MEM
 	.read		= read_mem,
 	.write		= write_mem,
+#endif
 	.mmap		= xen_mmap_mem,
 	.open		= open_mem,
 };

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#9 lore raw
Quoted 8 lines · Jun Kamada
Quoted 5 lines

We define it in asm/mach-xen/asm/io.h.

However, the patch *is* of questionable value. It guards the only non-static definition in the file with #ifdef ARCH_HAS_DEV_MEM. Which begs the question why you would build the file at all if !ARCH_HAS_DEV_MEM. I'll revert it.

I'm sorry that I had posted the incomplete patch. I will attach a new one modified. The patch resolves ploblems mentioned above?

The case of building drivers/xen/char/mem.c, yet not defining ARCH_HAS_DEV_MEM, does not seem useful. Who will pick up and use the mem_fops defined by drivers/xen/char/mem.c?

At the very least this seems abusive of ARCH_HAS_DEV_MEM, and you might be better off defining a different macro name? But I think you need to explain to us what it is you're actually trying to achieve.

-- Keir

#10 lore raw

Keir-san,

Quoted 7 lines · On Wed, 11 Jul 2007 11:00:37 +0100 Keir Fraser <[email protected]> wrote:

The case of building drivers/xen/char/mem.c, yet not defining ARCH_HAS_DEV_MEM, does not seem useful. Who will pick up and use the mem_fops defined by drivers/xen/char/mem.c?

At the very least this seems abusive of ARCH_HAS_DEV_MEM, and you might be better off defining a different macro name? But I think you need to explain to us what it is you're actually trying to achieve.

I would like to deal with the drivers/xen/char/mem.c as follows. How do you think about it? It will cause any problem?

- I will post a patch, which removes definition of ARCH_HAS_DEV_MEM, to xen-ia64-devel later.
- If needed, I will post a revert patch of "xen-ia64-devel.hg c/s 12544:395aa5609e6d". (Creating the revert patch may be difficult...)

Quoted 2 lines

better off defining a different macro name? But I think you need to explain to us what it is you're actually trying to achieve.

We would like to map machine address to guest physical address at PCI initialization phase but at mmap system call in order to support Xwindow. The patch I posted is one of the patch which disables mapping process at mmap system call.

Best regards,

-----
Jun Kamada
Linux Technology Development Div.
Server Systems Unit
Fujitsu Ltd.
[email protected]

#11 lore raw

Re: [Xen-devel] Re: [Xen-changelog] [linux-2.6.18-xen] Add "#ifdefARCH_HAS_DEV_MEM" to archtecture specific file_operations.

Hi, Kama, Keir and Isaku

Quoted 10 lines
Quoted 7 lines · On Wed, 11 Jul 2007 11:00:37 +0100 Keir Fraser <[email protected]> wrote:

The case of building drivers/xen/char/mem.c, yet not defining ARCH_HAS_DEV_MEM, does not seem useful. Who will pick up and use the mem_fops defined by drivers/xen/char/mem.c?

At the very least this seems abusive of ARCH_HAS_DEV_MEM, and you might be better off defining a different macro name? But I think you need to explain to us what it is you're actually trying to achieve.

Quoted 8 lines

I would like to deal with the drivers/xen/char/mem.c as follows. How do you think about it? It will cause any problem?

- I will post a patch, which removes definition of ARCH_HAS_DEV_MEM, to xen-ia64-devel later.
- If needed, I will post a revert patch of "xen-ia64-devel.hg c/s 12544:395aa5609e6d". (Creating the revert patch may be difficult...)

Xen-ia64 already don't need to modify drivers/xen/char/mem.c. But as you mentioned, current drivers/xen/char/mem.c has some parts for xen-ia64. So we may need to cleanup drivers/xen/char/mem.c.

I made a attached revert patch of xen-unstablecs12513[1] (same as xen-ia64 cs12544). Keir, Isaku, how about it?

If the patch is applied, we cannot compile linux-xen-ia64. But I have a patch of reverting cs12873[2],
if the patch is also applied, we can compile linux-xen-ia64 again. I think Kama will post this patch to xen-ia64-devel soon.

[1] cs12513
http://xenbits.xensource.com/xen-unstable.hg?rev/395aa5609e6d
[2] cs12873
http://xenbits.xensource.com/xen-unstable.hg?rev/e5e6893ec699

Best Regards,

Akio Takebe

drivers/xen/char/mem.c +9 -22
diff -r 86ac3059ab67 drivers/xen/char/mem.c
@@ -26,12 +26,13 @@
 #include <asm/io.h>
 #include <asm/hypervisor.h>
 
-#ifndef ARCH_HAS_VALID_PHYS_ADDR_RANGE
-static inline int valid_phys_addr_range(unsigned long addr, size_t count)
+static inline int uncached_access(struct file *file)
 {
-	return 1;
+	if (file->f_flags & O_SYNC)
+		return 1;
+	/* Xen sets correct MTRR type on non-RAM for us. */
+	return 0;
 }
-#endif
 
 /*
  * This funcion reads the *physical* memory. The f_pos points directly to the 
@@ -44,9 +45,6 @@ static ssize_t read_mem(struct file * fi
 	ssize_t read = 0, sz;
 	void __iomem *v;
 
-	if (!valid_phys_addr_range(p, count))
-		return -EFAULT;
-
 	while (count > 0) {
 		/*
 		 * Handle first page in case it's not aligned
@@ -58,7 +56,7 @@ static ssize_t read_mem(struct file * fi
 
 		sz = min_t(unsigned long, sz, count);
 
-		v = xen_xlate_dev_mem_ptr(p, sz);
+		v = ioremap(p, sz);
 		if (IS_ERR(v) || v == NULL) {
 			/*
 			 * Some programs (e.g., dmidecode) groove off into
@@ -75,7 +73,7 @@ static ssize_t read_mem(struct file * fi
 		}
 
 		ignored = copy_to_user(buf, v, sz);
-		xen_xlate_dev_mem_ptr_unmap(v);
+		iounmap(v);
 		if (ignored)
 			return -EFAULT;
 		buf += sz;
@@ -95,9 +93,6 @@ static ssize_t write_mem(struct file * f
 	ssize_t written = 0, sz;
 	void __iomem *v;
 
-	if (!valid_phys_addr_range(p, count))
-		return -EFAULT;
-
 	while (count > 0) {
 		/*
 		 * Handle first page in case it's not aligned
@@ -109,7 +104,7 @@ static ssize_t write_mem(struct file * f
 
 		sz = min_t(unsigned long, sz, count);
 
-		v = xen_xlate_dev_mem_ptr(p, sz);
+		v = ioremap(p, sz);
 		if (v == NULL)
 			break;
 		if (IS_ERR(v)) {
@@ -119,7 +114,7 @@ static ssize_t write_mem(struct file * f
 		}
 
 		ignored = copy_from_user(v, buf, sz);
-		xen_xlate_dev_mem_ptr_unmap(v);
+		iounmap(v);
 		if (ignored) {
 			written += sz - ignored;
 			if (written)
@@ -137,14 +132,6 @@ static ssize_t write_mem(struct file * f
 }
 
 #ifndef ARCH_HAS_DEV_MEM_MMAP_MEM
-static inline int uncached_access(struct file *file)
-{
-	if (file->f_flags & O_SYNC)
-		return 1;
-	/* Xen sets correct MTRR type on non-RAM for us. */
-	return 0;
-}
-
 static int xen_mmap_mem(struct file * file, struct vm_area_struct * vma)
 {
 	size_t size = vma->vm_end - vma->vm_start;
include/asm-i386/mach-xen/asm/io.h +1 -2
diff -r 86ac3059ab67 include/asm-i386/mach-xen/asm/io.h
@@ -53,8 +53,7 @@
  * Convert a physical pointer to a virtual kernel pointer for /dev/mem
  * access
  */
-#define xen_xlate_dev_mem_ptr(p, sz)	ioremap(p, sz)
-#define xen_xlate_dev_mem_ptr_unmap(p)	iounmap(p)
+#define xen_xlate_dev_mem_ptr(p)	__va(p)
 
 /*
  * Convert a virtual cached pointer to an uncached pointer
include/asm-x86_64/mach-xen/asm/io.h +1 -2
diff -r 86ac3059ab67 include/asm-x86_64/mach-xen/asm/io.h
@@ -315,8 +315,7 @@ extern int iommu_bio_merge;
  * Convert a physical pointer to a virtual kernel pointer for /dev/mem
  * access
  */
-#define xen_xlate_dev_mem_ptr(p, sz)	ioremap(p, sz)
-#define xen_xlate_dev_mem_ptr_unmap(p)	iounmap(p)
+#define xen_xlate_dev_mem_ptr(p)	__va(p)
 
 /*
  * Convert a virtual cached pointer to an uncached pointer

# HG changeset patch
# User [email protected]
# Date 1184254766 -32400
# Node ID c94d485e18d7fb33abab4c1e6761d9d62a192603 # Parent 02987ed7948ad0b0253fbc53991bf61ae2e305e4 revert 12873:[IA64] paraviatualize /dev/mem to enable X.
http://xenbits.xensource.com/xen-unstable.hg?rev/e5e6893ec699

arch/ia64/Kconfig +3 -0
diff -r 02987ed7948a -r c94d485e18d7 arch/ia64/Kconfig
@@ -582,6 +582,9 @@ if XEN
 if XEN
 config XEN_SMPBOOT
 	default n
+
+config XEN_DEVMEM
+	default n
 endif
 
 source "drivers/xen/Kconfig"
arch/ia64/xen/Makefile +1 -1
diff -r 02987ed7948a -r c94d485e18d7 arch/ia64/xen/Makefile
@@ -4,6 +4,6 @@
 
 obj-y := hypercall.o xenivt.o xenentry.o xensetup.o xenpal.o xenhpski.o \
 	 hypervisor.o util.o xencomm.o xcom_hcall.o xcom_mini.o \
-	 xcom_privcmd.o mem.o xen_dma.o
+	 xcom_privcmd.o xen_dma.o
 
 obj-$(CONFIG_IA64_GENERIC) += machvec.o
arch/ia64/xen/mem.c deleted +0 -75

75 lines not on this page · raw message

include/asm-ia64/io.h +0 -4
diff -r 02987ed7948a -r c94d485e18d7 include/asm-ia64/io.h
@@ -129,10 +129,6 @@ extern int valid_mmap_phys_addr_range (u
 	 ((bvec_to_pseudophys((vec1)) + (vec1)->bv_len) ==		\
 	  bvec_to_pseudophys((vec2))))
 
-/* We will be supplying our own /dev/mem implementation */
-#define ARCH_HAS_DEV_MEM
-#define ARCH_HAS_DEV_MEM_MMAP_MEM
-int xen_mmap_mem(struct file * file, struct vm_area_struct * vma);
 #endif /* CONFIG_XEN */
 
 # endif /* KERNEL */
include/asm-ia64/uaccess.h +0 -20
diff -r 02987ed7948a -r c94d485e18d7 include/asm-ia64/uaccess.h
@@ -365,7 +365,6 @@ ia64_done_with_exception (struct pt_regs
 }
 
 #define ARCH_HAS_TRANSLATE_MEM_PTR	1
-#ifndef CONFIG_XEN
 static __inline__ char *
 xlate_dev_mem_ptr (unsigned long p)
 {
@@ -380,25 +379,6 @@ xlate_dev_mem_ptr (unsigned long p)
 
 	return ptr;
 }
-#else
-static __inline__ char *
-xen_xlate_dev_mem_ptr (unsigned long p, ssize_t sz)
-{
-	unsigned long pfn = p >> PAGE_SHIFT;
-
-	if (pfn_valid(pfn) && !PageUncached(pfn_to_page(pfn)))
-		return __va(p);
-
-	return ioremap(p, sz);
-}
-
-static __inline__ void
-xen_xlate_dev_mem_ptr_unmap (char* v)
-{
-	if (REGION_NUMBER(v) == RGN_UNCACHED)
-		iounmap(v);
-}
-#endif
 
 /*
  * Convert a virtual cached kernel memory pointer to an uncached pointer

_______________________________________________
Xen-ia64-devel mailing list
[email protected]
http://lists.xensource.com/xen-ia64-devel

#12 lore raw

Re: Re: [Xen-changelog] [linux-2.6.18-xen] Add "#ifdefARCH_HAS_DEV_MEM" to archtecture specific file_operations.

I am happy to apply these if this is the right direction for ia64. Will someone else (e.g., Alex, Isaku) ack them if so, please?

-- Keir

Quoted 6 lines · Akio Takebe

Xen-ia64 already don't need to modify drivers/xen/char/mem.c. But as you mentioned, current drivers/xen/char/mem.c has some parts for xen-ia64. So we may need to cleanup drivers/xen/char/mem.c.

I made a attached revert patch of xen-unstablecs12513[1] (same as xen-ia64 cs12544). Keir, Isaku, how about it?

#13 lore raw

Re: Re: [Xen-changelog] [linux-2.6.18-xen] Add "#ifdefARCH_HAS_DEV_MEM" to archtecture specific file_operations.

Quoted 3 lines · Keir Fraser

I am happy to apply these if this is the right direction for ia64. Will someone else (e.g., Alex, Isaku) ack them if so, please?

Fine for me.

Signature · 1 line
yamahata
#14 lore raw

Re: Re: [Xen-changelog] [linux-2.6.18-xen] Add "#ifdefARCH_HAS_DEV_MEM" to archtecture specific file_operations.

Quoted 7 lines · Isaku Yamahata
Quoted 3 lines · Keir Fraser

I am happy to apply these if this is the right direction for ia64. Will someone else (e.g., Alex, Isaku) ack them if so, please?

Fine for me.

Okay, revert of 12513 is now applied. I assume the other patch will be applied to the ia64 linux tree.

-- Keir