From mboxrd@z Thu Jan 1 00:00:00 1970 From: Miquel Raynal Date: Thu, 3 May 2018 14:56:04 +0200 Subject: [U-Boot] [PATCH v3 25/25] tpm: allow Sandbox to run TPMv2.x commands In-Reply-To: References: <20180502085934.29292-1-miquel.raynal@bootlin.com> <20180502085934.29292-26-miquel.raynal@bootlin.com> Message-ID: <20180503145604.4cdb72b5@xps13> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: u-boot@lists.denx.de Hi Simon, On Wed, 2 May 2018 20:32:55 -0600, Simon Glass wrote: > Hi Miquel, >=20 > On 2 May 2018 at 02:59, Miquel Raynal wrote: > > Sandbx is run in userspace. What is done in baremetal applications like > > U-Boot is using an address in memory which is supposedly free to load > > and store data to it. The user interaction in U-Boot's shell works like > > that and it is hard to find another way to transfer a 'buffer' from one > > side to the other. It is always possible to fill an environment > > variable, but not that easy to use. > > > > Of course our Linux distributions do not allow such salvage accesses and > > Sandbox will simply be killed. To avoid such scenario, it is possible, > > when compiling the Sandbox driver, to allocate some memory so the > > pointer that is given does not point to an unauthorized area anymore. > > This just give the possibility to run all the TPM commands without > > killing Sandbox. > > =20 >=20 > map_sysmem() and map_to_sysmem() are supposed to handle this, assuming > I understand the problem correctly. Thank you very much for this, I searched a better solution to handle it, even asked on #u-boot but ended using these horrible hacks. I will drop this patch and integrate the map_*sysmem() functions as and when appropriate. Thanks, Miqu=C3=A8l --=20 Miquel Raynal, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com