diff --git a/ras-cxl-handler.c b/ras-cxl-handler.c index 67ce32e..857900f 100644 --- a/ras-cxl-handler.c +++ b/ras-cxl-handler.c @@ -917,6 +917,12 @@ int ras_cxl_dram_event_handler(struct trace_seq *s, 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; @@ -1045,6 +1051,13 @@ int ras_cxl_dram_event_handler(struct trace_seq *s, } } +#ifdef HAVE_MEMORY_CE_PFA + /* Page offline for CE when threeshold is set */ + if (!(ev.descriptor & CXL_GMER_EVT_DESC_UNCORECTABLE_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); diff --git a/ras-page-isolation.c b/ras-page-isolation.c index 30572e4..2166f5c 100644 --- a/ras-page-isolation.c +++ b/ras-page-isolation.c @@ -429,6 +429,13 @@ void ras_record_page_error(unsigned long long addr, unsigned int count, time_t t } } +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 */ diff --git a/ras-page-isolation.h b/ras-page-isolation.h index a9bae13..215f26d 100644 --- a/ras-page-isolation.h +++ b/ras-page-isolation.h @@ -117,6 +117,7 @@ struct isolation { 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); diff --git a/ras-record.h b/ras-record.h index cd549a1..f4eb5d9 100644 --- a/ras-record.h +++ b/ras-record.h @@ -206,6 +206,7 @@ struct ras_cxl_general_media_event { struct ras_cxl_dram_event { struct ras_cxl_event_common_hdr hdr; uint64_t dpa; + uint64_t hpa; uint8_t dpa_flags; uint8_t descriptor; uint8_t type;