[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [PATCH 1/6] VT-d: properly reserve DID 0 for caching mode IOMMUs


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • From: "Tian, Kevin" <kevin.tian@xxxxxxxxx>
  • Date: Mon, 15 Nov 2021 05:13:34 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2IlupBnn5xbXSaGAV5CSvSuE8JlVgR3wVykdA/YCIKA=; b=QWiYSGFPjGoO/19KYuBpMk/yGRTmmLHImPOF9PMEni7H7znAmCTcnmZR7pqOct6Dyoqjp7mirDpDkHEWGy817yPAcrtCPwtFEX76t0JMB2u2ELveDV9WgSAfmJn1O+gHZEAXgDDbp3b5jB3tngTZFB7NzK2ValSTw0iVAXdgT/PN4rFtGD1mQ8VG3fqOKVacKyMOHz6bLW3GhR/aDbSB1dpl8lVSfxVbVt4QFu6RlwfW86YfNZdKhl8o49zQxNRV7bYCGUQqzLwAs+n2wgy8uRn9TNUixZd36hpGcrX9gUiGZvRFJlS72NAhfcYMn+pFwUhf2GJwHDuKIQrG1MScvQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RiP1p6IBJX/aP+cTN/KkEzGfymNSXLb5ZE3X/t/in3+rAexyqj9TECLMkRkoH8Ecpv5fp1DDJsbvJ/nopCJ94QihXmKmfL97pHWbRLocqZ+dHcTBqrI0312F0sfmNiJQ9BJxP8AKeC+adPrCH3qXIKAhVGfCuZrmHUwmPG6bqv3/ecO7TbVyGr5VQa5voVSBK9azrvdVmeVDhnFwQVqNaQFlU8MWRCLAQnaaPCiq41IYvf7ep6vh6Iv0Tk6BpDghlkjciyfSYWL8KZtY/VwYmMRcvvkBgjTqcpykAHGWmEr2CSmPhDX7Y7OvTSCYdbgE8xxv88hRc9QeC3Dbs0m18A==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 15 Nov 2021 05:13:54 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHX16ptxP2kemn3HkOptj6NHfmn+qv/wDwAgAAMLoCAAAMzAIAEP/6g
  • Thread-topic: [PATCH 1/6] VT-d: properly reserve DID 0 for caching mode IOMMUs

> From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> Sent: Friday, November 12, 2021 8:19 PM
> 
> On Fri, Nov 12, 2021 at 01:07:33PM +0100, Jan Beulich wrote:
> > On 12.11.2021 12:23, Roger Pau Monné wrote:
> > > On Fri, Nov 12, 2021 at 10:47:59AM +0100, Jan Beulich wrote:
> > >> Merely setting bit 0 in the bitmap is insufficient, as then Dom0 will
> > >> still have DID 0 allocated to it, because of the zero-filling of
> > >> domid_map[]. Set slot 0 to DOMID_INVALID to keep DID 0 from getting
> > >> used.
> > >
> > > Shouldn't the whole domid_map be initialized to DOMID_INVALID to
> > > prevent dom0 matching against any unused slot?
> > >
> > > Similarly cleanup_domid_map should set the slot to DOMID_INVALID.
> >
> > I don't think so, that's the purpose of setting the bit in domid_bitmap.
> > The problem really was only with setting a bit in that bitmap without
> > invalidating the corresponding slot.
> >
> > This said, I can still see value in doing as you suggest, but as a
> > separate change with a different justification. In fact domid_bitmap is
> > kind of redundant now anyway; aiui it was the thing that existed first.
> > Then domid_map[] was simply added, rather than fully replacing the
> > original bitmap.
> 
> I guess using domid_bitmap to find a free slot is faster than scanning
> the array of iommu IDs to domids. Not sure how performance critical
> that search is, so maybe it's fine to just drop domid_bitmap and rely
> exclusively on the array.
> 

I'm fine to drop domid_bitmap. I don't think domain creation
is in hot path...

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.