All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/3 -mm] kexec jump -v8 : add write support to oldmem device
@ 2007-12-21  7:33 ` Huang, Ying
  0 siblings, 0 replies; 12+ messages in thread
From: Huang, Ying @ 2007-12-21  7:33 UTC (permalink / raw)
  To: Eric W. Biederman, Pavel Machek, nigel, Rafael J. Wysocki,
	Andrew Morton
  Cc: linux-pm, Kexec Mailing List, linux-kernel

This patch adds writing support for /dev/oldmem. This can be used to

- Communicate between original kernel and kexeced kernel through write
  to some pages in original kernel.

- Restore the memory contents of hibernated system in kexec based
  hibernation.

Signed-off-by: Huang Ying <ying.huang@intel.com>

---
 arch/x86/kernel/crash_dump_32.c |   27 +++++++++++++++++++++++++++
 drivers/char/mem.c              |   32 ++++++++++++++++++++++++++++++++
 include/linux/crash_dump.h      |    2 ++
 3 files changed, 61 insertions(+)

--- a/arch/x86/kernel/crash_dump_32.c
+++ b/arch/x86/kernel/crash_dump_32.c
@@ -59,6 +59,33 @@ ssize_t copy_oldmem_page(unsigned long p
 	return csize;
 }
 
+ssize_t write_oldmem_page(unsigned long pfn, const char *buf,
+			  size_t csize, unsigned long offset, int userbuf)
+{
+	void  *vaddr;
+
+	if (!csize)
+		return 0;
+
+	if (!userbuf) {
+		vaddr = kmap_atomic_pfn(pfn, KM_PTE0);
+		memcpy(vaddr + offset, buf, csize);
+	} else {
+		if (!kdump_buf_page) {
+			printk(KERN_WARNING "Kdump: Kdump buffer page not"
+				" allocated\n");
+			return -EFAULT;
+		}
+		if (copy_from_user(kdump_buf_page, buf, csize))
+			return -EFAULT;
+		vaddr = kmap_atomic_pfn(pfn, KM_PTE0);
+		memcpy(vaddr + offset, kdump_buf_page, csize);
+	}
+	kunmap_atomic(vaddr, KM_PTE0);
+
+	return csize;
+}
+
 static int __init kdump_buf_page_init(void)
 {
 	int ret = 0;
--- a/include/linux/crash_dump.h
+++ b/include/linux/crash_dump.h
@@ -11,6 +11,8 @@
 extern unsigned long long elfcorehdr_addr;
 extern ssize_t copy_oldmem_page(unsigned long, char *, size_t,
 						unsigned long, int);
+extern ssize_t write_oldmem_page(unsigned long, const char *, size_t,
+				 unsigned long, int);
 extern const struct file_operations proc_vmcore_operations;
 extern struct proc_dir_entry *proc_vmcore;
 
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -348,6 +348,37 @@ static ssize_t read_oldmem(struct file *
 	}
 	return read;
 }
+
+/*
+ * Write memory corresponding to the old kernel.
+ */
+static ssize_t write_oldmem(struct file *file, const char __user *buf,
+			    size_t count, loff_t *ppos)
+{
+	unsigned long pfn, offset;
+	size_t write = 0, csize;
+	int rc = 0;
+
+	while (count) {
+		pfn = *ppos / PAGE_SIZE;
+		if (pfn > saved_max_pfn)
+			return write;
+
+		offset = (unsigned long)(*ppos % PAGE_SIZE);
+		if (count > PAGE_SIZE - offset)
+			csize = PAGE_SIZE - offset;
+		else
+			csize = count;
+		rc = write_oldmem_page(pfn, buf, csize, offset, 1);
+		if (rc < 0)
+			return rc;
+		buf += csize;
+		*ppos += csize;
+		write += csize;
+		count -= csize;
+	}
+	return write;
+}
 #endif
 
 extern long vread(char *buf, char *addr, unsigned long count);
@@ -783,6 +814,7 @@ static const struct file_operations full
 #ifdef CONFIG_CRASH_DUMP
 static const struct file_operations oldmem_fops = {
 	.read	= read_oldmem,
+	.write	= write_oldmem,
 	.open	= open_oldmem,
 };
 #endif


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* [PATCH 2/3 -mm] kexec jump -v8 : add write support to oldmem device
@ 2007-12-21  7:33 ` Huang, Ying
  0 siblings, 0 replies; 12+ messages in thread
