From owner-freebsd-virtualization@FreeBSD.ORG Sun Dec 7 00:39:18 2014 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3DA5240A for ; Sun, 7 Dec 2014 00:39:18 +0000 (UTC) Received: from mail.openmailbox.org (mail.openmailbox.org [62.4.1.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8E69786 for ; Sun, 7 Dec 2014 00:39:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.openmailbox.org (Postfix) with ESMTP id 7A8FC2E01E3 for ; Sun, 7 Dec 2014 01:39:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=openmailbox.org; h=user-agent:message-id:references:in-reply-to:subject:subject :from:from:date:date:content-transfer-encoding:content-type :content-type:mime-version:received:received; s=openmailbox; t= 1417912752; bh=Hldjtb4wwybxu81iERD6qoHSgFx1PHKefKH6YZWTGTs=; b=u guX4CMAZpf2Svs7y69ufhh9axkxXNLMLXQ3cqxpRRkJQmMw8yUw48ahPIMIAcHfe 45ROyAhS+J2/YwetjmHCy0VJpwXebcBMeyPeqVMw7khCGf4uxW45JBrVjTnrJZDp 2p9UCSgEruMVVnd5BivzupS9jewXhSqGH+Z3yi0ohk= X-Virus-Scanned: at openmailbox.org Received: from mail.openmailbox.org ([62.4.1.34]) by localhost (mail.openmailbox.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MT8i3ZD92Uf9 for ; Sun, 7 Dec 2014 01:39:12 +0100 (CET) Received: from www.openmailbox.org (localhost [127.0.0.1]) by mail.openmailbox.org (Postfix) with ESMTP id DD3F52E0096 for ; Sun, 7 Dec 2014 01:39:12 +0100 (CET) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 07 Dec 2014 01:39:12 +0100 From: Tinker To: freebsd-virtualization@freebsd.org Subject: Can a host OS user process create a zillion BHyVe VM:s and microcontrol =?UTF-8?Q?them=3F?= In-Reply-To: References: <1423616F-F44D-47E5-8595-DE862DC04464@bsdimp.com> <546A34C8.6060004@freebsd.org> <546C8812.2070904@FreeBSD.org> <20141119195923.GS24601@funkthat.com> <69A8C06F-A7F6-49EC-8601-91AC4CDBFB13@FreeBSD.org> <547364EB.7090505@freebsd.org> <547AEB93.3050600@freebsd.org> Message-ID: <5fa49b79a601363b471babbfc577590d@openmailbox.org> X-Sender: tinkr@openmailbox.org User-Agent: Roundcube Webmail/1.0.2 X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.18-1 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, 07 Dec 2014 00:39:18 -0000 Hi! Can the following under any circumstance be done with BHyVe? This is basically what Google's NaCL was intended to do, but noone uses NaCL for security reasons - so I feel this is a long shot, but I want to ask you if BHyVe can do this. Usecase with pseudocode: Say that I have an audio encoding service "my_audio_encoding_service_program.c" wherein I run third-party audio codec libraries (as dylib or executable), and those are absolutely untrusted so I need to sandbox them. So therefore, I need to do something like BHyVe_sandbox* s = BHyVe_createSandbox(100KB RAM, 2 CPU cores,void* pointer to the audio codec binary code,int size of the same code); and then pass in data for procedure invocation like BHyVe_call(s, "encoder_iterate", my arguments); and then drive its execution further with BHyVe_resumeExecution(s, max 1 millisecond); and then pick up results somehow. And I'd have 50 000 of these running simultaneously on one machine, but their respective heap size is 100KB each so that's only 5GB RAM in total. As I get more data to encode from the network from any of the 50 000 audio streams I'm listening to, I feed the respective audio encoder instance with the respective data with it, reactively. Key characteristics here are * How light a BHyVe instance is (like, does a BHyVe instance require allocation of any device file or FD otherwise), and * How lightweight trampolines between OS host process and guest code is, * I guess, if an OS scheduler context switch is needed for switching between my host "my_audio_encoding_service_program.c" code and the guest library code - can this be done like 100 000 times in a second. Thanks!