Skip to content

Commit e010ab8

Browse files
rajatgoyal47prashymh
authored andcommitted
ras: PAL select common PFG error flow
Move pseudo fault generation selection from RAS_ERR_IN_t to RAS_ERR_OUT_t so PAL setup can request the common VAL PFG path. Update VAL setup and injection to use out_param->is_pfg_check for PFG setup/injection, and update ras005 interrupt cleanup to use the PAL-selected mode. Remove stale test-side is_pfg_check initialization from RAS_ERR_IN_t users. Initialize the new output flag in PAL setup stubs and leave PAL inject from modifying the setup-selected state. Signed-off-by: Rajat Goyal <rajat.goyal@arm.com> Change-Id: If594ddf1682e09fb112576e6e3357b0a338f2fc7
1 parent 6de8ca8 commit e010ab8

14 files changed

Lines changed: 103 additions & 41 deletions

File tree

pal/baremetal/base/include/pal_common_support.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1000,17 +1000,22 @@ typedef enum {
10001000
ERR_CRITICAL /* Critical Error */
10011001
} RAS_ERROR_TYPE;
10021002

1003+
#define RAS_INTR_TYPE_FHI 0x0 /* Fault Handling Interrupt */
1004+
#define RAS_INTR_TYPE_ERI 0x1 /* Error Recovery Interrupt */
1005+
#define RAS_INTR_TYPE_NONE 0xFF /* No ERI/FHI selected */
1006+
10031007
typedef struct {
10041008
RAS_ERROR_TYPE ras_error_type; /* Error Type */
10051009
uint64_t error_pa; /* Error Phy Address */
10061010
uint32_t rec_index; /* Error Record Index */
10071011
uint32_t node_index; /* Error Node Index in Info table */
1008-
uint8_t is_pfg_check; /* Pseudo Fault Check or not */
1012+
uint32_t intr_type; /* Interrupt type used for common PFG setup */
10091013
} RAS_ERR_IN_t;
10101014

10111015
typedef struct {
10121016
uint32_t intr_id; /* Interrupt ID */
10131017
uint32_t error_record; /* Error Record Number */
1018+
uint8_t is_pfg_check; /* Pseudo Fault Check or not */
10141019
} RAS_ERR_OUT_t;
10151020

10161021
void pal_ras_create_info_table(RAS_INFO_TABLE *ras_info_table);

pal/baremetal/target/RDN2/src/pal_sbsa.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,9 @@ pal_ras_setup_error(RAS_ERR_IN_t in_param, RAS_ERR_OUT_t *out_param)
162162
/* Platform Defined way of setting up the Error Environment */
163163

164164
(void) in_param;
165-
(void) out_param;
165+
166+
if (out_param)
167+
out_param->is_pfg_check = 0;
166168

167169
pal_warn_not_implemented(__func__);
168170
return PAL_STATUS_NOT_IMPLEMENTED;

pal/baremetal/target/RDV3/src/pal_sbsa.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ pal_ras_setup_error(RAS_ERR_IN_t in_param, RAS_ERR_OUT_t *out_param)
163163
/* Platform Defined way of setting up the Error Environment */
164164

165165
(void) in_param;
166-
(void) out_param;
166+
167+
if (out_param)
168+
out_param->is_pfg_check = 0;
167169

168170
pal_warn_not_implemented(__func__);
169171
return PAL_STATUS_NOT_IMPLEMENTED;

pal/baremetal/target/RDV3CFG1/src/pal_sbsa.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ pal_ras_setup_error(RAS_ERR_IN_t in_param, RAS_ERR_OUT_t *out_param)
163163
/* Platform Defined way of setting up the Error Environment */
164164

165165
(void) in_param;
166-
(void) out_param;
166+
167+
if (out_param)
168+
out_param->is_pfg_check = 0;
167169

168170
pal_warn_not_implemented(__func__);
169171
return PAL_STATUS_NOT_IMPLEMENTED;

pal/uefi_acpi/include/pal_uefi.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,17 +894,22 @@ typedef enum {
894894
ERR_CONTAINABLE /* Containable Error */
895895
} RAS_ERROR_TYPE;
896896

897+
#define RAS_INTR_TYPE_FHI 0x0 /* Fault Handling Interrupt */
898+
#define RAS_INTR_TYPE_ERI 0x1 /* Error Recovery Interrupt */
899+
#define RAS_INTR_TYPE_NONE 0xFF /* No ERI/FHI selected */
900+
897901
typedef struct {
898902
RAS_ERROR_TYPE ras_error_type; /* Error Type */
899903
UINT64 error_pa; /* Error Phy Address */
900904
UINT32 rec_index; /* Error Record Index */
901905
UINT32 node_index; /* Error Node Index in Info table */
902-
UINT8 is_pfg_check; /* Pseudo Fault Check or not */
906+
UINT32 intr_type; /* Interrupt type used for common PFG setup */
903907
} RAS_ERR_IN_t;
904908