From: Huang, Ying @ 2007-12-21  7:33 UTC (permalink / raw)
  To: Eric W. Biederman, Pavel Machek, nigel, Rafael J. Wysocki,
	Andrew Morton
  Cc: linux-kernel, linux-pm, Kexec Mailing List

This patch adds writing support for /dev/oldmem. This can be used to

- Communicate between original kernel and kexeced kernel through write
  to some pages in original kernel.

- Restore the memory contents of hibernated system in kexec based
  hibernation.

Signed-off-by: Huang Ying <ying.huang@intel.com>

---
 arch/x86/kernel/crash_dump_32.c |   27 +++++++++++++++++++++++++++
 drivers/char/mem.c              |   32 ++++++++++++++++++++++++++++++++
 include/linux/crash_dump.h      |    2 ++
 3 files changed, 61 insertions(+)

--- a/arch/x86/kernel/crash_dump_32.c
+++ b/arch/x86/kernel/crash_dump_32.c
@@ -59,6 +59,33 @@ ssize_t copy_oldmem_page(unsigned long p
 	return csize;
 }
 
+ssize_t write_oldmem_page(unsigned long pfn, const char *buf,
+			  size_t csize, unsigned long offset, int userbuf)
+{
+	void  *vaddr;
+
+	if (!csize)
+		return 0;
+
+	if (!userbuf) {
+		vaddr = kmap_atomic_pfn(pfn, KM_PTE0);
+		memcpy(vaddr + offset, buf, csize);
+	} else {
+		if (!kdump_buf_page) {
+			printk(KERN_WARNING "Kdump: Kdump buffer page not"
+				" allocated\n");
+			return -EFAULT;
+		}
+		if (copy_from_user(kdump_buf_page, buf, csize))
+			return -EFAULT;
+		vaddr = kmap_atomic_pfn(pfn, KM_PTE0);
+		memcpy(vaddr + offset, kdump_buf_page, csize);
+	}
+	kunmap_atomic(vaddr, KM_PTE0);
+
+	return csize;
+}
+
 static int __init kdump_buf_page_init(void)
 {
 	int ret = 0;
--- a/include/linux/crash_dump.h
+++ b/include/linux/crash_dump.h
@@ -11,6 +11,8 @@
 extern unsigned long long elfcorehdr_addr;
 extern ssize_t copy_oldmem_page(unsigned long, char *, size_t,
 						unsigned long, int);
+extern ssize_t write_oldmem_page(unsigned long, const char *, size_t,
+				 unsigned long, int);
 extern const struct file_operations proc_vmcore_operations;
 extern struct proc_dir_entry *proc_vmcore;
 
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -348,6 +348,37 @@ static ssize_t read_oldmem(struct file *
 	}
 	return read;
 }
+
+/*
+ * Write memory corresponding to the old kernel.
+ */
+static ssize_t write_oldmem(struct file *file, const char __user *buf,
+			    size_t count, loff_t *ppos)
+{
+	unsigned long pfn, offset;
+	size_t write = 0, csize;
+	int rc = 0;
+
+	while (count) {
+		pfn = *ppos / PAGE_SIZE;
+		if (pfn > saved_max_pfn)
+			return write;
+
+		offset = (unsigned long)(*ppos % PAGE_SIZE);
+		if (count > PAGE_SIZE - offset)
+			csize = PAGE_SIZE - offset;
+		else
+			csize = count;
+		rc = write_oldmem_page(pfn, buf, csize, offset, 1);
+		if (rc < 0)
+			return rc;
+		buf += csize;
+		*ppos += csize;
+		write += csize;
+		count -= csize;
+	}
+	return write;
+}
 #endif
 
 extern long vread(char *buf, char *addr, unsigned long count);
@@ -783,6 +814,7 @@ static const struct file_operations full
 #ifdef CONFIG_CRASH_DUMP
 static const struct file_operations oldmem_fops = {
 	.read	= read_oldmem,
+	.write	= write_oldmem,
 	.open	= open_oldmem,
 };
 #endif


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

* [PATCH 2/3 -mm] kexec jump -v8 : add write support to oldmem device
@ 2007-12-21  7:33 Huang, Ying
  0 siblings, 0 replies; 12+ messages in thread
