From patchwork Thu Apr 21 13:21:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 12821618 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 896D8C433EF for ; Thu, 21 Apr 2022 13:22:13 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.310170.526850 (Exim 4.92) (envelope-from ) id 1nhWkw-0005Wh-Nc; Thu, 21 Apr 2022 13:21:58 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 310170.526850; Thu, 21 Apr 2022 13:21:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nhWkw-0005Wa-Kb; Thu, 21 Apr 2022 13:21:58 +0000 Received: by outflank-mailman (input) for mailman id 310170; Thu, 21 Apr 2022 13:21:56 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nhWku-0005Gk-Mb for xen-devel@lists.xenproject.org; Thu, 21 Apr 2022 13:21:56 +0000 Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com [216.71.145.153]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 029bfa40-c176-11ec-8fc2-03012f2f19d4; Thu, 21 Apr 2022 15:21:53 +0200 (CEST) Received: from mail-bn8nam12lp2168.outbound.protection.outlook.com (HELO NAM12-BN8-obe.outbound.protection.outlook.com) ([104.47.55.168]) by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 21 Apr 2022 09:21:54 -0400 Received: from DS7PR03MB5608.namprd03.prod.outlook.com (2603:10b6:5:2c9::18) by BN7PR03MB3649.namprd03.prod.outlook.com (2603:10b6:406:c9::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.13; Thu, 21 Apr 2022 13:21:53 +0000 Received: from DS7PR03MB5608.namprd03.prod.outlook.com ([fe80::5df3:95ce:4dfd:134e]) by DS7PR03MB5608.namprd03.prod.outlook.com ([fe80::5df3:95ce:4dfd:134e%4]) with mapi id 15.20.5186.015; Thu, 21 Apr 2022 13:21:53 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 029bfa40-c176-11ec-8fc2-03012f2f19d4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1650547315; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=3IGNZ+VfL0mt0x6amMhXSerxu1UgLXEzTKuf9OnMG/4=; b=Pbr2AQzLjRK3mzr6SgeNiYJk7Ti2dk5qwIUCeG1zIcCUruRrMRsMbw77 k6hDzqU7ZPtNIhUALuxjiCy3KxRGMj2JKCQrZKLfyw6xEx2SoEXmeQKXA Zfy/a+e41XPXeLNh3gxjBSxzSAvbMrh5LhPNU07spNH6j/+AxonhOFzB1 8=; X-IronPort-RemoteIP: 104.47.55.168 X-IronPort-MID: 69628147 X-IronPort-Reputation: None X-IronPort-Listener: OutboundMail X-IronPort-SenderGroup: RELAY_O365 X-IronPort-MailFlowPolicy: $RELAYED IronPort-Data: A9a23:wEJKo67y30ubgqHYVcnBbAxRtEzGchMFZxGqfqrLsTDasY5as4F+v mofXD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rHo6mt jFpBkte+x19nPqZ2mw5SDg3gHxuQxen0PK+Bu9uz/OsMb5TDU1B45qnoRCaCbU7EImoZVVzL 9L93jxjesZMTrw2ADGo/TYXRBjkUS55VA4l/QIsnBZWYwCLJdMsI0k+l9PGptoJlO31GkeKp guMCjg3ocXTbvDBEqp/VWHgebcE0jbJy32DHTr4aeuonprdHMQ9Tps+CVQpAZEyHsHceg02w 31CNUXqFhwdL5nUUsEPpZmfSKWMB27ffueChPlHbzYfJt3SE7lmtrQ3Igfwt2MVdgh8KYS8a 6xIm+w81RCMX7TNQ== X-IronPort-AV: E=Sophos;i="5.90,278,1643691600"; d="scan'208";a="69628147" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YuSE/ALZgipOcoubIbKMxWWpUa/cMFsdouIFYVcITL/ios4ZD9CfHQLLCyfUnwL8g1CEbjatrvOwdCEfuFpWLrVIATX6uTz6t3YCB2+kqOLs1CFbotSNBK0HGO5jfMZUjNXVHwnte5KXiAPU6bvMBjFqdwfT18I85mfwOUXekX6ePCOCBI1wkQT0QrUb0taYp8r2qulx/kSeIV8CDInoeXuUiLhIJ6FcCYv9LKgwmcInzgf930bN9D359U9WAkWYd7RNJcyucucqcbuGo+/a3bdF+BLovOVCWAsvW1+2Pa8ZY0EZE99m+wZ4V6DDB9C5bfLI1Qxmim1aX98D6uTA5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=MplFUaOgPEc44piH8DIO1e3W6kPo2BvT4PdjJ9GUhPE=; b=jVeVuPjKTczt3lAsHs4Bpkw04JWa/WkcMeHXl7i4erFkPyLo8OXzA8QYjYfrpIFC2OGR4Vw3KQf3BzWXH4i5Rk9EatoT73GM8BJOp+1cM3pJUjkahXpnHwO5SooRaiK1BEaAOFkK9Lr4J5kp5xEITgcis783B9xk/Py9KlQtasPuh6+vaB0nIKYXJ0j74FszmRs9uF9ZJ7jaEjoX/zwhkphA4nQSN8QwGEv+J/gmQX3KiSVLSY48riYqlkl0E0RFTIZ+FEQcmFp7R45crmnxGH1UhCkMH9vkI5Q1SIqzTsd6lweOP2hiRVEk+5NFpX2De8KELWnjLsJFbDp5jFyOPg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MplFUaOgPEc44piH8DIO1e3W6kPo2BvT4PdjJ9GUhPE=; b=ib4J47h2/pybrx8wO+E5fzgg++JuNGHDUjT4lY1TlCEtx2lRmkPjFnp08D3QG5sWCCTVhnEIC661TCn3WosTTPQTDavmoDBaeD1ku2JT3QjxVT1vh662KDBm5ZrdEdY8PAQJeB5vWuZHZ1tXMRlhel663R/Z2EBqt7vOxf1J5ug= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com; From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: Roger Pau Monne , Jan Beulich , Andrew Cooper , Wei Liu Subject: [PATCH RFC 1/6] x86/ioapic: set disable hook for masking edge interrupts Date: Thu, 21 Apr 2022 15:21:09 +0200 Message-Id: <20220421132114.35118-2-roger.pau@citrix.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220421132114.35118-1-roger.pau@citrix.com> References: <20220421132114.35118-1-roger.pau@citrix.com> X-ClientProxiedBy: MR2P264CA0170.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501::9) To DS7PR03MB5608.namprd03.prod.outlook.com (2603:10b6:5:2c9::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 161fdfa6-5af9-4ded-dfd1-08da2399e645 X-MS-TrafficTypeDiagnostic: BN7PR03MB3649:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bGhWpL3wjHR52MNL7jnHfNnqzjjuQg7qlczAlmzRalkN3+Ew5ngFNFks9yy3VSwTfbBsrpsOFDy6iQApMk/InP4FDXQkdtqUSeoXTQmGaXfzjVDU0Vfi4XtGLq35/cmZjpc5ulkZc9smBFr/MhPDKMwPptedHHyXS/PRoLS0mIG1WOoVjLmcK49KpqwkyhfA45n98TtQrxwTGH+pUJct6TRJJjTQcWxSg1tgH/2sUpo+pVJb9JYofmX1QQ6TOWNo6roQvaQ+XMSNJnXYhF5udHPaTBXRSxaaeEfnIBJPm5Nhp9vHlfii8TVU79l3EoYyUuueYuO8JVFOb1ct7BSYvmzL9/3uhy3hvmx/xJgJo63GACWgl5vIsLsZwXvq0UjIvWQJ0miP2MB7UIyFzR6y7su175Ewsa8oFaPo5gqzigTzTPPrbVbHqK4v6l6e1m6ALBVgQejoRu4EpD/1UB+yoAosWWRfSFgxqj5j3xQRebL+Ei8LNgClEbhWvSswxBSR8DnxT4OnllOFJaLpcLX7LswA7atwJSYj9L1ZC9IyHPOyUVLI2tahoUfh0wWNCr1KzOS/VD7E5Af9V3DmvQMQdp/kJSC99KgBG7qakFwL98tuuRBPKS16RlDQAHnJlsvO2B5BUpm4RCO9J5F+gL6Sfg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR03MB5608.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(186003)(6666004)(1076003)(6512007)(316002)(26005)(36756003)(54906003)(6916009)(2616005)(2906002)(6506007)(8676002)(4326008)(83380400001)(38100700002)(82960400001)(8936002)(66476007)(66556008)(66946007)(86362001)(6486002)(5660300002)(508600001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Z/onOe6vnoxJfGyojrhcN4ehyLUP?= =?utf-8?q?SpP5Bj3PuR/Z+8lX4foR3yP8bAeiXGxsfpj0JMjRqFPZedMQ0XJIwmtqoOLyf89+E?= =?utf-8?q?joS8W/D/zbQic4CBuHtKPp0xZKBXaEaryEJpOSGs5pCfwmRITrDnIhTFmW2hnnZ6K?= =?utf-8?q?ur8fV9zBxj0+0Khu72JbeipcUnmhVSFUyKP4xp7JaukYk+Wh0NEZzTytFFn6ZKUGp?= =?utf-8?q?/LbosV+G35wXH68EyduwJtzkP19awn9VQQalIOioVR73Ke1hLTlvu5r4emLN6VZ5Z?= =?utf-8?q?MP35yu3MlPDcndFY1HPtT66kWjQyUJFAGkL2Yfk7ixbBALIYINuFefZyrJAfywb9x?= =?utf-8?q?pxQ9NKALazO8kITFEDEdKp65FCyWIYF7GViuVavzPD2KGbWJGrMHl9fPd4nl2MUVU?= =?utf-8?q?pkhWWmShuZ55dXQbPi9szdZy9zH5UWY/twcEcsPJo+tHkEKwk0cwbNB3uLpi4HQHj?= =?utf-8?q?A4o/kSpMSDwmL7uUPwJ92094393d/E2qQQyZlOUUb7wDLyv47HwsXSwMSDSRvo1An?= =?utf-8?q?aJLOw/ALev6D9qzLugAOgBAPO3tAHV2RJXrS14UrOSgdG2+2/CgpAHeLBwYa4f8be?= =?utf-8?q?q2+XGQd+ZUoR+JtAGokzQDY71SjG46a80I/4DTUG4JR9RTdu0oIuSiv++YHIluzAj?= =?utf-8?q?4r38K5uwnufNKo5+JmasBbk/xDR7tMP6pQaCOp6FpJtS/9xWGXVvK38SIF0PmEfUF?= =?utf-8?q?LdW53eP8nwfxxtwoMR76QWX7A3VQDpHJ8x9xg5MWA3i8q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94lvKiFGfV4Sfk?= =?utf-8?q?KHCYPAwMvYFBKQkmrUmFrTeSD3A7lGztHUHqjzWWbFLyg938mPSiY=3D?= X-OriginatorOrg: citrix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 161fdfa6-5af9-4ded-dfd1-08da2399e645 X-MS-Exchange-CrossTenant-AuthSource: DS7PR03MB5608.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Apr 2022 13:21:52.9454 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: cF16NhysOp9sAQaW14Y9M8OnJ0cZZzvZfHBSZhN90sdvHr8XAT1LHWF0re7NKCI9jGJ8M2UCfbWzJ1CdvPneyQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR03MB3649 Allow disabling (masking) IO-APIC pins set to edge trigger mode. This is required in order to safely migrate such interrupts between CPUs, as the write to update the IO-APIC RTE (or the IRTE) is not done atomically, so there's a window where there's a mismatch between the destination CPU and the vector: (XEN) CPU1: No irq handler for vector b5 (IRQ -11, LAPIC) (XEN) IRQ10 a=0002[0002,0008] v=bd[b5] t=IO-APIC-edge s=00000030 The main risk with masking edge triggered interrupts is losing them, but getting them injected while in the process of updating the RTE is equally harmful as the interrupts gets lost anyway. Signed-off-by: Roger Pau Monné --- xen/arch/x86/io_apic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c index c086f40f63..2e5964640b 100644 --- a/xen/arch/x86/io_apic.c +++ b/xen/arch/x86/io_apic.c @@ -1782,7 +1782,7 @@ static hw_irq_controller ioapic_edge_type = { .startup = startup_edge_ioapic_irq, .shutdown = irq_shutdown_none, .enable = unmask_IO_APIC_irq, - .disable = irq_disable_none, + .disable = mask_IO_APIC_irq, .ack = ack_edge_ioapic_irq, .set_affinity = set_ioapic_affinity_irq, };