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: <636a680eb85aded76dd765ba297347ceadc3d1a4.camel@infradead.org>
Date:   Fri, 06 May 2022 08:16:41 +0100
From:   David Woodhouse <dwmw2@...radead.org>
To:     "Tian, Kevin" <kevin.tian@...el.com>,
        Baolu Lu <baolu.lu@...ux.intel.com>,
        Steve Wahl <steve.wahl@....com>,
        "Rodel, Jorg" <jroedel@...e.de>,
        Kyung Min Park <kyung.min.park@...el.com>,
        Will Deacon <will@...nel.org>,
        "iommu@...ts.linux-foundation.org" <iommu@...ts.linux-foundation.org>
Cc:     Mike Travis <mike.travis@....com>,
        Dimitri Sivanich <sivanich@....com>,
        "Anderson, Russ" <russ.anderson@....com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] iommu/vt-d: Increase DMAR_UNITS_SUPPORTED

On Fri, 2022-05-06 at 06:49 +0000, Tian, Kevin wrote:
> > From: Baolu Lu <baolu.lu@...ux.intel.com>
> > 
> > > --- a/include/linux/dmar.h
> > > +++ b/include/linux/dmar.h
> > > @@ -19,7 +19,7 @@
> > >   struct acpi_dmar_header;
> > > 
> > >   #ifdef	CONFIG_X86
> > > -# define	DMAR_UNITS_SUPPORTED	MAX_IO_APICS
> > > +# define	DMAR_UNITS_SUPPORTED	640
> > >   #else
> > >   # define	DMAR_UNITS_SUPPORTED	64
> > >   #endif
> 
> ... is it necessary to permanently do 10x increase which wastes memory
> on most platforms which won't have such need.

I was just looking at that. It mostly adds about 3½ KiB to each struct
dmar_domain.

I think the only actual static array is the dmar_seq_ids bitmap which
grows to 640 *bits* which is fairly negligible, and the main growth is
that it adds about 3½ KiB to each struct dmar_domain for the
iommu_refcnt[] and iommu_did[] arrays.

> Does it make more sense to have a configurable approach similar to
> CONFIG_NR_CPUS? or even better can we just replace those static
> arrays with dynamic allocation so removing this restriction
> completely?

Hotplug makes that fun, but I suppose you only need to grow the array
in a given struct dmar_domain if you actually add a device to it that's
behind a newly added IOMMU. I don't know if the complexity of making it
fully dynamic is worth it though. We could make it a config option,
and/or a command line option (perhaps automatically derived from
CONFIG_NR_CPUS).

If it wasn't for hotplug, I think we'd know the right number by the
time we actually need it anyway, wouldn't we? Can we have a heuristic
for how many DMAR units are likely to be hotplugged? Is it as simple as
the ratio of present to not-yet-present CPUs in MADT?


> another nit: dmar is intel specific thus CONFIG_X86 is always true.

DMAR exists on IA64 too.

Download attachment "smime.p7s" of type "application/pkcs7-signature" (5965 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