[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 03/13] vpci: move lock outside of struct vpci
- To: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Mon, 7 Feb 2022 15:11:03 +0100
- 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=Qo2Txv+cann+/Sw+Ehm5UvgQnQa77eTqW0JzwA4xoHc=; b=HX56dOFZ3VxQsoiBKh8hq4FMVyr3Um+obKBpBEEzHfznYxM1xbDwjd6bMsFDkpkiLY+WE4VxtvMX1tUpJchQ2Lp1bdx3QLQj5u16Ud1F96gkGfccHzFtHNEhNtYo6CPjxknDGbY+wzO88ioeOneukDPnAy+6yFLpxoLRf88gVImCsS3wmYNKQe8HU1o4Pu+fTE55Bzkbwc18Qk0fp+JexDwg+Qn3rKBig5mXm7zBvgibxFqyD0Wjc97rTSgAdcLoBV8ptQ1szsEC7K8lHP6Hb2csqrW88GkI53qBHMTcd6lmDAT9WfXZtsZCk6tgHLK/p7fUD4Y/bKqM9W+MUNSJog==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=afFAQic8k5hyCxEW2o/zQJuvY7yVhpIDmuOVfVifmWJ4IX+nHhn7p/b3xvHZzTZBeJrVlykTiYheQUjROpmPYo6nwgFCydWIfVHaaFYz/WRWMkDg8CfIu9SCU33pe8tZwDgy6mD+OYoCnFT0hq/cfdxikvvUXavvhWumIKyqjWFtmfTGlZLu99s7m8MJE1jlzM+8OL1kBhO3QijxLfrMaYSCNnYXbLGnxa0jgAdGpfW9rhHLZ5F4o14P1++Zhm8UaiY7LjeYfzMEprCFX8Pr7zS607Je89RIHtotu/XSmjPK0XMP9Dv0RDa0Y2CM+6hMVNpjRgrrsb78FHVzABM72Q==
- 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: Mon, 07 Feb 2022 14:11:13 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 07.02.2022 14:53, Oleksandr Andrushchenko wrote:
> On 07.02.22 14:46, Roger Pau Monné wrote:
>> I think the per-domain rwlock seems like a good option. I would do
>> that as a pre-patch.
> It is. But it seems it won't solve the thing we started this adventure for:
>
> With per-domain read lock and still ABBA in modify_bars (hope the below
> is correctly seen with a monospace font):
>
> cpu0: vpci_write-> d->RLock -> pdev1->lock ->
> rom_write -> modify_bars: tmp (pdev2) ->lock
> cpu1: vpci_write-> d->RLock pdev2->lock -> cmd_write -> modify_bars:
> tmp (pdev1) ->lock
>
> There is no API to upgrade read lock to write lock in modify_bars which could
> help,
> so in both cases vpci_write should take write lock.
Hmm, yes, I think you're right: It's not modify_bars() itself which needs
to acquire the write lock, but its (perhaps indirect) caller. Effectively
vpci_write() would need to take the write lock if the range written
overlaps the BARs or the command register.
Jan
|