[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: Jan Beulich <jbeulich@xxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Fri, 12 Nov 2021 13:19:00 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=EIutV54LE+Q+hlUsEj+2spGVpbShPkoGYHy5HFs0mDg=; b=DLCQ9Yy0vcPEI66qPu1dZrUZcJ7QT9314L6PJzh3R7Sb6No8tLupnIZqlxlYBpI6CBogXwx1KOsIPsGPidMJcdiRJd5d5TXXJtMDshjUaJvck3ROLFI9Fj0XYAuY2gMDNx44JyUqmn/tJc+esUIxcU8++hmNlbOn/uRxSWnNFe6b19frYjKb3uJ2MTSjFKvkNV+3qy3I0AY1zA6rKSuUux2/3WsIa/6ig8tHWpZhs80ytdD4CWiPYBK5hwh9EYePzpndPMeuNJi8x9gqvqb4jr3dnE0kBuYpZGF6qzUeIG8O/jyD4YUyKH96Qi+7phGjp4nxpiFqf5TD5zPBMpGCWg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cCCIgJh03ZBX/KjUUSNOvlzLHsf+2Oy1IntFiDWLHmp5o9pelxH2xTUr7vmDeIoYJkHsJYbcv+7L+d36zH/SFbOriUvMV+kDyJKoS6ie7G3ZEgdOtTbw6dtmxUiAmya3Djczfd+1skvuVNwvG4R6nqchsh5d/11HNilJxEj3U+QQDKANjGzSnJ/TRScdLmHNzCkBjySAeSsOycsi43S4+JgNEOivsIqstmSqguD/UzDvDhrLNH4ueqGJ+mAc8mlrCqeO458pNBaapkL35MfAuhLrAwoCho8cNVCwqoqjf9f6AZQGRwJniBdRB1HhzdsdEEPNN+zQ5Jx6R66Nb+fESA==
- Authentication-results: esa6.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Kevin Tian" <kevin.tian@xxxxxxxxx>
- Delivery-date: Fri, 12 Nov 2021 12:19:31 +0000
- Ironport-data: A9a23:FEyCHKPpiM2YIurvrR1EkMFynXyQoLVcMsEvi/4bfWQNrUoi1mcEz 2RJXz+GOauDYGb3ctxxOYq18hwDsZOBn4NnQQto+SlhQUwRpJueD7x1DKtR0wB+jCHnZBg6h ynLQoCYdKjYdpJYz/uUGuCJQUNUjMlkfZKhTr6bUsxNbVU8En540Es5w7RRbrNA2rBVPSvc4 bsenOWHULOV82Yc3rU8sv/rRLtH5ZweiRtA1rAMTakjUGz2zhH5OKk3N6CpR0YUd6EPdgKMq 0Qv+5nilo/R109F5tpICd8XeGVSKlLZFVDmZna7x8FOK/WNz8A/+v9TCRYSVatYoxqGvfth2 IRQjsPuFwcbFIaLwOAnbiANRkmSPYUekFPGCX22sMjVxEzaaXr8hf5pCSnaP6VBpLwxWzsXs 6VFdnZdNXhvhMrvqF6/YvNrick5atHiIasUu216zCGfBvEjKXzGa/iVu4MAhmph7ixINdP6Y fcrczBsV0nnbhlTKE8IFJMBguj90xETdBUH8QnI9MLb+VP7zwFv0b6rLNvcfPSLQ9lYmgCTo Weu13T0BFQWOcKSzRKB82mwnanfkCXjQoUQGbaksPlwjzW7xGYeFRkXXluTuuSihwi1XNc3F qAP0nNw9+5orhXtF4SjGU3jyJKZgvICc/VfMcYq+FCQ8fWKvQarLENDFjp7VeVz4afaWgcW/ lOOmtroAxlmv7uUVW+R+9+okN+iBc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em+yZNNXB77PQCZf 2hDp0tnUvfRZ1bVLX2OpFDNNKz0OHjpdbDW1orFhQn4A6BgXeB76P7KQGR2lM7XylUybkv3G DZm0ihj5/T/c2T+1v57Sv+/p5WkNzuxp9qA9GNsNEcLnHJhhyzbIpsdrWetHQeof2p6nwtjN 7Qyi1QcPhb2jf0RCWYsBHt0w7v3HIH7GLj80aRhT/ZrcnwVFsBeoF8rLMcViGcx1srvdl63q 4O9XmerYBrARTJmzm4z8TUVjlx/3DE4kYKoKo2tThyQIEeYLheocg050VOCqoNGyr89cQODP RuNsfB//xbGGnqL0wxhlMfheBEY05DWitvGiM5y4uoOnlt7TFEJnIjtY4idixqzuN6d3FGj9 60epiA2os+F/P+VpgNcdvpd/HHQ1AlcSi8Ql56Hm6XYJ3vG0i94aIfs49Fqd1DRvQzve0Pcd L6IQtliVI=
- Ironport-sdr: 8/2oTWwFotOhAaEPX64ICf/VTYpVqPDuwK5Lwq7kpSlDjIPBs0whs0tSSJT3O8+VVx2UjUAmFb Cx8I1eqjKceDX7WZ5dqY85q+If/0hy5NAMtHZLxXN1xz2VkASOYKIcDCFk/+OqFb9cSUokjArH +zbmGSDudzyZ4PJYQNU4JjmBc8K09/CMtLRb9I4qt6q4KVDXoy5wi1qvbC1v+/yAAT8t/8LhAw yDsV8JUoJQuVA/mUid5xxuNwHEax51Htr9jWnyTf7FAphTEcVk1BU+RQdnNsekYEAULzdz97c8 KBgbSUhf07CpW2ySmLsUhYKs
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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.
Thanks, Roger.
|