lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 1 Jan 2007 23:45:59 +0000
From:	Russell King <rmk+lkml@....linux.org.uk>
To:	Miklos Szeredi <miklos@...redi.hu>
Cc:	davem@...emloft.net, arjan@...radead.org, torvalds@...l.org,
	linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
	akpm@...l.org
Subject: Re: fuse, get_user_pages, flush_anon_page, aliasing caches and all that again

On Mon, Jan 01, 2007 at 11:15:04PM +0100, Miklos Szeredi wrote:
> > > > I'm willing to do that - and I guess this means we can probably do this
> > > > instead of walking the list of VMAs for the shared mapping, thereby
> > > > hitting both anonymous and shared mappings with the same code?
> > > 
> > > But for the get_user_pages() case there's no point, is there?  The VMA
> > > and the virtual address is already available, so trying to find it
> > > again through RMAP doesn't much make sense.
> > > 
> > > Users of get_user_pages() don't care about any other mappings (maybe
> > > ptrace does, I don't know) only about one single user mapping and one
> > > kernel mapping.
> > > 
> > > So using flush_dcache_page() there is an overkill, trying to teach it
> > > about anonymous pages is not the real solution, flush_dcache_page()
> > > was never meant to be used on anything but file mapped pages.
> > 
> > It's not actually.  For flush_anon_page() we currently have to flush the
> > user mapping and the kernel mapping.  For flush_dcache_page(), it's
> > exactly the same - we have to flush the kernel mapping and the user
> > mapping.
> 
> I was never advocating flush_anon_page().  I was suggesting a _new_
> cache operation:
> 
>    flush_kernel_user_page(page, vma, virt_addr)
> 
> which flushes the kernel mapping and the given user mapping.  Just
> like flush_dcache_page() but without needing to find the user
> mapping(s).

There's a problem with defining cache coherency macros to that extent.
You take away flexibility to efficiently implement them on various
platforms which you didn't think about (eg, in the above case it's
perfectly fine for VIVT, but not really VIPT.)

> However the cache flushing in kmap/kunmap idea might be cleaner and
> better.

It has the significant advantage that, unlike the flush* calls, they
can't really be forgotten by folk programming on cache alias-free
hardware.  That's a _very_ persuasive argument for this proposed
interface.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