From nobody Sun Dec 22 01:52:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1733995073968282.1103600707056; Thu, 12 Dec 2024 01:17:53 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 14C79B96; Thu, 12 Dec 2024 04:17:53 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 65E9911F2; Thu, 12 Dec 2024 04:17:36 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id DFAED11B8; Thu, 12 Dec 2024 04:17:33 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 6434911AA for ; Thu, 12 Dec 2024 04:17:33 -0500 (EST) Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-325-iMG0KkHpPvC-ig87Il-jew-1; Thu, 12 Dec 2024 04:17:31 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CE86D1956069 for ; Thu, 12 Dec 2024 09:17:30 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.3.236]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 32672300FA97 for ; Thu, 12 Dec 2024 09:17:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733995053; 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=0yAtf9+hWGJb6NR05t4h+jhFgpCzHe0KrBMKaBHTDjU=; b=ZDxVCVe1h2NYue44PinOM7oQi5a2MuN5uRiBEovlgNKSte8ylOwpWWHo3NeeJezS6CE/Gy OgKDxxrD7ixvXLX9mmMFLiCseIFi4Au3vUPtAsLNPWwnBZgFpKRrG9ecw5UsZ8/DgmNwH9 fsDSmcxptkpUj03VTHJ8xpLY+TqKEgE= X-MC-Unique: iMG0KkHpPvC-ig87Il-jew-1 X-Mimecast-MFC-AGG-ID: iMG0KkHpPvC-ig87Il-jew From: Michal Privoznik To: devel@lists.libvirt.org Subject: [PATCH] qemu: Enable I/O APIC if needed Date: Thu, 12 Dec 2024 10:17:08 +0100 Message-ID: <1263c8c84de1cb7e5a2bbe6e3147b4a2f32e0cbc.1733995028.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: kCMbSXgHVnv2ZFSTsosGobawEmrDI-yhdPhNDL_QXxs_1733995050 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: KBAJRHQDXIDSM6RWQNRSQPX3U5BW7UK2 X-Message-ID-Hash: KBAJRHQDXIDSM6RWQNRSQPX3U5BW7UK2 X-MailFrom: mprivozn@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1733995074966116600 Content-Type: text/plain; charset="utf-8"; x-default="true" This is a follow up of my previous commits. If the number of vCPUs exceeds some arbitrary value (255) then QEMU requires IOMMU with EIM and interemap enabled. But in turn, intremap IOMMU requires split I/O APIC (per virDomainDefIOMMUValidate()). Since after my previous commits (e.g. v10.10.0-rc1~183) IOMMU is added automagically, the I/O APIC can be also enabled automagically. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_postparse.c | 7 +++++++ tests/qemuxmlconfdata/intel-iommu-eim-autoadd.xml | 3 --- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_postparse.c b/src/qemu/qemu_postparse.c index 03b5ef825a..f48f172c37 100644 --- a/src/qemu/qemu_postparse.c +++ b/src/qemu/qemu_postparse.c @@ -1547,6 +1547,13 @@ qemuDomainDefEnableDefaultFeatures(virDomainDef *def, * capabilities, we still want to enable this */ def->features[VIR_DOMAIN_FEATURE_GIC] =3D VIR_TRISTATE_SWITCH_ON; } + + /* IOMMU with intremap requires split I/O APIC */ + if (def->iommu && + def->iommu->intremap =3D=3D VIR_TRISTATE_SWITCH_ON && + def->features[VIR_DOMAIN_FEATURE_IOAPIC] =3D=3D VIR_DOMAIN_IOAPIC_= NONE) { + def->features[VIR_DOMAIN_FEATURE_IOAPIC] =3D VIR_DOMAIN_IOAPIC_QEM= U; + } } =20 =20 diff --git a/tests/qemuxmlconfdata/intel-iommu-eim-autoadd.xml b/tests/qemu= xmlconfdata/intel-iommu-eim-autoadd.xml index fa3aaf0d44..5abc40e566 100644 --- a/tests/qemuxmlconfdata/intel-iommu-eim-autoadd.xml +++ b/tests/qemuxmlconfdata/intel-iommu-eim-autoadd.xml @@ -8,9 +8,6 @@ hvm - - - qemu64 --=20 2.45.2