[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 04/14] vpci: cancel pending map/unmap on vpci removal
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
- Date: Fri, 28 Jan 2022 12:21:08 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=Tx0e/oqjV1uLH9gyiTqXXT74vkpnxNakMYuIGCdco5I=; b=ORteBCNkcDeJyavhnFwvVv3j4/pTvSOMAzhQwV4mAHOts0IUAjfWtwqpmHGksg9gFYNO3ceDt5+qVxAZlrF8Hwc2sHscCJoRqFy3GMyf//nYteAE+qn2asdV2Eda6IP7bs6FMFkcdOdxAHDe+QQqLPyY9lxqhcGevLpARmOMSSIxOF+XRvDDGe711aOF9l/hK8L+VX/Ik+9OEsncKSkhEWnVYr2RFr7d1MDBFkxP9KvXVeZxaUW8RqwpFMUqbIsyOnsSa/BQ6Im2Y95Q/By2ailEE1Dt5fA63gpqVGhPwrf5hYO+STi7yV7Pl8gIGMWX+/Ajri5yFpWThiOCAOkz8w==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VF5brUyIuxa++prqKXoFYGohFhtEMyQAFsfz6wi8B0ERC3e5D3q+RN/mQ92PgaqxGeqrlyslPIzZ7V3IywORZ2k492A48929KsjnRyc2q9TpU89k8gk8T140dFFf1pgzXNwS4d1JAJzzEMiBq98rCHsJlTpykKeedlfzRs87r1MjQ86WJhcSt6fSHkiP4hKhdlVntN1awdYlOLPmDK5qSt9MODc7Rk4ud+6UBbOjM1PGmW/PgsdGe8pLejqDnQt5Uc7AG9pOMwemX3zY8NXSYVMYeXn/4H2sMgEyh4+ZoB1Z/cC80zRsf13eFxUupbIK50+J7OlWq0tTf/p0JcZIBw==
- Cc: "julien@xxxxxxx" <julien@xxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Artem Mygaiev <Artem_Mygaiev@xxxxxxxx>, "roger.pau@xxxxxxxxxx" <roger.pau@xxxxxxxxxx>, "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>, Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
- Delivery-date: Fri, 28 Jan 2022 12:24:09 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHX4ewFMUIx3Ap2dEiG4Ts6A1fyCaxfzfoAgBjxPAA=
- Thread-topic: [PATCH v5 04/14] vpci: cancel pending map/unmap on vpci removal
On 12.01.22 17:27, Jan Beulich wrote:
> On 25.11.2021 12:02, Oleksandr Andrushchenko wrote:
>> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>
>>
>> When a vPCI is removed for a PCI device it is possible that we have
>> scheduled a delayed work for map/unmap operations for that device.
>> For example, the following scenario can illustrate the problem:
>>
>> 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)
>>
>> leave_hypervisor_to_guest
>> vpci_process_pending: v->vpci.mem != NULL; v->vpci.pdev->vpci == NULL
>>
>> For the hardware domain we continue execution as the worse that
>> could happen is that MMIO mappings are left in place when the
>> device has been deassigned.
>>
>> For unprivileged domains that get a failure in the middle of a vPCI
>> {un}map operation we need to destroy them, as we don't know in which
>> state the p2m is. This can only happen in vpci_process_pending for
>> DomUs as they won't be allowed to call pci_add_device.
>>
>> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>
>>
>> ---
>> Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>
>> ---
>> Since v4:
>> - crash guest domain if map/unmap operation didn't succeed
>> - re-work vpci cancel work to cancel work on all vCPUs
>> - use new locking scheme with pdev->vpci_lock
>> New in v4
>>
>> Fixes: 86dbcf6e30cb ("vpci: cancel pending map/unmap on vpci removal")
> What is this about?
Just a leftover after squashing WIP patches, sorry
>
> Jan
>
Thank you,
Oleksandr
|