On 9/4/26 8:05 PM, Shameer Kolothum wrote: > With accel=on the guest owns Stage 1, so the Stage 2 nesting parent is the > only page table the host can track guest writes through. > > VFIO only asks for IOMMU_HWPT_ALLOC_DIRTY_TRACKING on the nesting parent > when the vIOMMU sets VIOMMU_FLAG_WANT_NESTING_DIRTY_TRACKING, which > smmuv3-accel does not, so the parent is allocated plain. > > Set the flag. > > Signed-off-by: Shameer Kolothum <[email protected]> Reviewed-by: Eric Auger <[email protected]> Eric > --- > hw/arm/smmuv3-accel.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/hw/arm/smmuv3-accel.c b/hw/arm/smmuv3-accel.c > index b653f3f4ce..3f83b505d0 100644 > --- a/hw/arm/smmuv3-accel.c > +++ b/hw/arm/smmuv3-accel.c > @@ -1037,6 +1037,12 @@ static uint64_t smmuv3_accel_get_viommu_flags(void > *opaque) > SMMUState *bs = opaque; > SMMUv3State *s = ARM_SMMUV3(bs); > > + /* > + * The guest owns Stage 1, so the Stage 2 parent is the only page table > + * the host can track guest writes through. > + */ > + flags |= VIOMMU_FLAG_WANT_NESTING_DIRTY_TRACKING; > + > if (smmuv3_pasid_supported(s)) { > flags |= VIOMMU_FLAG_PASID_SUPPORTED; > }
