From nobody Fri Jun 14 07:50:35 2024 X-Original-To: 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 4W0s0549VHz5NdC4 for ; Fri, 14 Jun 2024 07:50:45 +0000 (UTC) (envelope-from SRS0=FW9I=NQ=freebsd.org=grehan@iredmail.onthenet.com.au) Received: from alto.onthenet.com.au (alto.OntheNet.com.au [203.13.68.12]) (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 4W0s050K6Cz57mX for ; Fri, 14 Jun 2024 07:50:43 +0000 (UTC) (envelope-from SRS0=FW9I=NQ=freebsd.org=grehan@iredmail.onthenet.com.au) Authentication-Results: mx1.freebsd.org; none Received: from iredmail.onthenet.com.au (iredmail.onthenet.com.au [203.13.68.150]) by alto.onthenet.com.au (Postfix) with ESMTPS id 3FC3320B4A00 for ; Fri, 14 Jun 2024 17:50:38 +1000 (AEST) Received: from iredmail.onthenet.com.au (iredmail.onthenet.com.au [127.0.0.1]) by iredmail.onthenet.com.au (Postfix) with ESMTP id 38DE920510CA for ; Fri, 14 Jun 2024 17:50:38 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nt.com.au; h= content-transfer-encoding:content-type:content-type:in-reply-to :from:from:references:to:content-language:subject:subject :user-agent:mime-version:date:date:message-id; s=dkim; t= 1718351438; x=1720943439; bh=524xMbId24gH0ogILH14aBj0QJLCuI8Iuu1 I9mRJGEI=; b=LUouw7QPkuiay4cHT4jsmf2l64x4/zY9CXslVOGaqJOuP/M4eKe noZGtZBVX9OxukXSfagf6wE60UzOHhuUuQ76q0UWN7U7HOgjz/bKKWhqAobfU/YG nH12UwGzfxhH0Q199TEf0gdh2YNXXsqeYpE3VG1UwRH4EaYlAzntUPsw= Received: from iredmail.onthenet.com.au ([127.0.0.1]) by iredmail.onthenet.com.au (iredmail.onthenet.com.au [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id bFMLBZdqFrvq for ; Fri, 14 Jun 2024 17:50:38 +1000 (AEST) Received: from [192.168.1.118] (otn-120-29-28-205.broadband.onthenet.net [120.29.28.205]) by iredmail.onthenet.com.au (Postfix) with ESMTPSA id 66DFE20B49B3; Fri, 14 Jun 2024 17:50:37 +1000 (AEST) Message-ID: Date: Fri, 14 Jun 2024 17:50:35 +1000 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 User-Agent: Mozilla Thunderbird Subject: Re: bhyve passthru problem Content-Language: en-US To: =?UTF-8?Q?Corvin_K=C3=B6hne?= References: <38c9656c26fc3cee7ba733168c0fa2cdd01209d9.camel@FreeBSD.org> Cc: virtualization@freebsd.org, Oleksandr Kryvulia From: Peter Grehan In-Reply-To: <38c9656c26fc3cee7ba733168c0fa2cdd01209d9.camel@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CMAE-Score: 0 X-CMAE-Analysis: v=2.4 cv=Fu4D/Xrq c=1 sm=1 tr=0 ts=666bf64e a=A6CF0fG5TOl4vs6YHvqXgw==:117 a=aUkRY6iF7mx+osBZGfXMrQ==:17 a=IkcTkHD0fZMA:10 a=T1WGqf2p2xoA:10 a=NEAV23lmAAAA:8 a=q2Y7N2zY64vj4DhgRysA:9 a=QEXdDO2ut3YA:10 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:9313, ipnet:203.13.68.0/24, country:AU] X-Rspamd-Queue-Id: 4W0s050K6Cz57mX > I don't know why bhyve validates the BAR size. The commit adding this > check is old [1] and doesn't explain it. What bhyve could do is > rounding up the BAR size to a full page size when allocating memory for > the BAR. > > [1] https://github.com/freebsd/freebsd- > src/commit/7a902ec0eccc752c9c38533ed123121eaaea1225 At the time, BIOSs would often place device BARs of less than a page size in the same physical page. Since EPT only gives page granularity, this would result in all those devices being available to the guest even if they hadn't been passed through. later, Peter.