<feed xmlns='http://www.w3.org/2005/Atom'>
<title>phosphor-mboxd/test, branch master</title>
<subtitle>OpenBMC Phosphor Flash mailbox daemon sources</subtitle>
<id>https://git.raptorcs.com/git/phosphor-mboxd/atom?h=master</id>
<link rel='self' href='https://git.raptorcs.com/git/phosphor-mboxd/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/phosphor-mboxd/'/>
<updated>2018-04-04T07:57:31+00:00</updated>
<entry>
<title>mbox_msg: Move handler table to struct mbox_context</title>
<updated>2018-04-04T07:57:31+00:00</updated>
<author>
<name>Andrew Jeffery</name>
<email>andrew@aj.id.au</email>
</author>
<published>2018-03-26T04:06:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/phosphor-mboxd/commit/?id=efb09def5e21959972adde9f5c092f1840eff908'/>
<id>urn:sha1:efb09def5e21959972adde9f5c092f1840eff908</id>
<content type='text'>
This allows us to provide alternative implementations for the handlers
as necessary. The vpnor feature, which enforces the read-only property
of FFS partitions, requires this for handling CREATE_WRITE_WINDOW.

Change-Id: Ia969a6f085244b194c500e66b62adca5e10bacba
Signed-off-by: Andrew Jeffery &lt;andrew@aj.id.au&gt;
</content>
</entry>
<entry>
<title>test: Move vpnor tests to vpnor directory</title>
<updated>2018-04-04T07:57:31+00:00</updated>
<author>
<name>Andrew Jeffery</name>
<email>andrew@aj.id.au</email>
</author>
<published>2018-03-26T01:43:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/phosphor-mboxd/commit/?id=30bcf84c932a579532e5f8417af549494e11b6e9'/>
<id>urn:sha1:30bcf84c932a579532e5f8417af549494e11b6e9</id>
<content type='text'>
In the spirit of things that are together should be kept together. The
repository layout now better corresponds to upstream with the exception
of the vpnor directory and some modifications to Makefile.am

Change-Id: I16d59a3c9ee846065f6a8c83eb4459715d525f3f
Signed-off-by: Andrew Jeffery &lt;andrew@aj.id.au&gt;
</content>
</entry>
<entry>
<title>vpnor: Isolate relevant code in vpnor directory</title>
<updated>2018-04-04T07:57:31+00:00</updated>
<author>
<name>Andrew Jeffery</name>
<email>andrew@aj.id.au</email>
</author>
<published>2018-03-26T01:26:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/phosphor-mboxd/commit/?id=53c21aaa803e148c9c79cb3f5e0252d911506b10'/>
<id>urn:sha1:53c21aaa803e148c9c79cb3f5e0252d911506b10</id>
<content type='text'>
This is prepatory work for introducing more vpnor-specific behaviours to
window handling. We will be introducing more objects to link, in order
to hook some of the window command handlers.

This change takes the opportunity to revert back to the upstream names
for some of the original C files.

Change-Id: I6b67ae466a2695054035e65ba752881be9c32d1a
Signed-off-by: Andrew Jeffery &lt;andrew@aj.id.au&gt;
</content>
</entry>
<entry>
<title>test: vpnor: Add create_write_window_unmapped</title>
<updated>2018-04-04T07:56:23+00:00</updated>
<author>
<name>Andrew Jeffery</name>
<email>andrew@aj.id.au</email>
</author>
<published>2018-03-29T00:11:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/phosphor-mboxd/commit/?id=8b9102389718f639434253be3fa99f8f6d38d9a6'/>
<id>urn:sha1:8b9102389718f639434253be3fa99f8f6d38d9a6</id>
<content type='text'>
Deny attempts to open write windows to flash space that is unmapped in
the ToC. This gives explicit feedback that any data written would not be
persisted if it were possible create the write window in the first
place.

