From nobody Mon Jun 17 06:21:24 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 4W2fsf4KLqz5NRYk for ; Mon, 17 Jun 2024 06:21:26 +0000 (UTC) (envelope-from corvink@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4W2fsf3lJpz45X6; Mon, 17 Jun 2024 06:21:26 +0000 (UTC) (envelope-from corvink@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718605286; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=z8FDkjeCqtqT176NDpqyoPnG33OJl0TaWURJoRS8LWE=; b=OdAym1VsJ6ZcljOzpdm6ffnv+93emdCx+VQk8r9OByVMQ1gt7Ff3wpZBkWlqimitAa0E4Q bwlzUjR9YERAyBS2n7QbmEuHwhdvaaqY5H38EPVlFxRMXmSJ4Vs2A5vaVpqliy0za1vIu9 5LeBK1qiNKlpAHjVsfC1helw9ZiTe+SW6Za1Eh38Ciox6CyNT1WiPx0qDAdcPV34DTCROw MlumopITUNsALdq+FCHFLS9ilhSfKDmfCz4MMTLest72MTqYujVLd6DIpUR3fjHrSbKFae eQzsGvADMEbgpMRFKc748W7WMsyyN2yBc7DIREHyB7w5NDC1FdLScKck861q9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1718605286; a=rsa-sha256; cv=none; b=ZDOYjfso/xfOGq5+D6/JQUdLQ/sCtOyZ00QnoYyKjXgVAL9Q7rMGnzGTMbqZB7byQFf0gM g9bFpqtAGgUBFTtIIoXudpMY50ykSRm9dQLTPfSIzXXf+pHUBo0jAUDe4jWD2lCkm7Afd1 TT6KJLPhWC4QFWBJ6xX0tTNr+H1O0eajz5vyEwtO0uAHYy+Z/UNZeBEAnB/kjYhcYi+o9r uvVRak8Fn0iEsisxLoh33T8lfXehxPcArfJF8cDgSFFMLMXPGqTdyb5tNJ/GC62g+XZz45 2gRSF6VMtAIslbr/NzIvoIOFkQ9SmARwSrCU0RvK71gwCHaUviN6TzVZ6rioRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718605286; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=z8FDkjeCqtqT176NDpqyoPnG33OJl0TaWURJoRS8LWE=; b=lefVi2FGSXNVl8NCEcy6hrRy8ncz6dtASZ3a7OOPhj+kI/JCSYGez/bH3Y86BLk/GcWRRR t51dOJilKtNAYYyO4+mDh5SqF5/ikC6hvMz5CtAdeh1rS5bBv2U0pJlWGQM8h5B4sTgEa9 g1O0zmZBVKzc6o0bLbnk1gxUx1zfas02yh6Q7c5UD+EEk4ihOa/6rFLvP0L0Fg29QJpQSE Id/Smu6Y+mW9baaLvIqVvWBsXaF921ym2OVKELmeQ8SJeVWU09f2mVkXp69wDOaqr8WlpP jz5wGuIWu7GFI+AudaexlPCHIQearT4D1v9jgkXZva8ubLxemlyWPDs7U/XhkQ== Received: from [172.21.179.142] (unknown [195.226.174.194]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: corvink) by smtp.freebsd.org (Postfix) with ESMTPSA id 4W2fsf0ghbzFgr; Mon, 17 Jun 2024 06:21:25 +0000 (UTC) (envelope-from corvink@FreeBSD.org) Message-ID: <5473b6f9d3e542b45d9c7ef3e28c57b2f937ab79.camel@FreeBSD.org> Subject: Re: bhyve passthru problem From: Corvin =?ISO-8859-1?Q?K=F6hne?= To: Peter Grehan Cc: virtualization@freebsd.org, Oleksandr Kryvulia Date: Mon, 17 Jun 2024 08:21:24 +0200 In-Reply-To: References: <38c9656c26fc3cee7ba733168c0fa2cdd01209d9.camel@FreeBSD.org> Autocrypt: addr=corvink@FreeBSD.org; prefer-encrypt=mutual; keydata=mQINBGNjZaIBEADDTrDNf+0pwiuRPBdClcnZW83dH1UhuOi0u+A1J2SatEBbNaFVtXXAa vewCTuyV/ZbNidjlhq3R/pWyiKjFKvs5dj7PMCw+3z2D5OWpMdHg7TrB+fbdFPOEsu0zQVKNaO+pS KCfN0Re0m7bL3wuvl7PXvBufRwA3Guo1P4j3TXWaEkuso7VupTvE25zVGg9ONHrGOjA9RUy+Yg4Se 3NLgtUdjBgA21SBQTDvRQV4fDmVenlwvWeE0Xm8FcDcpQb6sJTihaDku78mi3Ux1HCk7rTcepVEB0 xIB6qmFxv0sLlDmVv6Z6qg1y/Q5m23Pgz60o3TulMPV4F+3Itm8ifU+wgVSzBZbD29GYkd7LKqMkF bhvfSBk+5db3vbYY5OD//+LTM5AV7e2AhXuXMvG1UNBqXqSJTTSy6KZz+qmPQO0zos0dq46p8o82l KiBEGD2Hu0p+u0OyV+MmRYo1NIBFVbOPXp2MvUVl5II0UIJ3+N9gLBmfGA+HEpVO8PnvdoT/5NQ7m 8JK1rQHzjiDub/iDPAYMqKH4C0eZ/7zO0fuY5FeRNtuNtpH1Bw/+7/5RJH7bcKkfGHHEp15FJUrGH gWNydoDLB9QBprwQc8FEldDXBjzOMXIgh6FGKLNu6DswvIPGy6M3u7DXwDakCXz+c9Ym0oFihLzZx WntrsxdswD/CwARAQABtCdDb3J2aW4gS8O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uOtZI8gWapHhqGZRbXB2fuJkCoKCl6V67h/7 aWhU3LjFTsC5siJyrxPjapKcIk8a7PqZDswNCKR+24LJ5D59mPgEOnsiCCVpik1WE/kgD+rOu9dQx jpjKwuKowf4EJP1KYNkYtoy1HthzyTOqPwqXC3IUl0GVPO3xw6MhUM3irCVFruC+ecVrv85Rd37vr duT6JvgW92xjWegMsamtkDZH8Ik/cmYhH0K/qEc6OZVNea/4PTEZe0uxODJ6pbMd80AJyGqDPPVeA gWJtEIG4k6IS8XyD5v1QJtlpDVpPwP/bbFnVc3h3Oatfn8Etm1KAqYvNwyO+om2PkF1p732uapDZd LwksVmgc9s79+9pSpeP5DbIeMzhrIK Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-7OuE1F3YU0+mfEpfmESN" User-Agent: Evolution 3.52.2 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 --=-7OuE1F3YU0+mfEpfmESN Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2024-06-14 at 17:50 +1000, Peter Grehan wrote: > > 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. > >=20 > > [1] https://github.com/freebsd/freebsd- > > src/commit/7a902ec0eccc752c9c38533ed123121eaaea1225 >=20 > =C2=A0 At the time, BIOSs would often place device BARs of less than a > page=20 > size in the same physical page. Since EPT only gives page > granularity,=20 > this would result in all those devices being available to the guest > even=20 > if they hadn't been passed through. >=20 > later, >=20 > Peter. >=20 >=20 Thanks for the explanation! What can we do about it? Does FreeBSD remaps BARs if they aren't page aligned? If not, can we verify that the page is only used by a specific device? --=20 Kind regards, Corvin --=-7OuE1F3YU0+mfEpfmESN Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgvRSla3m2t/H2U9G2FTaVjFeAmoFAmZv1eQACgkQ2FTaVjFe AmruthAAlp36SQVZpvIh2x1njku3QtX6n8YOPviDzqlz5yaQD9tqyQC0qe6lQeqJ dcTO7lSidprSklXQmba+X0ZAppCVsOq13MSQrWR757C5c/oUXBgudQ4klaB4vI7o eGlHM2ju9hSGq8r2IJJoxJma0eZs448Nb6k1wC9+i93IO9arOFmY4Qyji4gln6cW FYbpaIRi4mNQvX4V9322DuG2DsIg7iuTQ2LyHhIZaWY0X4Q+goU77wElK5G95oY/ ouvxuZCXpo2lL1v68J+Jz5GE6wfkKVTIcuWJ+M+dRM2EAHKc6pVtwikU+4l4FvNK whLcdoBxfepDpcxhYXLqtWVnJQFjkm45bZJVq71heRmjfs+Z9zrnWi94k+DDJJgV +UcT0OJNAyQqjyIElBOrUirTXNtUZfHT6pzCRoeWYnPTAoXS7h8NRJ0KeLCuZ9Lm jmpQyjePyg2ekL6l0SilqG8qjoYPa/EHsSRjBDP6wrmj6ADRXk6oG9FUo/gPGcpr evuNeH4EQEsRYTvgHaChhYPPDWHxqqCTTETQEH/yaWh1iakHjYYVhZIBMdq1QAyJ C1ckzL2eqXJzwJic9NOD+wzLHU7FazJI0Iybht5VinI7/GTPoRPCw4GcG1nGDdgq nai6B96OX7WjiJcPUhNXkt9CGG02lM0+HENPf0XnSXLACIhSiIU= =w7Hl -----END PGP SIGNATURE----- --=-7OuE1F3YU0+mfEpfmESN--