From nobody Sun Mar 27 20:15:13 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 424A11A56476 for ; Sun, 27 Mar 2022 20:15:14 +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 4KRRrx3sHRz4pkm for ; Sun, 27 Mar 2022 20:15:13 +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 500A11BDD1 for ; Sun, 27 Mar 2022 20:15:13 +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 22RKFDuC046802 for ; Sun, 27 Mar 2022 20:15:13 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 22RKFDAE046801 for virtualization@FreeBSD.org; Sun, 27 Mar 2022 20:15:13 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: Sun, 27 Mar 2022 20:15:13 +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=1648412113; 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=q1Vy7owPqWN4Lc8KLnOFhf1eWIqSso7qjm1nfcH2f7w=; b=L0VZP5Q4Hr0A/1YbaJRl0RiCxco2bB0w9T/UvsXmUrzlWbBqbw8Jhg5tzpRvZ+jtQSdeBp iZt0v0oWJA8NHZ0ivw8h89j6WVKeU00tBWTFdgFH0TBLBI7i2MW9k9R8wPqgdTYhykvUIU CEPzbG5fL3FZN/1NcpnaTdnGvUIbWUO0dXpSUcqKtszE05wX/3pOXGKKvp+cKXOhelpths AJjFADoGnzf3972+XcWHup4pmR28cUUztq/anfhtFwHk9rF4NsM12jzzUwvEoCldYFdg9Y zDDXVQyWC4BJ4HS0nrYo4vu7QWoj7QWv7wyVZn8DmNFCAUsKKV9aEWodtKD4Bg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1648412113; a=rsa-sha256; cv=none; b=rpxPQBuUzFwtwbCcoFsf8FWh5PDSZ0VpmCnovQQ8MU2DyFiANV4U1U8ygQqbzeJ5ycnbdf rPnfnYAYKbR2GD5iCh2B6QJ0xdyQg8OqSauCPHXlHfnb/qkMJ+0NnJUfc4+4MwaFTJHiv2 4IG7sJ20mQTxVSUHZX7Ue4udSIFUhBqQBRt79UZqPxb82yTNEWxfx47T88SQJ50/4C6bSv C2jibwGsc6WKq069ztfpfExgRIr9Nz2idUsZb533I8Ifv6jk/F1vFp20L6j8kFBWzqZVKu OfuFkG0u+eQiiqPjTBe2LUoaQoap7hHpzVSYlPJ7cBKQYFBQHEyBv/j8LD2LEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D260178 --- Comment #12 from commit-hook@FreeBSD.org --- A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3Ddd113f67dfb5bdaf5d8b3a87bb19924ad= 447494c commit dd113f67dfb5bdaf5d8b3a87bb19924ad447494c Author: Bjoern A. Zeeb AuthorDate: 2022-03-18 20:39:06 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-03-27 17:57:28 +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. 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) 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.=