From: Huang, Ying @ 2007-12-21  7:33 UTC (permalink / raw)
  To: Eric W. Biederman, Pavel Machek, nigel, Rafael J. Wysocki,
	Andrew Morton
  Cc: linux-pm, Kexec Mailing List, linux-kernel

This patch adds writing support for /dev/oldmem. This can be used to

- Communicate between original kernel and kexeced kernel through write
  to some pages in original kernel.

- Restore the memory contents of hibernated system in kexec based
  hibernation.

Signed-off-by: Huang Ying <ying.huang@intel.com>

---
 arch/x86/kernel/crash_dump_32.c |   27 +++++++++++++++++++++++++++
 drivers/char/mem.c              |   32 ++++++++++++++++++++++++++++++++
 include/linux/crash_dump.h      |    2 ++
 3 files changed, 61 insertions(+)

--- a/arch/x86/kernel/crash_dump_32.c
+++ b/arch/x86/kernel/crash_dump_32.c
@@ -59,6 +59,33 @@ ssize_t copy_oldmem_page(unsigned long p
 	return csize;
 }
 
+ssize_t write_oldmem_page(unsigned long pfn, const char *buf,
+			  size_t csize, unsigned long offset, int userbuf)
+{
+	void  *vaddr;
+
+	if (!csize)
+		return 0;
+
+	if (!userbuf) {
+		vaddr = kmap_atomic_pfn(pfn, KM_PTE0);
+		memcpy(vaddr + offset, buf, csize);
+	} else {
+		if (!kdump_buf_page) {
+			printk(KERN_WARNING "Kdump: Kdump buffer page not"
+				" allocated\n");
+			return -EFAULT;
+		}
+		if (copy_from_user(kdump_buf_page, buf, csize))
+			return -EFAULT;
+		vaddr = kmap_atomic_pfn(pfn, KM_PTE0);
+		memcpy(vaddr + offset, kdump_buf_page, csize);
+	}
+	kunmap_atomic(vaddr, KM_PTE0);
+
+	return csize;
+}
+
 static int __init kdump_buf_page_init(void)
 {
 	int ret = 0;
--- a/include/linux/crash_dump.h
+++ b/include/linux/crash_dump.h
@@ -11,6 +11,8 @@
 extern unsigned long long elfcorehdr_addr;
 extern ssize_t copy_oldmem_page(unsigned long, char *, size_t,
 						unsigned long, int);
+extern ssize_t write_oldmem_page(unsigned long, const char *, size_t,
+				 unsigned long, int);
 extern const struct file_operations proc_vmcore_operations;
 extern struct proc_dir_entry *proc_vmcore;
 
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -348,6 +348,37 @@ static ssize_t read_oldmem(struct file *
 	}
 	return read;
 }
+
+/*
+ * Write memory corresponding to the old kernel.
+ */
+static ssize_t write_oldmem(struct file *file, const char __user *buf,
+			    size_t count, loff_t *ppos)
+{
+	unsigned long pfn, offset;
+	size_t write = 0, csize;
+	int rc = 0;
+
+	while (count) {
+		pfn = *ppos / PAGE_SIZE;
+		if (pfn > saved_max_pfn)
+			return write;
+
+		offset = (unsigned long)(*ppos % PAGE_SIZE);
+		if (count > PAGE_SIZE - offset)
+			csize = PAGE_SIZE - offset;
+		else
+			csize = count;
+		rc = write_oldmem_page(pfn, buf, csize, offset, 1);
+		if (rc < 0)
+			return rc;
+		buf += csize;
+		*ppos += csize;
+		write += csize;
+		count -= csize;
+	}
+	return write;
+}
 #endif
 
 extern long vread(char *buf, char *addr, unsigned long count);
@@ -783,6 +814,7 @@ static const struct file_operations full
 #ifdef CONFIG_CRASH_DUMP
 static const struct file_operations oldmem_fops = {
 	.read	= read_oldmem,
+	.write	= write_oldmem,
 	.open	= open_oldmem,
 };
 #endif

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

* Re: [PATCH 2/3 -mm] kexec jump -v8 : add write support to oldmem device
  2007-12-21  7:33 ` Huang, Ying
@ 2007-12-21 10:17   ` Pavel Machek
  -1 siblings, 0 replies; 12+ messages in thread
From: Pavel Machek @ 2007-12-21 10:17 UTC (permalink / raw)
  To: Huang, Ying
  Cc: nigel, Kexec Mailing List, linux-kernel, Rafael J. Wysocki,
	Eric W. Biederman, Andrew Morton, linux-pm

