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

Re: [PATCH v2 6/8] vpci: add SR-IOV support for PVH Dom0


  • To: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Mykyta Poturai <Mykyta_Poturai@xxxxxxxx>
  • Date: Mon, 23 Mar 2026 09:46: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=arcselector10001; 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=0q0PiQZMLqqcTWoiLWBnffvBZD/sjOt+B4Icqn4BIa0=; b=mOeONoj+YhgTsGN2Fy4gW6htEVTp3UPAFuISNp3vKkGVKEvjQuMtb+HEJvuHQKVAohX1WKu4U7Lsay4Babk6a3bbexUDOkfeeTLPBZADCTSTnL4gPR380xQwxKpLQ26TsQ9o4dq1ijUNN+Yw0C7puwO56sWAK8IOgdd+08ACCb/80BdK9I6390Onsq94p5vp7KeQ0dUkcqclOdwHa5NIsTRJfNPTftCxghnhJ8iuEWPmvJvbuQZJGterLum3qcAVjKmGfxLyVDEjGd71G69K46PYTvay0igWpo5G5N9Jw7nxHkHE5y+hEQ5sjM081cBay1r6kJ0VqvK5BWEW5Hg+5Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=zN0K+9VnPHKafNXF4A7/YpIb4KuP/d/JPFYk3ZBpDWRPSxTeiBL9ngT5r/o2XRHW4bzCfCXZMWwZ48+W8oGtSpm8G4XAtkz/WQYhd40ZsRi7X4ZCfe8wRCFNyctsZPOZCMUt35ElhgCYcqYRnQTkPGiZWo5t6T9WtlSKmaOYaJoop0H5GN7efUJnIMWinG2mEaCKY/3ODaeF9e7HEf1cDI1tnFUM86zIpZ3xPsCC7TUqSZQmVuGx34WZh8ftiWjk+KYOgSsaPAM1MwWfg5uKVof8rsljVtDo44OJvTH2uAZi56PRRHEersovjnmvwXH6FWoQZNwj/CwwMBjxFo1BaA==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 23 Mar 2026 09:46:35 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHcr7UOJDdt9SAQzUinWXRod1IIzLW2apcAgAWJuwA=
  • Thread-topic: [PATCH v2 6/8] vpci: add SR-IOV support for PVH Dom0

On 3/19/26 23:11, Stewart Hildebrand wrote:
> On 3/9/26 07:08, Mykyta Poturai wrote:
>> From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
>>
>> This code is expected to only be used by privileged domains,
>> unprivileged domains should not get access to the SR-IOV capability.
>>
>> Implement RW handlers for PCI_SRIOV_CTRL register to dynamically
>> map/unmap VF BARS. Recalculate BAR sizes before mapping VFs to account
>> for possible changes in the system page size register.
>>
>> Allow forcing vpci_modify_bars to not defer the actual mapping changes,
> 
> I don't think this is suitable. We perform the p2m operations in a deferred
> context because they may take a long time. And since they may take a long 
> time,
> the logic is interruptible: in map_range(), we perform a 
> general_preempt_check()
> and return -ERESTART so that we give a chance for other pending work to
> complete, including the scheduler softirq. If vpci_process_pending() returns
> true, it will be called again and is expected to resume where it left off. The
> vcpu won't continue until vpci_process_pending() returns false.
> 
>> which is needed to fix the sequential calls to vpci_modify_bars when
>> enabling VFs from Dom0.
> 
> I'm guessing you resorted to this because you need to perform multiple mapping
> operations, but the vPCI deferred mapping mechanism only supports a single
> operation? If so, this is an issue I've been attempting to resolve for some 
> time
> with the BAR-write-with-memory-decoding-enabled series [1]. In that series I'm
> working on introducing the ability perform multiple mapping operations. I'm
> almost ready to send v3 of the BAR-write-with-memory-decoding-enabled series,
> and I hope you don't mind that I include your patch ("vpci: Use pervcpu ranges
> for BAR mapping"). You may consider the possibility of basing SR-IOV on this
> work if suitable.
> 
> [1] 
> https://lore.kernel.org/xen-devel/20250723163744.13095-1-stewart.hildebrand@xxxxxxx/T/#t
> 

I’ve looked at your changes, but there seems to be a push against 
dynamically allocating tasks, which would not work with SR-IOV, or 
require a lot of task structs to be preallocated and used very rarely.

> Regardless, ultimately we need to find a way to return from
> vpci_process_pending() during the potentially long-running p2m operations.
> As an alternative suggestion, could you return from control_write_cb() after
> each call to map_vfs(), and somehow make it resume where it left off?

I’ll try this approach, thanks.

-- 
Mykyta

 


Rackspace

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