[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: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Wed, 27 Oct 2021 15:23:55 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=JE5xfLqvEgTX7DCAiYY1bVSPmz+g5/It3HNMaqoeK28=; b=dQkSJXZeCUf/WarlFvJztbwO7K/m2ExTTOOTiolG07dOyTYUXYPVKKtoF8hXCp8ExqIsbTYSCfn6U9XYMM4BK7I1qeRv+J5QYdD5LPfDpImlwIezo5XNuRVKUrauEOEQM+lqd/eHuSIfPGG2VvhKiPK8XEwTSR5ldffKmDLZTyTVmj5Om1l/pHRi9BL6+Tc8/PSvrUBeokYPw4YgLc0ssDRtSq8jcwTsVczApzotFSZ8884kHqbi3neXbEW1E5RG/lZmharLUcLii+UKjxKxZEFKjX6Grre/R+NPilHY4p9OAD/XDGa9bAQbnedppIP9NGnwARo5bZseypqYW3Hvkw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mcN3noz0xxnCv1Hrh7HDDEwAucWOXw8Ysg6BbRkC+LUQsDsKGGPWii8enJOKx8IqX2ZGqt+7g0cUopeeUnRDIRw5yM2KcqoZQ8LSwkoU9TqGCJEaToZrSr/t5ecZA0c6II/P1aKvpEa1VAYZlVqqDOqSqBmtNEcCOmX4yKmVFnuJ59tOz7fBEiup5w1harB9aDVfhbPp8g0wtvtmYfB39PPvByaTsEZ8THRtvbHRlnRJcy7smwIRIeOP6yfjdn02eBgtoBMFW5wuDff4KzK9Q93RnkW/q5bgl4NhKPLdfOJq1/FG5/VR0TKPt3Q/G6NRs3apqcivvdfZRun2pAFeTQ==
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • 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>
  • Delivery-date: Wed, 27 Oct 2021 13:24:16 +0000
  • Ironport-data: A9a23:ZNMCUKKotycgjmLzFE+Ry5MlxSXFcZb7ZxGr2PjKsXjdYENS1TQBx 2BNWz2FaPiOY2umLt10b4zk/RgFvZLQm4NlQQJlqX01Q3x08seUXt7xwmUcns+xwm8vaGo9s q3yv/GZdJhcokcxIn5BC5C5xZVG/fjgqoHUVaiUZUideSc+EH140Eo5xLZg6mJVqYPR7z2l6 IuaT/L3YDdJ6xYsWo7Dw/vewP/HlK2aVAIw5jTSV9gS1LPtvyB94KYkDbOwNxPFrrx8RYZWc QphIIaRpQs19z91Yj+sfy2SnkciGtY+NiDW4pZatjTLbrGvaUXe345iXMfwZ3u7hB2Thvoh5 NpDkaetagsQZ7HOnsVBXklXRnQW0a1uoNcrIFC6uM2XiUbHb2Ht07NlC0Re0Y8wo7gtRzsUr LpBdW5LPkvra+GemdpXTsF2gcsuNo/zNZ43sXB81zDJS/0hRPgvRo2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VEQjlSbmI3M6J+1X78acoMm0UGHyMa/V1RDH+QWKKhlvQSgHRL+CeK08mQ6MxI0ETl nvhnIWfvJqEaqNTQmZIIvyQYUvlrhDNP4/GK/AAENZuxR17ZB6UDk3HJUfKjFa9SRrU/VYX0fW H35iP6eaBWPvmf3hH+yDwNPDjYK34bFretcOXS1VAfDA1ax9KzBCN2f12VQ2lx81yt0k6ul9SA qar3zus8nYrzXumcM7fRCsLW
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Oct 27, 2021 at 11:59:47AM +0000, Oleksandr Andrushchenko wrote:
> 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.

I think you assume that there will always be a hardware domain with
vPCI enabled that will get the device assigned and thus init_bars will
be executed prior to assigning to a domU.

But what about dom0less, or when using a classic PV dom0? In that case
the device won't get assigned to a hardware domain with vPCI support,
so the vpci structure won't be allocated or filled, and hence
init_bars would have to be executed when assigning to a domU.

Thanks, Roger.



 


Rackspace

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