All of lore.kernel.org
 help / color / mirror / Atom feed
From: Giuseppe Sacco <giuseppe@eppesuigoccas.homedns.org>
To: Ralf Baechle <ralf@linux-mips.org>
Cc: Florian Lohoff <flo@rfc822.org>,
	linux-mips@linux-mips.org, David Daney <ddaney@avtrex.com>
Subject: Re: 2.6.24-rc2 crash in kmap_coherent
Date: Wed, 12 Dec 2007 18:11:11 +0100	[thread overview]
Message-ID: <1197479471.25499.48.camel@scarafaggio> (raw)
In-Reply-To: <20071212153218.GA30291@linux-mips.org>

Hi Ralf,
the change you proposed here give an error since "page" is onlt
available on function copy_user_highpage() while there is not such
variable (nor parameter) in function copy_to_user_page().

I am actually recompiling everything using only the first part of your
patch, but I think it will not be enough.

Bye,
Giuseppe

Il giorno mer, 12/12/2007 alle 15.32 +0000, Ralf Baechle ha scritto:
[...]
> Totally untested because I have other stuff to do but something along the
> lines of below patch, I think.
> 
>   Ralf
> 
> diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
> index 480dec0..db5d608 100644
> --- a/arch/mips/mm/init.c
> +++ b/arch/mips/mm/init.c
> @@ -211,7 +211,8 @@ void copy_user_highpage(struct page *to, struct page *from,
>  	void *vfrom, *vto;
>  
>  	vto = kmap_atomic(to, KM_USER1);
> -	if (cpu_has_dc_aliases && page_mapped(from)) {
> +	if (cpu_has_dc_aliases &&
> +	    page_mapped(from) && !Page_dcache_dirty(from)) {
>  		vfrom = kmap_coherent(from, vaddr);
>  		copy_page(vto, vfrom);
>  		kunmap_coherent();
> @@ -234,7 +235,8 @@ void copy_to_user_page(struct vm_area_struct *vma,
>  	struct page *page, unsigned long vaddr, void *dst, const void *src,
>  	unsigned long len)
>  {
> -	if (cpu_has_dc_aliases && page_mapped(page)) {
> +	if (cpu_has_dc_aliases &&
> +	    page_mapped(page) && !Page_dcache_dirty(from)) {
>  		void *vto = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK);
>  		memcpy(vto, src, len);
>  		kunmap_coherent();
> @@ -253,7 +255,8 @@ void copy_from_user_page(struct vm_area_struct *vma,
>  	struct page *page, unsigned long vaddr, void *dst, const void *src,
>  	unsigned long len)
>  {
> -	if (cpu_has_dc_aliases && page_mapped(page)) {
> +	if (cpu_has_dc_aliases &&
> +	    page_mapped(page) && !Page_dcache_dirty(page)) {
>  		void *vfrom = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK);
>  		memcpy(dst, vfrom, len);
>  		kunmap_coherent();
> 
> 

  reply	other threads:[~2007-12-12 17:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-11 22:13 2.6.24-rc2 crash in kmap_coherent Florian Lohoff
2007-12-11 22:49 ` David Daney
2007-12-12  6:40   ` David Daney
2007-12-12 12:06 ` Ralf Baechle
2007-12-12 15:32   ` Ralf Baechle
2007-12-12 17:11     ` Giuseppe Sacco [this message]
2007-12-12 17:25       ` Giuseppe Sacco

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1197479471.25499.48.camel@scarafaggio \
    --to=giuseppe@eppesuigoccas.homedns.org \
    --cc=ddaney@avtrex.com \
    --cc=flo@rfc822.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.