linux-mips
[Top] [All Lists]

Re: [PATCH] MIPS: KDUMP: Fix to access non-sectioned memory

To: Prem Mallappa <prem.mallappa@gmail.com>
Subject: Re: [PATCH] MIPS: KDUMP: Fix to access non-sectioned memory
From: Ralf Baechle <ralf@linux-mips.org>
Date: Thu, 3 Oct 2013 20:29:15 +0200
Cc: linux-mips <linux-mips@linux-mips.org>, Prem Mallappa <pmallappa@caviumnetworks.com>
In-reply-to: <1380786415-24956-2-git-send-email-pmallappa@caviumnetworks.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1380786415-24956-1-git-send-email-pmallappa@caviumnetworks.com> <1380786415-24956-2-git-send-email-pmallappa@caviumnetworks.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.21 (2010-09-15)
On Thu, Oct 03, 2013 at 01:16:55PM +0530, Prem Mallappa wrote:

> @@ -41,19 +42,20 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
>       if (!csize)
>               return 0;
>  
> -     vaddr = kmap_atomic_pfn(pfn);
> +     vaddr = ioremap(pfn << PAGE_SHIFT, PAGE_SIZE);

This is not portable, I'm afraid.

Ioremap on MIPS is creating uncached mappings - on most systems, that is.
However there is no guarantee that the data accessed through this mapping
does not reside in a cache on another CPU or another virtual address
which would make the operation undefined.

On SGI IP27 and IP35 ioremap is not even able to create RAM mappings at
all.  If you're lucky this would result in a bus error; if you're unlucky
it'll make the SCSI controller scribble the answer to the universe, life
and everything on the disk drive only to corrupt it again before you have
a chance to read it ;-)

I think this is bulletproof on Octeon so until there's a better patch you
may want to keep this around for the SDK.

I wonder, does commit 5395d97b675986e7e8f3140f9e0819d20b1d22cd
in upstream-sfr.git fix your issue?

Cheers,

  Ralf

<Prev in Thread] Current Thread [Next in Thread>