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

Re: [PATCH 09/11] xen/arm: Setup MMIO range trap handlers for hardware domain


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • Date: Wed, 15 Sep 2021 04:50:06 +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=YFEIHkrqVx3dzdXzYlJfTvgvrLVAsNPXYEvsCpIhXB4=; b=defh8b78xl8NtjsLGCqX2Dn2QCrGKlvJ5ztywNY9NfEKdpA52YHXErNLk7frRIVTyhT29F6Fb9uzQBvsJ2BSWmxqa5V/sauRlrjz+BdbnSO0IeW3Qrx32qmiPuXqWRDYLyLjv7w/OKczpnS5FWtCS21fRBJnpGWVvs3Pf5OqsLefFCHLG70QC4IAulO/KkNHlXepNt3j/hosYzFt2t0XxPXmlSsqH75jfc5OYizlo2zCEF+T6rKvwYaYYSMV8RyneB3iC1KxTflQx4TCsPcGzi165E4AWc2XlH3/M0NlrtYKMn3/Uk5OBlykafTjMEsNKOj00CYht9Yhz3R13/AvKQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lYFbiSrE68zkQMFUiblj/BkwSqmrdZuRN5GgC9qnzFFecjj+XpJtC8glmvbWYuiMk9AZ8yq2SLf0UeUQzwK0dv92yhHDdo4SfmNJqGnzCXvmFSMGRQpHRS5j+bUQeG1F5ZxBHppKCiaAuekFeYSVyPwSgm6G8YEAPU/Q/5iy6xhdJCeEaKCYZGpKSz6KT3FgT2DmKz2YkhQ3dAAxmY8LTDAw4eU7vioCww1OShWOkoDWWJi2WO8LXK9zJPX4S75ta+Ei59D3ynvsjpe0gj9Y8keGh+Yl5lB+oJTvfaAEh/apFatSyQxfUpp+afrrdAOqptm9/KF0ueWlHOyBYV2dqA==
  • Authentication-results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=epam.com;
  • Cc: Julien Grall <julien@xxxxxxx>, 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>, Oleksandr Andrushchenko <andr2000@xxxxxxxxx>
  • Delivery-date: Wed, 15 Sep 2021 04:50:31 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHXoJ6eIuPEzuAZLUmx1GA90MGEBKucAxCAgAEt4ACAABanAIAAAwIAgAABgYCAAAHPAIAAAcgAgAABzYCABkt1gIAAsi4AgABJ7oA=
  • Thread-topic: [PATCH 09/11] xen/arm: Setup MMIO range trap handlers for hardware domain

On 15.09.21 03:25, Stefano Stabellini wrote:
> On Tue, 14 Sep 2021, Oleksandr Andrushchenko wrote:
>>>> What you want to know if how many times register_mmio_handler() will be 
>>>> called from domain_vpci_init().
>>>>
>>>> You introduced a function pci_host_iterate_bridges() that will walk over 
>>>> the bridges and then call the callback vpci_setup_mmio_handler(). So you 
>>>> could introduce a new callback that will return 1 if 
>>>> bridge->ops->register_mmio_handler is not NULL or 0.
>>> Ok, clear. Something like:
>>>
>>>      if ( (rc = domain_vgic_register(d, &count)) != 0 )
>>>          goto fail;
>>>
>>>      *find out how many bridges and update count*
>>>
>>>
>>>      if ( (rc = domain_io_init(d, count + MAX_IO_HANDLER)) != 0 )
>>>          goto fail;
>>>
>> I have the following code now:
>>
>> int domain_vpci_get_num_mmio_handlers(struct domain *d)
>> {
>>       int count;
> count is incremented but not initialized
Excessive cleanup before sending ;)
>
>
>>       if ( is_hardware_domain(d) )
>>           /* For each PCI host bridge's configuration space. */
>>           count += pci_host_get_num_bridges();
>>       else
>>           /*
>>            * VPCI_MSIX_MEM_NUM handlers for MSI-X tables per each PCI device
>>            * being passed through. Maximum number of supported devices
>>            * is 32 as virtual bus topology emulates the devices as embedded
>>            * endpoints.
>>            * +1 for a single emulated host bridge's configuration space. */
>>           count = VPCI_MSIX_MEM_NUM * 32 + 1;
>>       return count;
>> }
>>
>> Please note that we cannot tell how many PCIe devices are going to be passed 
>> through
>>
>> So, worst case for DomU is going to be 65 to what we already have...
>>
>> This sounds scary a bit as most probably we won't pass through 32 devices 
>> most of the
>>
>> time, but will make d->arch.vmmio.handlers almost 4 times bigger then it is 
>> now.
>>
>> This may have influence on the MMIO handlers performance...
> I am OK with that given that it doesn't affect performance until you
> actually start creating too many virtual devices for the DomU. In other
> words, find_mmio_handler restricts the search to vmmio->num_entries, so
> as long as most entries are allocated but unused, we should be fine.

Ok, fine, so I'll have this change as above in v2.

Thanks,

Oleksandr

 


Rackspace

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