On Wed, Oct 06, 2021 at 03:04:15PM +0200, Eric Auger wrote:
> > +    if (config.bypass != dev->config.bypass) {
> > +        if (!virtio_vdev_has_feature(vdev, VIRTIO_IOMMU_F_BYPASS_CONFIG)) {
> > +            virtio_error(vdev, "cannot set config.bypass");
> > +            return;
> > +        }
> > +        if (config.bypass != 0 && config.bypass != 1) {
> > +            warn_report("invalid config.bypass value '%d'", config.bypass);
> > +            dev->config.bypass = 0;
> Shouldn't we leave the old value instead. The spec proposal says it
> takes 0 though.

Yes keeping the old value is better, I'll change the spec. Writing a
different value is a driver bug since new values for the bypass field will
be keyed off a new feature bit.

Thanks,
Jean


Reply via email to