All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lu Baolu <baolu.lu@linux.intel.com>
To: Joerg Roedel <joro@8bytes.org>, Kevin Tian <kevin.tian@intel.com>,
	Ashok Raj <ashok.raj@intel.com>, Liu Yi L <yi.l.liu@intel.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>
Cc: linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org,
	Jason Gunthorpe <jgg@nvidia.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Christoph Hellwig <hch@lst.de>
Subject: [PATCH v2 00/11] iommu/vt-d: Some Intel IOMMU cleanups
Date: Mon, 14 Feb 2022 10:56:53 +0800	[thread overview]
Message-ID: <20220214025704.3184654-1-baolu.lu@linux.intel.com> (raw)

Hi folks,

After a long time of evolution, the drivers/iommu/intel/iommu.c
becomes a bit messy. This series tries to cleanup and refactor
the driver to make it more concise.

It includes,

- Remove some unnecessary code, includes and prototypes;
- Move creating per-device driver data from domain_attach to
  device_probe callback.
- Use an array for global per-device driver data so that they
  could be searched repidly.
- Use the rculist for per-domain device driver data and remove
  the existing spinlock.
- Code style fix.

Your comments are very appreciated.

Best regards,
baolu

Change log:

v1: initial post
 - https://lore.kernel.org/linux-iommu/20220207064142.1092846-1-baolu.lu@linux.intel.com/

v2:
 - Avoid migration of large amounts of code.
 - Split the cleanup patches into separated ones for convenient code
   review.
 - This version of series is available on github:
   https://github.com/LuBaolu/intel-iommu/commits/iommu-vtd-cleanup-v2

Lu Baolu (11):
  iommu/vt-d: Remove intel_iommu::domains
  iommu/vt-d: Remove finding domain in dmar_insert_one_dev_info()
  iommu/vt-d: Remove iova_cache_get/put()
  iommu/vt-d: Remove domain and devinfo mempool
  iommu/vt-d: Remove DEFER_DEVICE_DOMAIN_INFO
  iommu/vt-d: Remove unnecessary includes
  iommu/vt-d: Remove unnecessary prototypes
  iommu/vt-d: Fix indentation of goto labels
  iommu/vt-d: Remove commented code
  iommu/vt-d: Use xarray for global device_domain_info
  iommu/vt-d: Use rculist for per-domain device list

 include/linux/intel-iommu.h   |   6 +-
 drivers/iommu/intel/debugfs.c |  14 +-
 drivers/iommu/intel/iommu.c   | 597 +++++++++-------------------------
 drivers/iommu/intel/pasid.c   |  12 +-
 drivers/iommu/intel/svm.c     |   6 +-
 5 files changed, 165 insertions(+), 470 deletions(-)

-- 
2.25.1

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

WARNING: multiple messages have this Message-ID (diff)
From: Lu Baolu <baolu.lu@linux.intel.com>
To: Joerg Roedel <joro@8bytes.org>, Kevin Tian <kevin.tian@intel.com>,
	Ashok Raj <ashok.raj@intel.com>, Liu Yi L <yi.l.liu@intel.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>
Cc: Robin Murphy <robin.murphy@arm.com>,
	Jason Gunthorpe <jgg@nvidia.com>, Christoph Hellwig <hch@lst.de>,
	iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org,
	Lu Baolu <baolu.lu@linux.intel.com>
Subject: [PATCH v2 00/11] iommu/vt-d: Some Intel IOMMU cleanups
Date: Mon, 14 Feb 2022 10:56:53 +0800	[thread overview]
Message-ID: <20220214025704.3184654-1-baolu.lu@linux.intel.com> (raw)

Hi folks,

After a long time of evolution, the drivers/iommu/intel/iommu.c
becomes a bit messy. This series tries to cleanup and refactor
the driver to make it more concise.

It includes,

- Remove some unnecessary code, includes and prototypes;
- Move creating per-device driver data from domain_attach to
  device_probe callback.
- Use an array for global per-device driver data so that they
  could be searched repidly.
- Use the rculist for per-domain device driver data and remove
  the existing spinlock.
- Code style fix.

Your comments are very appreciated.

Best regards,
baolu

Change log:

v1: initial post
 - https://lore.kernel.org/linux-iommu/20220207064142.1092846-1-baolu.lu@linux.intel.com/

v2:
 - Avoid migration of large amounts of code.
 - Split the cleanup patches into separated ones for convenient code
   review.
 - This version of series is available on github:
   https://github.com/LuBaolu/intel-iommu/commits/iommu-vtd-cleanup-v2

Lu Baolu (11):
  iommu/vt-d: Remove intel_iommu::domains
  iommu/vt-d: Remove finding domain in dmar_insert_one_dev_info()
  iommu/vt-d: Remove iova_cache_get/put()
  iommu/vt-d: Remove domain and devinfo mempool
  iommu/vt-d: Remove DEFER_DEVICE_DOMAIN_INFO
  iommu/vt-d: Remove unnecessary includes
  iommu/vt-d: Remove unnecessary prototypes
  iommu/vt-d: Fix indentation of goto labels
  iommu/vt-d: Remove commented code
  iommu/vt-d: Use xarray for global device_domain_info
  iommu/vt-d: Use rculist for per-domain device list

 include/linux/intel-iommu.h   |   6 +-
 drivers/iommu/intel/debugfs.c |  14 +-
 drivers/iommu/intel/iommu.c   | 597 +++++++++-------------------------
 drivers/iommu/intel/pasid.c   |  12 +-
 drivers/iommu/intel/svm.c     |   6 +-
 5 files changed, 165 insertions(+), 470 deletions(-)