905909
typedef struct {
906910
UINT32 intr_id; /* Interrupt ID */
907911
UINT32 error_record; /* Error Record Number */
912+
UINT8 is_pfg_check; /* Pseudo Fault Check or not */
908913
} RAS_ERR_OUT_t;
909914

910915
void pal_ras_create_info_table(RAS_INFO_TABLE *ras_info_table);

pal/uefi_acpi/src/pal_ras.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ pal_ras_setup_error(RAS_ERR_IN_t in_param, RAS_ERR_OUT_t *out_param)
6161
if (out_param == NULL)
6262
return PAL_STATUS_INVALID_PARAM;
6363

64+
out_param->is_pfg_check = 0;
65+
6466
pal_warn_not_implemented(__func__);
6567
return PAL_STATUS_NOT_IMPLEMENTED;
6668
}

test_pool/ras/ras005.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ intr_handler(void)
4242
/* Clear the RAS source before the common IRQ wrapper EOIs the interrupt. */
4343
val_ras_clear_error_status(intr_node_index, intr_is_pfg_check);
4444

45-
val_print(TRACE, "\n Received interrupt 0x%x", int_id);
45+
val_print(TRACE, "\n Received interrupt 0x%lx", int_id);
4646
val_gic_end_of_interrupt(int_id);
4747
return;
4848
}
@@ -123,9 +123,9 @@ payload()
123123
err_in_params.rec_index = rec_index;
124124
err_in_params.node_index = node_index;
125125
err_in_params.ras_error_type = ERR_CE;
126-
err_in_params.is_pfg_check = 0;
126+
/* Pass the selected interrupt type so common RAS setup can enable FHI or ERI. */
127+
err_in_params.intr_type = (fhi_id) ? RAS_INTR_TYPE_FHI : RAS_INTR_TYPE_ERI;
127128
intr_node_index = node_index;
128-
intr_is_pfg_check = err_in_params.is_pfg_check;
129129

130130
/* Install handler for interrupt */
131131
val_gic_install_isr(int_id, intr_handler);
@@ -140,6 +140,8 @@ payload()
140140
fail_cnt++;
141141
break;
142142
}
143+
/* Preserve PAL/VAL-selected PFG mode for interrupt-source cleanup. */
144+
intr_is_pfg_check = err_out_params.is_pfg_check;
143145

144146
/* Inject error in an implementation defined way */
145147
status = val_ras_inject_error(err_in_params, &err_out_params);

test_pool/ras/ras006.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ payload()
145145
err_in_params.ras_error_type = ERR_CE; /* correctable error */
146146
err_in_params.error_pa = err_inj_addr; /* address of the location where error
147147
needs to be injected */
148-
err_in_params.is_pfg_check = 0; /* not a pseudo fault check */
148+
err_in_params.intr_type = RAS_INTR_TYPE_NONE;
149149

150150
/* Setup error in an implementation defined way */
151151
status = val_ras_setup_error(err_in_params, &err_out_params);

test_pool/ras/ras009.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ payload()
154154
err_in_params.ras_error_type = ERR_CONTAINABLE; /* containable error */
155155
err_in_params.error_pa = err_inj_addr; /* address of the location where error
156156
needs to be injected */
157-
err_in_params.is_pfg_check = 0; /* not a pseudo fault check */
157+
err_in_params.intr_type = RAS_INTR_TYPE_NONE;
158158

159159
/* Setup error in an implementation defined way */
160160
status = val_ras_setup_error(err_in_params, &err_out_params);

test_pool/ras/ras011.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ payload_poison_supported()
145145
err_in_params.rec_index = rec_index;
146146
err_in_params.node_index = node_index;
147147
err_in_params.ras_error_type = ERR_CE;
148-
err_in_params.is_pfg_check = 0;
148+
err_in_params.intr_type = RAS_INTR_TYPE_ERI;
149149

150150
/* Get Interrupt details for this node */
151151
status = val_ras_get_info(RAS_INFO_ERI_ID, node_index, &int_id);
@@ -346,7 +346,7 @@ payload_poison_unsupported()
346346
err_in_params.rec_index = rec_index;
347347
err_in_params.node_index = node_index;
348348
err_in_params.ras_error_type = ERR_CE;
349-
err_in_params.is_pfg_check = 0;
349+
err_in_params.intr_type = RAS_INTR_TYPE_ERI;
350350

351351
/* Get Interrupt details for this node */
352352
status = val_ras_get_info(RAS_INFO_ERI_ID, node_index, &int_id);

0 commit comments

Comments
 (0)