<feed xmlns='http://www.w3.org/2005/Atom'>
<title>BMC/Intel-BMC/linux.git/arch/powerpc/platforms/powernv/opal-sysparam.c, branch dev</title>
<subtitle>Intel OpenBMC Linux kernel source tree (mirror)</subtitle>
<id>https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev</id>
<link rel='self' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/'/>
<updated>2015-06-04T12:27:56+00:00</updated>
<entry>
<title>powerpc/powernv: convert OPAL codes returned by sysparam calls</title>
<updated>2015-06-04T12:27:56+00:00</updated>
<author>
<name>Cédric Le Goater</name>
<email>clg@fr.ibm.com</email>
</author>
<published>2015-04-08T07:31:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=14aae78f084af5241476ede8e28b377fc751b191'/>
<id>urn:sha1:14aae78f084af5241476ede8e28b377fc751b191</id>
<content type='text'>
The opal_{get,set}_param calls return internal error codes which need
to be translated in errnos in Linux.

Signed-off-by: Cédric Le Goater &lt;clg@fr.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>powerpc/powernv: Silence SYSPARAM warning on boot</title>
<updated>2015-05-11T10:26:42+00:00</updated>
<author>
<name>Joel Stanley</name>
<email>joel@jms.id.au</email>
</author>
<published>2015-04-30T03:50:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=38c0488770983b2654f075540cc1fc71f55b6df5'/>
<id>urn:sha1:38c0488770983b2654f075540cc1fc71f55b6df5</id>
<content type='text'>
OpenPower BMC machines do not place any sysparams in the device tree, so
at every boot we get a warning:

 [    0.437176] SYSPARAM: Opal sysparam node not found

Remove the warning, and reorder the init so we don't peform allocations
when there is no sysparam node in the device tree.

Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
Acked-by: Neelesh Gupta &lt;neelegup@linux.vnet.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>powernv: Fix permissions on sysparam sysfs entries</title>
<updated>2014-06-11T07:03:15+00:00</updated>
<author>
<name>Anton Blanchard</name>
<email>anton@samba.org</email>
</author>
<published>2014-06-07T01:29:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=1bd098903fda069cb96fe8b5cb4595b46c683385'/>
<id>urn:sha1:1bd098903fda069cb96fe8b5cb4595b46c683385</id>
<content type='text'>
Everyone can write to these files, which is not what we want.

Cc: stable@vger.kernel.org # 3.15
Signed-off-by: Anton Blanchard &lt;anton@samba.org&gt;
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
<entry>
<title>powerpc/powernv: Check sysparam size before creation</title>
<updated>2014-04-28T03:08:49+00:00</updated>
<author>
<name>Joel Stanley</name>
<email>joel@jms.id.au</email>
</author>
<published>2014-04-24T07:25:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=63aecfb20a6629f1ca91d7a052f87988ceb6dd53'/>
<id>urn:sha1:63aecfb20a6629f1ca91d7a052f87988ceb6dd53</id>
<content type='text'>
The size of the sysparam sysfs files is determined from the device tree
at boot. However the buffer is hard coded to 64 bytes. If we encounter a
parameter that is larger than 64, or miss-parse the device tree, the
buffer will overflow when reading or writing to the parameter.

Check it at discovery time, and if the parameter is too large, do not
create a sysfs entry for it.

Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
<entry>
<title>powerpc/powernv: Fix typos in sysparam code</title>
<updated>2014-04-28T03:08:49+00:00</updated>
<author>
<name>Joel Stanley</name>
<email>joel@jms.id.au</email>
</author>
<published>2014-04-24T07:25:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=16003d235bdb4d1ebcecfe4915c6e6d8c95f4a0c'/>
<id>urn:sha1:16003d235bdb4d1ebcecfe4915c6e6d8c95f4a0c</id>
<content type='text'>
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
<entry>
<title>powerpc/powernv: Check sysfs size before copying</title>
<updated>2014-04-28T03:08:48+00:00</updated>
<author>
<name>Joel Stanley</name>
<email>joel@jms.id.au</email>
</author>
<published>2014-04-24T07:25:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=85390378f0a6abf3bdb10c3d504d77862a2d0ec9'/>
<id>urn:sha1:85390378f0a6abf3bdb10c3d504d77862a2d0ec9</id>
<content type='text'>
The sysparam code currently uses the userspace supplied number of
bytes when memcpy()ing in to a local 64-byte buffer.

