/* Automatically generated by tdx.py */ static int get_tdx_sys_info_version(struct tdx_sys_info_version *out) { int ret = 0; u64 val; if (!ret && !(ret = read_sys_metadata_field(0x8800000200000001, &val))) out->build_date = val; if (!ret && !(ret = read_sys_metadata_field(0x8800000100000002, &val))) out->build_num = val; if (!ret && !(ret = read_sys_metadata_field(0x0800000100000003, &val))) out->minor_version = val; if (!ret && !(ret = read_sys_metadata_field(0x0800000100000004, &val))) out->major_version = val; if (!ret && !(ret = read_sys_metadata_field(0x0800000100000005, &val))) out->update_version = val; if (!ret && !(ret = read_sys_metadata_field(0x0800000100000006, &val))) out->internal_version = val; return ret; } static int get_tdx_sys_info_features(struct tdx_sys_info_features *out) { int ret = 0; u64 val; if (!ret && !(ret = read_sys_metadata_field(0x0A00000300000008, &val))) out->tdx_features0 = val; return ret; } static int get_tdx_sys_info_tdmr(struct tdx_sys_info_tdmr *out) { int ret = 0; u64 val; if (!ret && !(ret = read_sys_metadata_field(0x9100000100000008, &val))) out->max_tdmrs = val; if (!ret && !(ret = read_sys_metadata_field(0x9100000100000009, &val))) out->max_reserved_per_tdmr = val; if (!ret && !(ret = read_sys_metadata_field(0x9100000100000010, &val))) out->pamt_4k_entry_size = val; if (!ret && !(ret = read_sys_metadata_field(0x9100000100000011, &val))) out->pamt_2m_entry_size = val; if (!ret && !(ret = read_sys_metadata_field(0x9100000100000012, &val))) out->pamt_1g_entry_size = val; return ret; } static int get_tdx_sys_info_cmr(struct tdx_sys_info_cmr *out) { int ret = 0; u64 val; int i; if (!ret && !(ret = read_sys_metadata_field(0x9000000100000000, &val))) out->num_cmrs = val; for (i = 0; i < 32; i++) if (!ret && !(ret = read_sys_metadata_field(0x9000000300000080 + i, &val))) out->cmr_base[i] = val; for (i = 0; i < 32; i++) if (!ret && !(ret = read_sys_metadata_field(0x9000000300000100 + i, &val))) out->cmr_size[i] = val; return ret; }