1783
#define CXL_DRAM_VALID_ROW BIT(5)
1784
#define CXL_DRAM_VALID_COLUMN BIT(6)
1785
#define CXL_DRAM_VALID_CORRECTION_MASK BIT(7)
1786
+#define CXL_DRAM_VALID_COMPONENT BIT(8)
1787
+#define CXL_DRAM_VALID_COMPONENT_ID_FORMAT BIT(9)
1788
+#define CXL_DRAM_VALID_SUB_CHANNEL BIT(10)
1789
+
1790
+#define CXL_DRAM_EV_DESC_UCE BIT(0)
1791
+#define CXL_DRAM_EV_DESC_THRESHOLD_EVENT BIT(1)
1792
+#define CXL_DRAM_EV_DESC_POISON_LIST_OVERFLOW_EVENT BIT(2)
1793
1794
void qmp_cxl_inject_dram_event(const char *path, CxlEventLog log,
1795
uint32_t flags,
1809
bool has_column, uint16_t column,
1810
bool has_correction_mask,
1811
uint64List *correction_mask,
1812
+ const char *component_id,
1813
+ bool has_comp_id_pldm, bool is_comp_id_pldm,
1814
+ bool has_sub_channel, uint8_t sub_channel,
1815
+ bool has_cme_ev_flags, uint8_t cme_ev_flags,
1816
+ bool has_cvme_count, uint32_t cvme_count,
1817
+ uint8_t sub_type,
1818
Error **errp)
1819
{
1820
Object *obj = object_resolve_path(path, NULL);
1851
has_maint_op_subclass, maint_op_subclass,
1852
has_ld_id, ld_id, has_head_id, head_id);
1853
stq_le_p(&dram.phys_addr, dpa);
1841
- dram.descriptor = descriptor;
1854
dram.type = type;
1855
dram.transaction_type = transaction_type;
1856
1900
valid_flags |= CXL_DRAM_VALID_CORRECTION_MASK;
1901
}
1902
1903
+ if (component_id) {
1904
+ strncpy((char *)dram.component_id, component_id,
1905
+ sizeof(dram.component_id) - 1);
1906
+ valid_flags |= CXL_DRAM_VALID_COMPONENT;
1907
+ if (has_comp_id_pldm && is_comp_id_pldm) {
1908
+ valid_flags |= CXL_DRAM_VALID_COMPONENT_ID_FORMAT;
1909
+ }
1910
+ }
1911
+
1912
+ if (has_sub_channel) {
1913
+ dram.sub_channel = sub_channel;
1914
+ valid_flags |= CXL_DRAM_VALID_SUB_CHANNEL;
1915
+ }
1916
+
1917
+ if (has_cme_ev_flags) {
1918
+ dram.cme_ev_flags = cme_ev_flags;
1919
+ } else {
1920
+ dram.cme_ev_flags = 0;
1921
+ }
1922
+
1923
+ if (has_cvme_count) {
1924
+ descriptor |= CXL_DRAM_EV_DESC_THRESHOLD_EVENT;
1925
+ st24_le_p(dram.cvme_count, cvme_count);
1926
+ } else {
1927
+ st24_le_p(dram.cvme_count, 0);
1928
+ }
1929
+ dram.descriptor = descriptor;
1930
+
1931
+ dram.sub_type = sub_type;
1932
+
1933
stw_le_p(&dram.validity_flags, valid_flags);
1934
1935
if (cxl_event_insert(cxlds, enc_log, (CXLEventRecordRaw *)&dram)) {