From owner-freebsd-virtualization@freebsd.org Fri Jan 15 13:00:50 2021 Return-Path: Delivered-To: freebsd-virtualization@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7788B4E52B6; Fri, 15 Jan 2021 13:00:50 +0000 (UTC) (envelope-from andrei.cos.martin@gmail.com) Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DHLrx5hmqz4v8T; Fri, 15 Jan 2021 13:00:49 +0000 (UTC) (envelope-from andrei.cos.martin@gmail.com) Received: by mail-pl1-x634.google.com with SMTP id s15so4661319plr.9; Fri, 15 Jan 2021 05:00:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=Tq0epQ3abQiApC9J55dqC5pJKfs/ZIo4Ws+HXcK3Jxc=; b=dDxnsKCMgJwOoi9jqqDi0/cQJXxuxvOp+1rZyzS0tMmhhvR9rRvutGiqNhV7fW0AVx lMWcvsNHf+zSi2O+MOZhxbntNw77pbIF3F/7wjIVO4MF109E8gNChGtWNwm5kevBK8QG kG072Ck4pXxlAcqTywMFk26sQcd9UMTlZcvOMysw/vBfgWJcqNn1rUwZr+Yz7i13KUCS MEWUFUpi0kN3QeWYzjcJ9l8gPRflK24Sct1E1CMzayCOIws4IGE8i0rwU26X75KntDTR FUD9i2IgITixSSl7YvllvvgKq5OJHwXovW0i13TW7CR2BRPi0i97FRd3IUlSTHr3Q78i mCqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=Tq0epQ3abQiApC9J55dqC5pJKfs/ZIo4Ws+HXcK3Jxc=; b=V5RdccoL9lXsFvYl20Y4r9cbm1PQ8v6Mv3V3PMTy7vENqQpkOK2mGmNtpI3E3xJjqY +ZZc7EMCThGZJTQwUmY/rkcvhCYpmVJloorby4NGLVNicMHwG9txLxuVI2r1GbCAcXe2 me3Sfk9x+VNBiBQ6/luMHPObcX0gtusYRXIEmxT6kRhv0YXXFmk8jTd2NBV0QVEOZj1k CZUH7GxDG7xQPzY5Rk8Reiay5LBLIy4J0JOJToa3BQaCjIN+EzSQq3fcC/u7FkEwf5Xy xFnvbQzcEPV+TPkuVz09udZRPl220UHhFM00PSl+O/ohymkyntzjxaGqvVP47VAxzNha GkmA== X-Gm-Message-State: AOAM530cgm/OM6Jd8YpMcjP7zwERxWR9Sqx0iYeE+Z2AkoktgoPOkvHM WQgLWmrnVGgoGOuOe86fWz/+7IChvKESqzkdxWkOya3RnNE= X-Google-Smtp-Source: ABdhPJy4tupDbrEoIglVV/CUdgj5cf+ZYXHeb0tzvQZ0YoCg97MMJy+6eRNQ8d03psUfygwefHqDNJCtbAwU4Wz8snQ= X-Received: by 2002:a17:90a:a608:: with SMTP id c8mr10332241pjq.61.1610715648668; Fri, 15 Jan 2021 05:00:48 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Andrei Martin Date: Fri, 15 Jan 2021 15:00:37 +0200 Message-ID: Subject: Re: [bhyve][arm64] Number of allowed vcpus To: freebsd-arm@freebsd.org, freebsd-virtualization@freebsd.org, Mihai Carabas , Darius Mihai , Elena Mihailescu X-Rspamd-Queue-Id: 4DHLrx5hmqz4v8T X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=dDxnsKCM; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of andreicosmartin@gmail.com designates 2607:f8b0:4864:20::634 as permitted sender) smtp.mailfrom=andreicosmartin@gmail.com X-Spamd-Result: default: False [-2.00 / 15.00]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; RCPT_COUNT_FIVE(0.00)[5]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FREEMAIL_TO(0.00)[freebsd.org,gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::634:from]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(1.00)[1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::634:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::634:from]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-arm,freebsd-virtualization] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.34 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: Fri, 15 Jan 2021 13:00:50 -0000 Thanks for you responses and sorry for not specifying the guest's device tree. I've summed up your proposals and sketched and algorithm: N - the number of vcpus from the '-c' parameter X - the number of vcpus from the device tree if there isn't the parameter -> start the vm with X vcpus if there is the parameter --> if N <= X -> start the vm with N parameters |-> if N > X -> throw an error I believe this gives the opportunity to rebuild the device tree and use all vcpus (first branch) or let the device tree as it is (more vcpus) but use only a subset of them. Is this alright? Thanks, Andrei On Wed, Jan 13, 2021 at 1:55 PM Andrei Martin wrote: > Hello, > > While working on enabling multiple virtual cpus for the arm64 virtual > machine > I used the bhyve's "-c N" parameter to create N cpus (it gets only the > cpus, in contrast to the amd64). If N is smaller than the number of cores > described in the device tree it will enable only N and if it's larger it > will enable only the number of cores from the device tree. > > I don't know if it is the best approach. Another way would be to enable > all the cpus from the device tree, no more, no less. > > Do you have any suggestions? > > Andrei >