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] [day] [month] [year] [list]
Message-ID: <20111111085239.GA12913@n2100.arm.linux.org.uk>
Date:	Fri, 11 Nov 2011 08:52:39 +0000
From:	Russell King - ARM Linux <linux@....linux.org.uk>
To:	David Rientjes <rientjes@...gle.com>
Cc:	Nai Xia <nai.xia@...il.com>,
	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
	LKML <linux-kernel@...r.kernel.org>,
	linux-mm <linux-mm@...ck.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Hugh Dickins <hughd@...gle.com>,
	Dave Hansen <dave@...ux.vnet.ibm.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
	Paul Mundt <lethal@...ux-sh.org>
Subject: Re: mm: convert vma->vm_flags to 64bit

On Wed, Nov 09, 2011 at 08:49:58PM -0800, David Rientjes wrote:
> On Thu, 10 Nov 2011, Nai Xia wrote:
> 
> > Did this patch get merged at last, or on this way being merged, or
> > just dropped ?
> > 
> 
> I thought we were waiting to find out if it caused a problem on arm.  
> Either Russell should be able to clarify that or a couple months in 
> linux-next.

As I said last time, these flags are passed into assembly on ARM.  For
example, we pass a pointer to the VMA, and the assembly code them loads
the vma flags to check whether VM_EXEC is set, so it knows whether it
needs to flush the instruction TLB.

Making this a 64-bit quantity then means we have to deal with the host
endian issues and the position of the VM_EXEC bit inside that 64-bit
quantity.  Remembering that ARM is 32-bit, that needs additional
complexity to sort out, something like:

#ifdef __ARMEB__
#define VM_FLAGS_LOWWORD	4
#else
#define VM_FLAGS_LOWWORD	0
#endif

#if VM_EXEC >= 1<<32
#define VM_FLAG_EXEC		(VM_EXEC >> 32)
#define VM_FLAG_EXECWORD	4
#else
#define VM_FLAG_EXEC		VM_EXEC
#define VM_FLAG_EXECWORD	0
#endif

	ldr	rd, [rn, #VMA_VM_FLAGS + (VM_FLAGS_LOWWORD ^ VM_FLAG_EXECWORD)]
...
	tst	rd, #VM_FLAG_EXEC

which is not only rather horrible, but I also wonder whether VM_EXEC >> 32
will provide the right answer with a binutils targetting 32-bit.
--
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