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

Re: [PATCH v3 2/4] vpci: allow queueing of mapping operations


  • To: Mykyta Poturai <Mykyta_Poturai@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
  • Date: Fri, 3 Apr 2026 14:51:01 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=epam.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • 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=oC6lf+/IxzAXK7sLui9otpPRDv6pzf0mVrn8HUpJay0=; b=MIuMkyK0iSB6Z9njTlCsapLIwQTvSfGLwFrkbA5jcsCONNahr6ivmjkoz6IRzK8rl/jzp7q3LJ1wNutJn/kz0qeX4Uu2YW3GEMR7U1+4d4JhrcxS60hXKoSmpQ/jkwCouKOpczKka7XLNWxcD1ynCMECqr1q15BE2YYha8E/EpU2qTfCqwjOFyoT2sSb3hSsNHz3B3YfbK686Iqqn2jQzuYk8rvEV9N5v7S+jSK3kEfY9i/A+lQM3tVbsc3dIDi8Ue+RG7Oruhj433seNnegC+HI2clkTcMl+gDnflvQmawz+COSIZ+QCyzpjzMt3SRsUZzpQ2zbIOhQIKKIYKExDg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=B3hbgRxyaBq5CBnIW9dhbEvXJkU5l5GsdUmWJu6RCpfkRC+RPHLFH7k9XytesAnK1WcsQwsfTgovCEQzBXLNqOV1baY5OEpK3EW9b4+lOMGBid4DEe1nYl9kdNeeZMYiATq4a2Q6+cfizHy0hc9rbIs0bk2neUeWc+i0Iu/6mcZ8loldBUwdv2u5VffsQ8CYZ+rrT1yv9W02CeRAS8/iga5T0SKvE73kjVfKOy5iv28Pcu2jJZYrpR1aV306qVf1kw2JpFu6wdP5VzOeOs4rONCYvlTp5yESh9VVVcx+JudHAvnG01qLCzotaLP18+CgUZsdgI/JZO4KAo5H7jS07w==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Fri, 03 Apr 2026 18:51:28 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 4/2/26 11:52, Mykyta Poturai wrote:
> On 3/24/26 05:04, Stewart Hildebrand wrote:
>> Introduce vPCI BAR mapping task queue. Store information necessary in an
>> array in struct vpci_vcpu to perform multiple p2m operations associated
>> with single device.
>>
>> This is preparatory work for further changes that need to perform
>> multiple unmap/map operations before returning to guest.
>>
>> At the moment, only a single slot is needed in the array. However, when
>> multiple operations are queued and pending, there is a check in
>> modify_bars() to skip BARs already in the requested state that is not
>> accurate. Remove this check.
>>
>> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
>> ---
>> apply_map() and vpci_process_map_task() are very similar. Should we try
>> to combine them into a single function?
>>
>> v2->v3:
>> * base on ("vpci: Use pervcpu ranges for BAR mapping") from [1]
>> * rework with fixed array of map/unmap slots
>>
>> [1] 
>> https://lore.kernel.org/xen-devel/cover.1772806036.git.mykyta_poturai@xxxxxxxx/T/#t
>>
>> v1->v2:
>> * new patch
> 
> Hi everyone,
> 
> 
> Would it be possible to move back to a dynamically allocated number of 
> tasks? This would help with mapping SR-IOV virtual functions a lot. 
> @Stewart @Roger, what are your thoughts?

Yes, assuming each VF will need another queued map operation, and there could be
a lot of VFs, statically pre-allocating that much seems wasteful. Only the
control and/or hardware domains will queue a lot of operations, and only when
enabling SR-IOV. DomUs will only queue 1 operation (possibly 2 if we will allow
domU BAR writes with memory decoding enabled).

So I'll plan to switch back to dynamically allocated map tasks for v4.

> Alternatively, I can continue with an approach described in SR-IOV 
> series, where VFs are handled separately. I figured out how to return to 
> do_softirq after mapping each VF, so it should not block the CPU for too 
> long.
> 



 


Rackspace

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