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: <81C3A93C17462B4BBD7E272753C1057924588EE066@EXDCVYMBSTM005.EQ1STM.local>
Date:	Tue, 15 Jan 2013 16:13:45 +0100
From:	Sjur BRENDELAND <sjur.brandeland@...ricsson.com>
To:	Ido Yariv <ido@...ery.com>
Cc:	Ohad Ben-Cohen <ohad@...ery.com>,
	Linus Walleij <linus.walleij@...aro.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Sjur Brændeland <sjur@...ndeland.net>
Subject: RE: [RFCv2 09/11] remoteproc: Add operation to find resource table
 in memory

Hi Ido,

> From: Ido Yariv [mailto:ido@...ery.com]
> > +struct resource_table *rproc_elf_get_rsctab_addr(struct rproc *rproc,
> > +						 const struct firmware *fw)
> > +{
> > +	struct elf32_shdr *shdr;
> > +
> > +	shdr = find_rsc_shdr(&rproc->dev, (struct elf32_hdr *)fw->data);
> > +	if (!shdr)
> > +		return NULL;
> 
> Instead of traversing the headers twice, perhaps we could save the
> address and size in advance and use it here?

To do that we would have to store the struct elf32_shdr in struct rproc.
So this is a trade-off between bloating rproc structure with shdr or 
spending some more cpu-cycles to scan the elf sections.
It shouldn't be that many sections to scan, and as we've just parsed
this firmware sections earlier so it might be hot in cache.
This shouldn't be very expensive, so I'd prefer to keep this as is.

Are you OK with that?

Regards,
Sjur
--
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