All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: David Miller <davem@davemloft.net>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: joerg.roedel@amd.com, fujita.tomonori@lab.ntt.co.jp,
	reif@earthlink.net, sparclinux@vger.kernel.org,
	linux-kernel@vger.kernel.org, x86@kernel.org,
	tony.luck@intel.com, akpm@linux-foundation.org
Subject: Re: [PATCH v2 0/8] sparc: use asm-generic/dma-mapping-common.h and
Date: Sat, 18 Jul 2009 11:06:20 +0000	[thread overview]
Message-ID: <20090718110620.GC27287@elte.hu> (raw)
In-Reply-To: <20090714.131224.205307048.davem@davemloft.net>


* David Miller <davem@davemloft.net> wrote:

> From: Joerg Roedel <joerg.roedel@amd.com>
> Date: Tue, 14 Jul 2009 11:23:55 +0200
> 
> > On Tue, Jul 14, 2009 at 10:40:16AM +0900, FUJITA Tomonori wrote:
> >> On Mon, 13 Jul 2009 20:56:21 -0400
> >> Robert Reif <reif@earthlink.net> wrote:
> >> 
> >> > The bad address is within the kernel so it looks like
> >> > it's catching a real bug.
> >> > 
> >> > cat kallsyms | grep f0007000
> >> > f0007000 T trapbase_cpu3
> >> > 
> >> > WARNING: at lib/dma-debug.c:873 check_for_illegal_area+0xc8/0x100()
> >> > esp ffd7ba30: DMA-API: device driver maps memory from kernel text or 
> >> > rodata [addrð007000] [len@96]
> >> > Modules linked in: ext3 jbd sd_mod sun_esp esp_scsi scsi_transport_spi 
> >> 
> >> Ok, I looked at check_for_illegal_area() in dma-debug.
> >> 
> >> What check_for_illegal_area() does looks bogus to me with some of I/O
> >> remapping hardware.
> > 
> > Can you be more specific about this one? 
> > check_for_illegal_area() should not depend on any hardware 
> > because all it does is checking the machine addresses to be 
> > mapped.
> 
> The check can't work properly on sparc32.
> 
> Sparc32 always maps the kernel to a fixed physical location, and 
> it therefore can execute in the identity mapping area of physical 
> memory like where all the free pages and kmalloc areas live 
> virtually.
> 
> So if we free up some pages within the kernel image (because the 
> memory is unused, for exmple that's what's happening here with the 
> extra trap table pages on Robert's machine) we have pages in the 
> free page pool that are located right inside of the kernel text, 
> data, etc.
> 
> We'll thus need a way to turn off these checks somehow.  You could 
> also augment this check by seeing if there is a backing page, and 
> if so, whether it is PageReserved or not.  That's just one idea.

Hm, note, this sparc32 behavior might break certain aspects of 
lockdep as well, see kernel/lockdep.c::static_obj(). You could get 
spurious non-printing of 'trying to register non-static key'.

I'm wondering why sparc32 frees from the middle of the kernel image. 
The way architectures generally do it is to put freeable pages into 
a separate section. That way it does not get mingled with the kernel 
core image area (which stays nicely continuous).

	Ingo

WARNING: multiple messages have this Message-ID (diff)
From: Ingo Molnar <mingo@elte.hu>
To: David Miller <davem@davemloft.net>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: joerg.roedel@amd.com, fujita.tomonori@lab.ntt.co.jp,
	reif@earthlink.net, sparclinux@vger.kernel.org,
	linux-kernel@vger.kernel.org, x86@kernel.org,
	tony.luck@intel.com, akpm@linux-foundation.org
Subject: Re: [PATCH v2 0/8] sparc: use asm-generic/dma-mapping-common.h and pci-dma-compat.h
Date: Sat, 18 Jul 2009 13:06:20 +0200	[thread overview]
Message-ID: <20090718110620.GC27287@elte.hu> (raw)
In-Reply-To: <20090714.131224.205307048.davem@davemloft.net>


* David Miller <davem@davemloft.net> wrote:

> From: Joerg Roedel <joerg.roedel@amd.com>
> Date: Tue, 14 Jul 2009 11:23:55 +0200
> 
> > On Tue, Jul 14, 2009 at 10:40:16AM +0900, FUJITA Tomonori wrote:
> >> On Mon, 13 Jul 2009 20:56:21 -0400
> >> Robert Reif <reif@earthlink.net> wrote:
> >> 
> >> > The bad address is within the kernel so it looks like
> >> > it's catching a real bug.
> >> > 
> >> > cat kallsyms | grep f0007000
> >> > f0007000 T trapbase_cpu3
> >> > 
> >> > WARNING: at lib/dma-debug.c:873 check_for_illegal_area+0xc8/0x100()
> >> > esp ffd7ba30: DMA-API: device driver maps memory from kernel text or 
> >> > rodata [addr=f0007000] [len=4096]
> >> > Modules linked in: ext3 jbd sd_mod sun_esp esp_scsi scsi_transport_spi 
> >> 
> >> Ok, I looked at check_for_illegal_area() in dma-debug.
> >> 
> >> What check_for_illegal_area() does looks bogus to me with some of I/O
> >> remapping hardware.
> > 
> > Can you be more specific about this one? 
> > check_for_illegal_area() should not depend on any hardware 
> > because all it does is checking the machine addresses to be 
> > mapped.
> 
> The check can't work properly on sparc32.
> 
> Sparc32 always maps the kernel to a fixed physical location, and 
> it therefore can execute in the identity mapping area of physical 
> memory like where all the free pages and kmalloc areas live 
> virtually.
> 
> So if we free up some pages within the kernel image (because the 
> memory is unused, for exmple that's what's happening here with the 
> extra trap table pages on Robert's machine) we have pages in the 
> free page pool that are located right inside of the kernel text, 
> data, etc.
> 
> We'll thus need a way to turn off these checks somehow.  You could 
> also augment this check by seeing if there is a backing page, and 
> if so, whether it is PageReserved or not.  That's just one idea.

Hm, note, this sparc32 behavior might break certain aspects of 
lockdep as well, see kernel/lockdep.c::static_obj(). You could get 
spurious non-printing of 'trying to register non-static key'.

I'm wondering why sparc32 frees from the middle of the kernel image. 
The way architectures generally do it is to put freeable pages into 
a separate section. That way it does not get mingled with the kernel 
core image area (which stays nicely continuous).

	Ingo

  reply	other threads:[~2009-07-18 11:06 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-13  6:25 [PATCH v2 0/8] sparc: use asm-generic/dma-mapping-common.h and pci-dma-compat.h FUJITA Tomonori
2009-07-13  6:25 ` FUJITA Tomonori
2009-07-13  6:25 ` [PATCH 1/8] remove flush_write_buffers() in dma-mapping-common.h FUJITA Tomonori
2009-07-13  6:25   ` FUJITA Tomonori
2009-08-05  1:48   ` [PATCH 1/8] remove flush_write_buffers() in FUJITA Tomonori
2009-08-05  1:48     ` [PATCH 1/8] remove flush_write_buffers() in dma-mapping-common.h FUJITA Tomonori
2009-07-13  6:25 ` [PATCH 2/8] IA64: remove NULL flush_write_buffers FUJITA Tomonori
2009-07-13  6:25   ` FUJITA Tomonori
2009-07-13  6:25 ` [PATCH 3/8] sparc: use dma_map_ops struct FUJITA Tomonori
2009-07-13  6:25   ` FUJITA Tomonori
2009-07-17  2:36   ` David Miller
2009-07-17  2:36     ` David Miller
2009-07-13  6:25 ` [PATCH 4/8] sparc: use asm-generic/dma-mapping-common.h FUJITA Tomonori
2009-07-13  6:25   ` FUJITA Tomonori
2009-07-17  2:37   ` David Miller
2009-07-17  2:37     ` David Miller
2009-07-13  6:25 ` [PATCH 5/8] sparc: remove no-op dma_4v_sync_single_for_cpu and dma_4v_sync_sg_for_cpu FUJITA Tomonori
2009-07-13  6:25   ` FUJITA Tomonori
2009-07-17  2:37   ` [PATCH 5/8] sparc: remove no-op dma_4v_sync_single_for_cpu and David Miller
2009-07-17  2:37     ` [PATCH 5/8] sparc: remove no-op dma_4v_sync_single_for_cpu and dma_4v_sync_sg_for_cpu David Miller
2009-07-13  6:25 ` [PATCH 6/8] sparc: replace sbus_map_single and sbus_unmap_single with sbus_map_page and sbus_unmap_p FUJITA Tomonori
2009-07-13  6:25   ` [PATCH 6/8] sparc: replace sbus_map_single and sbus_unmap_single with sbus_map_page and sbus_unmap_page FUJITA Tomonori
2009-07-17  2:37   ` [PATCH 6/8] sparc: replace sbus_map_single and David Miller
2009-07-17  2:37     ` [PATCH 6/8] sparc: replace sbus_map_single and sbus_unmap_single with sbus_map_page and sbus_unmap_page David Miller
2009-07-13  6:25 ` [PATCH 7/8] sparc: use asm-generic/pci-dma-compat FUJITA Tomonori
2009-07-13  6:25   ` FUJITA Tomonori
2009-07-17  2:38   ` David Miller
2009-07-17  2:38     ` David Miller
2009-07-13  6:26 ` [PATCH 8/8] sparc: add CONFIG_DMA_API_DEBUG support FUJITA Tomonori
2009-07-13  6:26   ` FUJITA Tomonori
2009-07-17  2:39   ` David Miller
2009-07-17  2:39     ` David Miller
2009-07-14  0:56 ` [PATCH v2 0/8] sparc: use asm-generic/dma-mapping-common.h and Robert Reif
2009-07-14  0:56   ` [PATCH v2 0/8] sparc: use asm-generic/dma-mapping-common.h and pci-dma-compat.h Robert Reif
2009-07-14  1:40   ` [PATCH v2 0/8] sparc: use asm-generic/dma-mapping-common.h and FUJITA Tomonori
2009-07-14  1:40     ` [PATCH v2 0/8] sparc: use asm-generic/dma-mapping-common.h and pci-dma-compat.h FUJITA Tomonori
2009-07-14  9:23     ` [PATCH v2 0/8] sparc: use asm-generic/dma-mapping-common.h and Joerg Roedel
2009-07-14  9:23       ` [PATCH v2 0/8] sparc: use asm-generic/dma-mapping-common.h and pci-dma-compat.h Joerg Roedel
2009-07-14 20:12       ` [PATCH v2 0/8] sparc: use asm-generic/dma-mapping-common.h and David Miller
2009-07-14 20:12         ` [PATCH v2 0/8] sparc: use asm-generic/dma-mapping-common.h and pci-dma-compat.h David Miller
2009-07-18 11:06         ` Ingo Molnar [this message]
2009-07-18 11:06           ` Ingo Molnar
2009-08-03  3:21           ` [PATCH v2 0/8] sparc: use asm-generic/dma-mapping-common.h and David Miller
2009-08-03  3:21             ` [PATCH v2 0/8] sparc: use asm-generic/dma-mapping-common.h and pci-dma-compat.h David Miller
2009-08-03  5:54             ` [PATCH v2 0/8] sparc: use asm-generic/dma-mapping-common.h and Ingo Molnar
2009-08-03  5:54               ` [PATCH v2 0/8] sparc: use asm-generic/dma-mapping-common.h and pci-dma-compat.h Ingo Molnar
2009-08-04  4:21               ` [PATCH v2 0/8] sparc: use asm-generic/dma-mapping-common.h and David Miller
2009-08-04  4:21                 ` [PATCH v2 0/8] sparc: use asm-generic/dma-mapping-common.h and pci-dma-compat.h David Miller
2009-07-21 16:05         ` [PATCH v2 0/8] sparc: use asm-generic/dma-mapping-common.h and Joerg Roedel
2009-07-21 16:05           ` [PATCH v2 0/8] sparc: use asm-generic/dma-mapping-common.h and pci-dma-compat.h Joerg Roedel
2009-07-21 19:15           ` [PATCH v2 0/8] sparc: use asm-generic/dma-mapping-common.h and David Miller
2009-07-21 19:15             ` [PATCH v2 0/8] sparc: use asm-generic/dma-mapping-common.h and pci-dma-compat.h David Miller
2009-08-03  5:56             ` [PATCH v2 0/8] sparc: use asm-generic/dma-mapping-common.h and Ingo Molnar
2009-08-03  5:56               ` [PATCH v2 0/8] sparc: use asm-generic/dma-mapping-common.h and pci-dma-compat.h Ingo Molnar
2009-08-04  4:22               ` [PATCH v2 0/8] sparc: use asm-generic/dma-mapping-common.h and David Miller
2009-08-04  4:22                 ` [PATCH v2 0/8] sparc: use asm-generic/dma-mapping-common.h and pci-dma-compat.h David Miller
2009-08-04  7:45                 ` [PATCH v2 0/8] sparc: use asm-generic/dma-mapping-common.h and Ingo Molnar
2009-08-04  7:45                   ` [PATCH v2 0/8] sparc: use asm-generic/dma-mapping-common.h and pci-dma-compat.h Ingo Molnar

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=20090718110620.GC27287@elte.hu \
    --to=mingo@elte.hu \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=joerg.roedel@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=reif@earthlink.net \
    --cc=sparclinux@vger.kernel.org \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.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.