From nobody Tue Oct 28 15:58:01 2025 X-Original-To: freebsd-virtualization@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cww5C4s9cz6F56j for ; Tue, 28 Oct 2025 15:58:07 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) (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 "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cww5B6rsDz43mt for ; Tue, 28 Oct 2025 15:58:06 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=H3hK59UM; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=freebsd.org (policy=none); spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::72d as permitted sender) smtp.mailfrom=markjdb@gmail.com Received: by mail-qk1-x72d.google.com with SMTP id af79cd13be357-8a479c772cfso142449785a.0 for ; Tue, 28 Oct 2025 08:58:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761667085; x=1762271885; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=jaQUJ2URlM+Leai6XaFDYFuBh+vNYL5tkmmPviI24oU=; b=H3hK59UMWQYBmN3aHRO7NeMD9nS++4Q1bXexdvxx4tSlohed1/hOeACZWdwpT8DnvN 2gwxy4e8VQ8nmgNdB9nOcED9colzduZkjQxINRCR+O9ef89T6g7wQMJuwdu4/ibl1Iaf irBoSX7LFsx3rOIYN3XR5kLTuyUYKYtqtDsfGc+Va2+uz47vY/5cTJDHljIfxaed5xHZ kBPyPxVZz1qArT8CGsE31fVyfK8lwS022mmOk1/LIDS+oAtCGW71gIudorVZcemPeKYw h2IhXuUgwp/FRVSUztPUKy5EOPYlQ3Do2l8k7lqpS9He7zdK/pGbpJkru1SamJOf7EbI t/Qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761667085; x=1762271885; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jaQUJ2URlM+Leai6XaFDYFuBh+vNYL5tkmmPviI24oU=; b=hO1gADLminC7t3Fz8kqJSAeBYOitysbgrWGPxrO87iLENdkBNR3ybvYvB3/xvQl83U CECNjcrCsVzPdfY67p76HSofcRQNDpTzfycXpJUNm+EfQqoN19P1xVfdBEM4v3Q3u+0A kJ39gX+TxSCoB3EZTKMkpq0qVPKr7m+3F/S+vqDY0Fowg3O0GgX3PJErarBW5TwnKsOQ VmGuklbzJkBOXdFbSUpoA3unGIldRoSa45eSnTUyJu4VRjyWVruSFDieH5rruKVSaLhH CmlO8YAo9iRG8fEXHbJKet3rIetaQoDRtSRbFgVlSFB/hTApv9214xkr7nQGUwq53BS4 ygZw== X-Gm-Message-State: AOJu0YxYo0+JAntbBwMTb8piNb2+ICmI5z+pmUtR9MLustCqynFT5CF/ qTh2+oGi84Ipz3XwX5v4n7aw0oa0ZciyY8qIF2BoC3N3Kdmi3AwhDIIL X-Gm-Gg: ASbGncv341wyahmGmXHK1hWTPV+izrh9eYk57RjjRaXM9+X061p9eRmsy9Rz77gcdxF Qh1rztz+qKIrrjiyq7LAdj3gdxL3iiNxD8EJyqK1DtBPhYlskk23FNWC79DnIymR/LsChHDWGUx 8t1GV/Vowywe2EbM03SIlB4Y70ct+lMetk33Om9mLT8JuNAXHPqFzYnZ8OWSH5n5hU0QRY1Bf3Q bfegASUh+CyEBgLzRQh/5MWui9521MABhKIJB40KTnUpXNRfzIUj+ianh2okWbHdEjcaWxjLYul 2reAckfI7+82ZLdtNBb8OsjVmK+rCBRUBmecFthDPaKEo8xGzTbywQ84CFEr+1XQXmkuwZFAyAY UFjYWilIwgcmAfOVeSm/pyOVrqkmU8NCzjhDF6k4PCIc+28A684R9JMppI2weKBjywQgkKXIhCz G8+b40wb0= X-Google-Smtp-Source: AGHT+IGwCF+npc4pJAuLffBJNVSCXe3lxK0oyW8gv1bYCiCvs8HyDpCW9QSwCq+ndIpbpiym5EqImA== X-Received: by 2002:a05:620a:44d6:b0:89e:c4d2:52f0 with SMTP id af79cd13be357-8a70137a5d9mr428469785a.77.1761667084504; Tue, 28 Oct 2025 08:58:04 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4eba37d7db2sm74601101cf.11.2025.10.28.08.58.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Oct 2025 08:58:04 -0700 (PDT) Date: Tue, 28 Oct 2025 11:58:01 -0400 From: Mark Johnston To: "Sean C. Farley" Cc: freebsd-virtualization@freebsd.org Subject: Re: bhyve command-line option order Message-ID: References: <385a62cf-22ad-c1ed-13fe-1ac8c7ab1408@FreeBSD.org> List-Id: Discussion List-Archive: https://lists.freebsd.org/archives/freebsd-virtualization List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-virtualization@freebsd.org Sender: owner-freebsd-virtualization@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <385a62cf-22ad-c1ed-13fe-1ac8c7ab1408@FreeBSD.org> X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.60 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MID_RHS_NOT_FQDN(0.50)[]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), DKIM not aligned (relaxed),none]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_TWO(0.00)[2]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; DKIM_TRACE(0.00)[gmail.com:+]; PREVIOUSLY_DELIVERED(0.00)[freebsd-virtualization@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; MLMMJ_DEST(0.00)[freebsd-virtualization@freebsd.org]; MISSING_XM_UA(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::72d:from] X-Rspamd-Queue-Id: 4cww5B6rsDz43mt On Thu, Oct 23, 2025 at 10:00:42PM -0400, Sean C. Farley wrote: > I wrote a change to vm-bhyve[1] to be able to pass the options to bhyve in > the correct order to use GPU passthru. In the incorrect order, bhyve will > return an error. The question was raised: Is it expected that bhyve will > return an error depending upon the order of command-line arguments, or > should it be handling this scenario? > > The issue is when "-s 31, lpc" is presented to bhyve. If it is passed prior > to "-o pci.0.31.0.pcireg.vendor=host", then there is no error. However, if > it is in the opposite order, this is returned: > > $ bhyve ... -o pci.0.31.0.pcireg.vendor=host -s 31,lpc ... > pci slot 0:31:0 already occupied! > > I will be updating my PR to make things a bit easier regardless of the > answer, but it would be nice to know if this is intended or not. I don't really think it's intended, it's just an artifact of the way option handling is implemented. The -s option creates a PCI device and raises an error if one already exists in the configuration tree. The -o option adds arbitrary configuration nodes and silently overwrites existing nodes. One solution which allows both orders would be to process -o options after everything else. It's hard to say whether that might break some existing command-line invocations though. One other option would be to make -s more permissive, but that would make it easier to flub command-line invocations. > > Thank you. > > Sean > 1. https://github.com/freebsd/vm-bhyve/pull/56 > -- > scf@FreeBSD.org >