lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 19 Jan 2018 08:45:34 -0700
From:   Alex Williamson <alex.williamson@...hat.com>
To:     Shameerali Kolothum Thodi <shameerali.kolothum.thodi@...wei.com>
Cc:     "eric.auger@...hat.com" <eric.auger@...hat.com>,
        "pmorel@...ux.vnet.ibm.com" <pmorel@...ux.vnet.ibm.com>,
        "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Linuxarm <linuxarm@...wei.com>,
        John Garry <john.garry@...wei.com>,
        "xuwei (O)" <xuwei5@...wei.com>
Subject: Re: [RFC v2 2/5] vfio/type1: Check reserve region conflict and
 update iova list

On Fri, 19 Jan 2018 09:48:22 +0000
Shameerali Kolothum Thodi <shameerali.kolothum.thodi@...wei.com> wrote:
> > > +static void vfio_iommu_iova_resv_refresh(struct vfio_iommu *iommu)
> > > +{
> > > +	struct vfio_domain *d;
> > > +	struct vfio_group *g;
> > > +	struct vfio_iova *node, *tmp;
> > > +	struct iommu_resv_region *resv, *resv_next;
> > > +	struct list_head resv_regions;
> > > +	phys_addr_t start, end;
> > > +
> > > +	INIT_LIST_HEAD(&resv_regions);
> > > +
> > > +	list_for_each_entry(d, &iommu->domain_list, next) {
> > > +		list_for_each_entry(g, &d->group_list, next)
> > > +			iommu_get_group_resv_regions(g->iommu_group,
> > > +							 &resv_regions);
> > > +	}
> > > +
> > > +	if (list_empty(&resv_regions))
> > > +		return;
> > > +
> > > +	list_sort(NULL, &resv_regions, vfio_resv_cmp);
> > > +
> > > +	node = list_first_entry(&iommu->iova_list, struct vfio_iova, list);
> > > +	start = node->start;
> > > +	node = list_last_entry(&iommu->iova_list, struct vfio_iova, list);
> > > +	end = node->end;  
> > 
> > list_sort() only sorts based on ->start, we added reserved regions for
> > all our groups to one list, we potentially have multiple entries with
> > the same ->start.  How can we be sure that the last one in the list
> > actually has the largest ->end value?  
> 
> Hmm.. the sorting is done on the reserved list. The start and end entries 
> are of the iova list which is kept updated on _attach(). So I don't think
> there is a problem here.

Oops, yes you're right.  List confusion.  Thanks,

Alex

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