Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4890054iob; Mon, 9 May 2022 04:11:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxg2z+GyGLbwapbqDZKw8wjBHz4S1ZY3m2xsp77GFqu4Kr/7fwyo6yBZdJRa8Muf8N22NDS X-Received: by 2002:a65:6c0b:0:b0:39d:8c30:4bb9 with SMTP id y11-20020a656c0b000000b0039d8c304bb9mr12682026pgu.411.1652094677767; Mon, 09 May 2022 04:11:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652094677; cv=none; d=google.com; s=arc-20160816; b=GZP2h2S6vjIiRRtpGDfPdPkytij/eOnEoot0BTPLCrek19qvX9yiNR+K1bTmCp4lZY hAUslml7HwZCv+QgOjYyHZZZ+E/GH3ZTlYruo7R24iiw6OTPAHyPkFr5k60vnZYulWCh RRNeGoxjnzDQ0KNnDlhTqwKX/uZFWesHsGTOBYTbDQ7uNP30DVp970WiTmepry5IySvw deQ+yyqY6T/ybj4CogPV2kmErh3Zgk6+KQi9nkEZKQYbsrDAoI9zgGewknHg61pxq8R6 rEZ2g8nCSYJz1Qj8+66fvlvs4BD0AUmfxu1EIBPMT+VtiSuuEpVLAme5jPZemolyaEHg qP6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2skifB7yhiSXdtVruXZ7hf8Iei8i9T0j7kAsVQIYaI0=; b=BZWKzHPd/6BK0BlL37VtUBWxdEjXDegykRLtZ+se9oRhAzVQkWErKDyZI6iRZUK5WD RP9jL1muSCF43uXrrugVZIzT/PRhKOFI4ghHjIxvbg/89lX2EnswhRJ/IiwbKl7d2cex 0jUfKFCK3tTqhJmb4Zy/vpOL6oHYZgZoQ9ujcimLRU/kVbBFQSILWTjNgvjCdGuAqHVw VefuCqez+li8oRj10MbEr0YtU2YSgxDmL23JdCktdJ0s+HcRZvUkhOttXC769Axj/TXr pvLc+/xPlQsnCjpqgkkFGUKa085NHFS0MaiaIh20mVNWls3pCZ4N/QOYw7vFwVtG2pma ag6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=I8QCg4au; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id q18-20020a056a00151200b0050daf6ed35bsi14802475pfu.308.2022.05.09.04.11.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 04:11:17 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=I8QCg4au; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D75B5245622; Mon, 9 May 2022 03:24:02 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239331AbiEDRhx (ORCPT + 99 others); Wed, 4 May 2022 13:37:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356872AbiEDRJr (ORCPT ); Wed, 4 May 2022 13:09:47 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C265B43AF6; Wed, 4 May 2022 09:56:10 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 28AB9CE28AD; Wed, 4 May 2022 16:56:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 53C89C385AF; Wed, 4 May 2022 16:56:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1651683367; bh=+q2s/HQ66eGx5eZW7CMgSoE5sCjAqyFL5yBUXuzj48M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I8QCg4au/CBR3mUI0Y4wpvlu0S3VYpWfEaPYtnlg+Klu+46gtLMyVpT/CtCpLHbeJ IvKwPzKDpOr/rojKtZ3XnItHlUz1rZ+HECA6gJJkd7ftwb3K4/YP+HCaUTOozOuafq 9alGbwXAwODvYZvTDRF24CwbRFzT18hgQSW9pO+E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jeremi Piotrowski , Dusty Mabe , Salvatore Bonaccorso , Thomas Gleixner , Noah Meyerhans Subject: [PATCH 5.17 052/225] x86/pci/xen: Disable PCI/MSI[-X] masking for XEN_HVM guests Date: Wed, 4 May 2022 18:44:50 +0200 Message-Id: <20220504153114.793472327@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220504153110.096069935@linuxfoundation.org> References: <20220504153110.096069935@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thomas Gleixner commit 7e0815b3e09986d2fe651199363e135b9358132a upstream. When a XEN_HVM guest uses the XEN PIRQ/Eventchannel mechanism, then PCI/MSI[-X] masking is solely controlled by the hypervisor, but contrary to XEN_PV guests this does not disable PCI/MSI[-X] masking in the PCI/MSI layer. This can lead to a situation where the PCI/MSI layer masks an MSI[-X] interrupt and the hypervisor grants the write despite the fact that it already requested the interrupt. As a consequence interrupt delivery on the affected device is not happening ever. Set pci_msi_ignore_mask to prevent that like it's done for XEN_PV guests already. Fixes: 809f9267bbab ("xen: map MSIs into pirqs") Reported-by: Jeremi Piotrowski Reported-by: Dusty Mabe Reported-by: Salvatore Bonaccorso Signed-off-by: Thomas Gleixner Tested-by: Noah Meyerhans Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/87tuaduxj5.ffs@tglx Signed-off-by: Greg Kroah-Hartman --- arch/x86/pci/xen.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/arch/x86/pci/xen.c +++ b/arch/x86/pci/xen.c @@ -467,7 +467,6 @@ static __init void xen_setup_pci_msi(voi else xen_msi_ops.setup_msi_irqs = xen_setup_msi_irqs; xen_msi_ops.teardown_msi_irqs = xen_pv_teardown_msi_irqs; - pci_msi_ignore_mask = 1; } else if (xen_hvm_domain()) { xen_msi_ops.setup_msi_irqs = xen_hvm_setup_msi_irqs; xen_msi_ops.teardown_msi_irqs = xen_teardown_msi_irqs; @@ -481,6 +480,11 @@ static __init void xen_setup_pci_msi(voi * in allocating the native domain and never use it. */ x86_init.irqs.create_pci_msi_domain = xen_create_pci_msi_domain; + /* + * With XEN PIRQ/Eventchannels in use PCI/MSI[-X] masking is solely + * controlled by the hypervisor. + */ + pci_msi_ignore_mask = 1; } #else /* CONFIG_PCI_MSI */