[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] xen/arm: fix SBDF calculation for vPCI MMIO handlers
- To: Julien Grall <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
- Date: Thu, 28 Oct 2021 18:00:22 +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=cpKiKheWiTfjBLTy5YHdUPBNxXxGmMNB11suL+eBGNc=; b=GhCS3WoeGNSiyHNH4Q8S+aaI6+WZue8MDfKi4ip+M8nvKFvZZyFf2vgsC1S8NYV5PUdDLf4iyINiDBTA2mUZCGQF2tWTlDYV5X4HljN/703qbUfeq+tjbxnAWbkPOHccBEJ8sO89GAyUISmHRfFMsDftI5Qt6+AYt+IZmRm6vG6S0xTf0jm4Nozcowhu39p0hGND4IsgjiSxTNBvbPVy6HP+vQjmmE53+Uo3WqGpqNGRjtJe0ROHgARqXhvSM2Jt4kU2OLsR52GHSFi+VGdBXAYmOqXEsI6jOL140u3y74U/7kBfGWte0ZvrMsgP4Q0cPgDkVcfYMQul8eKc3wiT7A==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X1Y8EgoeCu24OTmpEfOPHEl1nPjrvA0v8M+ujpiXwC+4PlXETXq19Vj6Q3bk+AhRql/7PplPVvTuGRu5PDAPX2/E7Qw5xj/GyVrfErs7ypI9bBpXE0DwX5UIbi0QqpHbs7AeKH4inH8CqkUHuUenyUfwxLnwvAtOf3n4kol8SkRkndxV4kwPXcIlSdYUQMkBxAwq/KwvOA3dZyL5I5KXtjF0C4NMzyO9z1V3KGDcr6OZZ9VcJJVXjQH+GF2ZBbc9lYuRnALf0nP3EKD1gKURxNphnhiYoYyvdNGf89d34tuV32X32Wi/SbiyQS7Bf0f66no72Br68zoYowoWRHT7vQ==
- Cc: "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Rahul Singh <rahul.singh@xxxxxxx>, Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
- Delivery-date: Thu, 28 Oct 2021 18:00:36 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHXyww6rKHs3LJru0q52eLUia+oNavnHBIAgAE3H4CAABSQgIAADtGAgAADkwCAABB5AIAAAiIAgAAofwA=
- Thread-topic: [PATCH] xen/arm: fix SBDF calculation for vPCI MMIO handlers
On 28.10.21 18:35, Julien Grall wrote:
> Hi,
>
> On 28/10/2021 16:27, Oleksandr Andrushchenko wrote:
>> bridge as private and using info->gpa - GUEST_VPCI_ECAM_BASE...
>> So, I would stay with simpler
>>
>> if ( bridge )
>> {
>> sbdf.sbdf = VPCI_ECAM_BDF(info->gpa - bridge->cfg->phys_addr);
>> sbdf.seg = bridge->segment;
>> }
>> else
>> sbdf.sbdf = VPCI_ECAM_BDF(info->gpa - GUEST_VPCI_ECAM_BASE);
>
> I am fine with that so long this is part of an helper (maybe
> vpci_sbdf_from_addr()) rather than duplicated.
>
Ok, I will implement a helper then:
pci_sbdf_t vpci_sbdf_from_gpa(const struct pci_host_bridge *bridge, paddr_t
gpa);
> Cheers,
>
Thank you,
Oleksandr
|