From owner-svn-src-all@freebsd.org Tue Feb 7 13:50:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20428CD5321; Tue, 7 Feb 2017 13:50:20 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BD1051158; Tue, 7 Feb 2017 13:50:19 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm0-x242.google.com with SMTP id u63so28411320wmu.2; Tue, 07 Feb 2017 05:50:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=PpQzmTLItw5sximOQjW5g84QVpQ0sdMLTjQs1vLY6mA=; b=UGANyXDMGhUDcXvNOGJokj1wNAiu/UHvdqiRZDnoHaw/OBAHBZQIdP6WcxC5exRI9Z 3zyslcGnnzRybRgDT7damASSQqDKUaPBk0SjyZU0h7BXKMwilPnncK7vxGNfnccaDla1 WwVlm1J0VOStuH2etSq23scpQGeobF0bPIyByVJXLMrH+8uNpmLYXxw/xcH3NxSdAIu0 wD25Ble9iEfyN4vWtJZzNjhPdrRgNGZpzI5GJKiEwQ9WSAOTRChAjJvOucexO+14ujlO eaxVGWqKFOLvarX7ISiH3Se141Lj0ChwflG5jn9cVAj+u4Oy60GxGRA00EKAvJjnWVNx uPqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=PpQzmTLItw5sximOQjW5g84QVpQ0sdMLTjQs1vLY6mA=; b=XO5d2/s1incB/qR9DgqD/QJqf7Yx/diiQbvJNGqdk2E88qYKtuCnhnx2aiPBOPrSf8 IjJVR5RjK673WahgHHB0XhULpXgag+wQEok2FAHXIYbMY6wa9jzJCpy7cXzaZFDz93no 1Ujsw/udKMS604wvhiW9v3i9GEukafV6LT+Nw8pY/JPxqsbipQOgbj9SHaNg/mexVWXB Za1azeFD0VpDHD2Mj8dWvqyhnaqxYK6xeW8yekleT5qLM2lY3aRdRNN6sIoJExF4utTY I9mzg79d6uOnUqQkZzAty9wnBmBPC7K8ov5dn1lwdWBxr8lxTXUjGSZctMPci5kRVvGy T8vA== X-Gm-Message-State: AMke39mQrjb2PV+qdizLPfe92MI2ceB4f5eKaObdA7SZN+fSMwX1TKdOQ4fTiN0Hf+MUYA== X-Received: by 10.28.178.16 with SMTP id b16mr14513611wmf.83.1486475417917; Tue, 07 Feb 2017 05:50:17 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by smtp.gmail.com with ESMTPSA id p49sm7482787wrb.10.2017.02.07.05.50.16 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 07 Feb 2017 05:50:17 -0800 (PST) Date: Tue, 7 Feb 2017 14:50:15 +0100 From: Mateusz Guzik To: Edward Tomasz Napierala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313352 - in head/sys: compat/cloudabi compat/freebsd32 compat/linux vm Message-ID: <20170207135014.GC4772@dft-labs.eu> References: <201702062057.v16KvCtI069664@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201702062057.v16KvCtI069664@repo.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2017 13:50:20 -0000 On Mon, Feb 06, 2017 at 08:57:12PM +0000, Edward Tomasz Napierala wrote: > Author: trasz > Date: Mon Feb 6 20:57:12 2017 > New Revision: 313352 > URL: https://svnweb.freebsd.org/changeset/base/313352 > > Log: > Add kern_vm_mmap2(), kern_vm_mprotect(), kern_vm_msync(), kern_vm_munlock(), > kern_vm_munmap(), and kern_vm_madvise(), and use them in various compats > instead of their sys_*() counterparts. > > -sys_mmap(td, uap) > - struct thread *td; > - struct mmap_args *uap; > +sys_mmap(struct thread *td, struct mmap_args *uap) > +{ > + > + return (kern_vm_mmap(td, (vm_offset_t)uap->addr, uap->len, > + uap->prot, uap->flags, uap->fd, uap->pos)); > +} > + > +int > +kern_vm_mmap(struct thread *td, vm_offset_t addr, vm_size_t size, > + vm_prot_t prot, int flags, int fd, off_t pos) > { Can we start dropping the td argument? It always is curthread and almost always has to be anyway as something down below accesses data in a manner only safe for curthread (classic: credential checks). With this example the function takes 7 args. So the commit added an indirection which cannot be tail called on amd64 due to the 7th argument passed through the stack. Removing the td argument deals with the problem. -- Mateusz Guzik