From owner-freebsd-virtualization@freebsd.org Tue Feb 27 06:57:17 2018 Return-Path: Delivered-To: freebsd-virtualization@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD6A9F29DC1 for ; Tue, 27 Feb 2018 06:57:17 +0000 (UTC) (envelope-from grehan@freebsd.org) Received: from alto.onthenet.com.au (alto.OntheNet.com.au [203.13.68.12]) by mx1.freebsd.org (Postfix) with ESMTP id 1FC8585993 for ; Tue, 27 Feb 2018 06:57:16 +0000 (UTC) (envelope-from grehan@freebsd.org) Received: from iredmail.onthenet.com.au (iredmail.onthenet.com.au [203.13.68.150]) by alto.onthenet.com.au (Postfix) with ESMTPS id B2676209C006 for ; Tue, 27 Feb 2018 16:57:08 +1000 (AEST) Received: from localhost (iredmail.onthenet.com.au [127.0.0.1]) by iredmail.onthenet.com.au (Postfix) with ESMTP id AC01A280903 for ; Tue, 27 Feb 2018 16:57:08 +1000 (AEST) X-Amavis-Modified: Mail body modified (using disclaimer) - iredmail.onthenet.com.au Received: from iredmail.onthenet.com.au ([127.0.0.1]) by localhost (iredmail.onthenet.com.au [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id TZqGzNcf2kQz for ; Tue, 27 Feb 2018 16:57:08 +1000 (AEST) Received: from Peters-MacBook-Pro-2.local (c-67-180-92-13.hsd1.ca.comcast.net [67.180.92.13]) by iredmail.onthenet.com.au (Postfix) with ESMTPSA id D4E1D2820A7; Tue, 27 Feb 2018 16:57:06 +1000 (AEST) Subject: Re: bhyve and mmap(2) To: Fabian Freyer References: <0001CF7F-66BC-451E-9C86-03C50471F23D@physik.tu-berlin.de> Cc: freebsd-virtualization@freebsd.org From: Peter Grehan Message-ID: Date: Mon, 26 Feb 2018 22:57:03 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <0001CF7F-66BC-451E-9C86-03C50471F23D@physik.tu-berlin.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-CMAE-Score: 0 X-CMAE-Analysis: v=2.3 cv=KPZ08mNo c=1 sm=1 tr=0 a=A6CF0fG5TOl4vs6YHvqXgw==:117 a=5eVCmCvhg37cu/pjidAGzw==:17 a=IkcTkHD0fZMA:10 a=Op4juWPpsa0A:10 a=07d9gI8wAAAA:8 a=XV5vBF53AnnAyZL96wAA:9 a=6srBFSeoIlzI1HAV:21 a=6-a_Z7xu-HBWCG-z:21 a=QEXdDO2ut3YA:10 a=H71i6ErUBJYA:10 a=e2CUPOnPG4QKp8I52DXD:22 wl=host:3 X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Feb 2018 06:57:17 -0000 Hi Fabian, > Would be possible to use mmap(2) around libvmmapi to map a file > (MAP_PRIVATE) and or shared memory segments (MAP_SHARED) into guest > physical address space? It currently isn't - doing that will just insert the mappings into the user process's view, and not into guest address space. Bhyve currently uses a separate vmspace for guest address space. While this simplifies the EPT code internally, it also prevents direct manipulation of the address space using standard system calls. A possible solution to this would be to have the ability to apply address-space manipulation calls to an arbitrary address space - this was brought up in Linux a long while back: https://lwn.net/Articles/19047/ later, Peter.