From owner-freebsd-hackers@FreeBSD.ORG Thu Mar 22 19:33:55 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56DF31065673 for ; Thu, 22 Mar 2012 19:33:55 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id D8AFF8FC0C for ; Thu, 22 Mar 2012 19:33:54 +0000 (UTC) Received: by wern13 with SMTP id n13so2850686wer.13 for ; Thu, 22 Mar 2012 12:33:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ckX2asfQk9YPHZ7cIQ2oCj7fvk2/6G7cWeLO6W6Y1Jw=; b=yDMz0cDtAujwiFxS3XyyaWM6FXBe5IIvWJHLlGswPSTUP3tGYouw36ITV7SEVYnWya Rq7ccvjJmdAM6BbJF002GnhV2AKhtwQ2nsK6u+2jGvSmzRV7x/hY/C8OfYP4BD0vTYtE k6YUgLZJcVpLALBEBU0xT/j9rQh+87Q4pW+vofWvAybLFE+Ls7miS6wzboX7oVa8iD/1 +IjFIl4swAwVy+CM7zwxN2trPBdp9YjjLSGvZjMqaujRsODbBk7oJy/eZP5+2wBdwT9w qgBUIcBWO9/2WWjVn831iN+P8jykqCIDsKoTj6CekZ1pYe/VstWh6Hs2gKkK+RafQQ0t hk1A== MIME-Version: 1.0 Received: by 10.180.14.73 with SMTP id n9mr196950wic.16.1332444833959; Thu, 22 Mar 2012 12:33:53 -0700 (PDT) Received: by 10.180.79.137 with HTTP; Thu, 22 Mar 2012 12:33:53 -0700 (PDT) In-Reply-To: References: Date: Thu, 22 Mar 2012 15:33:53 -0400 Message-ID: From: Ryan Stone To: Eric Saint-Etienne Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org Subject: Re: malloc pages map to user space X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 19:33:55 -0000 On Thu, Mar 22, 2012 at 10:42 AM, Eric Saint-Etienne wrote: > Actually when using kernel_map, the object returned is NULL! However the > the vm_entry_t it returns seems a valid address, its 'object' field is NULL > too (that's consistent) > That's the reason why I didn't find it in any existing 'puclic' map (such as > kernel_map, buffers_map, kmem_map, exec_map or pipe_map) > > But a NULL object isn't good at anything and I'm not sure what to do with > a vm_entry_t only... Any idea how to insert it in the process map? If your kernel module creates a device in /dev that implements the mmap method, then you don't need to worry about mucking around with vm_maps and objects and whatnot. Your mmap method just needs to be able to convert offsets into the device into physical memory addresses, and the vm infrastructure will do the rest for you.