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, 3 Jan 2012 09:26:27 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	Alan Cox <alan@...rguk.ukuu.org.uk>
Cc:	Jack Stone <jwjstone@...tmail.fm>,
	Matthew Garrett <mjg@...hat.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Alan Stern <stern@...land.harvard.edu>,
	Oliver Neukum <oliver@...kum.org>,
	Dave Jones <davej@...hat.com>,
	Linux Kernel <linux-kernel@...r.kernel.org>,
	Larry Finger <Larry.Finger@...inger.net>,
	Chaoming Li <chaoming_li@...lsil.com.cn>,
	"John W. Linville" <linville@...driver.com>,
	Greg Kroah-Hartman <gregkh@...e.de>,
	USB list <linux-usb@...r.kernel.org>,
	Linux Wireless List <linux-wireless@...r.kernel.org>
Subject: Re: loading firmware while usermodehelper disabled.


* Alan Cox <alan@...rguk.ukuu.org.uk> wrote:

> > You mensioned earlier about not being able to tell the 
> > difference between a device that needs firmware and one that 
> > needs flash (e.g. they use exactly the same ids). It doesn't 
> > really matter - we just assume that it might need firmware 
> > and load it anyway. It uses more memory but is robust.
> 
> We only need to do that for the devices where order and not 
> blocking matters. There are a few (and some are video) where 
> the firmware sizes is megabytes, which on an embedded 
> controlling device is not acceptable. I don't believe any of 
> them are things where simply delaying the restoration will 
> cause problems however - its video, and DVB and the like not 
> wireless or serial.

Here's the size histogram/analysis of all *.fw, *.bin, *.dat, 
*.ucode, etc. files in /lib/firmware on a fully populated 
distro:

 476 firmware blobs total

The toplist:

 -rw-r--r--. 1 root root 2786404 Jul 24  2010 ./bcm70012fw.bin
 -rw-r--r--. 1 root root 1781048 Feb  9  2011 ./phanfw.bin
 -rw-r--r--. 1 root root  864276 Jul 24  2010 ./bcm70015fw.bin
 -rw-r--r--. 1 root root  844980 Feb  8  2011 ./asihpi/dsp6200.bin
 -rw-r--r--. 1 root root  636980 Feb  8  2011 ./asihpi/dsp6600.bin
 -rw-r--r--. 1 root root  627696 Feb  8  2011 ./asihpi/dsp6400.bin
 -rw-r--r--. 1 root root  563592 Aug  4 22:04 ./myri10ge_rss_ethp_z8e.dat
 -rw-r--r--. 1 root root  553192 Aug  4 22:04 ./myri10ge_rss_eth_z8e.dat
 -rw-r--r--. 1 root root  504916 Feb  8  2011 ./asihpi/dsp8900.bin
 -rw-r--r--. 1 root root  498128 Sep  7 20:14 ./ct2fw.bin

 - 2% of them, i.e. just a tiny fraction is over 512 KB.
 - 80% of the firmware blobs are below 100K.
 - 50% of them are below 16K.

So loading them into RAM is the obviously right solution.

Those few devices that absolutely want to load the firmware blob 
dynamically on some weird low-RAM system can do so *BEFORE* 
suspending.

There is nothing that prevents a low-RAM system from loading the 
firmware blob in an early suspend callback and making sure it's 
there at resume time - and then unloading it from RAM after 
resume.

I.e. large blobs can manage their RAM usage just fine - but the 
obscenity of the 1% should not control the design and sanity of 
the 99% case ...

> [...]
> 
> The world is heading this way more and more. It's moving from 
> the old PC model of 'user closes lid, clunk for 15 seconds, 
> enter suspend, user opens lid, churn churn, video, churn 
> clunk. resume' to suspend/resume being so fast it happens 
> between keystrokes.

Exactly!

Thanks,

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