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:	Thu, 10 Jul 2008 14:54:39 +0200
From:	Joerg Roedel <joerg.roedel@....com>
To:	Andrew Morton <akpm@...ux-foundation.org>
CC:	tglx@...utronix.de, mingo@...hat.com, linux-kernel@...r.kernel.org,
	iommu@...ts.linux-foundation.org, bhavna.sarathy@....com,
	Sebastian.Biemueller@....com, robert.richter@....com,
	joro@...tes.org
Subject: Re: [PATCH 22/34] AMD IOMMU: add domain allocation and deallocation functions

On Wed, Jul 09, 2008 at 07:14:59PM -0700, Andrew Morton wrote:
> On Thu, 26 Jun 2008 21:27:58 +0200 Joerg Roedel <joerg.roedel@....com> wrote:
> 
> > +static u16 domain_id_alloc(void)
> > +{
> > +	unsigned long flags;
> > +	int id;
> > +
> > +	write_lock_irqsave(&amd_iommu_devtable_lock, flags);
> > +	id = find_first_zero_bit(amd_iommu_pd_alloc_bitmap, MAX_DOMAIN_ID);
> > +	BUG_ON(id == 0);
> > +	if (id > 0 && id < MAX_DOMAIN_ID)
> > +		__set_bit(id, amd_iommu_pd_alloc_bitmap);
> > +	else
> > +		id = 0;
> > +	write_unlock_irqrestore(&amd_iommu_devtable_lock, flags);
> > +
> > +	return id;
> > +}
> 
> Presumably this is not performance-critical.  If it is, an IDR
> tree would help.

No, its not performance critical. Domain id allocation is only done at
IOMMU initialization currently. In the future it may also be used at
virtual machine creation when we have device passthrough for KVM.

Joerg

-- 
           |           AMD Saxony Limited Liability Company & Co. KG
 Operating |         Wilschdorfer Landstr. 101, 01109 Dresden, Germany
 System    |                  Register Court Dresden: HRA 4896
 Research  |              General Partner authorized to represent:
 Center    |             AMD Saxony LLC (Wilmington, Delaware, US)
           | General Manager of AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy

--
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