From nobody Sun Nov 03 16:02:38 2024 X-Original-To: dev-commits-src-all@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 4XhKBR0mmKz5cMmT; Sun, 03 Nov 2024 16:02:55 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4XhKBQ35wxz4PBM; Sun, 3 Nov 2024 16:02:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 4A3G2cL5044435; Sun, 3 Nov 2024 18:02:41 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 4A3G2cL5044435 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 4A3G2cUT044434; Sun, 3 Nov 2024 18:02:38 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 3 Nov 2024 18:02:38 +0200 From: Konstantin Belousov To: Mark Johnston Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 0f5116d7efe3 - main - AMD IOMMU driver Message-ID: References: <202411022346.4A2NkeBT097606@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home 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:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Queue-Id: 4XhKBQ35wxz4PBM X-Spamd-Bar: ---- On Sun, Nov 03, 2024 at 10:39:50AM -0500, Mark Johnston wrote: > On Sat, Nov 02, 2024 at 11:46:40PM +0000, Konstantin Belousov wrote: > > The branch main has been updated by kib: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=0f5116d7efe33c81f0b24b56eec78af37898f500 > > > > commit 0f5116d7efe33c81f0b24b56eec78af37898f500 > > Author: Konstantin Belousov > > AuthorDate: 2024-05-12 10:20:11 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2024-11-02 23:45:40 +0000 > > > > AMD IOMMU driver > > > > This driver is functionally equivalent to the in-tree Intel DMAR code. > > It handles busdma and interrupt remapping from the host OS. There is no > > integration with bhyve, and the stub iommu drivers in bhyve code cannot > > coexist with this driver (planned). > > > > The biggest architectural problem with the code is that the AMD IOMMU > > units are enumerated as PCIe-attached security devices, which is much > > later after HPET and IOAPIC drivers attached and actived interrupts. > > Because of this, HPET FSB interrupts and IOAPIC interrupts are always > > identity-mapped. > > > > The code is of late alpha quality. By default the driver is disabled. > > To enable for testing, set in loader.conf: > > hw.amdiommu.enable=1 > > hw.iommu.dma=1 <- to enable iommu busdma > > hw.iommu.ir=1 <- to enable interrupt remapping > > > > Discussed with: emaste > > Sponsored by: Advanced Micro Devices (AMD) > > Sponsored by: The FreeBSD Foundation > > MFC after: 1 week > > Differential revision: https://reviews.freebsd.org/D47256 > > This appears to break loading of vmm.ko, as sys/amd64/vmm/amd/amdiommu.c > already defines a driver called "amdiommu". Perhaps the module in vmm > should be renamed to amdviiommu or so? Perhaps. Will you commit this yourself?