From owner-freebsd-virtualization@freebsd.org Sun Jun 28 16:21:01 2015 Return-Path: Delivered-To: freebsd-virtualization@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 4F1F798F3C5 for ; Sun, 28 Jun 2015 16:21:01 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 239431C33 for ; Sun, 28 Jun 2015 16:21:00 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id t5SGKxhr054438 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 28 Jun 2015 09:20:59 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.14.5/8.14.5/Submit) id t5SGKxrM054437 for freebsd-virtualization@freebsd.org; Sun, 28 Jun 2015 09:20:59 -0700 (PDT) (envelope-from jmg) Date: Sun, 28 Jun 2015 09:20:59 -0700 From: John-Mark Gurney To: freebsd-virtualization@freebsd.org Subject: weird console issue w/ bhyve... Message-ID: <20150628162059.GU96349@funkthat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: FreeBSD 9.1-PRERELEASE amd64 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (gold.funkthat.com [127.0.0.1]); Sun, 28 Jun 2015 09:20:59 -0700 (PDT) X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.20 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: Sun, 28 Jun 2015 16:21:01 -0000 I'm running into a weird bhyve console issue... I'm running bhyve on HEAD at r282774... In bhyve I'm running a HEAD at r284273:284880M... more and less work perfectly fine when I first login from the console.. Sometimes due to terminal issues, the cursor gets "stuck" at the bottom on the screen... If I run the rest command, more and less "break" in that they do not output... It appears that they are waiting on open of the tty... # less /etc/motd load: 0.89 cmd: less 674 [ttydcd] 0.96r 0.00u 0.00s 0% 2528k load: 0.89 cmd: less 674 [ttydcd] 1.14r 0.00u 0.00s 0% 2528k # more /etc/motd load: 0.16 cmd: more 677 [ttydcd] 1.34r 0.00u 0.00s 0% 2528k load: 0.16 cmd: more 677 [ttydcd] 2.82r 0.00u 0.00s 0% 2528k load: 0.16 cmd: more 677 [ttydcd] 3.20r 0.00u 0.00s 0% 2528k Ideas? I am running bhyve under screen, and I can reset screen's terminal w/ a ^A-Z which also recovers from this issue, so I have a work around, but reset shouldn't break things like this... Thanks. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-freebsd-virtualization@freebsd.org Sun Jun 28 18:01:56 2015 Return-Path: Delivered-To: freebsd-virtualization@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 3737998FF06 for ; Sun, 28 Jun 2015 18:01:56 +0000 (UTC) (envelope-from peterg@ptree32.com.au) Received: from alto.onthenet.com.au (alto2.onthenet.com.au [203.13.68.14]) by mx1.freebsd.org (Postfix) with ESMTP id EADEF26BB for ; Sun, 28 Jun 2015 18:01:55 +0000 (UTC) (envelope-from peterg@ptree32.com.au) Received: from iredmail.onthenet.com.au (iredmail.onthenet.com.au [203.13.68.150]) by alto.onthenet.com.au (Postfix) with ESMTP id DF4FD12616 for ; Mon, 29 Jun 2015 04:01:47 +1000 (EST) Received: from localhost (iredmail.onthenet.com.au [127.0.0.1]) by iredmail.onthenet.com.au (Postfix) with ESMTP id D889E28095B for ; Mon, 29 Jun 2015 04:01:47 +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 10024) with ESMTP id YnYq9WiGDKfV for ; Mon, 29 Jun 2015 04:01:47 +1000 (AEST) Received: from Peters-MacBook-Pro.local (c-67-180-92-13.hsd1.ca.comcast.net [67.180.92.13]) by iredmail.onthenet.com.au (Postfix) with ESMTPSA id DFEBB280904; Mon, 29 Jun 2015 04:01:44 +1000 (AEST) Message-ID: <55903687.1070601@ptree32.com.au> Date: Sun, 28 Jun 2015 11:01:43 -0700 From: Peter Grehan User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: John-Mark Gurney CC: freebsd-virtualization@freebsd.org Subject: Re: weird console issue w/ bhyve... References: <20150628162059.GU96349@funkthat.com> In-Reply-To: <20150628162059.GU96349@funkthat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.20 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: Sun, 28 Jun 2015 18:01:56 -0000 Hi John-Mark, > more and less work perfectly fine when I first login from the console.. > Sometimes due to terminal issues, the cursor gets "stuck" at the bottom > on the screen... If I run the rest command, more and less "break" in > that they do not output... It appears that they are waiting on open > of the tty... > > # less /etc/motd > load: 0.89 cmd: less 674 [ttydcd] 0.96r 0.00u 0.00s 0% 2528k > load: 0.89 cmd: less 674 [ttydcd] 1.14r 0.00u 0.00s 0% 2528k > > # more /etc/motd > load: 0.16 cmd: more 677 [ttydcd] 1.34r 0.00u 0.00s 0% 2528k > load: 0.16 cmd: more 677 [ttydcd] 2.82r 0.00u 0.00s 0% 2528k > load: 0.16 cmd: more 677 [ttydcd] 3.20r 0.00u 0.00s 0% 2528k > > Ideas? /usr/bin/reset clears the clocal flag. That can be reenabled with 'stty clocal'. The bhyve 16550 emulation doesn't nail up DCD so modem control has to be disabled in software (i.e. by setting clocal). Perhaps this should be changed so the default is to have DCD always 1 unless specified otherwise. later, Peter. From owner-freebsd-virtualization@freebsd.org Tue Jun 30 09:58:13 2015 Return-Path: Delivered-To: freebsd-virtualization@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 4448F98CDE7 for ; Tue, 30 Jun 2015 09:58:13 +0000 (UTC) (envelope-from stefanogarzarella@gmail.com) Received: from mail-wi0-x22e.google.com (mail-wi0-x22e.google.com [IPv6:2a00:1450:400c:c05::22e]) (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 DECAB15F6; Tue, 30 Jun 2015 09:58:09 +0000 (UTC) (envelope-from stefanogarzarella@gmail.com) Received: by wibdq8 with SMTP id dq8so11380532wib.1; Tue, 30 Jun 2015 02:58:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:cc:content-type; bh=TpExZ4dS2fqHFaRR0t11wKbp9F5EZJGJ2LewNv4M+rA=; b=Wa02hbXHEJFVMMLKF564ink05bnXEcU6FhErRKzI/z+EtoiPA4c4AbZnOuuL43ozRa RhwfQrvreyMm4VYmH2Q+Ryn/62EbMAXeSoT1XAKJeYQ04XjoNe4V2jG5UENXv6eEQgkj VuQk7NP3MzUm9bksJvk0qkcuHP9lc6/6neaYWXXhQjIQSI7IaT1fZ3iQW74nGfDxe6/G 1Siva2/ijz0PaixCNkeMab27RiFzHe9+DHRXaTjnpR6NdYAq6BiWDKBbZ0yQ27l435BK bAyF63oIn2I4cgHIlqMQUyfxdcQo+xOImaZaM/1ClI/sZu8iUpIvlpU3Romw03FuxWRy yQMw== X-Received: by 10.194.7.97 with SMTP id i1mr37897459wja.107.1435658287287; Tue, 30 Jun 2015 02:58:07 -0700 (PDT) MIME-Version: 1.0 Received: by 10.27.39.135 with HTTP; Tue, 30 Jun 2015 02:57:47 -0700 (PDT) From: Stefano Garzarella Date: Tue, 30 Jun 2015 11:57:47 +0200 Message-ID: Subject: bhyve - map user-space buffer in the VM To: freebsd-virtualization@freebsd.org Cc: Luigi Rizzo , Peter Grehan , Neel Natu , stefano@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.20 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, 30 Jun 2015 09:58:13 -0000 Hi all, I'm working on bhyve to support ptnetmap (netmap passthrough) for my GSoC. http://wiki.freebsd.org/SummerOfCode2015/ptnetmapOnBhyve I've already implemented it on QEMU/KVM and, to expose the netmap memory in the VM, I used a PCI BAR and I mapped the netmap memory (the buffer returned by mmap() on netmap fd in the user space) on the BAR in the VM through KVM API. In bhyve I able to create a PCI BAR but I only found vm_map_pptdev_mmio() API to map physical host page into the VM. I saw that this IOCTL is implemented in the kernel module with sglist_append_phys() to populate a scatter/gather list, than it is mapped in VM. I would like to add a new function in the API to map a user buffer in the VM: int vm_map_user_buf(struct vmctx *ctx, vm_paddr_t gpa, size_t len, void *host_buf) I would implement it adding a new IOCTL and I would create, in the kernel module, a new function like vmm_mmio_alloc() (sys/amd64/vmm/vmm_mem.c) but using sglist_append_user() instead of sglist_append_phys(). What do you think about it? There is another way to map an user-space buffer in the VM? Thanks, Stefano