#include <unistd.h>
#include "ras-cxl-handler.h"
+#include "ras-page-isolation.h"
#include "ras-logger.h"
#include "ras-record.h"
#include "ras-report.h"
if (trace_seq_printf(s, "dpa:0x%llx ", (unsigned long long)ev.dpa) <= 0)
return -1;
+ if (tep_get_field_val(s, event, "hpa", record, &val, 1) < 0)
+ return -1;
+ ev.hpa = val;
+ if (trace_seq_printf(s, "hpa:0x%llx ", (unsigned long long)ev.hpa) <= 0)
+ return -1;
+
if (tep_get_field_val(s, event, "dpa_flags", record, &val, 1) < 0)
return -1;
ev.dpa_flags = val;
}
}
+#ifdef HAVE_MEMORY_CE_PFA
+ /* Page offline for CE when threeshold is set */
+ if (!(ev.descriptor & CXL_GMER_EVT_DESC_UNCORRECTABLE_EVENT) &&
+ (ev.descriptor & CXL_GMER_EVT_DESC_THRESHOLD_EVENT))
+ ras_hw_threshold_pageoffline(ev.hpa);
+#endif
+
/* Insert data into the SGBD */
#ifdef HAVE_SQLITE3
ras_store_cxl_dram_event(ras, &ev);
}
}
+void ras_hw_threshold_pageoffline(unsigned long long addr)
+{
+ time_t now = time(NULL);
+
+ ras_record_page_error(addr, threshold.val, now);
+}
+
/* memory page CE threshold policy ends */
/* memory row CE threshold policy starts */
void ras_page_account_init(void);
void ras_record_page_error(unsigned long long addr,
unsigned int count, time_t time);
+void ras_hw_threshold_pageoffline(unsigned long long addr);
void ras_row_account_init(void);
void ras_record_row_error(const char *detail, unsigned int count, time_t time,
unsigned long long addr);