[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: Jan Beulich <jbeulich@xxxxxxxx>
- From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
- Date: Wed, 29 Sep 2021 08:58:53 +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; bh=Y9yIjwUgEDjl0IhuAuptyB1XfD7qbghho+J9Lpgir7E=; b=O8xpdbKcKIiVw5H26FUPY+INu4TadXddB6ijbI1aGBw1WVIxgD0JjszAq8RoNoGbaJUFCTfdPn72CXk2IOnq8gMqJYtDCMBVMp+ETmxbGVyuEgf/sQrEIfqLirk1Y/SPUNGwnGZtTWz3wFR00EmGZSRi9NxPwDrb6Sir8xbP5KZVNq0pwuPOR54OcSj/bxMn8ngGQaYDdTVgDr++ng0SgeE72PEQlJ69WlMLCAa3w+pCEY0BB2TD3J8sRob9aFml97F2dhEByMHoeUSMp8hu9fA+EXp9RX1H1J9asjQPDXId43pJALsUYbxbSi3PTMW4uRNhBhJ4VZrVzzT/4viccw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VgXLDAgFNTrivUDY3h1uFxMsyfKSbi19j524k8TmEQiLCobo5uCEXWpCXe/RYBpfiKRsUbZ3BueMOcj6leOfCK/cyxwn065NEPC+oMHyWkbIhSP8KVYgx3t/Im87HM+0G8DfhS02UhZGFPmKYx7NeXlfCy2yyfQGycUhmaerFtgsWpVZwAFYdTWzzqArJVCIWAQdAkvRQQtTfsnDmOkgfsX1XC2fwuGA8qxPCAceLZtPAnpkorysx3Sjb5F9tVXrdfYqL1mXTdfRvudIwkl/iKMo6sZzGgK0VJXvczATLDfAEiUl9vsvA3FJs8/fsfiFGWg17DbwDXUdzxzFqYHF1Q==
- Authentication-results: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=epam.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:59:08 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHXsHpCfe0n3k8oF0eTl7KOfxT3R6u6ssAAgAAA3gCAAAIlAIAAA4oAgAAGMQA=
- Thread-topic: [PATCH v2 07/11] vpci/header: program p2m with guest BAR view
On 29.09.21 11:36, Jan Beulich wrote:
> 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));
I'll go with this one, thank you
>
> or
>
> data.start_gfn =
> _gfn(PFN_DOWN(is_hardware_domain(v->vpci.pdev->domain)
> ? bar->addr
> : bar->guest_addr));
>
> Jan
>
|