From 8ffdfc861b944e1d8768c2b81377bd7e8b5a92a5 Mon Sep 17 00:00:00 2001 From: Dan Crowell Date: Mon, 29 Jun 2015 10:21:09 -0500 Subject: Rediscover location of HDAT data to handle IO CM operations PHYP modifies the location of the HDAT memory during a IO CM operation. During a mpipl, during dump collection, HB will cache the location of the SPIRA. This cache will be pointing to the B side. Later in the boot the FSP repopulates the SPIRA using the A side. HB needs to use the A side pointers instead. Change-Id: I991fc731eb6292869e7280d29727ef270a6975a5 CQ: SW311349 Backport: release-fips830 Backport: release-fips820 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/18836 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Reviewed-by: Elizabeth Liner Reviewed-by: A. Patrick Williams III --- src/include/usr/runtime/runtime.H | 10 +++++++++- src/usr/runtime/hdatservice.C | 35 +++++++++++++++++++++++++++-------- src/usr/runtime/hdatservice.H | 10 +++++++++- src/usr/runtime/populate_attributes.C | 6 ++++++ 4 files changed, 51 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/include/usr/runtime/runtime.H b/src/include/usr/runtime/runtime.H index 433f82169..73633cb00 100644 --- a/src/include/usr/runtime/runtime.H +++ b/src/include/usr/runtime/runtime.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2012,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2015 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -135,6 +137,12 @@ void add_host_data_ffdc( SectionId i_section, */ void setPayloadBaseAddress(uint64_t i_payloadAddress); +/* + * @brief Clear out any cached data and rediscover the location + * of the HDAT memory + */ +void rediscover_hdat( void ); + } #endif diff --git a/src/usr/runtime/hdatservice.C b/src/usr/runtime/hdatservice.C index fd79e222f..0084a54fe 100644 --- a/src/usr/runtime/hdatservice.C +++ b/src/usr/runtime/hdatservice.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2015 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -337,13 +337,7 @@ hdatService::hdatService(void) hdatService::~hdatService(void) { - for(memRegionItr region = iv_mem_regions.begin(); - (region != iv_mem_regions.end()); ++region) - { - mm_block_unmap((*region).virt_addr); - } - - iv_mem_regions.clear(); + rediscoverHDAT(); } errlHndl_t hdatService::mapRegion(uint64_t i_addr, size_t i_bytes, @@ -1442,6 +1436,26 @@ void hdatService::addFFDC( SectionId i_section, } } +/* + * @brief Clear out any cached data and rediscover the location + * of the HDAT memory + */ +void hdatService::rediscoverHDAT( void ) +{ + // Clear out the pointers we cached + iv_spiraS = NULL; + iv_spiraL = NULL; + iv_spiraH = NULL; + + // Clear out our cache of memory regions + for(memRegionItr region = iv_mem_regions.begin(); + (region != iv_mem_regions.end()); ++region) + { + mm_block_unmap((*region).virt_addr); + } + iv_mem_regions.clear(); +} + /******************** Public Methods ********************/ @@ -1489,6 +1503,11 @@ void add_host_data_ffdc( SectionId i_section, return Singleton::instance().addFFDC(i_section,io_errlog); } +void rediscover_hdat( void ) +{ + Singleton::instance().rediscoverHDAT(); +} + }; /******************** diff --git a/src/usr/runtime/hdatservice.H b/src/usr/runtime/hdatservice.H index a3e26c24d..a8de9402d 100644 --- a/src/usr/runtime/hdatservice.H +++ b/src/usr/runtime/hdatservice.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2011,2014 */ +/* Contributors Listed Below - COPYRIGHT 2013,2015 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -119,6 +121,12 @@ namespace RUNTIME void addFFDC( SectionId i_section, errlHndl_t& io_errlog ); + /* + * @brief Clear out any cached data and rediscover the location + * of the HDAT memory + */ + void rediscoverHDAT( void ); + protected: /** * @brief Constructor diff --git a/src/usr/runtime/populate_attributes.C b/src/usr/runtime/populate_attributes.C index 6a6024219..820dfc62a 100644 --- a/src/usr/runtime/populate_attributes.C +++ b/src/usr/runtime/populate_attributes.C @@ -245,6 +245,9 @@ errlHndl_t populate_system_attributes( uint64_t i_nodes ) do { TRACDCOMP( g_trac_runtime, "-SYSTEM-" ); + // Wipe out our cache of the NACA/SPIRA pointers + RUNTIME::rediscover_hdat(); + // find our memory range and fill it with some junk data uint64_t sys_data_addr = 0; uint64_t sys_data_size = 0; @@ -415,6 +418,9 @@ errlHndl_t populate_node_attributes( uint64_t i_nodeNum ) TRACDCOMP( g_trac_runtime, "-NODE-" ); TRACFCOMP( g_trac_runtime, "populate_node_attributes(node=%d)", i_nodeNum ); + // Wipe out our cache of the NACA/SPIRA pointers + RUNTIME::rediscover_hdat(); + // allocate memory and fill it with some junk data uint64_t node_data_addr = 0; size_t node_data_size = 0; -- cgit v1.2.1