From nobody Wed Mar 30 15:50:31 2022 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 EA5B01A56142 for ; Wed, 30 Mar 2022 15:50:31 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KT9r72Sxkz3kyr for ; Wed, 30 Mar 2022 15:50:31 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0EDAB15CEC for ; Wed, 30 Mar 2022 15:50:31 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 22UFoU6d045647 for ; Wed, 30 Mar 2022 15:50:30 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 22UFoUva045646 for virtualization@FreeBSD.org; Wed, 30 Mar 2022 15:50:30 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: virtualization@FreeBSD.org Subject: [Bug 260178] bhyve: passthru makes ahci-hd boot fail Date: Wed, 30 Mar 2022 15:50:31 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bhyve X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: bhyve X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: commit-hook@FreeBSD.org X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: virtualization@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Discussion List-Archive: https://lists.freebsd.org/archives/freebsd-virtualization List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-virtualization@freebsd.org X-BeenThere: freebsd-virtualization@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648655431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yKElnTiTGsl1GHKbUoL85YIAWffrUlqTPYVe/qqxF2w=; b=c575kWFeS0NrKSmClZE036M7H3gfRUfLyehksdzTuW3OLbFhALIjj/1UTJ+Flo1nBewtau rgPitObLYACylXYtvBjWTl9wcU0sAr5Vfw4if7A6EGRgl1SngGZnztwtvwFE1lsxDZGod2 SXvTjuZAFWmfkWddnlV8BPczSfXLyMkNNfofud2IlBgkY9M7EMLCqusTc/MOUuXmtD9Y6y QQNGTwNm82ldyqCeJLSY0wc3K92ONrV3oq3x+haJ1NITvXbs3oL2wCNPvkUq3lhX+/Galb XrR0Hy8kyl2tMT+S2CO67M2NJZhvcB/wGk4NSuhbv6QgtJhrWwzrC362iMEa9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1648655431; a=rsa-sha256; cv=none; b=xKxFi/xWBflGlTTKMGfOUx/pkFRAvJjCU+hJuWm5iJOZ0TLE445Iz+X55j0AdoZEMdoKDR dI7iTYRwCrZeLS/wbFZrz/4IuIOS3wmajzl8VOpalm7IOWNAfqx9FmpWgVtxaOOw+6NBT5 vBb8D6JAJgbGY/MMw4UW+k1KOZa5vydJP2rxOtEZEB1WOh1EJz3hpfHEBnBMix8I923yRa i2q67D0fa83yGrMLQfK7abj4l4BlcgzbuTS6RuTIdrdOu1FJqP1u4G+U5ztjhOH933xA4m 5QbohBV7+Xgqg/7EOYH2Whbk6AxNxQ5sW/dpwb5CjBu1xOwf/Xc3FvhICDX5UA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D260178 --- Comment #13 from commit-hook@FreeBSD.org --- A commit in branch releng/13.1 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3D1c6abf864ecd3bbf07ace2018f9aab45b= 6406ce2 commit 1c6abf864ecd3bbf07ace2018f9aab45b6406ce2 Author: Bjoern A. Zeeb AuthorDate: 2022-03-18 20:39:06 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-03-30 15:33:47 +0000 bhyve: Do not remove guest physical addresses from IOMMU host domain This permits I/O devices on the host to directly access wired memory dedicated to guests using passthru devices. Note that wired memory belonging to guests that do not use passthru devices has always been accessible by I/O devices on the host. bhyve maps guest physical addresses into the user address space of the bhyve process by mmap'ing /dev/vmm/. Device models pass pointers derived from this mapping directly to system calls such as preadv() to minimize copies when emulating DMA. If the backing store for a device model is a raw host device (e.g. when exporting a raw disk device such as /dev/ada as a drive in the guest), the host device driver (e.g. ahci for /dev/ada) can itself use DMA on the host directly to the guest's memory. However, if the guest's memory is not present in the host IOMMU domain, these DMA requests by the host device will fail without raising an error visible to the host device driver or to the guest resulting in non-working I/O in the guest. It is unclear why guest addresses were removed from the IOMMU host doma= in initially, especially only for VM's with a passthru device as the host IOMMU domain does not affect the permissions of passthru devices, only devices on the host. A considered alternative was using bounce buffers instead (D34535 is a proof of concept), but that adds additional overhead for unclear benefit. This solves a long-standing problem when using passthru devices and physical disks in the same VM. Approved by: re (gjb) Thanks to: grehan (patience and help) Thanks to: jhb (for improving the commit message) PR: 260178, 215740 Reviewed by: grehan, jhb Differential Revision: https://reviews.freebsd.org/D34607 (cherry picked from commit 246c398145674e4a9337fd933a6e6da7f160118e) (cherry picked from commit dd113f67dfb5bdaf5d8b3a87bb19924ad447494c) sys/amd64/vmm/vmm.c | 2 -- 1 file changed, 2 deletions(-) --=20 You are receiving this mail because: You are the assignee for the bug.=