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]
Date:	Tue, 19 Jun 2007 16:32:23 -0700 (PDT)
From:	Christoph Lameter <clameter@....com>
To:	"Keshavamurthy, Anil S" <anil.s.keshavamurthy@...el.com>
cc:	akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
	ak@...e.de, gregkh@...e.de, muli@...ibm.com,
	suresh.b.siddha@...el.com, arjan@...ux.intel.com,
	ashok.raj@...el.com, davem@...emloft.net
Subject: Re: [Intel IOMMU 05/10] Intel IOMMU driver

On Tue, 19 Jun 2007, Keshavamurthy, Anil S wrote:

> +static inline void *alloc_pgtable_page(void)
> +{
> +	return (void *)get_zeroed_page(GFP_ATOMIC);
> +}

Need to pass gfp_t parameter. Repeates a couple of times.

> +	addr &= (((u64)1) << addr_width) - 1;
> +	parent = domain->pgd;
> +
> +	spin_lock_irqsave(&domain->mapping_lock, flags);
> +	while (level > 0) {
> +		void *tmp_page;
> +
> +		offset = address_level_offset(addr, level);
> +		pte = &parent[offset];
> +		if (level == 1)
> +			break;
> +
> +		if (!dma_pte_present(*pte)) {
> +			tmp_page = alloc_pgtable_page();

Is it not possible here to drop the lock and do the alloc with GFP_KERNEL 
and deal with the resulting race? That is done in other parts of the 
kernel.

> +/* iommu handling */
> +static int iommu_alloc_root_entry(struct intel_iommu *iommu)
> +{
> +	struct root_entry *root;
> +	unsigned long flags;
> +
> +	root = (struct root_entry *)alloc_pgtable_page();

This may be able to become a GFP_KERNEL alloc since interrupts are enabled 
at this point?

> +int __init init_dmars(void)
> +{
> +	struct dmar_drhd_unit *drhd;
> +	struct dmar_rmrr_unit *rmrr;
> +	struct pci_dev *pdev;
> +	struct intel_iommu *iommu;
> +	int ret, unit = 0;
> +
> +	/*
> +	 * for each drhd
> +	 *    allocate root
> +	 *    initialize and program root entry to not present
> +	 * endfor
> +	 */
> +	for_each_drhd_unit(drhd) {
> +		if (drhd->ignored)
> +			continue;
> +		iommu = alloc_iommu(drhd);

GFP_KERNEL alloc possible?

> +{
> +	int ret = 0;
> +
> +	iommu_devinfo_cache = kmem_cache_create("iommu_devinfo",
> +					 sizeof(struct device_domain_info),
> +					 0,
> +					 SLAB_HWCACHE_ALIGN,
> +					 NULL,

Replace by

iommu_devinfo_cache = KMEM_CACHE(iommu_devinfo, SLAB_HWCACHE_ALIGN)

> +static inline int iommu_iova_cache_init(void)
> +{
> +	int ret = 0;
> +
> +	iommu_iova_cache = kmem_cache_create("iommu_iova",
> +					 sizeof(struct iova),
> +					 0,
> +					 SLAB_HWCACHE_ALIGN,
> +					 NULL,
> +					 NULL);

Ditto

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