Change-Id: I0e7967247b122aa8d0c1de38af43162ba0ccc8fa
Signed-off-by: Andrew Jeffery &lt;andrew@aj.id.au&gt;
</content>
</entry>
<entry>
<title>test: vpnor: Add create_write_window_rw_partition</title>
<updated>2018-04-04T07:56:23+00:00</updated>
<author>
<name>Andrew Jeffery</name>
<email>andrew@aj.id.au</email>
</author>
<published>2018-03-26T06:39:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/phosphor-mboxd/commit/?id=e32f2c15b96980f0d3e0962b0fe545788e94f7ce'/>
<id>urn:sha1:e32f2c15b96980f0d3e0962b0fe545788e94f7ce</id>
<content type='text'>
This test case should always pass. Ensure it does in the face of
modifications to how the request is processed.

Change-Id: I090aa6518750615c6b931404f5ad54b13cf95e28
Signed-off-by: Andrew Jeffery &lt;andrew@aj.id.au&gt;
</content>
</entry>
<entry>
<title>test: vpnor: Add create_write_window_ro_partition</title>
<updated>2018-04-04T07:56:23+00:00</updated>
<author>
<name>Andrew Jeffery</name>
<email>andrew@aj.id.au</email>
</author>
<published>2018-03-26T00:46:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/phosphor-mboxd/commit/?id=7c5a1091903d5e0959b1ab48211aa187170eaacf'/>
<id>urn:sha1:7c5a1091903d5e0959b1ab48211aa187170eaacf</id>
<content type='text'>
The virtual PNOR implementation enforces the read-only attribute of
partitions out of the box. This causes trouble when the host requests a
write window over a read-only partition, as the flush command will fail.
Further, by design, we have open-implies-close-implies-flush semantics,
which means once a flush fails, any subsequent request to open a window
also fails.

We want the daemon to deny attempts to open write windows over a
read-only partition during the CREATE_WRITE_WINDOW request, to avoid
the cascading failures later on.

Change-Id: Ib6bec3d34a8a47e517088dd504f7a74641882f5d
Signed-off-by: Andrew Jeffery &lt;andrew@aj.id.au&gt;
</content>
</entry>
<entry>
<title>mboxd_windows: Shrink windows accessing the end of flash</title>
<updated>2018-04-04T07:56:23+00:00</updated>
<author>
<name>Andrew Jeffery</name>
<email>andrew@aj.id.au</email>
</author>
<published>2018-03-23T01:57:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/phosphor-mboxd/commit/?id=3da0de69628d1341e38608067a9f5198a1e35954'/>
<id>urn:sha1:3da0de69628d1341e38608067a9f5198a1e35954</id>
<content type='text'>
The host may request a window over the end of the flash where the window
size combined with the requested offset exceeds the limit of the flash.
This issue was introduced with the virtual PNOR, as copy_flash() now may
return a size less than requested. This leads to offset requests that
are still block aligned, but the windows may no longer be aligned with
respect to the flash size.

This issue triggers the read error reported from the Petitboot
environment in an earlier commit message:

    / # cat /dev/mtd0 &gt; /dev/null
    [  501.061616288,3] MBOX-FLASH: Bad response code from BMC 2
    [  501.150405995,3] MBOX-FLASH: Error waiting for BMC
    cat: read error: Input/output error
    / # echo $?
    1
    / #

With the corresponding mboxd trace on the BMC:

    [ 1519966031.652036815] Received MBOX command: 4
    [ 1519966031.652272613] Host requested flash @ 0x03f1a000
    [ 1519966031.652411603] Tried to open read window past flash limit
    [ 1519966031.652500088] Couldn't create window mapping for offset 0x03f1a000
    [ 1519966031.652607966] Error handling mbox cmd: 4
    [ 1519966031.652661421] Writing MBOX response: 2
    [ 1519966031.652762229] Error handling MBOX event

Instead, shrink the request such that the resulting window exactly maps
the flash limit, and no further.

