[v9,22/25] MPIPL: Clear tags and metadata
diff mbox series

Message ID 20190712111802.23560-23-hegdevasant@linux.vnet.ibm.com
State Accepted
Headers show
Series
  • MPIPL support
Related show

Checks

Context Check Description
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot-dco success Signed-off-by present
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot success Test snowpatch/job/snowpatch-skiboot on branch master
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (4db38a36b31045f0a116d388ddeac850b38c8680)

Commit Message

Vasant Hegde July 12, 2019, 11:17 a.m. UTC
Post dump process, kernel sends FREE_PRESERVE_MEMEORY notification
to OPAL. OPAL will clear metadata section and tags. Subsequent
opal_mpipl_query_tag() call will return OPAL_EMPTY.

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
---
 core/opal-dump.c | 6 ++++++
 1 file changed, 6 insertions(+)

Patch
diff mbox series

diff --git a/core/opal-dump.c b/core/opal-dump.c
index 2ff3a2f60..6aefefdf7 100644
--- a/core/opal-dump.c
+++ b/core/opal-dump.c
@@ -301,6 +301,12 @@  static int64_t opal_mpipl_update(enum opal_mpipl_ops ops,
 			prlog(PR_NOTICE, "Payload unregistered for MPIPL\n");
 		break;
 	case OPAL_MPIPL_FREE_PRESERVED_MEMORY:
+		/* Clear tags */
+		memset(&opal_mpipl_tags, 0, (sizeof(u64) * MAX_OPAL_MPIPL_TAGS));
+		opal_mpipl_max_tags = 0;
+		/* Release memory */
+		free(opal_mpipl_data);
+		opal_mpipl_data = NULL;
 		/* Clear MDRT table */
 		memset((void *)MDRT_TABLE_BASE, 0, MDRT_TABLE_SIZE);
 		/* Set MDRT count to max allocated count */