[PATCH 2/5] lib: sbi: Introduce sbi_hart_protection_reconfigure() function
Anup Patel
anup.patel at oss.qualcomm.com
Fri Jul 24 07:54:19 PDT 2026
On Wed, Jul 22, 2026 at 4:30 PM Rahul Pathak
<rahul.pathak at oss.qualcomm.com> wrote:
>
> On Fri, Jul 17, 2026 at 1:15 PM Anup Patel <anup.patel at oss.qualcomm.com> wrote:
> >
> > Instead of assuming that hart protection reconfiguration is unconfigure
> > followed by configure, introduce a separate sbi_hart_protection_reconfigure()
> > function and use it in switch_to_next_domain_context().
> >
> > Signed-off-by: Anup Patel <anup.patel at oss.qualcomm.com>
> > ---
> > include/sbi/sbi_hart_protection.h | 7 +++++++
> > lib/sbi/sbi_domain_context.c | 3 +--
> > lib/sbi/sbi_hart_protection.c | 33 +++++++++++++++++++++++++------
> > 3 files changed, 35 insertions(+), 8 deletions(-)
> >
> >
> > +int sbi_hart_protection_configure(struct sbi_scratch *scratch)
> > +{
> > + return __hart_protection_configure(scratch, sbi_hart_protection_best());
> > +}
> > +
> > +void sbi_hart_protection_unconfigure(struct sbi_scratch *scratch)
> > +{
> > + __hart_protection_unconfigure(scratch, sbi_hart_protection_best());
> > +}
> > +
> > +int sbi_hart_protection_reconfigure(struct sbi_scratch *scratch)
> > +{
> > + struct sbi_hart_protection *hprot = sbi_hart_protection_best();
> > + int ret;
> > +
> > + __hart_protection_unconfigure(scratch, hprot);
> > + ret = __hart_protection_configure(scratch, hprot);
> > + if (ret)
> > + return ret;
> Simply - return __hart_protection_configure(scratch, hprot);
>
Okay, I will update.
Regards,
Anup
More information about the opensbi
mailing list