From: Quan Xu <quan.xu@intel.com>
To: xen-devel@lists.xen.org
Cc: Kevin Tian <kevin.tian@intel.com>,
dario.faggioli@citrix.com, Feng Wu <feng.wu@intel.com>,
Jan Beulich <jbeulich@suse.com>, Quan Xu <quan.xu@intel.com>
Subject: [PATCH v2 11/11] vt-d: propagate error up to ME phantom function mapping and unmapping
Date: Mon, 18 Apr 2016 22:00:11 +0800 [thread overview]
Message-ID: <1460988011-17758-12-git-send-email-quan.xu@intel.com> (raw)
In-Reply-To: <1460988011-17758-1-git-send-email-quan.xu@intel.com>
While IOMMU Device-TLB flush timed out, xen calls panic() at present.
However the existing panic() is going to be eliminated, so we must
propagate the IOMMU Device-TLB flush error up to ME phantom function
mapping and unmapping.
Signed-off-by: Quan Xu <quan.xu@intel.com>
CC: Jan Beulich <jbeulich@suse.com>
CC: Kevin Tian <kevin.tian@intel.com>
CC: Feng Wu <feng.wu@intel.com>
---
xen/drivers/passthrough/vtd/extern.h | 2 +-
xen/drivers/passthrough/vtd/quirks.c | 26 ++++++++++++++++----------
2 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/xen/drivers/passthrough/vtd/extern.h b/xen/drivers/passthrough/vtd/extern.h
index cbe0286..d4d37c3 100644
--- a/xen/drivers/passthrough/vtd/extern.h
+++ b/xen/drivers/passthrough/vtd/extern.h
@@ -91,7 +91,7 @@ int is_igd_vt_enabled_quirk(void);
void platform_quirks_init(void);
void vtd_ops_preamble_quirk(struct iommu* iommu);
void vtd_ops_postamble_quirk(struct iommu* iommu);
-void me_wifi_quirk(struct domain *domain, u8 bus, u8 devfn, int map);
+int me_wifi_quirk(struct domain *domain, u8 bus, u8 devfn, int map);
void pci_vtd_quirk(const struct pci_dev *);
bool_t platform_supports_intremap(void);
bool_t platform_supports_x2apic(void);
diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index 49df41d..c6d9a03 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -332,10 +332,11 @@ void __init platform_quirks_init(void)
* assigning Intel integrated wifi device to a guest.
*/
-static void map_me_phantom_function(struct domain *domain, u32 dev, int map)
+static int map_me_phantom_function(struct domain *domain, u32 dev, int map)
{
struct acpi_drhd_unit *drhd;
struct pci_dev *pdev;
+ int rc;
/* find ME VT-d engine base on a real ME device */
pdev = pci_get_pdev(0, 0, PCI_DEVFN(dev, 0));
@@ -343,23 +344,26 @@ static void map_me_phantom_function(struct domain *domain, u32 dev, int map)
/* map or unmap ME phantom function */
if ( map )
- domain_context_mapping_one(domain, drhd->iommu, 0,
- PCI_DEVFN(dev, 7), NULL);
+ rc = domain_context_mapping_one(domain, drhd->iommu, 0,
+ PCI_DEVFN(dev, 7), NULL);
else
- domain_context_unmap_one(domain, drhd->iommu, 0,
- PCI_DEVFN(dev, 7));
+ rc = domain_context_unmap_one(domain, drhd->iommu, 0,
+ PCI_DEVFN(dev, 7));
+
+ return rc;
}
-void me_wifi_quirk(struct domain *domain, u8 bus, u8 devfn, int map)
+int me_wifi_quirk(struct domain *domain, u8 bus, u8 devfn, int map)
{
u32 id;
+ int rc = 0;
id = pci_conf_read32(0, 0, 0, 0, 0);
if ( IS_CTG(id) )
{
/* quit if ME does not exist */
if ( pci_conf_read32(0, 0, 3, 0, 0) == 0xffffffff )
- return;
+ return 0;
/* if device is WLAN device, map ME phantom device 0:3.7 */
id = pci_conf_read32(0, bus, PCI_SLOT(devfn), PCI_FUNC(devfn), 0);
@@ -373,7 +377,7 @@ void me_wifi_quirk(struct domain *domain, u8 bus, u8 devfn, int map)
case 0x423b8086:
case 0x423c8086:
case 0x423d8086:
- map_me_phantom_function(domain, 3, map);
+ rc = map_me_phantom_function(domain, 3, map);
break;
default:
break;
@@ -383,7 +387,7 @@ void me_wifi_quirk(struct domain *domain, u8 bus, u8 devfn, int map)
{
/* quit if ME does not exist */
if ( pci_conf_read32(0, 0, 22, 0, 0) == 0xffffffff )
- return;
+ return 0;
/* if device is WLAN device, map ME phantom device 0:22.7 */
id = pci_conf_read32(0, bus, PCI_SLOT(devfn), PCI_FUNC(devfn), 0);
@@ -399,12 +403,14 @@ void me_wifi_quirk(struct domain *domain, u8 bus, u8 devfn, int map)
case 0x42388086: /* Puma Peak */
case 0x422b8086:
case 0x422c8086:
- map_me_phantom_function(domain, 22, map);
+ rc = map_me_phantom_function(domain, 22, map);
break;
default:
break;
}
}
+
+ return rc;
}
void pci_vtd_quirk(const struct pci_dev *pdev)
--
1.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-04-18 14:00 UTC|newest]
Thread overview: 78+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-18 14:00 [PATCH v2 00/11] Check VT-d Device-TLB flush error Quan Xu
2016-04-18 14:00 ` [PATCH v2 01/11] vt-d: fix the IOMMU flush issue Quan Xu
2016-04-19 6:33 ` Tian, Kevin
2016-04-19 8:33 ` Xu, Quan
2016-04-25 9:22 ` Jan Beulich
2016-04-26 1:17 ` Xu, Quan
2016-04-26 2:18 ` Xu, Quan
2016-04-26 9:10 ` Jan Beulich
2016-04-26 10:15 ` Xu, Quan
2016-04-26 10:52 ` Jan Beulich
2016-04-26 10:58 ` Xu, Quan
2016-04-18 14:00 ` [PATCH v2 02/11] IOMMU: handle IOMMU mapping and unmapping failures Quan Xu
2016-04-19 6:36 ` Tian, Kevin
2016-04-19 6:40 ` Xu, Quan
2016-04-25 9:26 ` Jan Beulich
2016-04-27 14:26 ` Xu, Quan
2016-04-27 15:02 ` Jan Beulich
2016-04-28 1:23 ` Xu, Quan
2016-04-18 14:00 ` [PATCH v2 03/11] IOMMU/MMU: enhance the call trees of IOMMU unmapping and mapping Quan Xu
2016-04-19 6:44 ` Tian, Kevin
2016-04-20 5:27 ` Xu, Quan
2016-04-20 5:44 ` Tian, Kevin
2016-04-20 6:11 ` Jan Beulich
2016-04-20 6:26 ` Xu, Quan
2016-04-25 9:50 ` Jan Beulich
2016-04-27 8:49 ` Xu, Quan
2016-04-27 9:36 ` Jan Beulich
2016-04-27 13:10 ` Xu, Quan
2016-04-27 14:06 ` Jan Beulich
2016-04-27 15:48 ` George Dunlap
2016-04-28 1:18 ` Xu, Quan
2016-04-18 14:00 ` [PATCH v2 04/11] grant_table: avoid unnecessary work during grant table unmapping Quan Xu
2016-04-19 6:46 ` Tian, Kevin
2016-04-19 13:27 ` Xu, Quan
2016-04-20 5:35 ` Tian, Kevin
2016-04-25 9:55 ` Jan Beulich
2016-04-26 6:48 ` Xu, Quan
2016-04-18 14:00 ` [PATCH v2 05/11] vt-d: propagate IOMMU Device-TLB flush error up to IOMMU unmapping Quan Xu
2016-04-19 6:51 ` Tian, Kevin
2016-04-19 7:01 ` Xu, Quan
2016-04-25 10:06 ` Jan Beulich
2016-04-26 6:49 ` Xu, Quan
2016-04-18 14:00 ` [PATCH v2 06/11] vt-d: propagate IOMMU Device-TLB flush error up to IOMMU mapping Quan Xu
2016-04-19 6:53 ` Tian, Kevin
2016-04-18 14:00 ` [PATCH v2 07/11] IOMMU/MMU: propagate IOMMU Device-TLB flush error up to iommu_iotlb_flush{, _all} (top level ones) Quan Xu
2016-04-25 10:19 ` Jan Beulich
2016-04-26 12:23 ` Xu, Quan
2016-04-26 12:48 ` Jan Beulich
2016-04-27 6:21 ` Xu, Quan
2016-04-27 6:31 ` Jan Beulich
2016-04-27 9:08 ` Xu, Quan
2016-04-27 9:38 ` Jan Beulich
2016-04-18 14:00 ` [PATCH v2 08/11] IOMMU: propagate IOMMU Device-TLB flush error up to iommu_iotlb_flush{, _all} (leaf ones) Quan Xu
2016-04-19 6:58 ` Tian, Kevin
2016-04-19 8:58 ` Xu, Quan
2016-04-25 11:39 ` Jan Beulich
2016-04-26 11:50 ` Xu, Quan
2016-04-26 12:51 ` Jan Beulich
2016-04-26 13:20 ` Xu, Quan
2016-04-18 14:00 ` [PATCH v2 09/11] IOMMU: propagate IOMMU Device-TLB flush error up to IOMMU suspending Quan Xu
2016-04-25 11:52 ` Jan Beulich
2016-04-25 13:58 ` Julien Grall
2016-04-25 14:50 ` Xu, Quan
2016-04-26 9:40 ` Julien Grall
2016-04-26 11:28 ` Xu, Quan
2016-04-28 14:14 ` Xu, Quan
2016-04-28 14:36 ` Jan Beulich
2016-04-28 15:03 ` Xu, Quan
2016-04-28 15:12 ` Jan Beulich
2016-04-28 16:08 ` Xu, Quan
2016-04-29 2:20 ` Tian, Kevin
2016-04-29 2:41 ` Xu, Quan
2016-04-29 7:13 ` Jan Beulich
2016-04-29 8:23 ` Xu, Quan
2016-04-18 14:00 ` [PATCH v2 10/11] vt-d: propagate IOMMU Device-TLB flush error up to vt-d hardware initialization Quan Xu
2016-04-18 14:00 ` Quan Xu [this message]
2016-04-25 12:00 ` [PATCH v2 11/11] vt-d: propagate error up to ME phantom function mapping and unmapping Jan Beulich
2016-04-26 10:48 ` Xu, Quan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1460988011-17758-12-git-send-email-quan.xu@intel.com \
--to=quan.xu@intel.com \
--cc=dario.faggioli@citrix.com \
--cc=feng.wu@intel.com \
--cc=jbeulich@suse.com \
--cc=kevin.tian@intel.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).