Hi!

> This patch adds writing support for /dev/oldmem. This can be used to
> 
> - Communicate between original kernel and kexeced kernel through write
>   to some pages in original kernel.
> 
> - Restore the memory contents of hibernated system in kexec based
>   hibernation.
> 
> Signed-off-by: Huang Ying <ying.huang@intel.com>
> 
> --- a/arch/x86/kernel/crash_dump_32.c
> +++ b/arch/x86/kernel/crash_dump_32.c
> +ssize_t write_oldmem_page(unsigned long pfn, const char *buf,
> +			  size_t csize, unsigned long offset, int
> userbuf)

> --- a/drivers/char/mem.c
> +++ b/drivers/char/mem.c
> @@ -348,6 +348,37 @@ static ssize_t read_oldmem(struct file *
>  	}
>  	return read;
>  }
> +
> +/*
> + * Write memory corresponding to the old kernel.
> + */
> +static ssize_t write_oldmem(struct file *file, const char __user *buf,
> +			    size_t count, loff_t *ppos)
> +{
...
> +		rc = write_oldmem_page(pfn, buf, csize, offset, 1);

I believe this is going to break compilation on non-32bit
machines. Or is crashdump only supported on i386?
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* Re: [PATCH 2/3 -mm] kexec jump -v8 : add write support to oldmem device
  2007-12-21  7:33 ` Huang, Ying
  (?)
@ 2007-12-21 10:17 ` Pavel Machek
  -1 siblings, 0 replies; 12+ messages in thread
From: Pavel Machek @ 2007-12-21 10:17 UTC (permalink / raw)
  To: Huang, Ying
  Cc: nigel, Kexec Mailing List, linux-kernel, Eric W. Biederman,
	Andrew Morton, linux-pm

Hi!

> This patch adds writing support for /dev/oldmem. This can be used to
> 
> - Communicate between original kernel and kexeced kernel through write
>   to some pages in original kernel.
> 
> - Restore the memory contents of hibernated system in kexec based
>   hibernation.
> 
> Signed-off-by: Huang Ying <ying.huang@intel.com>
> 
> --- a/arch/x86/kernel/crash_dump_32.c
> +++ b/arch/x86/kernel/crash_dump_32.c
> +ssize_t write_oldmem_page(unsigned long pfn, const char *buf,
> +			  size_t csize, unsigned long offset, int
> userbuf)

> --- a/drivers/char/mem.c
> +++ b/drivers/char/mem.c
> @@ -348,6 +348,37 @@ static ssize_t read_oldmem(struct file *
>  	}
>  	return read;
>  }
> +
> +/*
> + * Write memory corresponding to the old kernel.
> + */
> +static ssize_t write_oldmem(struct file *file, const char __user *buf,
> +			    size_t count, loff_t *ppos)
> +{
...
> +		rc = write_oldmem_page(pfn, buf, csize, offset, 1);

I believe this is going to break compilation on non-32bit
machines. Or is crashdump only supported on i386?
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* Re: [PATCH 2/3 -mm] kexec jump -v8 : add write support to oldmem device
@ 2007-12-21 10:17   ` Pavel Machek
  0 siblings, 0 replies; 12+ messages in thread
From: Pavel Machek @ 2007-12-21 10:17 UTC (permalink / raw)
  To: Huang, Ying
  Cc: Eric W. Biederman, nigel, Rafael J. Wysocki, Andrew Morton,
	linux-kernel, linux-pm, Kexec Mailing List

Hi!

> This patch adds writing support for /dev/oldmem. This can be used to
> 
> - Communicate between original kernel and kexeced kernel through write
>   to some pages in original kernel.
> 
> - Restore the memory contents of hibernated system in kexec based
>   hibernation.
> 
> Signed-off-by: Huang Ying <ying.huang@intel.com>
> 
> --- a/arch/x86/kernel/crash_dump_32.c
> +++ b/arch/x86/kernel/crash_dump_32.c
> +ssize_t write_oldmem_page(unsigned long pfn, const char *buf,
> +			  size_t csize, unsigned long offset, int
> userbuf)

> --- a/drivers/char/mem.c
> +++ b/drivers/char/mem.c
> @@ -348,6 +348,37 @@ static ssize_t read_oldmem(struct file *
>  	}
>  	return read;
>  }
> +
> +/*
> + * Write memory corresponding to the old kernel.
> + */
> +static ssize_t write_oldmem(struct file *file, const char __user *buf,
> +			    size_t count, loff_t *ppos)
> +{
...
> +		rc = write_oldmem_page(pfn, buf, csize, offset, 1);

I believe this is going to break compilation on non-32bit
machines. Or is crashdump only supported on i386?
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* Re: [PATCH 2/3 -mm] kexec jump -v8 : add write support to oldmem device
  2007-12-21 10:17   ` Pavel Machek
@ 2007-12-21 10:58     ` Bernhard Walle
  -1 siblings, 0 replies; 12+ messages in thread
From: Bernhard Walle @ 2007-12-21 10:58 UTC (permalink / raw)
  To: kexec, linux-kernel, Andrew Morton, linux-pm

* Pavel Machek <pavel@ucw.cz> [2007-12-21 11:17]:
> Or is crashdump only supported on i386?

No.


Thanks,
   Bernhard

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* Re: [PATCH 2/3 -mm] kexec jump -v8 : add write support to oldmem device
  2007-12-21 10:17   ` Pavel Machek
  (?)
@ 2007-12-21 10:58   ` Bernhard Walle
  -1 siblings, 0 replies; 12+ messages in thread
From: Bernhard Walle @ 2007-12-21 10:58 UTC (permalink / raw)
  To: kexec, linux-kernel, Andrew Morton, linux-pm

* Pavel Machek <pavel@ucw.cz> [2007-12-21 11:17]:
> Or is crashdump only supported on i386?

No.


Thanks,
   Bernhard

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

* Re: [PATCH 2/3 -mm] kexec jump -v8 : add write support to oldmem device
@ 2007-12-21 10:58     ` Bernhard Walle
  0 siblings, 0 replies; 12+ messages in thread
From: Bernhard Walle @ 2007-12-21 10:58 UTC (permalink / raw)
  To: kexec, linux-kernel, Andrew Morton, linux-pm

* Pavel Machek <pavel@ucw.cz> [2007-12-21 11:17]:
> Or is crashdump only supported on i386?

No.


Thanks,
   Bernhard

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

* Re: [PATCH 2/3 -mm] kexec jump -v8 : add write support to oldmem device
  2007-12-21 10:17   ` Pavel Machek
@ 2007-12-21 12:50     ` huang ying
  -1 siblings, 0 replies; 12+ messages in thread
From: huang ying @ 2007-12-21 12:50 UTC (permalink / raw)
  To: Pavel Machek
  Cc: nigel, Kexec Mailing List, linux-kernel, Rafael J. Wysocki,
	Eric W. Biederman, Huang, Ying, Andrew Morton, linux-pm

On Dec 21, 2007 6:17 PM, Pavel Machek <pavel@ucw.cz> wrote:
> Hi!
>
> > This patch adds writing support for /dev/oldmem. This can be used to
> >
> > - Communicate between original kernel and kexeced kernel through write
> >   to some pages in original kernel.
> >
> > - Restore the memory contents of hibernated system in kexec based
> >   hibernation.
> >
> > Signed-off-by: Huang Ying <ying.huang@intel.com>
> >
> > --- a/arch/x86/kernel/crash_dump_32.c
> > +++ b/arch/x86/kernel/crash_dump_32.c
> > +ssize_t write_oldmem_page(unsigned long pfn, const char *buf,
> > +                       size_t csize, unsigned long offset, int
> > userbuf)
>
> > --- a/drivers/char/mem.c
> > +++ b/drivers/char/mem.c
> > @@ -348,6 +348,37 @@ static ssize_t read_oldmem(struct file *
> >       }
> >       return read;
> >  }
> > +
> > +/*
> > + * Write memory corresponding to the old kernel.
> > + */
> > +static ssize_t write_oldmem(struct file *file, const char __user *buf,
> > +                         size_t count, loff_t *ppos)
> > +{
> ...
> > +             rc = write_oldmem_page(pfn, buf, csize, offset, 1);
>
> I believe this is going to break compilation on non-32bit
> machines.

Yes, I will fix this.

Best Regards,
Huang Ying

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* Re: [PATCH 2/3 -mm] kexec jump -v8 : add write support to oldmem device
  2007-12-21 10:17   ` Pavel Machek
                     ` (2 preceding siblings ...)
  (?)
@ 2007-12-21 12:50   ` huang ying
  -1 siblings, 0 replies; 12+ messages in thread
From: huang ying @ 2007-12-21 12:50 UTC (permalink / raw)
  To: Pavel Machek
  Cc: nigel, Kexec Mailing List, linux-kernel, Eric W. Biederman,
	Andrew Morton, linux-pm

On Dec 21, 2007 6:17 PM, Pavel Machek <pavel@ucw.cz> wrote:
> Hi!
>
> > This patch adds writing support for /dev/oldmem. This can be used to
> >
> > - Communicate between original kernel and kexeced kernel through write
> >   to some pages in original kernel.
> >
> > - Restore the memory contents of hibernated system in kexec based
> >   hibernation.
> >
> > Signed-off-by: Huang Ying <ying.huang@intel.com>
> >
> > --- a/arch/x86/kernel/crash_dump_32.c
> > +++ b/arch/x86/kernel/crash_dump_32.c
> > +ssize_t write_oldmem_page(unsigned long pfn, const char *buf,
> > +                       size_t csize, unsigned long offset, int
> > userbuf)
>
> > --- a/drivers/char/mem.c
> > +++ b/drivers/char/mem.c
> > @@ -348,6 +348,37 @@ static ssize_t read_oldmem(struct file *
> >       }
> >       return read;
> >  }
> > +
> > +/*
> > + * Write memory corresponding to the old kernel.
> > + */
> > +static ssize_t write_oldmem(struct file *file, const char __user *buf,
> > +                         size_t count, loff_t *ppos)
> > +{
> ...
> > +             rc = write_oldmem_page(pfn, buf, csize, offset, 1);
>
> I believe this is going to break compilation on non-32bit
> machines.

Yes, I will fix this.

Best Regards,
Huang Ying

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

* Re: [PATCH 2/3 -mm] kexec jump -v8 : add write support to oldmem device
@ 2007-12-21 12:50     ` huang ying
  0 siblings, 0 replies; 12+ messages in thread
From: huang ying @ 2007-12-21 12:50 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Huang, Ying, Eric W. Biederman, nigel, Rafael J. Wysocki,
	Andrew Morton, linux-kernel, linux-pm, Kexec Mailing List

On Dec 21, 2007 6:17 PM, Pavel Machek <pavel@ucw.cz> wrote:
> Hi!
>
> > This patch adds writing support for /dev/oldmem. This can be used to
> >
> > - Communicate between original kernel and kexeced kernel through write
> >   to some pages in original kernel.
> >
> > - Restore the memory contents of hibernated system in kexec based
> >   hibernation.
> >
> > Signed-off-by: Huang Ying <ying.huang@intel.com>
> >
> > --- a/arch/x86/kernel/crash_dump_32.c
> > +++ b/arch/x86/kernel/crash_dump_32.c
> > +ssize_t write_oldmem_page(unsigned long pfn, const char *buf,
> > +                       size_t csize, unsigned long offset, int
> > userbuf)
>
> > --- a/drivers/char/mem.c
> > +++ b/drivers/char/mem.c
> > @@ -348,6 +348,37 @@ static ssize_t read_oldmem(struct file *
> >       }
> >       return read;
> >  }
> > +
> > +/*
> > + * Write memory corresponding to the old kernel.
> > + */
> > +static ssize_t write_oldmem(struct file *file, const char __user *buf,
> > +                         size_t count, loff_t *ppos)
> > +{
> ...
> > +             rc = write_oldmem_page(pfn, buf, csize, offset, 1);
>
> I believe this is going to break compilation on non-32bit
> machines.

Yes, I will fix this.

Best Regards,
Huang Ying

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

end of thread, other threads:[~2007-12-21 12:50 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-21  7:33 [PATCH 2/3 -mm] kexec jump -v8 : add write support to oldmem device Huang, Ying
2007-12-21  7:33 ` Huang, Ying
2007-12-21 10:17 ` Pavel Machek
2007-12-21 10:17 ` Pavel Machek
2007-12-21 10:17   ` Pavel Machek
2007-12-21 10:58   ` Bernhard Walle
2007-12-21 10:58   ` Bernhard Walle
2007-12-21 10:58     ` Bernhard Walle
2007-12-21 12:50   ` huang ying
2007-12-21 12:50   ` huang ying
2007-12-21 12:50     ` huang ying
  -- strict thread matches above, loose matches on Subject: below --
2007-12-21  7:33 Huang, Ying

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.