On Mon, Nov 03, 2025 at 07:11:18AM -0800, Shameer Kolothum wrote:
> > > + if (s1_hwpt) {
> > > + if (!smmuv3_accel_dev_uninstall_nested_ste(accel_dev, true,
> > > errp)) {
> > > + return false;
> > > + }
> > > + }
> >
> > I think we could have some improvements here.
> >
> > The current flow is:
> > (attached to s1_hwpt1)
> > attach to bypass/abort_hwpt // no issue though.
> > free s1_hwpt1
> > alloc s2_hwpt2
> > attach to s2_hwpt2
> >
> > It could have been a flow like replace() in the kernel:
> > (attached to s1_hwpt1)
> > alloc s2_hwpt2
> > attach to s2_hwpt2 /* skipping bypass/abort */
> > free s1_hwpt
>
> Not sure I get the above, you mean in this _instatl_nested_ste() path,
> we have a case where we need to alloc a S2 HWPT and attach?
Oh no. s1_hwpt1 and s1_hwpt2. The point is that we don't really
need that bypass/abort attachment (i.e. the uninstall function)
when switching between two nested hwpts. The sample code that I
shared should cover this already.
> > That being said, HW doesn't seem to propagate C_BAD_STE during a
> > CFGI_STE or CFGI_STE_RANGE, IIUIC. It reports C_BAD_STE event when
> > a transaction starts. If we want to perfectly mimic the hardware,
> > we'd have to set up a bad STE down to the HW, which will trigger a
> > C_BAD_STE vevent to be forwarded by vEVENTQ.
>
> I don't think we need to mimic that behaviour. We could return an event
> from here to Guest if required or just have error_report().
I am not sure about that. Reporting event on CMD_CFGI_STE doesn't
sound like a correct behavior following the HW spec.
error_report() would be fine. But we might need to leave a FIXME.
Nicolin