Change-Id: Id33ae3b14252eb40240ef1925311f22aceb103b4
Signed-off-by: Andrew Jeffery &lt;andrew@aj.id.au&gt;
</content>
</entry>
<entry>
<title>mboxd_windows: Reset evicted windows</title>
<updated>2018-04-04T07:56:23+00:00</updated>
<author>
<name>Andrew Jeffery</name>
<email>andrew@aj.id.au</email>
</author>
<published>2018-03-23T01:10:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/phosphor-mboxd/commit/?id=0d087f17f868587ca01259632ba0bd584b66aae4'/>
<id>urn:sha1:0d087f17f868587ca01259632ba0bd584b66aae4</id>
<content type='text'>
After copying a portion of the backing store to a window,
create_map_window() "resizes" the window to the aligned-up size reported
by copy_flash(). This allows use of the window size as the content size
elsewhere in the codebase.

However, if we needed to evict a window to satisfy a request, the window
properties were not reset. This lead to inefficient use of the reserved
memory by limiting the effective window size to the minimum size of all
requests that were previously allocated the window in question.

Inefficient use of reserved memory isn't the only side effect; the host
takes an eye-watering hit to throughput that gets exponentionally
worse over time:

From the petitboot shell without the patch applied:

    / # time cat /dev/mtd0 &gt; /dev/null
    real    0m 49.77s
    user    0m 0.00s
    sys     0m 49.76s
    / # time cat /dev/mtd0 &gt; /dev/null
    real    1m 33.57s
    user    0m 0.00s
    sys     1m 33.55s
    / # time cat /dev/mtd0 &gt; /dev/null
    real    4m 45.37s
    user    0m 0.00s
    sys     4m 45.35s
    / # time cat /dev/mtd0 &gt; /dev/null
    real    9m 17.77s
    user    0m 0.00s
    sys     9m 17.76s
    / #

And with the patch applied:

    / # time cat /dev/mtd0 &gt; /dev/null
    real    0m 43.00s
    user    0m 0.00s
    sys     0m 42.99s
    / # time cat /dev/mtd0 &gt; /dev/null
    real    0m 42.40s
    user    0m 0.00s
    sys     0m 42.39s
    / # time cat /dev/mtd0 &gt; /dev/null
    real    0m 42.41s
    user    0m 0.00s
    sys     0m 42.39s
    / #

Reset the properties to allow use of the entire reserved memory region
allocated to the window, improving memory efficiency, throughput, and
minimising throughput variance.

Change-Id: I7be78ec5e0a9ee0caf31133b0861e333844b8975
Signed-off-by: Andrew Jeffery &lt;andrew@aj.id.au&gt;
</content>
</entry>
<entry>
<title>test: vpnor: Add create_read_window_remap</title>
<updated>2018-04-04T07:56:23+00:00</updated>
<author>
<name>Andrew Jeffery</name>
<email>andrew@aj.id.au</email>
</author>
<published>2018-03-23T03:01:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/phosphor-mboxd/commit/?id=912c9bdf938893e41c675f6cd97b7b00bcc83940'/>
<id>urn:sha1:912c9bdf938893e41c675f6cd97b7b00bcc83940</id>
<content type='text'>
Sanity check that requesting arbitrary offsets inside a partition will
map to an existing window containing that partitions data. This ensures
we don't have multiple windows mapping the same content and shooting
ourselves in the foot with coherency issues.

Change-Id: Ie13cc36a9f092381660d5c45ed6d2477c3a4d6ce
Signed-off-by: Andrew Jeffery &lt;andrew@aj.id.au&gt;
</content>
</entry>
<entry>
<title>test: vpnor: Add create_read_window_size</title>
<updated>2018-04-04T07:56:23+00:00</updated>
<author>
<name>Andrew Jeffery</name>
<email>andrew@aj.id.au</email>
</author>
<published>2018-03-23T05:43:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/phosphor-mboxd/commit/?id=929b421a3db4b9d5c4412d8293ce8fa8d153f5f0'/>
<id>urn:sha1:929b421a3db4b9d5c4412d8293ce8fa8d153f5f0</id>
<content type='text'>
Tests to make sure that the window size returned has not been shrunk
inappropriately by previous requests.

Change-Id: Ib86d0744c774b5cf57235833a402bc79ef9979b9
Signed-off-by: Andrew Jeffery &lt;andrew@aj.id.au&gt;
</content>
</entry>
</feed>