Limit the maximum number of bytes by the size of the buffer.

Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
<entry>
<title>powerpc/powernv: Use ssize_t for sysparam return values</title>
<updated>2014-04-28T03:08:48+00:00</updated>
<author>
<name>Joel Stanley</name>
<email>joel@jms.id.au</email>
</author>
<published>2014-04-24T07:25:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=b8569d230416c490065098684adf13c1751cb830'/>
<id>urn:sha1:b8569d230416c490065098684adf13c1751cb830</id>
<content type='text'>
The OPAL calls are returning int64_t values, which the sysparam code
stores in an int, and the sysfs callback returns ssize_t. Make code a
easier to read by consistently using ssize_t.

Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
<entry>
<title>powerpc/powernv: Fix sysparam sysfs error handling</title>
<updated>2014-04-28T03:08:47+00:00</updated>
<author>
<name>Joel Stanley</name>
<email>joel@jms.id.au</email>
</author>
<published>2014-04-24T07:25:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=ba9a32b176c31ec4d3d7314bb2e529a85423f7a4'/>
<id>urn:sha1:ba9a32b176c31ec4d3d7314bb2e529a85423f7a4</id>
<content type='text'>
When a sysparam query in OPAL returned a negative value (error code),
sysfs would spew out a decent chunk of memory; almost 64K more than
expected. This was traced to a sign/unsigned mix up in the OPAL sysparam
sysfs code at sys_param_show.

The return value of sys_param_show is a ssize_t, calculated using

  return ret ? ret : attr-&gt;param_size;

Alan Modra explains:

  "attr-&gt;param_size" is an unsigned int, "ret" an int, so the overall
  expression has type unsigned int.  Result is that ret is cast to
  unsigned int before being cast to ssize_t.

Instead of using the ternary operator, set ret to the param_size if an
error is not detected. The same bug exists in the sysfs write callback;
this patch fixes it in the same way.

A note on debugging this next time: on my system gcc will warn about
this if compiled with -Wsign-compare, which is not enabled by -Wall,
only -Wextra.

Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
<entry>
<title>powerpc/powernv: Fix endian issues with OPAL async code</title>
<updated>2014-04-07T00:34:27+00:00</updated>
<author>
<name>Anton Blanchard</name>
<email>anton@samba.org</email>
</author>
<published>2014-03-28T05:33:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=bb4398e1de739a13e06589fc04cbb2267ba59800'/>
<id>urn:sha1:bb4398e1de739a13e06589fc04cbb2267ba59800</id>
<content type='text'>
OPAL defines opal_msg as a big endian struct so we have to
byte swap it on little endian builds.

Signed-off-by: Anton Blanchard &lt;anton@samba.org&gt;
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
<entry>
<title>powerpc/powernv: Enable reading and updating of system parameters</title>
<updated>2014-03-23T22:47:30+00:00</updated>
<author>
<name>Neelesh Gupta</name>
<email>neelegup@linux.vnet.ibm.com</email>
</author>
<published>2014-03-07T05:32:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=4029cd66545f0a45258eda5313b7559bfeaaaae4'/>
<id>urn:sha1:4029cd66545f0a45258eda5313b7559bfeaaaae4</id>
<content type='text'>
This patch enables reading and updating of system parameters through
OPAL call.

Signed-off-by: Neelesh Gupta &lt;neelegup@linux.vnet.ibm.com&gt;
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
</feed>
