[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 03/11] vpci/header: Move register assignments from init_bars


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • Date: Wed, 27 Oct 2021 11:59:47 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.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=TwtKAD/U7xJJJxkyj6ijJDX5fvDJUHshCauM3+qbnU0=; b=NoIK7LFam+4JwH5nMs5co3HXWySffmiE96hWg5NYKhSglZQRIJxlw22QkQVUN/TZrCp8fS+gPhM+VvorxK9l4PHRrmWgrOHdL3kCrQV6kGS/BqzHaneEj5BpvpcR+jyOv4pxC+Hi1hDZy+e1ORJe8tnUxGmnixcxDNErE/kbBqZ81cb5dyAgMB7cDSUM+e38coYozhL9nT/C9d/5WxJyqvmqGqiNzpCTonN9VaaS90hcsRId6Be6cDswIIq1UkU4G9g+tBgLY3sCHJH6MWkpcM4ZvP1oWJyySUWRnk5fDj4unfReZhNGc//ud8UcHEkeiKHn20fzjY+8EUli6JeUrg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZtFs1gb8NzeI54Ehulow8bilsGvy5apcZzfqatu8sBRs15PLSWpomx17M5VO/0ctPHHmGbpqYTkL1Jo2XlUc4QQlHh9YUC4HVO4a3oYZsEzvpih7C4/lmjYUyoKLs3of9UIRaAHUs4f5OlCkssTKPUe1W1FlIxVsa4uu0gPxRShEqSEu7nMLnlZWVSkRKsYtEzzUpjDHDDd3waOjrG58BpfXPySg1kkTodSUe09uJPxFlp6AoDUIyqMdM2XINRNM7wccTuPbj/lJ4sN0arm/VWRGeXXPVRgQLvCc+JaYsKjIM5NSx8PrI/tVNhDtr4FkoBOrmH7H2f4ijb5UzRkvbw==
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "julien@xxxxxxx" <julien@xxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Artem Mygaiev <Artem_Mygaiev@xxxxxxxx>, "jbeulich@xxxxxxxx" <jbeulich@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Rahul Singh <rahul.singh@xxxxxxx>, Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • Delivery-date: Wed, 27 Oct 2021 12:00:10 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHXtdAhPfrDnvz+/U+T4IKIC1fCcavRBz+AgBXEsICAABy1AA==
  • Thread-topic: [PATCH v3 03/11] vpci/header: Move register assignments from init_bars

Hi, Roger!

On 27.10.21 13:17, Oleksandr Andrushchenko wrote:
> Hi, Roger!
>
> On 13.10.21 16:51, Roger Pau Monné wrote:
>> On Thu, Sep 30, 2021 at 10:52:15AM +0300, Oleksandr Andrushchenko wrote:
>>> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>
>>>
>>> This is in preparation for dynamic assignment of the vPCI register
>>> handlers depending on the domain: hwdom or guest.
>>> The need for this step is that it is easier to have all related 
>>> functionality
>>> put at one place. When the subsequent patches add decisions on which
>>> handlers to install, e.g. hwdom or guest handlers, then this is easily
>>> achievable.
>> Won't it be possible to select the handlers to install in init_bars
>> itself?
> It is possible
>> Splitting it like that means you need to iterate over the numbers of
>> BARs twice (one in add_bar_handlers and one in init_bars), which makes
>> it more likely to introduce errors or divergences.
>>
>> Decoupling the filling of vpci_bar data with setting the handlers
>> seems slightly confusing.
> Ok, I won't introduce add_bar_handlers, thus rendering this patch useless.
> I'll drop it and re-work the upcoming patches with this respect
On the other hand after thinking a bit more.
What actually init_bars do?
1. Runs once per each pdev (__init?)
2. Sizes the BARs and detects their type, sets up pdev->vpci->header BAR values
3. Adds register handlers.

For DomU we only need 3), so we can setup guest handlers.
So, from this POV either we need to have a yet another add_bar_handlers
or similar for at least the guests and the case when pdev is assigned back to 
hwdom.

So this can be a reason to defend the current approach with add_bar_handlers.

Or? Do you have an idea how to do that some other way?
>
> Thank you,
> Oleksandr

 


Rackspace

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