insert_hfn_ov_op(struct program *p,
uint32_t shift,
enum pdb_type_e pdb_type,
- unsigned char era_2_sw_hfn_ovrd)
+ unsigned char era_2_sw_hfn_ovrd,
+ bool clear_dpovrd_at_end)
{
uint32_t imm = PDCP_DPOVRD_HFN_OV_EN;
uint16_t hfn_pdb_offset;
MATHB(p, MATH0, SHLD, MATH0, MATH0, 8, 0);
MOVE(p, MATH0, 0, DESCBUF, hfn_pdb_offset, 4, IMMED);
- if (rta_sec_era >= RTA_SEC_ERA_8)
+ if (clear_dpovrd_at_end && (rta_sec_era >= RTA_SEC_ERA_8)) {
/*
* For ERA8, DPOVRD could be handled by the PROTOCOL command
* itself. For now, this is not done. Thus, clear DPOVRD here
* to alleviate any side-effects.
*/
MATHB(p, DPOVRD, AND, ZERO, DPOVRD, 4, STL);
+ }
SET_LABEL(p, keyjump);
PATCH_JUMP(p, pkeyjump, keyjump);
SET_LABEL(p, pdb_end);
err = insert_hfn_ov_op(p, sn_size, pdb_type,
- era_2_sw_hfn_ovrd);
+ era_2_sw_hfn_ovrd, true);
if (err)
return err;
SET_LABEL(p, pdb_end);
err = insert_hfn_ov_op(p, sn_size, pdb_type,
- era_2_sw_hfn_ovrd);
+ era_2_sw_hfn_ovrd, true);
if (err)
return err;
}
SET_LABEL(p, pdb_end);
- err = insert_hfn_ov_op(p, sn_size, pdb_type, era_2_sw_hfn_ovrd);
+ err = insert_hfn_ov_op(p, sn_size, pdb_type, era_2_sw_hfn_ovrd, true);
if (err)
return err;
}
SET_LABEL(p, pdb_end);
- err = insert_hfn_ov_op(p, sn_size, pdb_type, era_2_sw_hfn_ovrd);
+ err = insert_hfn_ov_op(p, sn_size, pdb_type, era_2_sw_hfn_ovrd, true);
if (err)
return err;