-- 
2.25.1


             reply	other threads:[~2022-02-14  2:58 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-14  2:56 Lu Baolu [this message]
2022-02-14  2:56 ` [PATCH v2 00/11] iommu/vt-d: Some Intel IOMMU cleanups Lu Baolu
2022-02-14  2:56 ` [PATCH v2 01/11] iommu/vt-d: Remove intel_iommu::domains Lu Baolu
2022-02-14  2:56   ` Lu Baolu
2022-02-24 12:58   ` Jason Gunthorpe via iommu
2022-02-24 12:58     ` Jason Gunthorpe
2022-02-14  2:56 ` [PATCH v2 02/11] iommu/vt-d: Remove finding domain in dmar_insert_one_dev_info() Lu Baolu
2022-02-14  2:56   ` Lu Baolu
2022-02-24 12:59   ` Jason Gunthorpe via iommu
2022-02-24 12:59     ` Jason Gunthorpe
2022-02-14  2:56 ` [PATCH v2 03/11] iommu/vt-d: Remove iova_cache_get/put() Lu Baolu
2022-02-14  2:56   ` Lu Baolu
2022-02-24 13:00   ` Jason Gunthorpe via iommu
2022-02-24 13:00     ` Jason Gunthorpe
2022-02-14  2:56 ` [PATCH v2 04/11] iommu/vt-d: Remove domain and devinfo mempool Lu Baolu
2022-02-14  2:56   ` Lu Baolu
2022-02-24 13:01   ` Jason Gunthorpe via iommu
2022-02-24 13:01     ` Jason Gunthorpe
2022-02-14  2:56 ` [PATCH v2 05/11] iommu/vt-d: Remove DEFER_DEVICE_DOMAIN_INFO Lu Baolu
2022-02-14  2:56   ` Lu Baolu
2022-02-14  7:31   ` Christoph Hellwig
2022-02-14  7:31     ` Christoph Hellwig
2022-02-24 13:04   ` Jason Gunthorpe via iommu
2022-02-24 13:04     ` Jason Gunthorpe
2022-02-25  1:55     ` Lu Baolu
2022-02-25  1:55       ` Lu Baolu
2022-02-14  2:56 ` [PATCH v2 06/11] iommu/vt-d: Remove unnecessary includes Lu Baolu
2022-02-14  2:56   ` Lu Baolu
2022-02-14  7:32   ` Christoph Hellwig
2022-02-14  7:32     ` Christoph Hellwig
2022-02-24 13:05   ` Jason Gunthorpe via iommu
2022-02-24 13:05     ` Jason Gunthorpe
2022-02-25  1:56     ` Lu Baolu
2022-02-25  1:56       ` Lu Baolu
2022-02-14  2:57 ` [PATCH v2 07/11] iommu/vt-d: Remove unnecessary prototypes Lu Baolu
2022-02-14  2:57   ` Lu Baolu
2022-02-14  7:32   ` Christoph Hellwig
2022-02-14  7:32     ` Christoph Hellwig
2022-02-24 13:05   ` Jason Gunthorpe via iommu
2022-02-24 13:05     ` Jason Gunthorpe
2022-02-14  2:57 ` [PATCH v2 08/11] iommu/vt-d: Fix indentation of goto labels Lu Baolu
2022-02-14  2:57   ` Lu Baolu
2022-02-14  7:33   ` Christoph Hellwig
2022-02-14  7:33     ` Christoph Hellwig
2022-02-24 13:08   ` Jason Gunthorpe via iommu
2022-02-24 13:08     ` Jason Gunthorpe
2022-02-25  1:57     ` Lu Baolu
2022-02-25  1:57       ` Lu Baolu
2022-02-14  2:57 ` [PATCH v2 09/11] iommu/vt-d: Remove commented code Lu Baolu
2022-02-14  2:57   ` Lu Baolu
2022-02-14  7:34   ` Christoph Hellwig
2022-02-14  7:34     ` Christoph Hellwig
2022-02-16  3:45     ` Tian, Kevin
2022-02-16  3:45       ` Tian, Kevin
2022-02-16  7:11       ` Lu Baolu
2022-02-16  7:11         ` Lu Baolu
2022-02-24 13:09   ` Jason Gunthorpe via iommu
2022-02-24 13:09     ` Jason Gunthorpe
2022-02-25  1:53     ` Lu Baolu
2022-02-25  1:53       ` Lu Baolu
2022-02-14  2:57 ` [PATCH v2 10/11] iommu/vt-d: Use xarray for global device_domain_info Lu Baolu
2022-02-14  2:57   ` Lu Baolu
2022-02-14  7:38   ` Christoph Hellwig
2022-02-14  7:38     ` Christoph Hellwig
2022-02-15  5:54     ` Lu Baolu
2022-02-15  5:54       ` Lu Baolu
2022-02-14 14:00   ` Jason Gunthorpe via iommu
2022-02-14 14:00     ` Jason Gunthorpe
2022-02-15  5:46     ` Lu Baolu
2022-02-15  5:46       ` Lu Baolu
2022-02-14  2:57 ` [PATCH v2 11/11] iommu/vt-d: Use rculist for per-domain device list Lu Baolu
2022-02-14  2:57   ` Lu Baolu

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=20220214025704.3184654-1-baolu.lu@linux.intel.com \
    --to=baolu.lu@linux.intel.com \
    --cc=ashok.raj@intel.com \
    --cc=hch@lst.de \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jacob.jun.pan@linux.intel.com \
    --cc=jgg@nvidia.com \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=yi.l.liu@intel.com \
    /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.