From nobody Wed Sep 11 08:44:39 2024 X-Original-To: dev-commits-src-branches@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 4X3YzD0mBtz5W7bS; Wed, 11 Sep 2024 08:44:40 +0000 (UTC) (envelope-from git@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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X3YzC4VvRz41R8; Wed, 11 Sep 2024 08:44:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726044279; 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; bh=gfZyN6yPBUe3yW/QirxNHadBFxBr18J8eHjeHCmlwDU=; b=TyLCGSdWn2q+UrHF0MmWKzbA3jEQa76IGSa/mC59yShSQ1+bH5xhKo9oMZSi7PK/79BRxy 6Zp818WCh9Ex0+6TSlep9m5tTweh8mKvn+rpBq9LsbDsuH/dNCwvmJBYd+bFjP+a+hkIv0 Su//eSe6fVcSYeBrB8o++faZDELBknrc+NJuoXGmmegV1qVacx2IYjQr0qXWBsYZ43gtmr /7/R7FS43c7HQGyWFLyRPcJq3U42eY/5T0W6pmUD8hFTARJGKisss0lZApMpykC9xe+DT5 VulCu+UW2b3ZsRocCPclVLcvOGdV4Zo+RHOB9rBI4Leo2llpKat5i4dDwzirRw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726044279; a=rsa-sha256; cv=none; b=hkmQMdGydxuQa/OEJsprH3J95pb7cXchg2ohzh1V2/dir/5MUD0aCcJv4iHqN5WStMQIoF OQvfJbo4qbluO5JVeKLftLg/F/hcjzFav0/XxpSPtPEoHMaD6QXlloTfnl/rQoDGXESm1+ K2ZFenOkAh/ZzOPioOSZrF71Ui3Gv/vS8kQrVrP6c1nzwmsTu2Le3R8s4pQXOTgT3cR4B3 WN0Ht5tqMZEwd91vyMxy08qTfxj7S1YVLMC3RoRZ6Cidk7IV/Xv/mNL/lKbM5yU8xRdo0H qdVBBGiYjdSRfby5hPefkrBXDoLhTYqv0Fb76dsX1KNDXDrp4O3X3kNpmB1rlA== 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=1726044279; 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; bh=gfZyN6yPBUe3yW/QirxNHadBFxBr18J8eHjeHCmlwDU=; b=Pp7XoaVzfKhDW0cewvTrRipYM4mrsUUTaFYjLkndnZiCkdNzStTy9pF2sHGRlYvbk97/ds T6YgXCBOaIGuWQZmY5/IBMSbBZfqgdBUbZZSlXvVBOAh0PEYsWrOEiGBXv3dYQ6lFmmBkG 8g+yjOkJNzq8Mp/vYydkduEQ5Y4o3cGpgNRe/6cqE/+BVj4m9iwDVZGgU+26vg1BpT905G vZ5rIqM+C0o3mFi9V/b9KZfT0IVEp7CNffsSx1pQMnNVHssXt4GQXwmnQ2oWc6+J58Z4lt M+P2SVgMXc7sAH2A6HMKKTkQN4dCG9PY5dSWWsG05kRGZRbcQ3ZhnPS7cBU1dQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 4X3YzC477qzPbC; Wed, 11 Sep 2024 08:44:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48B8id6x008195; Wed, 11 Sep 2024 08:44:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48B8idWS008192; Wed, 11 Sep 2024 08:44:39 GMT (envelope-from git) Date: Wed, 11 Sep 2024 08:44:39 GMT Message-Id: <202409110844.48B8idWS008192@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: c5c01f6276ee - stable/14 - x86: always provide dummy x86_iommu virtual methods List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c5c01f6276ee117af069ca84f84f46362b0b279c Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c5c01f6276ee117af069ca84f84f46362b0b279c commit c5c01f6276ee117af069ca84f84f46362b0b279c Author: Konstantin Belousov AuthorDate: 2024-09-05 00:33:34 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-11 08:44:00 +0000 x86: always provide dummy x86_iommu virtual methods (cherry picked from commit 99e3d96fc1a2b1d5cac5a635608ec3044ec4fa13) --- sys/x86/iommu/iommu_utils.c | 52 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/sys/x86/iommu/iommu_utils.c b/sys/x86/iommu/iommu_utils.c index 2c647fd21c67..2011c632f770 100644 --- a/sys/x86/iommu/iommu_utils.c +++ b/sys/x86/iommu/iommu_utils.c @@ -190,12 +190,60 @@ SYSCTL_INT(_hw_iommu, OID_AUTO, batch_coalesce, CTLFLAG_RWTUN, &iommu_qi_batch_coalesce, 0, "Number of qi batches between interrupt"); -static struct x86_iommu *x86_iommu; +static struct iommu_unit * +x86_no_iommu_find(device_t dev, bool verbose) +{ + return (NULL); +} + +static int +x86_no_iommu_alloc_msi_intr(device_t src, u_int *cookies, u_int count) +{ + return (EOPNOTSUPP); +} + +static int +x86_no_iommu_map_msi_intr(device_t src, u_int cpu, u_int vector, + u_int cookie, uint64_t *addr, uint32_t *data) +{ + return (EOPNOTSUPP); +} + +static int +x86_no_iommu_unmap_msi_intr(device_t src, u_int cookie) +{ + return (0); +} + +static int +x86_no_iommu_map_ioapic_intr(u_int ioapic_id, u_int cpu, u_int vector, + bool edge, bool activehi, int irq, u_int *cookie, uint32_t *hi, + uint32_t *lo) +{ + return (EOPNOTSUPP); +} + +static int +x86_no_iommu_unmap_ioapic_intr(u_int ioapic_id, u_int *cookie) +{ + return (0); +} + +static struct x86_iommu x86_no_iommu = { + .find = x86_no_iommu_find, + .alloc_msi_intr = x86_no_iommu_alloc_msi_intr, + .map_msi_intr = x86_no_iommu_map_msi_intr, + .unmap_msi_intr = x86_no_iommu_unmap_msi_intr, + .map_ioapic_intr = x86_no_iommu_map_ioapic_intr, + .unmap_ioapic_intr = x86_no_iommu_unmap_ioapic_intr, +}; + +static struct x86_iommu *x86_iommu = &x86_no_iommu; void set_x86_iommu(struct x86_iommu *x) { - MPASS(x86_iommu == NULL); + MPASS(x86_iommu == &x86_no_iommu); x86_iommu = x; }