summaryrefslogtreecommitdiffstats
path: root/src/usr/pnor/pnorrp.C
diff options
context:
space:
mode:
authorIlya Smirnov <ismirno@us.ibm.com>2018-04-02 16:39:21 -0500
committerNicholas E. Bofferding <bofferdn@us.ibm.com>2018-04-12 16:20:04 -0400
commitf5cd23d6c3be17356e0851ec5d5bb65cee48f15f (patch)
treeecdfb7de737d9b97649f4cd025b392d256b1e470 /src/usr/pnor/pnorrp.C
parente84f5604125d704d098efbea74f8368060be593d (diff)
downloadtalos-hostboot-f5cd23d6c3be17356e0851ec5d5bb65cee48f15f.tar.gz
talos-hostboot-f5cd23d6c3be17356e0851ec5d5bb65cee48f15f.zip
Mark Read-Only Partitions as Such
Partitions marked with readOnly tag in the xml were treated as WRITABLE in the code. This change modifies the permissions to be READ_ONLY and adds unit tests to test the read only functionality. Change-Id: I8c1f23fd7e30edc38ff882c59716ab63a4f310e6 CQ: SW423350 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/56771 CI-Ready: ILYA SMIRNOV <ismirno@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/57066 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Diffstat (limited to 'src/usr/pnor/pnorrp.C')
-rw-r--r--src/usr/pnor/pnorrp.C15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/usr/pnor/pnorrp.C b/src/usr/pnor/pnorrp.C
index e33a1b0c3..df88ba821 100644
--- a/src/usr/pnor/pnorrp.C
+++ b/src/usr/pnor/pnorrp.C
@@ -1776,32 +1776,31 @@ errlHndl_t PnorRP::setVirtAddrs(void)
// Handle section permissions
if (iv_TOC[i].misc & FFS_MISC_READ_ONLY)
{
- // Need to set permissions to allow writing to virtual
- // addresses, but prevents the kernel from ejecting
- // dirty pages (no WRITE_TRACKED).
+ // Partitions marked with readOnly flag should be
+ // READ_ONLY and not WRITABLE.
int rc = mm_set_permission(
(void*)iv_TOC[i].virtAddr,
iv_TOC[i].size,
- WRITABLE);
+ READ_ONLY);
if (rc)
{
- TRACFCOMP(g_trac_pnor, "E>PnorRP::readTOC: Failed to set block permissions to WRITABLE for section %s.",
+ TRACFCOMP(g_trac_pnor, "E>PnorRP::readTOC: Failed to set block permissions to READ_ONLY for section %s.",
SectionIdToString(i));
/*@
* @errortype
* @moduleid PNOR::MOD_PNORRP_READTOC
- * @reasoncode PNOR::RC_WRITABLE_PERM_FAIL
+ * @reasoncode PNOR::RC_READ_ONLY_PERM_FAIL
* @userdata1 PNOR section id
* @userdata2 PNOR section vaddr
* @devdesc Could not set permissions of the
- * given PNOR section to WRITABLE
+ * given PNOR section to READ_ONLY
* @custdesc A problem occurred while reading
* Processor NOR flash partition table
*/
l_errhdl = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_UNRECOVERABLE,
PNOR::MOD_PNORRP_READTOC,
- PNOR::RC_WRITABLE_PERM_FAIL,
+ PNOR::RC_READ_ONLY_PERM_FAIL,
i,
iv_TOC[i].virtAddr,
true /*Add HB SW Callout*/);
OpenPOWER on IntegriCloud