From nobody Mon Feb 9 20:34:33 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) 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=1595869588; cv=none; d=zohomail.com; s=zohoarc; b=JRjOplxKcmm4ZLBcpulU041u0FDsFl92rVRiZ71U+GR5KR3QTyv8WgzUqyYqTVZjaFHSO3Y9siPOSF23/WZKno73grZ9Bj0UNv3+mUhQJExC0nE+tVtJt67xUPbXmqDSmxDt6gsppsznd8fBjQX5jPCCMNui1Ef4mVE4nUdw3B4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595869588; 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=MDjfXWSFLaPY1d+sXPpNfLruRKN61vo/QD2rp7B54v4=; b=gMv2m34US9l079kX4ntNcQbG2QdxcN6Nn8sPtIorDkA+zpCwqtUMkIGovRbQJZ+3UNu3G8jwbhOVmaODztHsKCd9HxcTk+PIkprysd58PUmD7aCKxp8gDkg9X+pk5UVrduHCLQQ3bDq95wiibGhWHE2dfqIwOuJEyqFuHkcnqBI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) 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 1595869588980819.3174248620702; Mon, 27 Jul 2020 10:06:28 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k06Zc-0006r0-Hu; Mon, 27 Jul 2020 17:06:00 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k06Zc-0006qK-7U for xen-devel@lists.xenproject.org; Mon, 27 Jul 2020 17:06:00 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 6f1647b4-d02b-11ea-a7b1-12813bfff9fa; Mon, 27 Jul 2020 17:05:55 +0000 (UTC) X-Inumbo-ID: 6f1647b4-d02b-11ea-a7b1-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1595869555; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9BA2HuY2XfFbO7rOd5htwjlC8tyCla4CvMSRDDan0zM=; b=hvHbfeSU5EghLHXL0RE4MfWuUjtKOxBqV8nRz33X9lmu942Mmx3W0MQl NXSNgPZoG7VmOzuF64RdN7Q7qTHkngnSu3b1W22L8Z+I9RJ4zNuHVTsCf kfx8cpwXaxW0jwegLsYdCQ9jEyLHhSyb0+eRoQtwiRbgVaW0cNNPWVRtZ c=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: Cn+VFplSK30A9ca43AE3YL9md4WrnPn8Hd8a+AWow0raSKjK6EGyBpPdmEAToQ+UOrkXTHUPwr 0xkgbKh5R/r6OQ/Yt/bZtjewBYXoXMkehllRyFl9N4vJKukDB4zyoGt/tzExtPRE/tf7Q8rHGY 3YzHsq7bBlo0iHYFpkLbALQbdYVKqCC9hreyMI9J1GIiy93wKQdv+uGJiVpsLw4MNlXozw2oJQ PkGLS+mHAkzhteDah9IoEOTqheAA83On1BKqcsuj9MA/yrEcKnHO/rm9UlBHNIGm8MblLga+J4 sF0= X-SBRS: 2.7 X-MesageID: 23610699 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.75,402,1589256000"; d="scan'208";a="23610699" From: Roger Pau Monne To: Subject: [PATCH v2 2/5] x86/hvm: don't force vCPU 0 for IRQ 0 when using fixed destination mode Date: Mon, 27 Jul 2020 19:05:36 +0200 Message-ID: <20200727170539.55798-3-roger.pau@citrix.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727170539.55798-1-roger.pau@citrix.com> References: <20200727170539.55798-1-roger.pau@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 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 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) When the IO APIC pin mapped to the ISA IRQ 0 has been configured to use fixed delivery mode do not forcefully route interrupts to vCPU 0, as the OS might have setup those interrupts to be injected to a different vCPU, and injecting to vCPU 0 can cause the OS to miss such interrupts or errors to happen due to unexpected vectors being injected on vCPU 0. In order to fix remove such handling altogether for fixed destination mode pins and just inject them according to the data setup in the IO-APIC entry. Signed-off-by: Roger Pau Monn=C3=A9 Reviewed-by: Jan Beulich --- xen/arch/x86/hvm/vioapic.c | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c index b00037ea87..123191db75 100644 --- a/xen/arch/x86/hvm/vioapic.c +++ b/xen/arch/x86/hvm/vioapic.c @@ -438,26 +438,11 @@ static void vioapic_deliver(struct hvm_vioapic *vioap= ic, unsigned int pin) } =20 case dest_Fixed: - { -#ifdef IRQ0_SPECIAL_ROUTING - /* Do not deliver timer interrupts to VCPU !=3D 0 */ - if ( (irq =3D=3D hvm_isa_irq_to_gsi(0)) && pt_active(&d->arch.vpit= .pt0) ) - { - if ( (v =3D d->vcpu ? d->vcpu[0] : NULL) !=3D NULL ) - ioapic_inj_irq(vioapic, vcpu_vlapic(v), vector, - trig_mode, delivery_mode); - } - else -#endif - { - for_each_vcpu ( d, v ) - if ( vlapic_match_dest(vcpu_vlapic(v), NULL, - 0, dest, dest_mode) ) - ioapic_inj_irq(vioapic, vcpu_vlapic(v), vector, - trig_mode, delivery_mode); - } + for_each_vcpu ( d, v ) + if ( vlapic_match_dest(vcpu_vlapic(v), NULL, 0, dest, dest_mod= e) ) + ioapic_inj_irq(vioapic, vcpu_vlapic(v), vector, trig_mode, + delivery_mode); break; - } =20 case dest_NMI: { --=20 2.27.0