path: root/vpnor
Commit message (Collapse)AuthorAgeFilesLines
* vpnor: Add README describing the expected behavioursHEADmasterAndrew Jeffery2018-04-041-0/+59
| | | | | Change-Id: I68d3f453325c15ef524d0fdce5228d65148427be Signed-off-by: Andrew Jeffery <>
* test: vpnor: Use MAP_SHARED for read-only file memory mapAndrew Jeffery2018-04-042-2/+2
| | | | | | | | | | | | It's not well defined whether a private mapping of a resource that is MAP_SHARED on a separate file descriptor will see the updates done via the shared mapping, though under Linux if the private mapping is not written then we can expect updates from the shared mapping to propagate (copy-on-write). However, we get a concrete guarantee of the desired behaviour (observing the effects of the write) if we use MAP_SHARED. Change-Id: If6a053209a979ee5b96ed09c60fbbd9bdb060a32 Signed-off-by: Andrew Jeffery <>
* vpnor: Add handler for CREATE_WRITE_WINDOWAndrew Jeffery2018-04-044-10/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The virtual PNOR implementation enforces the read-only attribute of FFS partitions, which is a departure from how things were handled previously. In the past it was purely up to the host to respect the flags set on the partition, but nothing prevented the host from modifying it. Now it's possible for errors to occur when the host attempts to flush changes back to the flash: mboxd can deny the change. This denial can happen in a number of circumstances: 1. An explicit WRITE_FLUSH command from the host 2. An implicit WRITE_FLUSH via an explicit CLOSE_WINDOW command 3. An implicit WRITE_FLUSH via CREATE_{READ,WRITE}_WINDOW, which happens via the implicit CLOSE_WINDOW All of these attempts will fail if the write to the currently open window cannot be allowed to succeed. Failing to open a read window due to failure to flush pending writes is particularly painful, as we are not able to ever successfully open a window again. Instead, detect when the host attempts to open a write window over a anything but a writeable partition. If this case is detected, return an error for the CREATE_WRITE_WINDOW operation to prevent systemic failures later on. Change-Id: I991b6f1570d9b1b384b1024e3bd8a77e5efcd198 Signed-off-by: Andrew Jeffery <>
* vpnor: Configure a handler table in init_vpnor()Andrew Jeffery2018-04-045-21/+40
| | | | | | | | | | | Currently the table just mirrors that which is set by the regular implementation, however getting to that point requires massaging the code a little. Thus, separate out this change from one that changes the behaviour of the commands to improve the readability of the latter change. Change-Id: I4007a8a4d508c6d850b8cc878bab8f72bd343498 Signed-off-by: Andrew Jeffery <>
* test: Move vpnor tests to vpnor directoryAndrew Jeffery2018-04-0431-0/+2155
| | | | | | | | | 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 Change-Id: I16d59a3c9ee846065f6a8c83eb4459715d525f3f Signed-off-by: Andrew Jeffery <>
* vpnor: Isolate relevant code in vpnor directoryAndrew Jeffery2018-04-0410-0/+1639
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 <>
OpenPOWER on IntegriCloud