From patchwork Thu Apr 21 13:21:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 12821620 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 6FDADC433FE for ; Thu, 21 Apr 2022 13:22:16 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.310169.526839 (Exim 4.92) (envelope-from ) id 1nhWkv-0005H2-Bj; Thu, 21 Apr 2022 13:21:57 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 310169.526839; Thu, 21 Apr 2022 13:21:57 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nhWkv-0005Gv-8T; Thu, 21 Apr 2022 13:21:57 +0000 Received: by outflank-mailman (input) for mailman id 310169; Thu, 21 Apr 2022 13:21:55 +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 1nhWkt-0005Gk-SW for xen-devel@lists.xenproject.org; Thu, 21 Apr 2022 13:21:55 +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 00f9627d-c176-11ec-8fc2-03012f2f19d4; Thu, 21 Apr 2022 15:21:52 +0200 (CEST) Received: from mail-bn8nam12lp2172.outbound.protection.outlook.com (HELO NAM12-BN8-obe.outbound.protection.outlook.com) ([104.47.55.172]) by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 21 Apr 2022 09:21:51 -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:48 +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:48 +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: 00f9627d-c176-11ec-8fc2-03012f2f19d4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1650547314; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=jZyrjLFF7c26fEoKVpZ5U3W1KX5PPxiSRBxQXY3VBOY=; b=XR1XMXW9Mty9Q527f+GEx+CLqddsAaHFjfxNtnzVdG/a+MBCyDqfQ9y8 YBqtY8XRqD0+1HHlIWl1K/mzV0TTIfnR8W+ylp1M1RX6ToQUR6ZNO4OPh BwSvBJTELAEeG/yjFgkuisla4BD/xBbSxvN+0OHqZ4NCzCQwEDbVoKF+R o=; X-IronPort-RemoteIP: 104.47.55.172 X-IronPort-MID: 69628143 X-IronPort-Reputation: None X-IronPort-Listener: OutboundMail X-IronPort-SenderGroup: RELAY_O365 X-IronPort-MailFlowPolicy: $RELAYED IronPort-Data: A9a23:Wi78SKOr1hOd+qXvrR21lsFynXyQoLVcMsEvi/4bfWQNrUpz3zACz GtNUWrSbqmN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WxZVLn9nKzMdFGaW3+4EoAwSprjztSJVqWrWEsjxwiOaz6GwymN 2JmBskN9Qb0QKlQkiF5T/WnyXw2jcn7HHvjXWCh2H4nMD/TDUmT+JcmINwaHLimgYdleA59J gO83OStpJRAx+Ftj/6/cL0WxZjkVfxiWY+kNQUk2dUXeIlGfJsRLQkjQ1o+ao7bWPHANhNKp gvMCic3ocdTbqiVQGXgoE1q+bcHUjaHX+9Mzo/U4KuonprdUtCvjQlLfwk7ws9Ha0GOud5Dp z/Q8JVfZF1P7srhPFGdZA8qfXeMB28fTv8dESvHH/AKIYrf1rwlr+f2sRH2AjtQu1C8KcP X-IronPort-AV: E=Sophos;i="5.90,278,1643691600"; d="scan'208";a="69628143" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EaH5qi5fFEkyBpCF6gUewO3xE1DhH0OoypZ9uf0xjk6nCvD34JgjS3jdXKfU3nNkI561Xv0FdOrsTBkTmvOQrKr/jXeQKss8WNvg1H4AcyEoVzmEWNF/9lvfj9m8nrU6MmysrCWa5gkxglWixuidufAJh+mMT6ebtHj2sVMtWS9AMp4MDyyGeeBsAd/C7WN8KYkSbY4y6EVlVzUbQ/Y256JPF3O1sY9a1S05+J57urOKNsdRFy1hhYh5FAL4RE921Wc4SE2i7Fvl3cDr2DLxJVCOeq/nLaHCVoSaHe8ugV3Mv/DjL+WSlcrk5oIxyXzuGQX9Swby2lMCk/4WZLz70w== 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=p0eLGIcM3P4X+NUpoJY3mSiSpRD256XuFHD/XZ8SoOc=; b=HEPg8uSPqP49OiWpOlhol7Xz3T1HznCLw+kzPbVo8wh5+p9/A/Aequr4eu6QMj5ej6OR87prOpTa3lHRPyjdzJuRw/gK/JqFx9Z5FMkww+CexBy94NiKiqxm8fDAo4DJsGxIM8TFo46/fL4R8KCFgC553uXL7rLwsLBNqNXT5LEJcd5hGsetR/SbZRu3QQkRwnokZGN4RJddPGDuW/szxzzarRZ3K7cWijRQe1slkYDbuvZ/8C3CpiU2h8218wCDKnrfTSkU9+M9qvcBexZr/YishGA1qUyi0+xR6Hz490Lcbr649Q1SU8YcJjOp5wJyt8bwszpf16ixjtF4ujkBnw== 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=p0eLGIcM3P4X+NUpoJY3mSiSpRD256XuFHD/XZ8SoOc=; b=K4fCB+Povrrk/cFCL+DH0nkZ/cnVFVDBLDYP+em/CwNWW4jH/vX+d7QDuajEjS8JZLtFVlHFqF1xSMpIKYBTVNkR1bMLpOPXrvcEQ0PKYs1ioD6CA+6rkGCPg6ibKYieO2CZCdxQvkHHLDccgD+zAUXMaBqWpU/S2CTGOhSxH0s= 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 , Kevin Tian , Paul Durrant Subject: [PATCH RFC 0/6] x86/ioapic: fix edge triggered interrupt migration Date: Thu, 21 Apr 2022 15:21:08 +0200 Message-Id: <20220421132114.35118-1-roger.pau@citrix.com> X-Mailer: git-send-email 2.35.1 X-ClientProxiedBy: MRXP264CA0038.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:14::26) 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: 7eaead84-28d0-4593-54e7-08da2399e399 X-MS-TrafficTypeDiagnostic: BN7PR03MB3649:EE_ X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr 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: V8q2XbyRzlrNNg4Hk35yQ2OTZ8+H7rkawrS9o8soSsMfKwDoiCnLB0MP3sFOgtrz5eAVAwWnn8a988b0PZrQsOHP2utJrl+12Ju0YM0ypD9ZT6m3gVEHCbJY2DSVwUuQBIqsuJWMpog1GlXcO5LKCFpsYDuV4FL16K6L2rLYw8/TYXlNmkGuM4s39oHVEOhN5bM9qblzYX977Lkng0A9cxIg8LiElMxuOw7d6MGXu/BaKlSFmI56IHxWqBjTPvAmFoM2VkQTHV9zOc8jPkwXtTleeysJ4tAWGy2cPqfHJm7+0SBGai2XCn/H5+5WpfnNcOUG2SuL1oLc22Yfc76WUR8SWWj9ZEGSu5mAo/zhMDFYr2yPK8fa8JfOr51xT9F/isyPZYWf67l0YNkmkZ6pLD0L8R1ye62VZAiLJ7JUF1fFhGi1mLRuDiRbCJUgKBityT+DK860x2rl5xoeBDSea6X7A/SS9AiOhZ8yyXaS49F7AdVwLAvjmYiLo9xrVIyvT+T4o839vK76bSIjZ3dLSLyN23HUFzVL6Na8j3/8qnxcCej7FStBDgT6KUOxkYA4iEoknIjC0eeUPQPBjsnWVlEecJZW7UBaQsnhmwOAGq4ANtHbbFkhsmHH0yYcErgvPZ2I6XdmJKiu2qIYWaL3YQ== 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?CECchju/ET34GKeZd0orgR4aDx+3?= =?utf-8?q?05vetP6jgdVl+88VH0VBsAn24tGFp7fFjWqd19q83fzbD2qNNbRZhKbEhw5I273J1?= =?utf-8?q?fbgRShQ2G5sz52PZiiXhPOwlsIULMGh8BXEZF1mbXA93wS3B3kMfgLX1PtsQg7SXb?= =?utf-8?q?OXKchxb54VATjll0882gJCuOOP8J4yANnhodEgEM04/lcGKuJr3zD00SUWAYC18ty?= =?utf-8?q?wT7a7bNZlNnzcwUK+idXbP7b/dRyg1ROvMngRiSYAA+fy+5Va2gktr1/4LKVytrh4?= =?utf-8?q?p0bG6B9AKXMR76JBnknretuP58/4R05gyCYGClKP66agnTUrLDtztiiDob+zZtlfs?= =?utf-8?q?tVU+JIHW1B9zumlyiSL+ppzWtriiU6zpMX7LIm6s/OA229dTuH/eGACtLokGKIXMN?= =?utf-8?q?hnpN07MsRXniWGgQ4BLHSN+aU8YQPDGQJ6t+E7Xcs9Z7K0VoIBzuxNY1IfbEuIm0w?= =?utf-8?q?pGCKTY2TyqMv5+/YKHZkmNJTtgMUPJUDcn8NanxH8cKPaDKoz44VQJ1KGa2tGOmoc?= =?utf-8?q?xC6TKP71QpeU2wwI+JQ0GKjPUELnfKUgY16J6Fc+tdzGEe9u9AXnkZNKDpGgfub7U?= =?utf-8?q?5EFpSfRp2aS/eMNKZXPptvIKcv4nYMa9WXwtcKdEEKGpoZsg5sDjQ8G8/A2N0Xzo5?= =?utf-8?q?QJ7yuT6Ox+R3HT6tsz2IKvaL6VycYGC8gV3AC86fJw1ojwn9H+4frcQBfBsTqO26e?= =?utf-8?q?L6Ks2tpK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b5zA1RRNz23GXGcNtVYTUVbahjlF5gfYJryHHeYCqoA3ogiHz2Cm?= =?utf-8?q?eTuspm/3MOd8r9yc3z6susD8iDBg8rkA=3D=3D?= X-OriginatorOrg: citrix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7eaead84-28d0-4593-54e7-08da2399e399 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:48.4135 (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: QjddaoNO2ao/nfF61A9tq0sNaps8IApB2LCsCZmmOLq2hLL5kcmPvLrfdBT/k8TiDKGykt8srJWC1RzXzeBedw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR03MB3649 Hello, Following series attempts to solve the issue with IO-APIC edge triggered interrupts seeing an inconsistent RTE or IRTE when injected while being migrated. It's currently RFC because some patches have post commit message notes, and because I'm not sure if patch 1 is really needed. I originally had the idea of suggesting to only backport patch 1 in order to fix the issue in older releases, while leaving the more complex (and thus error prone) IOMMU changes in unstable. Note however that patch 1 is just a workaround to prevent interrupts seeing inconsistent entries while being updated, masking the entry just makes the warning go away, but the interrupt will be lost. Thanks, Roger. Roger Pau Monne (6): x86/ioapic: set disable hook for masking edge interrupts x86/ioapic: add a raw field to RTE struct x86/ioapic: RTE modifications must use ioapic_write_entry x86/iommu: pass full IO-APIC RTE for remapping table update amd/iommu: atomically update remapping entries when possible x86/ioapic: mask entry while updating xen/arch/x86/include/asm/io_apic.h | 72 ++++++------- xen/arch/x86/include/asm/iommu.h | 3 +- xen/arch/x86/io_apic.c | 81 ++++++++++----- xen/drivers/passthrough/amd/iommu.h | 2 +- xen/drivers/passthrough/amd/iommu_intr.c | 115 +++++++-------------- xen/drivers/passthrough/vtd/extern.h | 2 +- xen/drivers/passthrough/vtd/intremap.c | 125 +++++++++++------------ xen/drivers/passthrough/x86/iommu.c | 4 +- xen/include/xen/iommu.h | 3 +- 9 files changed, 195 insertions(+), 212 deletions(-)