All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Ethan Zhao <haifeng.zhao@linux.intel.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: Re: [PATCH v14 3/3] iommu/vt-d: improve ITE fault handling if target device isn't present
Date: Tue, 5 Mar 2024 03:42:16 +0800	[thread overview]
Message-ID: <202403050307.IC7JKfyl-lkp@intel.com> (raw)
In-Reply-To: <20240301080727.3529832-4-haifeng.zhao@linux.intel.com>

Hi Ethan,

kernel test robot noticed the following build errors:

[auto build test ERROR on e60bf5aa1a74c0652cd12d0cdc02f5c2b5fe5c74]

url:    https://github.com/intel-lab-lkp/linux/commits/Ethan-Zhao/PCI-make-pci_dev_is_disconnected-helper-public-for-other-drivers/20240301-161016
base:   e60bf5aa1a74c0652cd12d0cdc02f5c2b5fe5c74
patch link:    https://lore.kernel.org/r/20240301080727.3529832-4-haifeng.zhao%40linux.intel.com
patch subject: [PATCH v14 3/3] iommu/vt-d: improve ITE fault handling if target device isn't present
config: x86_64-randconfig-r052-20240304 (https://download.01.org/0day-ci/archive/20240305/202403050307.IC7JKfyl-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240305/202403050307.IC7JKfyl-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202403050307.IC7JKfyl-lkp@intel.com/

All errors (new ones prefixed by >>):

   ld: vmlinux.o: in function `qi_check_fault':
>> drivers/iommu/intel/dmar.c:1346: undefined reference to `device_rbtree_find'


vim +1346 drivers/iommu/intel/dmar.c

  1271	
  1272	static int qi_check_fault(struct intel_iommu *iommu, int index, int wait_index)
  1273	{
  1274		u32 fault;
  1275		int head, tail;
  1276		u64 iqe_err, ite_sid;
  1277		struct device *dev = NULL;
  1278		struct q_inval *qi = iommu->qi;
  1279		int shift = qi_shift(iommu);
  1280	
  1281		if (qi->desc_status[wait_index] == QI_ABORT)
  1282			return -EAGAIN;
  1283	
  1284		fault = readl(iommu->reg + DMAR_FSTS_REG);
  1285		if (fault & (DMA_FSTS_IQE | DMA_FSTS_ITE | DMA_FSTS_ICE))
  1286			qi_dump_fault(iommu, fault);
  1287	
  1288		/*
  1289		 * If IQE happens, the head points to the descriptor associated
  1290		 * with the error. No new descriptors are fetched until the IQE
  1291		 * is cleared.
  1292		 */
  1293		if (fault & DMA_FSTS_IQE) {
  1294			head = readl(iommu->reg + DMAR_IQH_REG);
  1295			if ((head >> shift) == index) {
  1296				struct qi_desc *desc = qi->desc + head;
  1297	
  1298				/*
  1299				 * desc->qw2 and desc->qw3 are either reserved or
  1300				 * used by software as private data. We won't print
  1301				 * out these two qw's for security consideration.
  1302				 */
  1303				memcpy(desc, qi->desc + (wait_index << shift),
  1304				       1 << shift);
  1305				writel(DMA_FSTS_IQE, iommu->reg + DMAR_FSTS_REG);
  1306				pr_info("Invalidation Queue Error (IQE) cleared\n");
  1307				return -EINVAL;
  1308			}
  1309		}
  1310	
  1311		/*
  1312		 * If ITE happens, all pending wait_desc commands are aborted.
  1313		 * No new descriptors are fetched until the ITE is cleared.
  1314		 */
  1315		if (fault & DMA_FSTS_ITE) {
  1316			head = readl(iommu->reg + DMAR_IQH_REG);
  1317			head = ((head >> shift) - 1 + QI_LENGTH) % QI_LENGTH;
  1318			head |= 1;
  1319			tail = readl(iommu->reg + DMAR_IQT_REG);
  1320			tail = ((tail >> shift) - 1 + QI_LENGTH) % QI_LENGTH;
  1321	
  1322			/*
  1323			 * SID field is valid only when the ITE field is Set in FSTS_REG
  1324			 * see Intel VT-d spec r4.1, section 11.4.9.9
  1325			 */
  1326			iqe_err = dmar_readq(iommu->reg + DMAR_IQER_REG);
  1327			ite_sid = DMAR_IQER_REG_ITESID(iqe_err);
  1328	
  1329			writel(DMA_FSTS_ITE, iommu->reg + DMAR_FSTS_REG);
  1330			pr_info("Invalidation Time-out Error (ITE) cleared\n");
  1331	
  1332			do {
  1333				if (qi->desc_status[head] == QI_IN_USE)
  1334					qi->desc_status[head] = QI_ABORT;
  1335				head = (head - 2 + QI_LENGTH) % QI_LENGTH;
  1336			} while (head != tail);
  1337	
  1338			/*
  1339			 * If device was released or isn't present, no need to retry
  1340			 * the ATS invalidate request anymore.
  1341			 *
  1342			 * 0 value of ite_sid means old VT-d device, no ite_sid value.
  1343			 * see Intel VT-d spec r4.1, section 11.4.9.9
  1344			 */
  1345			if (ite_sid) {
> 1346				dev = device_rbtree_find(iommu, ite_sid);
  1347				if (!dev || !dev_is_pci(dev) ||
  1348					!pci_device_is_present(to_pci_dev(dev)))
  1349					return -ETIMEDOUT;
  1350			}
  1351			if (qi->desc_status[wait_index] == QI_ABORT)
  1352				return -EAGAIN;
  1353		}
  1354	
  1355		if (fault & DMA_FSTS_ICE) {
  1356			writel(DMA_FSTS_ICE, iommu->reg + DMAR_FSTS_REG);
  1357			pr_info("Invalidation Completion Error (ICE) cleared\n");
  1358		}
  1359	
  1360		return 0;
  1361	}
  1362	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

  reply	other threads:[~2024-03-04 19:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-01  8:07 [PATCH v14 0/3] fix vt-d hard lockup when hotplug ATS capable device Ethan Zhao
2024-03-01  8:07 ` [PATCH v14 1/3] PCI: make pci_dev_is_disconnected() helper public for other drivers Ethan Zhao
2024-03-01  8:07 ` [PATCH v14 2/3] iommu/vt-d: don't issue ATS Invalidation request when device is disconnected Ethan Zhao
2024-03-01  8:07 ` [PATCH v14 3/3] iommu/vt-d: improve ITE fault handling if target device isn't present Ethan Zhao
2024-03-04 19:42   ` kernel test robot [this message]
2024-03-05 12:00 ` [PATCH v14 0/3] fix vt-d hard lockup when hotplug ATS capable device Baolu Lu

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=202403050307.IC7JKfyl-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=haifeng.zhao@linux.intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.