[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 02/11] vpci: cancel pending map/unmap on vpci removal
- To: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Thu, 18 Nov 2021 15:35:14 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=9eXD7lSyYy++f0AHj3IOb5Lk5OJwElGRy3HgMpkNY1E=; b=WbErgp4uEqyWD5iD3/gYm2fr2Az4Sx5AgMYdmTJfR9vLVTkGa0KBqda1olRUSPRELlx3AsK16aRqlK86MUlsSDVLMbdqkLB554y5JztfHgdv9vOs0rd3VYtzThYnqNuLCdWdVECSyVttXNxoHDL4TnkML08BFmQBTmw+91ZVvEyS/x/1yrY5BetXLktQd/gOsmHEtnbIBFKOSxtpCHvfi44bM+cM2ydHj1sFAn6EHYW7nL3J8RAj6O8N4L9BH/XuS0Zw0O1g4Tl3eciX7WrmD+GIkEdvfofHGFrdo3IMQH5ENDmSBtIz2m7VAQwwbh5I+Oa5bnlO98XntHVquN8dEw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JYAN4BNDvhssVbv7eA4MnWf8TocRU16PmK5xrt8MisPOBvqjAQuGoVJsImxKk6XycwByj78AFh0u/1W5I3XzHWWk8dsF1Q8Xghm+gFVtjdzPlapeS+WIz+2Y+awzs6ChlQS9+O2inbnMBZAoQNPvYviu0sYY8kKlcZ0DCmjPyo9+o30C8qrDN1ANtzgy849V9PMxpQvad0T9QuacCGUod+67wqatFvIx9VVcS9jbHpr/ppoUWg9oiXk1udhOjq55jjzv/SquBYxvT6l8hjkdB7HMvoJs2LbYi9scdavWWmcF8vtGStKV1gfOvyT7TXB5OTebgPr+adCER5LSt8g4GA==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: "julien@xxxxxxx" <julien@xxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Artem Mygaiev <Artem_Mygaiev@xxxxxxxx>, "andrew.cooper3@xxxxxxxxxx" <andrew.cooper3@xxxxxxxxxx>, "george.dunlap@xxxxxxxxxx" <george.dunlap@xxxxxxxxxx>, "paul@xxxxxxx" <paul@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Rahul Singh <rahul.singh@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Delivery-date: Thu, 18 Nov 2021 14:35:39 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 18.11.2021 15:14, Oleksandr Andrushchenko wrote:
> On 18.11.21 16:04, Roger Pau Monné wrote:
>> Indeed. In the physdevop failure case this comes from an hypercall
>> context, so maybe you could do the mapping in place using hypercall
>> continuations if required. Not sure how complex that would be,
>> compared to just deferring to guest entry point and then dealing with
>> the possible cleanup on failure.
> This will solve one part of the equation:
>
> pci_physdev_op
> pci_add_device
> init_bars -> modify_bars -> defer_map ->
> raise_softirq(SCHEDULE_SOFTIRQ)
> iommu_add_device <- FAILS
> vpci_remove_device -> xfree(pdev->vpci)
>
> But what about the other one, e.g. vpci_process_pending is triggered in
> parallel with PCI device de-assign for example?
Well, that's again in hypercall context, so using hypercall continuations
may again be an option. Of course at the point a de-assign is initiated,
you "only" need to drain requests (for that device, but that's unlikely
to be worthwhile optimizing for), while ensuring no new requests can be
issued. Again, for the device in question, but here this is relevant -
a flag may want setting to refuse all further requests. Or maybe the
register handling hooks may want tearing down before draining pending
BAR mapping requests; without the hooks in place no new such requests
can possibly appear.
Jan
|