From nobody Tue Feb 10 00:58:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1575476482; cv=none; d=zohomail.com; s=zohoarc; b=OJYN4pCDICrIechQ5KU/2rVjzKvDgpUJH/o+ONo14bVLjvCefjywW5QGXDnHMicHWy4rTP3IN63ks+H+giMNksteEbzUU4VVsjKCUWg2rTw7+xSF3Y/LpK2W9+MGg0ZJSGQ2runpAhvYdj4PYIHyI+zHWxxPed1cnr9iPHWjybg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575476482; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=O7tmIZzHZ7agyZOxhz15sxJkijA2VH+1M0lSfOboecI=; b=C8gm8PXOA11yWeHJ4lidMyi5htlfkE5dv/FeabNALL14mb0s3lwtDhcIBzCkTbiyxA8+mFTUdajIndatDjahGoWBL71GFdqYEjHu0Q4mj/X6p8jrei3PSbmkKvxRy/mUsK3ucfUm5ghavj0dmaNvAuzBB5wybY8gwM0h1ltzKZw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1575476482286749.4564059601021; Wed, 4 Dec 2019 08:21:22 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1icXOQ-0006qY-TV; Wed, 04 Dec 2019 16:20:46 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1icXOP-0006qG-RM for xen-devel@lists.xenproject.org; Wed, 04 Dec 2019 16:20:45 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 05dce66e-16b2-11ea-a0d2-bc764e2007e4; Wed, 04 Dec 2019 16:20:45 +0000 (UTC) X-Inumbo-ID: 05dce66e-16b2-11ea-a0d2-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1575476445; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=a3VbCfnmF7tpj2vAyuyl6JFYJVMSgRm44pU8P/N40ZM=; b=SPPWUkKi48vySeIiQieUf5AYsjgiE8hpl2BVi/EntYujdZgLvxW/+WmL 7f5lXX6qgjC+DF0PCrMaFnuapvUOFmUuLikaRCaAem9WGsSBcutPfvBZ1 jVD/RNc8Oa5qrbcuhVXnfwmQv7dmSYHmDLGVVPZ+KNVkDE3ouL/yqb6lH A=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=roger.pau@citrix.com; spf=Pass smtp.mailfrom=roger.pau@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of roger.pau@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa6.hc3370-68.iphmx.com: domain of roger.pau@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: DiTWPkgppH4Ncg4m7tBrUmjWkmgJQ8GZG5ChhVNrQRR00qkdsmLWmhlh4D0jRysgVsBI8IYbf0 iQXsLP0DMnxFjEUaWE70D6Baq7DRp+W8wvu45kTGCseiOoQxAwBfE+C2uWWmULEqM0lTRp6zb1 yRPbySQfqIv5zEpW7YfOkxEMP4S0SRIUoBrz3acpnqU9TW7ADN45ukJf04GTU4OWYvy4uUhnt4 hcDPw6ba6Y7QxTcqnr57I6v7baHEOgRwL4A8vD+J0RxslVMoVNPtTGlDvqAbE8vSuYZptuFRAU dVE= X-SBRS: 2.7 X-MesageID: 9607271 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.69,277,1571716800"; d="scan'208";a="9607271" From: Roger Pau Monne To: Date: Wed, 4 Dec 2019 17:20:22 +0100 Message-ID: <20191204162025.37510-2-roger.pau@citrix.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191204162025.37510-1-roger.pau@citrix.com> References: <20191204162025.37510-1-roger.pau@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v3 1/4] x86/ioapic: only use dest32 with x2apic and interrupt remapping enabled X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Andrew Cooper , Wei Liu , Jan Beulich , Roger Pau Monne Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The IO-APIC code assumes that x2apic being enabled also implies interrupt remapping being enabled, and hence will use the 32bit destination field in the IO-APIC entry. This is safe now, but there's no reason to not enable x2APIC even without interrupt remapping, and hence the IO-APIC code needs to use the 32 bit destination field only when both interrupt remapping and x2APIC are enabled. Signed-off-by: Roger Pau Monn=C3=A9 Reviewed-by: Jan Beulich --- Changes since v1: - Fix set_ioapic_affinity_irq. --- xen/arch/x86/io_apic.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c index 97cb2d154a..6238df494b 100644 --- a/xen/arch/x86/io_apic.c +++ b/xen/arch/x86/io_apic.c @@ -562,7 +562,7 @@ set_ioapic_affinity_irq(struct irq_desc *desc, const cp= umask_t *mask) =20 dest =3D set_desc_affinity(desc, mask); if (dest !=3D BAD_APICID) { - if ( !x2apic_enabled ) + if ( !iommu_intremap || !x2apic_enabled ) dest =3D SET_APIC_LOGICAL_ID(dest); entry =3D irq_2_pin + irq; for (;;) { @@ -964,7 +964,7 @@ static hw_irq_controller ioapic_edge_type; #define IOAPIC_LEVEL 1 =20 #define SET_DEST(ent, mode, val) do { \ - if (x2apic_enabled) \ + if (x2apic_enabled && iommu_intremap) \ (ent).dest.dest32 =3D (val); \ else \ (ent).dest.mode.mode##_dest =3D (val); \ @@ -1194,14 +1194,14 @@ static void /*__init*/ __print_IO_APIC(bool boot) printk(KERN_DEBUG ".... IRQ redirection table:\n"); =20 printk(KERN_DEBUG " NR %s Msk Trg IRR Pol Stat DstM DelM Vec\n", - x2apic_enabled ? " DestID" : "Dst"); + (x2apic_enabled && iommu_intremap) ? " DestID" : "Dst"); =20 for (i =3D 0; i <=3D reg_01.bits.entries; i++) { struct IO_APIC_route_entry entry; =20 entry =3D ioapic_read_entry(apic, i, 0); =20 - if ( x2apic_enabled ) + if ( x2apic_enabled && iommu_intremap ) printk(KERN_DEBUG " %02x %08x", i, entry.dest.dest32); else printk(KERN_DEBUG " %02x %02x ", i, @@ -2504,9 +2504,9 @@ void dump_ioapic_irq_info(void) rte.dest_mode ? 'L' : 'P', rte.delivery_status, rte.polarity, rte.irr, rte.trigger ? 'L' : 'E', rte.mask, - x2apic_enabled ? 8 : 2, - x2apic_enabled ? rte.dest.dest32 - : rte.dest.logical.logical_dest); + (x2apic_enabled && iommu_intremap) ? 8 : 2, + (x2apic_enabled && iommu_intremap) ? + rte.dest.dest32 : rte.dest.logical.logical_dest); =20 if ( entry->next =3D=3D 0 ) break; --=20 2.24.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel