mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Baoquan He <bhe@redhat.com>
Cc: kbuild-all@01.org, jroedel@suse.de,
	iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org,
	Baoquan He <bhe@redhat.com>
Subject: Re: [PATCH v8 11/13] iommu/amd: Don't copy GCR3 table root pointer
Date: Mon, 24 Jul 2017 06:33:54 +0800	[thread overview]
Message-ID: <201707240618.mJ6b2eHv%fengguang.wu@intel.com> (raw)
In-Reply-To: <1500627551-12930-12-git-send-email-bhe@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 7065 bytes --]

Hi Baoquan,

[auto build test WARNING on iommu/next]
[also build test WARNING on v4.13-rc1]
[cannot apply to next-20170721]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Baoquan-He/Fix-the-on-flight-DMA-issue-on-system-with-amd-iommu/20170724-060048
base:   https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git next
config: x86_64-randconfig-x005-201730 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   drivers//iommu/amd_iommu_v2.c: In function 'ppr_notifier':
>> drivers//iommu/amd_iommu_v2.c:566:6: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
     int ret;
         ^~~

vim +/ret +566 drivers//iommu/amd_iommu_v2.c

028eeacc Joerg Roedel    2011-11-24  556  
028eeacc Joerg Roedel    2011-11-24  557  static int ppr_notifier(struct notifier_block *nb, unsigned long e, void *data)
028eeacc Joerg Roedel    2011-11-24  558  {
028eeacc Joerg Roedel    2011-11-24  559  	struct amd_iommu_fault *iommu_fault;
028eeacc Joerg Roedel    2011-11-24  560  	struct pasid_state *pasid_state;
028eeacc Joerg Roedel    2011-11-24  561  	struct device_state *dev_state;
028eeacc Joerg Roedel    2011-11-24  562  	unsigned long flags;
028eeacc Joerg Roedel    2011-11-24  563  	struct fault *fault;
028eeacc Joerg Roedel    2011-11-24  564  	bool finish;
49f3c23d Baoquan He      2017-07-21  565  	u16 tag, devid;
028eeacc Joerg Roedel    2011-11-24 @566  	int ret;
49f3c23d Baoquan He      2017-07-21  567  	struct iommu_dev_data *dev_data;
49f3c23d Baoquan He      2017-07-21  568  	struct pci_dev *pdev = NULL;
028eeacc Joerg Roedel    2011-11-24  569  
028eeacc Joerg Roedel    2011-11-24  570  	iommu_fault = data;
028eeacc Joerg Roedel    2011-11-24  571  	tag         = iommu_fault->tag & 0x1ff;
028eeacc Joerg Roedel    2011-11-24  572  	finish      = (iommu_fault->tag >> 9) & 1;
028eeacc Joerg Roedel    2011-11-24  573  
49f3c23d Baoquan He      2017-07-21  574  	devid = iommu_fault->device_id;
49f3c23d Baoquan He      2017-07-21  575  	pdev = pci_get_bus_and_slot(PCI_BUS_NUM(devid), devid & 0xff);
49f3c23d Baoquan He      2017-07-21  576  	if (!pdev)
49f3c23d Baoquan He      2017-07-21  577  		return -ENODEV;
49f3c23d Baoquan He      2017-07-21  578  	dev_data = get_dev_data(&pdev->dev);
49f3c23d Baoquan He      2017-07-21  579  
49f3c23d Baoquan He      2017-07-21  580  	/* In kdump kernel pci dev is not initialized yet -> send INVALID */
49f3c23d Baoquan He      2017-07-21  581  	if (translation_pre_enabled(amd_iommu_rlookup_table[devid])
49f3c23d Baoquan He      2017-07-21  582  		&& dev_data->defer_attach) {
49f3c23d Baoquan He      2017-07-21  583  		amd_iommu_complete_ppr(pdev, iommu_fault->pasid,
49f3c23d Baoquan He      2017-07-21  584  				       PPR_INVALID, tag);
49f3c23d Baoquan He      2017-07-21  585  		goto out;
49f3c23d Baoquan He      2017-07-21  586  	}
49f3c23d Baoquan He      2017-07-21  587  
028eeacc Joerg Roedel    2011-11-24  588  	ret = NOTIFY_DONE;
028eeacc Joerg Roedel    2011-11-24  589  	dev_state = get_device_state(iommu_fault->device_id);
028eeacc Joerg Roedel    2011-11-24  590  	if (dev_state == NULL)
028eeacc Joerg Roedel    2011-11-24  591  		goto out;
028eeacc Joerg Roedel    2011-11-24  592  
028eeacc Joerg Roedel    2011-11-24  593  	pasid_state = get_pasid_state(dev_state, iommu_fault->pasid);
53d340ef Joerg Roedel    2014-07-08  594  	if (pasid_state == NULL || pasid_state->invalid) {
028eeacc Joerg Roedel    2011-11-24  595  		/* We know the device but not the PASID -> send INVALID */
028eeacc Joerg Roedel    2011-11-24  596  		amd_iommu_complete_ppr(dev_state->pdev, iommu_fault->pasid,
028eeacc Joerg Roedel    2011-11-24  597  				       PPR_INVALID, tag);
028eeacc Joerg Roedel    2011-11-24  598  		goto out_drop_state;
028eeacc Joerg Roedel    2011-11-24  599  	}
028eeacc Joerg Roedel    2011-11-24  600  
028eeacc Joerg Roedel    2011-11-24  601  	spin_lock_irqsave(&pasid_state->lock, flags);
028eeacc Joerg Roedel    2011-11-24  602  	atomic_inc(&pasid_state->pri[tag].inflight);
028eeacc Joerg Roedel    2011-11-24  603  	if (finish)
028eeacc Joerg Roedel    2011-11-24  604  		pasid_state->pri[tag].finish = true;
028eeacc Joerg Roedel    2011-11-24  605  	spin_unlock_irqrestore(&pasid_state->lock, flags);
028eeacc Joerg Roedel    2011-11-24  606  
028eeacc Joerg Roedel    2011-11-24  607  	fault = kzalloc(sizeof(*fault), GFP_ATOMIC);
028eeacc Joerg Roedel    2011-11-24  608  	if (fault == NULL) {
028eeacc Joerg Roedel    2011-11-24  609  		/* We are OOM - send success and let the device re-fault */
028eeacc Joerg Roedel    2011-11-24  610  		finish_pri_tag(dev_state, pasid_state, tag);
028eeacc Joerg Roedel    2011-11-24  611  		goto out_drop_state;
028eeacc Joerg Roedel    2011-11-24  612  	}
028eeacc Joerg Roedel    2011-11-24  613  
028eeacc Joerg Roedel    2011-11-24  614  	fault->dev_state = dev_state;
028eeacc Joerg Roedel    2011-11-24  615  	fault->address   = iommu_fault->address;
028eeacc Joerg Roedel    2011-11-24  616  	fault->state     = pasid_state;
028eeacc Joerg Roedel    2011-11-24  617  	fault->tag       = tag;
028eeacc Joerg Roedel    2011-11-24  618  	fault->finish    = finish;
b00675b8 Alexey Skidanov 2014-07-08  619  	fault->pasid     = iommu_fault->pasid;
028eeacc Joerg Roedel    2011-11-24  620  	fault->flags     = iommu_fault->flags;
028eeacc Joerg Roedel    2011-11-24  621  	INIT_WORK(&fault->work, do_fault);
028eeacc Joerg Roedel    2011-11-24  622  
028eeacc Joerg Roedel    2011-11-24  623  	queue_work(iommu_wq, &fault->work);
028eeacc Joerg Roedel    2011-11-24  624  
028eeacc Joerg Roedel    2011-11-24  625  	ret = NOTIFY_OK;
028eeacc Joerg Roedel    2011-11-24  626  
028eeacc Joerg Roedel    2011-11-24  627  out_drop_state:
dc88db7e Joerg Roedel    2014-07-08  628  
dc88db7e Joerg Roedel    2014-07-08  629  	if (ret != NOTIFY_OK && pasid_state)
dc88db7e Joerg Roedel    2014-07-08  630  		put_pasid_state(pasid_state);
dc88db7e Joerg Roedel    2014-07-08  631  
028eeacc Joerg Roedel    2011-11-24  632  	put_device_state(dev_state);
028eeacc Joerg Roedel    2011-11-24  633  
028eeacc Joerg Roedel    2011-11-24  634  out:
028eeacc Joerg Roedel    2011-11-24  635  	return ret;
028eeacc Joerg Roedel    2011-11-24  636  }
028eeacc Joerg Roedel    2011-11-24  637  

