linux-mips
[Top] [All Lists]

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

To: David Daney <ddaney.cavm@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 22:16:41 +0200
Cc: Prem Mallappa <prem.mallappa@gmail.com>, linux-mips <linux-mips@linux-mips.org>, Prem Mallappa <pmallappa@caviumnetworks.com>
In-reply-to: <524DBC02.6020009@gmail.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> <20131003182915.GA15556@linux-mips.org> <524DBC02.6020009@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.21 (2010-09-15)
On Thu, Oct 03, 2013 at 11:48:34AM -0700, David Daney wrote:

> I wonder, how does /dev/mem handle it?  We should probably do what
> the mem driver does for this.

/dev/mem is converting physical address to virtual addresses using
xlate_dev_mem_ptr() which is defined as:

#define xlate_dev_mem_ptr(p)    __va(p)

which obviously is suffering from similar problems as Prem's suggested
patch.

Fortunately /dev/(k)mem have pretty much gotten out of fashion ;-)

The x86 implementation of xlate_dev_mem_ptr() is based on ioremap_cache()
which may be x86-specific - but very handy in situations like this and
there might also be devices which want to be mapped cached.

I'm considering to implement it since ages.  I just don't want a whole
flood of new cache modes like ioremap_uncached_accelerated() or maybe
ioremap_writeback_on_sunday_afternoons_only()  ;-)

  Ralf

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