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

Re: [PATCH v2 07/11] vpci/header: program p2m with guest BAR view


  • To: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 29 Sep 2021 10:36:42 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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; bh=oefe4BjwUZx0knaWRCIB7JYsRVkYHVMnovphYg5Xm0A=; b=KVlZFZ+vYr+z+sq2BXL8RY87n3QCXWkF9Odt1+3ESvjjkuC06v7vf2wY7EtkLaqporuL5MsiybjS7NcfxJXApf+TXhbFWe1zNKk9YrmhNhaC7UbzYU8GmTpT0Izy3ixXFi+xYamD2Et0q/XE70kTJ7et3E62zs3rHABMcZgJYyp441osDMZj7HUswnP2kL7EN7Ob+zoOSYzIagkyoYGfdx0f3L83+qLP4ddeU1v25FFsy9wJY50ALwWPouNFB9XY+O0tDdO789wFYGUR1VVIRPjcVMFLzrHxd9sOpYtKOZjW0HE5Eu53CclE6MQhFo8VayesmcXNS65eP4370+HXKg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l5jiwILP65IbWKx8pwshEGoNLnkfXTbi0UdJyxD/IdGP2qiD4wf3bNQCb8+vTvlvHYJDdD7q/Jir7Z9z7SiXSTgUk780IX1rAZXIiZfqD+zw0t5cr3v4Ima0whaWdQQm+fA7L5ue38XifoSp8ESthtlnEoKvc0VnLX96/GtOtNgArkGfoGGl7nzVQsQMhQr2UXTwYbyS1ODnQHypPPHeSAYHk2G6uBM9/xzZRlHljG+Jg+vSgYCiqiwBu/LGH4+BNOYBxWDFywll2D8QLD0QjhG/qcQGpSw3J8oHDFaY0jfhKgqnm3bL+Spt/bldq3Q4gKtbDAA7/HJob1o+DD4V1g==
  • Authentication-results: arm.com; dkim=none (message not signed) header.d=none;arm.com; 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>, "roger.pau@xxxxxxxxxx" <roger.pau@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Rahul Singh <rahul.singh@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>
  • Delivery-date: Wed, 29 Sep 2021 08:36:59 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 29.09.2021 10:24, Oleksandr Andrushchenko wrote:
> 
> On 29.09.21 11:16, Jan Beulich wrote:
>> On 29.09.2021 10:13, Michal Orzel wrote:
>>> On 23.09.2021 14:54, Oleksandr Andrushchenko wrote:
>>>> @@ -149,6 +172,10 @@ bool vpci_process_pending(struct vcpu *v)
>>>>               if ( !bar->mem )
>>>>                   continue;
>>>>   
>>>> +            data.start_gfn = is_hardware_domain(v->vpci.pdev->domain) ?
>>>> +                _gfn(PFN_DOWN(bar->addr)) :
>>>> +                _gfn(PFN_DOWN(bar->guest_addr));
>>> I believe this would look better with the following alignment:
>>> data.start_gfn = is_hardware_domain(v->vpci.pdev->domain)
>>>                   ? _gfn(PFN_DOWN(bar->addr))
>>>                   : _gfn(PFN_DOWN(bar->guest_addr));
>> FWIW I agree, yet personally I think the conditional operator here
>> even wants to move inside the _gfn(PFN_DOWN()).
> 
> I can do it as well:
> 
> data.start_gfn = _gfn(PFN_DOWN(is_hardware_domain(v->vpci.pdev->domain) ? 
> bar->addr : bar->guest_addr))
> But, help me please breaking it into multiline with 80 chars respected

Besides the option of latching v->vpci.pdev->domain or
is_hardware_domain(v->vpci.pdev->domain) into a helper variable,

            data.start_gfn =
                 _gfn(PFN_DOWN(is_hardware_domain(v->vpci.pdev->domain)
                               ? bar->addr : bar->guest_addr));

or

            data.start_gfn =
                 _gfn(PFN_DOWN(is_hardware_domain(v->vpci.pdev->domain)
                               ? bar->addr
                               : bar->guest_addr));

Jan




 


Rackspace

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