[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 3/3] VT-d: conditionalize IOTLB register offset check


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 23 Nov 2021 14:40:22 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • 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=GlPYVPHHKY0fQf4fXHxR88XAwYQ3msowxF+8PXwpKEI=; b=krGXBSTXg6qwRPtca0mBQdDsmCbspKtZskIEUMfzOcF3I+8A+tQm2AeTfVSj55zoyCBSyj0kSwd8JF1y343PxzZQT8pgJ2763x7XSTeILvJl7EpHy8YCB6vClsZnr0R6VBHb48meKN2OfqXG6oH6kOfUYKmEpf8SIl+/HYZS3oqQqQO+FCCvDjcnWUaFAtnRKkwelMV6x9OMSo42RSDxh6zgQFYahlbvWQpkoW5qMsdox3i9/rSISvrezXmbW4VA76Hhp6AR5VvvtR/8jJGbNyOavBGKvhbrLu3e/94bCfYyqccr6ME0bDsFBZTsSgFvYLM7YRuRcfr3FVezKxMHGA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e3OXwlBXBA1tw7vEgUymdKuo1o5wqWQciBxJjY/2bke63RZqF7BUb5CjoR3nQlAIPxjWBYEmG+R8U1ValllOgy6iK1zEhDd4Wah8SmdnjkLmrDZHxlEWxhAPvU6BXCI4sg89daJilebanLB3wsnl52jhIp1CK/3HrQ8KQMXjFL0mcCc8xrzchRMOTUcQ5VHAjKICM3IItBfykZ3HoW7jNcp/duiIgAzw9DVTCRrDL2Dtb85IcMzDCmY5B78J/9+NimK4D2IJNMXbDQ8BH8vi1NijgXRUzQPkhC4tu2ChO260dneEwZjbUjTNjUUebhM61b7EsAUuAPWVZjg9ofq0ig==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Kevin Tian <kevin.tian@xxxxxxxxx>
  • Delivery-date: Tue, 23 Nov 2021 13:40:37 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

As of commit 6773b1a7584a ("VT-d: Don't assume register-based
invalidation is always supported") we don't (try to) use register based
invalidation anymore when that's not supported by hardware. Hence
there's also no point in the respective check, avoiding pointless IOMMU
initialization failure. After all the spec (version 3.3 at the time of
writing) doesn't say what the respective Extended Capability Register
field would contain in such a case.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1228,7 +1228,8 @@ int __init iommu_alloc(struct acpi_drhd_
 
     if ( cap_fault_reg_offset(iommu->cap) +
          cap_num_fault_regs(iommu->cap) * PRIMARY_FAULT_REG_LEN > PAGE_SIZE ||
-         ecap_iotlb_offset(iommu->ecap) >= PAGE_SIZE )
+         (has_register_based_invalidation(iommu) &&
+          ecap_iotlb_offset(iommu->ecap) >= PAGE_SIZE) )
     {
         printk(XENLOG_ERR VTDPREFIX "IOMMU: unsupported\n");
         print_iommu_regs(drhd);




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.