[lkml]   [2017]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCHv2 2/5] x86/mm: introduce mmap_{,legacy}_base
On 01/17/2017 11:27 PM, Andy Lutomirski wrote:
> On Mon, Jan 16, 2017 at 4:33 AM, Dmitry Safonov <> wrote:
>> In the following patch they will be used to compute:
>> - mmap_base in compat sys_mmap() in native 64-bit binary
>> and vice-versa
>> - mmap_base for native sys_mmap() in compat x32/ia32-bit binary.
> I may be wrong here, but I suspect that you're repeating something
> that I consider to be a mistake that's all over the x86 code.
> Specifically, you're distinguishing "native" from "compat" instead of
> "32-bit" from "64-bit". If you did the latter, then you wouldn't need
> the "native" case to work differently on 32-bit kernels vs 64-bit
> kernels, I think. Would making this change make your code simpler?
> The x86 signal code is the worst offender IMO.

Yes, I also don't like to differ them especially by TIF_ADDR32 flag.
I did distinguishing for the reason that I needed to know for which
task 64/32-bit was computed mm->mmap_base.
Otherwise I could introduce mm->mmap_compat_base and don't differ
tasks by TIF_ADDR32 flag - only by in_compat_syscall(), but that
would change mm_struct generic code (adding a field to mm).
So, I thought it may have more opposition to add a field to mm
in generic code and fixed it here, in x86.

> --Andy


 \ /
  Last update: 2017-01-18 12:47    [W:0.077 / U:4.908 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site