summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcrgeddes <crgeddes@us.ibm.com>2016-11-11 15:53:28 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-11-15 17:20:35 -0500
commit0c8a408d7d7ba087e36607b47c5836c3cc21143e (patch)
treef6de93bcf0b7384eda9e6311bbad0d6d54d82cda
parentc10ef265b6e4233a6bf5ef60c60fc015f9f5f1da (diff)
downloadtalos-hostboot-0c8a408d7d7ba087e36607b47c5836c3cc21143e.tar.gz
talos-hostboot-0c8a408d7d7ba087e36607b47c5836c3cc21143e.zip
Read/Write from pnor for R/W attribute section in Attrrp in MPIPL
During an MPIPL the targeting and attribute data in pnor cannot be trusted so we use a copy of the info that we had stashed in memory during runtime. We do want to perserve writes to this info and if we only write it to memory it will not be preserved. To get around this we are hooking up the R/W section to pnor during MPIPL Change-Id: I5f98f5e5a522d923cc812060a5f8c959b74e683c RTC:164480 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/32557 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Martin Gloff <mgloff@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
-rwxr-xr-xsrc/usr/targeting/attrrp.C49
-rwxr-xr-xsrc/usr/targeting/attrrp_common.C2
2 files changed, 35 insertions, 16 deletions
diff --git a/src/usr/targeting/attrrp.C b/src/usr/targeting/attrrp.C
index d0cbda1b1..cce45e59c 100755
--- a/src/usr/targeting/attrrp.C
+++ b/src/usr/targeting/attrrp.C
@@ -177,11 +177,23 @@ namespace TARGETING
rc = -EINVAL;
break;
}
- // Do memcpy from PNOR into physical page.
- memcpy(pAddr,
- reinterpret_cast<void*>(
- iv_sections[section].pnorAddress + offset),
- size);
+ // if we are NOT in mpipl OR if this IS a r/w section,
+ // Do a memcpy from PNOR address into physical page.
+ if(!iv_isMpipl || (iv_sections[section].type == SECTION_TYPE_PNOR_RW) )
+ {
+ memcpy(pAddr,
+ reinterpret_cast<void*>(
+ iv_sections[section].pnorAddress + offset),
+ size);
+ }
+ else
+ {
+ // Do memcpy from real memory into physical page.
+ memcpy(pAddr,
+ reinterpret_cast<void*>(
+ iv_sections[section].realMemAddress + offset),
+ size);
+ }
break;
case MSG_MM_RP_WRITE:
@@ -393,23 +405,23 @@ namespace TARGETING
static_cast<uint64_t>(
TARG_TO_PLAT_PTR(l_header->vmmBaseAddress)) +
l_header->vmmSectionOffset*i;
- if(!iv_isMpipl)
- {
- iv_sections[i].pnorAddress = l_pnorSectionInfo.vaddr + l_section->sectionOffset;
- }
- else
+
+
+ iv_sections[i].pnorAddress = l_pnorSectionInfo.vaddr + l_section->sectionOffset;
+
+ if(iv_isMpipl)
{
//For MPIPL we are reading from real memory, not pnor flash. Set the real memory address
- //in place of the pnor address because that is where we are reading the data from
- iv_sections[i].pnorAddress = reinterpret_cast<uint64_t>(l_header) + l_section->sectionOffset;
+ iv_sections[i].realMemAddress = reinterpret_cast<uint64_t>(l_header) + l_section->sectionOffset;
}
iv_sections[i].size = l_section->sectionSize;
TRACFCOMP(g_trac_targeting,
- "Decoded Attribute Section: %d, 0x%lx 0x%lx 0x%lx",
+ "Decoded Attribute Section: %d, 0x%lx 0x%lx 0x%lx 0x%lx",
iv_sections[i].type,
iv_sections[i].vmmAddress,
iv_sections[i].pnorAddress,
+ iv_sections[i].realMemAddress,
iv_sections[i].size);
}
@@ -527,7 +539,7 @@ namespace TARGETING
}
rc = mm_set_permission(reinterpret_cast<void*>(
- iv_sections[i].vmmAddress),
+ iv_sections[i].vmmAddress),
iv_sections[i].size,
l_perm);
@@ -559,14 +571,19 @@ namespace TARGETING
// The volatile sections in MPIPL need to be copied because
// on the MPIPL flow we will not run the HWPs that set these attrs
+ // the RW section of the attribute data must be copied
+ // into the vmmAddress in order to make future r/w come
+ // from the pnor address, not real memory
if(((iv_sections[i].type == SECTION_TYPE_HEAP_ZERO_INIT) ||
- (iv_sections[i].type == SECTION_TYPE_HB_HEAP_ZERO_INIT)) &&
+ (iv_sections[i].type == SECTION_TYPE_HB_HEAP_ZERO_INIT) ||
+ (iv_sections[i].type == SECTION_TYPE_PNOR_RW)) &&
iv_isMpipl)
{
memcpy(reinterpret_cast<void*>(iv_sections[i].vmmAddress),
- reinterpret_cast<void*>(iv_sections[i].pnorAddress),
+ reinterpret_cast<void*>(iv_sections[i].realMemAddress),
(iv_sections[i].size));
}
+
} // End iteration through each section
if(l_errl)
diff --git a/src/usr/targeting/attrrp_common.C b/src/usr/targeting/attrrp_common.C
index 07df1b1e3..4406182a3 100755
--- a/src/usr/targeting/attrrp_common.C
+++ b/src/usr/targeting/attrrp_common.C
@@ -42,6 +42,8 @@ namespace TARGETING
// Location in PNOR virtual address space
uint64_t pnorAddress;
+ uint64_t realMemAddress;
+
// Section size
uint64_t size;
};
OpenPOWER on IntegriCloud