:::::: The code at line 566 was first introduced by commit
:::::: 028eeacc412a8bebf6711e58629b0cab56a9ba87 iommu/amd: Implement IO page-fault handler

:::::: TO: Joerg Roedel <joerg.roedel@amd.com>
:::::: CC: Joerg Roedel <joerg.roedel@amd.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 25833 bytes --]

  reply	other threads:[~2017-07-23 22:34 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-21  8:58 [PATCH v8 00/13] Fix the on-flight DMA issue on system with amd iommu Baoquan He
2017-07-21  8:58 ` [PATCH v8 01/13] iommu/amd: Detect pre enabled translation Baoquan He
2017-07-27 15:04   ` Joerg Roedel
2017-07-28  2:31     ` Baoquan He
2017-07-21  8:59 ` [PATCH v8 02/13] iommu/amd: add several helper functions Baoquan He
2017-07-27 15:06   ` Joerg Roedel
2017-07-28  2:36     ` Baoquan He
2017-07-31 10:01     ` Baoquan He
2017-07-31 10:07       ` Joerg Roedel
2017-07-21  8:59 ` [PATCH v8 03/13] Revert "iommu/amd: Suppress IO_PAGE_FAULTs in kdump kernel" Baoquan He
2017-07-21  8:59 ` [PATCH v8 04/13] iommu/amd: Define bit fields for DTE particularly Baoquan He
2017-07-21  8:59 ` [PATCH v8 05/13] iommu/amd: Add function copy_dev_tables() Baoquan He
2017-07-27 15:29   ` Joerg Roedel
2017-07-28  3:59     ` Baoquan He
2017-07-21  8:59 ` [PATCH v8 06/13] iommu/amd: copy old trans table from old kernel Baoquan He
2017-07-27 15:38   ` Joerg Roedel
2017-07-28  6:52     ` Baoquan He
2017-07-21  8:59 ` [PATCH v8 07/13] iommu/amd: Do sanity check for irq remap of old dev table entry Baoquan He
2017-07-21  8:59 ` [PATCH v8 08/13] iommu: Add is_attach_deferred call-back to iommu-ops Baoquan He
2017-07-21  8:59 ` [PATCH v8 09/13] iommu/amd: Use is_attach_deferred call-back Baoquan He
2017-07-27 15:53   ` Joerg Roedel
2017-07-28  4:02     ` Baoquan He
2017-07-21  8:59 ` [PATCH v8 10/13] iommu/amd: Allocate memory below 4G for dev table if translation pre-enabled Baoquan He
2017-07-27 15:55   ` Joerg Roedel
2017-07-28  9:06     ` Baoquan He
2017-07-28 11:14       ` Joerg Roedel
2017-07-28 11:15         ` Baoquan He
2017-07-28 11:18           ` Joerg Roedel
2017-07-28 11:26             ` Baoquan He
2017-07-31 10:15       ` Baoquan He
2017-07-31 10:21         ` Joerg Roedel
2017-07-31 10:29           ` Baoquan He
2017-07-21  8:59 ` [PATCH v8 11/13] iommu/amd: Don't copy GCR3 table root pointer Baoquan He
2017-07-23 22:33   ` kbuild test robot [this message]
2017-07-23 23:53     ` Baoquan He
2017-07-27 15:57   ` Joerg Roedel
2017-07-28  9:07     ` Baoquan He
2017-07-21  8:59 ` [PATCH v8 12/13] iommu/amd: Clear out the GV flag when handle deferred domain attach Baoquan He
2017-07-21  8:59 ` [PATCH v8 13/13] iommu/amd: Disable iommu only if amd_iommu=off is specified Baoquan He
2017-07-27 15:58   ` Joerg Roedel
2017-07-28  9:08     ` Baoquan He

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=201707240618.mJ6b2eHv%fengguang.wu@intel.com \
    --to=lkp@intel.com \
    --cc=bhe@redhat.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jroedel@suse.de \
    --cc=kbuild-all@01.org \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®