From patchwork Thu Jul 29 21:51:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 12409961 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 960E0C43214 for ; Thu, 29 Jul 2021 22:34:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7375160F4B for ; Thu, 29 Jul 2021 22:34:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232948AbhG2Weq (ORCPT ); Thu, 29 Jul 2021 18:34:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232559AbhG2Weq (ORCPT ); Thu, 29 Jul 2021 18:34:46 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFA0CC061765; Thu, 29 Jul 2021 15:34:42 -0700 (PDT) Message-ID: <20210729215139.889204656@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1627598079; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L1MWCB/mi8Eqvn+BCAxR2CLfHh9+meprPU/a+pwdFJI=; b=n9wU0n0IwY73C4bhFxrVJ+fQ9oHD8p/CqgAYBIjFv0vifHSlsriOBNs5wFlVahFsdeOygT XsmF+axvuuLpw4Rjb5vhvVGwdUofAQPrlCasuhQv+srhgT/T+HMXwBnrzlq1RkyJ+gRLBi Nv05CLGIgBA/ujcpaQWqpMiqcAFHDNvyPavcNymfntrqRV8gtV5u8SB/AM2YJ2T6lc1riH /E/rVGc94gDsYLGqj7QrvnO4FpmNS2HXLwYCYgiUmx1Xf3avmLkEHVbM+pkIzeXekKPMO+ mjwbWkDU14dO7AELrDQq4RjPk+8YnWrJPaQ559fyslBi1QNHQXEs1qgZPDPjzQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1627598079; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L1MWCB/mi8Eqvn+BCAxR2CLfHh9+meprPU/a+pwdFJI=; b=VvDQJ9HSE98noTCMfJQ8qDwLaEYDJxTcUgeWpgg4nxyMomFzjmRbYrQerGxKtrhW8N01u6 MdwcyOuIrbhHOnDg== Date: Thu, 29 Jul 2021 23:51:39 +0200 From: Thomas Gleixner To: LKML Cc: Alex Williamson , "Raj, Ashok" , "David S. Miller" , Bjorn Helgaas , linux-pci@vger.kernel.org, Kevin Tian , Marc Zyngier , Ingo Molnar , x86@kernel.org, linux-s390@vger.kernel.org, Niklas Schnelle , Gerald Schaefer , Heiko Carstens , Christian Borntraeger Subject: [patch V2 00/19] PCI/MSI, x86: Cure a couple of inconsistencies MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org A recent discussion about the PCI/MSI management for virtio unearthed a violation of the MSI-X specification vs. writing the MSI-X message: under certain circumstances the entry is written without being masked. While looking at that and the related violation of the x86 non-remapped interrupt affinity mechanism a few other issues were discovered by inspection. The following series addresses these. Note this does not fix the virtio issue, but while staring at the above problems I came up with a plan to address this. I'm still trying to convince myself that I can get away without sprinkling locking all over the place, so don't hold your breath that this will materialize tomorrow. The series is also available from git: git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git irq/msi V1 can be found here: https://lore.kernel.org/r/20210721191126.274946280@linutronix.de Changes vs. V1: - Identified and addressed more inconsistencies, especially the lack of serialization for multi-MSI masking - Removed the extra vector masking in S390 - Addressed review comments and picked up tags where applicable - Clean up of the naming of msi_desc::masked as discussed in the V1 thread - Consolidation of the mask/unmask functions Thanks, tglx Reviewed-by: Marc Zyngier Tested-by: Marc Zyngier --- arch/s390/pci/pci_irq.c | 4 arch/x86/kernel/apic/io_apic.c | 6 arch/x86/kernel/apic/msi.c | 11 + arch/x86/kernel/hpet.c | 2 drivers/base/core.c | 1 drivers/pci/msi.c | 274 ++++++++++++++++++++++------------------- include/linux/device.h | 1 include/linux/irq.h | 2 include/linux/msi.h | 10 - kernel/irq/chip.c | 5 10 files changed, 178 insertions(+), 138 deletions(-)