aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/mem.c
diff options
context:
space:
mode:
authorZhang Yanfei <zhangyanfei@cn.fujitsu.com>2013-07-03 18:08:36 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-03 19:08:03 -0400
commita11edb59a05d8d5195419bd1fc28d82752324158 (patch)
tree1100e82327ee45c50a4f9c0e47df9e845dcf0706 /drivers/char/mem.c
parent266b7a021f7dcc4d4531961a47f4ef74c3c4ab6b (diff)
/dev/oldmem: Remove the interface
/dev/oldmem provides the interface for us to access the "old memory" in the dump-capture kernel. Unfortunately, no one actually uses this interface. And this interface could actually cause some real problems if used on ia64 where the cached/uncached accesses are mixed. See the discussion from the link: https://lkml.org/lkml/2013/4/12/386. So Eric suggested that we should remove /dev/oldmem as an unused piece of code. [akpm@linux-foundation.org: mention /dev/oldmem obsolescence in devices.txt] Suggested-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com> Cc: Vivek Goyal <vgoyal@redhat.com> Cc: Dave Hansen <dave@sr71.net> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Matt Fleming <matt.fleming@intel.com> Cc: Michael Holzheu <holzheu@linux.vnet.ibm.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Tony Luck <tony.luck@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/mem.c')
-rw-r--r--drivers/char/mem.c47
1 files changed, 0 insertions, 47 deletions
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 2ca6d7844ad9..f895a8c8a244 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -21,7 +21,6 @@
21#include <linux/ptrace.h> 21#include <linux/ptrace.h>
22#include <linux/device.h> 22#include <linux/device.h>
23#include <linux/highmem.h> 23#include <linux/highmem.h>
24#include <linux/crash_dump.h>
25#include <linux/backing-dev.h> 24#include <linux/backing-dev.h>
26#include <linux/bootmem.h> 25#include <linux/bootmem.h>
27#include <linux/splice.h> 26#include <linux/splice.h>
@@ -357,40 +356,6 @@ static int mmap_kmem(struct file *file, struct vm_area_struct *vma)
357} 356}
358#endif 357#endif
359 358
360#ifdef CONFIG_CRASH_DUMP
361/*
362 * Read memory corresponding to the old kernel.
363 */
364static ssize_t read_oldmem(struct file *file, char __user *buf,
365 size_t count, loff_t *ppos)
366{
367 unsigned long pfn, offset;
368 size_t read = 0, csize;
369 int rc = 0;
370
371 while (count) {
372 pfn = *ppos / PAGE_SIZE;
373 if (pfn > saved_max_pfn)
374 return read;
375
376 offset = (unsigned long)(*ppos % PAGE_SIZE);
377 if (count > PAGE_SIZE - offset)
378 csize = PAGE_SIZE - offset;
379 else
380 csize = count;
381
382 rc = copy_oldmem_page(pfn, buf, csize, offset, 1);
383 if (rc < 0)
384 return rc;
385 buf += csize;
386 *ppos += csize;
387 read += csize;
388 count -= csize;
389 }
390 return read;
391}
392#endif
393
394#ifdef CONFIG_DEVKMEM 359#ifdef CONFIG_DEVKMEM
395/* 360/*
396 * This function reads the *virtual* memory as seen by the kernel. 361 * This function reads the *virtual* memory as seen by the kernel.
@@ -772,7 +737,6 @@ static int open_port(struct inode *inode, struct file *filp)
772#define aio_write_zero aio_write_null 737#define aio_write_zero aio_write_null
773#define open_mem open_port 738#define open_mem open_port
774#define open_kmem open_mem 739#define open_kmem open_mem
775#define open_oldmem open_mem
776 740
777static const struct file_operations mem_fops = { 741static const struct file_operations mem_fops = {
778 .llseek = memory_lseek, 742 .llseek = memory_lseek,
@@ -837,14 +801,6 @@ static const struct file_operations full_fops = {
837 .write = write_full, 801 .write = write_full,
838}; 802};
839 803
840#ifdef CONFIG_CRASH_DUMP
841static const struct file_operations oldmem_fops = {
842 .read = read_oldmem,
843 .open = open_oldmem,
844 .llseek = default_llseek,
845};
846#endif
847
848static const struct memdev { 804static const struct memdev {
849 const char *name; 805 const char *name;
850 umode_t mode; 806 umode_t mode;
@@ -866,9 +822,6 @@ static const struct memdev {
866#ifdef CONFIG_PRINTK 822#ifdef CONFIG_PRINTK
867 [11] = { "kmsg", 0644, &kmsg_fops, NULL }, 823 [11] = { "kmsg", 0644, &kmsg_fops, NULL },
868#endif 824#endif
869#ifdef CONFIG_CRASH_DUMP
870 [12] = { "oldmem", 0, &oldmem_fops, NULL },
871#endif
872}; 825};
873 826
874static int memory_open(struct inode *inode, struct file *filp) 827static int memory_open(struct inode *inode, struct file *filp)