linux/arch/arm
Nitin Gupta 787b2faadc ARM: force dcache flush if dcache_dirty bit set
On ARM, update_mmu_cache() does dcache flush for a page only if
it has a kernel mapping (page_mapping(page) != NULL). The correct
behavior would be to force the flush based on dcache_dirty bit only.

One of the cases where present logic would be a problem is when
a RAM based block device[1] is used as a swap disk. In this case,
we would have in-memory data corruption as shown in steps below:

do_swap_page()
{
    - Allocate a new page (if not already in swap cache)
    - Issue read from swap disk
        - Block driver issues flush_dcache_page()
        - flush_dcache_page() simply sets PG_dcache_dirty bit and does not
          actually issue a flush since this page has no user space mapping yet.
    - Now, if swap disk is almost full, this newly read page is removed
      from swap cache and corrsponding swap slot is freed.
    - Map this page anonymously in user space.
    - update_mmu_cache()
        - Since this page does not have kernel mapping (its not in page/swap
          cache and is mapped anonymously), it does not issue dcache flush
          even if dcache_dirty bit is set by flush_dcache_page() above.

    <user now gets stale data since dcache was never flushed>
}

Same problem exists on mips too.

[1] example:
 - brd (RAM based block device)
 - ramzswap (RAM based compressed swap device)

Signed-off-by: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-10-12 17:52:26 +01:00
..
boot kbuild: use INSTALLKERNEL to select customized installkernel script 2009-09-20 12:18:14 +02:00
common ARM: 5735/1: sa1111: CodingStyle cleanups 2009-10-02 22:32:33 +01:00
configs Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/xscaleiop 2009-10-02 22:31:04 +01:00
include/asm ARM: boolean bit testing 2009-10-11 16:25:06 +01:00
kernel Merge branch 'fix' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6 2009-10-12 14:38:08 +01:00
lib Merge branch 'for-rmk' of git://linux-arm.org/linux-2.6 2009-09-19 13:47:57 +01:00
mach-aaec2000
mach-at91 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2009-09-25 07:22:11 -07:00
mach-bcmring ARM: 5748/1: bcmring: fix build warning messages 2009-10-07 13:13:01 +01:00
mach-clps711x
mach-davinci ARM: includecheck fix: mach-davinci, board-dm365-evm.c 2009-09-28 18:06:20 +01:00
mach-ebsa110
mach-ep93xx ARM: 5756/1: ep93xx: introduce clk parent 2009-10-10 12:45:13 +01:00
mach-footbridge
mach-gemini
mach-h720x
mach-integrator headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
mach-iop13xx Merge branch 'iop-raid6' into async-tx-next 2009-09-08 17:53:57 -07:00
mach-iop32x
mach-iop33x
mach-ixp4xx ixp4xx: arch_idle() documentation fixup 2009-09-21 19:20:03 +02:00
mach-ixp23xx
mach-ixp2000
mach-kirkwood Merge branch 'master' into devel 2009-09-12 12:04:37 +01:00
mach-ks8695
mach-l7200
mach-lh7a40x
mach-loki
mach-mmp
mach-msm
mach-mv78xx0
mach-mx1
mach-mx2
mach-mx3 Merge branch 'master' into devel 2009-09-12 12:04:37 +01:00
mach-mx25
mach-mxc91231
mach-netx
mach-nomadik mtd: OneNand support for Nomadik 8815 SoC (on NHK8815 board) 2009-09-20 06:00:27 -07:00
mach-ns9xxx const: constify remaining file_operations 2009-10-01 16:11:11 -07:00
mach-omap1 omap: Fix wrong jtag_id for 850 2009-09-24 16:23:13 -07:00
mach-omap2 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2009-10-09 13:32:24 -07:00
mach-orion5x [ARM] orion5x: Add LaCie NAS 2Big Network support 2009-09-08 14:10:35 -04:00
mach-pnx4008
mach-pxa [ARM] pxa: workaround errata #37 by not using half turbo switching 2009-10-12 15:30:50 +08:00
mach-realview ARM: 5720/1: Move MMCI header to amba include dir 2009-09-22 20:49:04 +01:00
mach-rpc
mach-s3c24a0/include/mach
mach-s3c2400
mach-s3c2410 ARM: S3C: Add missing selection of S3C_DEV_NAND in machine Kconfigs. 2009-09-17 10:12:28 +01:00
mach-s3c2412 ARM: S3C: Add missing selection of S3C_DEV_NAND in machine Kconfigs. 2009-09-17 10:12:28 +01:00
mach-s3c2440 ARM: S3C: Add missing selection of S3C_DEV_NAND in machine Kconfigs. 2009-09-17 10:12:28 +01:00
mach-s3c2442
mach-s3c2443
mach-s3c6400 ARM: S3C: Add missing selection of S3C_DEV_NAND in machine Kconfigs. 2009-09-17 10:12:28 +01:00
mach-s3c6410 ARM: S3C: Add missing selection of S3C_DEV_NAND in machine Kconfigs. 2009-09-17 10:12:28 +01:00
mach-s5pc100
mach-sa1100 ARM: 5752/1: SA1100: fix building of h3100 2009-10-07 13:13:01 +01:00
mach-shark
mach-stmp37xx
mach-stmp378x
mach-u300 ARM: 5731/2: Fix U300 generic GPIO, remove ifdefs from MMCI v3 2009-10-01 16:26:15 +01:00
mach-versatile ARM: 5720/1: Move MMCI header to amba include dir 2009-09-22 20:49:04 +01:00
mach-w90x900 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2009-09-14 17:56:51 -07:00
mm ARM: force dcache flush if dcache_dirty bit set 2009-10-12 17:52:26 +01:00
nwfpe
oprofile
plat-iop Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/xscaleiop 2009-10-02 22:31:04 +01:00
plat-mxc spi: add SPI driver for most known i.MX SoCs 2009-09-23 07:39:43 -07:00
plat-omap Merge branch 'pm-fixes-32' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm into omap-fixes-for-linus 2009-10-06 08:32:28 -07:00
plat-orion
plat-pxa [ARM] pxa/dma: add debugfs entries 2009-09-10 18:49:29 +08:00
plat-s3c ARM: s3c: fix check of index into s3c_gpios[] 2009-09-19 12:14:06 +01:00
plat-s3c24xx headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
plat-s3c64xx Merge branch 'next-s3c-fixes' of git://aeryn.fluff.org.uk/bjdooks/linux 2009-09-18 20:55:56 +01:00
plat-s5pc1xx
plat-stmp3xxx ARM: STMP3xxx: deallocation with negative index of descriptors[] 2009-09-19 12:14:05 +01:00
tools [ARM] Update mach-types 2009-09-18 21:42:01 +01:00
vfp
Kconfig ARM: 5580/2: ARM TCM (Tightly-Coupled Memory) support v3 2009-09-15 22:11:05 +01:00
Kconfig-nommu
Kconfig.debug
Makefile Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next 2009-09-23 15:37:02 -07:00