[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: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • Date: Mon, 7 Feb 2022 14:28:43 +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=UAcMnT8uCKiLODXO71H8yGt0byHfus7KS6BKcroKuNc=; b=OkTyZJLH/84zmBFEQ7+UlX/jdzehfo03PiFaofXig5JJMAY2QDYwMW8Qer35cnvIpuunjoSTyKHYe/V3uoT6+vgEI8qyeDUuvd4/v9fV0oCviUK/BFW5yN8Aq38HB4/1SQVNdytCmDhXq3g9488Zrh9XcAw4vUDIBidYDbf2mIM64ba84Xzzsw/0UNcYXjrjx90LZMlq4QfBABRTVq6o8+oFqBxoTGBMhAR8VPkLXdw2eQyfzFjQ1ShS/J/kaQe6f8tCrVzv71yv6mIqQKh9pZxls3YX2Y/C/EMtGXzTjbgTzhXEKBfjy8KKVnPocF8xlODDtt0t+7/0zD43xPeegA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hZCv1l1F64NzO+6U1RzvK+J89Jkf0xvaln1i6eJ5XNlQdB+JlDc+WXHlGmH6aEqPfqO5Tdza1zuNeYA7cnYiHY9fpsZU1Y5pfi+X64i4tqTrokYuklPpoy6vp36czl+ChL+Rafc7uBo2ngUPIlidRzWUVKLkhkUDU6gP7e9CHpkT+Vmd8TMTXZya4UvQrnxSqQA/u5/QuTlaqTXilD4BlT9PVh7iiatwmSfxnJTSM2MVZ4eICek4k9E4+5k9jG7ibgHnlmlUiHFnmPpAYRFnbmlHLJK3Kqj9nkDtUh1T4a9HakaTnQjcteHzwklA4wU4W/TnSA84e500GsBotpljIQ==
  • 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:29:27 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHYGZFc/MnzQOjwVEeBBUHLSW0md6yDBUkAgAASSACAAATYAIAAD/WAgAAKNgCAAAbfgIAABnuAgAAQvgCAAAMCAIAAAY4AgAADxICAABrnAIAABAgAgAR3CoCAABt5gIAAEpuAgAAE5ICAAATvAA==
  • Thread-topic: [PATCH v6 03/13] vpci: move lock outside of struct vpci


On 07.02.22 16:11, Jan Beulich wrote:
> 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.
Exactly, vpci_write needs a write lock, but it is not desirable.
And again, there is a single offending piece of code which wants that...
> Jan
>
Thank you,
Oleksandr

 


Rackspace

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