lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BN9PR11MB52766E5569D115A4762AE9B68CFCA@BN9PR11MB5276.namprd11.prod.outlook.com>
Date:   Mon, 25 Sep 2023 06:54:54 +0000
From:   "Tian, Kevin" <kevin.tian@...el.com>
To:     Lu Baolu <baolu.lu@...ux.intel.com>,
        Joerg Roedel <joro@...tes.org>,
        "Will Deacon" <will@...nel.org>,
        Robin Murphy <robin.murphy@....com>,
        "Jason Gunthorpe" <jgg@...pe.ca>,
        Jean-Philippe Brucker <jean-philippe@...aro.org>,
        Nicolin Chen <nicolinc@...dia.com>
CC:     "Liu, Yi L" <yi.l.liu@...el.com>,
        Jacob Pan <jacob.jun.pan@...ux.intel.com>,
        "iommu@...ts.linux.dev" <iommu@...ts.linux.dev>,
        "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v5 11/12] iommu: Consolidate per-device fault data
 management

> From: Lu Baolu <baolu.lu@...ux.intel.com>
> Sent: Thursday, September 14, 2023 4:57 PM
> 
> +
> +/* Caller must hold a reference of the fault parameter. */
> +static void iopf_put_dev_fault_param(struct iommu_fault_param
> *fault_param)
> +{
> +	struct device *dev = fault_param->dev;
> +	struct dev_iommu *param = dev->iommu;
> +
> +	mutex_lock(&param->lock);
> +	if (WARN_ON(fault_param->users <= 0 ||
> +		    fault_param != param->fault_param)) {
> +		mutex_unlock(&param->lock);
> +		return;
> +	}
> +
> +	if (--fault_param->users == 0) {
> +		param->fault_param = NULL;
> +		kfree(fault_param);
> +		put_device(dev);
> +	}

this could be a helper to be shared with iopf_queue_remove_device().

Reviewed-by: Kevin Tian <kevin.tian@...el.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