Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp46505iof; Sun, 5 Jun 2022 20:39:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwmE4uZ26zKUdTTCWOph7lUmdjK/7W8DMvgv+L+lAgw7rpAqa7+lTK1LwY7F120xPOHbdA X-Received: by 2002:a17:902:7c8c:b0:161:f5b4:9aa6 with SMTP id y12-20020a1709027c8c00b00161f5b49aa6mr21867079pll.79.1654486773262; Sun, 05 Jun 2022 20:39:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654486773; cv=none; d=google.com; s=arc-20160816; b=ZSTyOaIA+wn1aC0YIiChrJ6QSOHFGZKrIfvL/lMlefxMmeX+eu82QTlc5d6ExZwJ4K o1R9leqi/5ZAU2xrDH0XuWVfpTP91tuISNhZbgRgWOSNKZJyFnjWxjnGh9GnB9ovHJAG 0gHZDLlw9miryUYHBXBGmoz5UUJDJevFTLQbgZ97poWCBIl33zM7UzGcWoY+UQKpLcr8 fwsY7HHNxWL6lriJGmQF5fwI8lMyUX6e7TiWbHRNGlBnIztn1OttSv+WMHhMSUpske/+ HJYT7LaP3wPhqoGN6qB2Z+VAnMm/YxvPsob0LOka3rm5kHme/4MeQoxlUCnOTqTOQ9zF D55g== 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=GTm+0D4hRkJoRw+DSKM30TFHRyqLMX0ww8xCgDXjp1Q=; b=En0F2OKLhZ1/hCfuVmk0UbVrs95CRiuR8w9J9c9U+/dPFRnC/2xNdlwrCYTGehvjVk 8TOfrGv+UsBFuQVYvDoHNjLckQlG7SOarZlNmgf1gZjyMVgF8C8QgY7SNzS1o0pyKkw4 VX147pJMwsvQl4nXfn6CQy/jcH+JHJKrn445Iq5tdmNttrFloUMRrRWyMtud9ElmOObu uUgwbMIplqgR/ia8161MGfkA8epYToYVT1Ew/BawSJ8RkCnPtpsx8HgTJy7UjP59AzDt sJL1hhOHomtFkmP5URsbXjCgde8qQPOAPH6Ete8/w2d353/DTWNpKHA23OS+xSM8redL DJAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=N0hvMffN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id v71-20020a63894a000000b003fddf6f5bb5si427714pgd.626.2022.06.05.20.39.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 20:39:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=N0hvMffN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 9227F5468C; Sun, 5 Jun 2022 20:36:28 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344688AbiFCRko (ORCPT + 99 others); Fri, 3 Jun 2022 13:40:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344687AbiFCRke (ORCPT ); Fri, 3 Jun 2022 13:40:34 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC02553A44; Fri, 3 Jun 2022 10:40:27 -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 ams.source.kernel.org (Postfix) with ESMTPS id 83BC0B8242C; Fri, 3 Jun 2022 17:40:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F09AAC385B8; Fri, 3 Jun 2022 17:40:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654278025; bh=qQ9iHfZ6wugFmp1WHIWplmKG5JxaDYYR9rPylEzzdDw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N0hvMffNW2nFLTzHEVHFHHhy1Sa1XjvK7onS4Lbt/LrEcGnLkzV2lN+52gaLAu/xc lWXydIwX5pSGHhcc01+0db3c5x10AHQY8YmN0AJJozXR8grCk6adUefzi/gnTR6F8H zO2vRz11+YZQSNLcqbuU7ZikpEi8RlOVbOwH68xg= 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 , Noah Meyerhans Subject: [PATCH 4.14 01/23] x86/pci/xen: Disable PCI/MSI[-X] masking for XEN_HVM guests Date: Fri, 3 Jun 2022 19:39:28 +0200 Message-Id: <20220603173814.409505858@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603173814.362515009@linuxfoundation.org> References: <20220603173814.362515009@linuxfoundation.org> User-Agent: quilt/0.66 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 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 [nmeyerha@amazon.com: backported to 4.14] Signed-off-by: Noah Meyerhans Signed-off-by: Greg Kroah-Hartman --- arch/x86/pci/xen.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/arch/x86/pci/xen.c +++ b/arch/x86/pci/xen.c @@ -442,6 +442,11 @@ void __init xen_msi_init(void) x86_msi.setup_msi_irqs = xen_hvm_setup_msi_irqs; x86_msi.teardown_msi_irq = xen_teardown_msi_irq; + /* + * With XEN PIRQ/Eventchannels in use PCI/MSI[-X] masking is solely + * controlled by the hypervisor. + */ + pci_msi_ignore_mask = 1; } #endif