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

Re: [PATCH v6 4/5] [FUTURE] xen/arm: enable vPCI for domUs


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
  • Date: Wed, 29 Nov 2023 21:47:57 -0500
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.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=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=ZPOxGdby4vw2bgFi3dCXqtxg3eEMOY1rd9+alhZLbi0=; b=enZ7zzS7aQ4ClRUwV4gjctzS6ay+tNzFbTJhqIfg5814ro6/RpYC1qsRZjqY8TH23/zU7Smzd82XKQIufphK1iLvYuDZt2XxHRNEWlMDjdEDYaAW7FmOE8QL/pQvFVtw+F0cEEmkLchJFuPYH1ueGSRAJKcN7trntQjAtAbihbD/DSZ+tSg/MiIruDk/BbqGWT4O/WYYa7Wx55NPIbDDfqJDPBmaqgR+YpPZNrVY2X95pOeFie+CCaJakY6KcnTAjspkbYoH/2D89VkVJTQcF6UQ/wfVm8G/BGbqCaj3h6k99iQ4CvR7OyI4JRuQ7xZ/OJBurZk+SBUWqdkOyZAk7g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ffza6LNleUs+7QOu4KnoE4Sv5iew3C41EwWX9bHUWc0goEPRC90v4M/KHg9AD4lSjYnlgX3cMN2Iadnk5HHkKd5CyNTbk3VNcKsWaZVOJhoWA1pYotPVCCSFqyHrqASvTYT0517u/CqJPNZowuc1GRO2n3JGLW/90ogu5/zKAxyPlzEXBfKw7fFjGNIrvGy6sKnRyJ4nE7Yv8P2BBU9+GOrwRDOcYRygskfixcWielAH+rqD8NlHjk4L4kx/tg2gs+3bM5sxoMrzOIYdDY7CHFEfq/IWdQz3u96DIC3LcUPlp/sDv4+vyIalG8RfWFvrxlFa1teoSZ6uN1o8sPrEBw==
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 30 Nov 2023 02:48:16 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 11/14/23 04:13, Jan Beulich wrote:
> On 13.11.2023 23:21, Stewart Hildebrand wrote:
>> --- a/xen/arch/x86/include/asm/domain.h
>> +++ b/xen/arch/x86/include/asm/domain.h
>> @@ -503,6 +503,8 @@ struct arch_domain
>>  #define has_vpit(d)        (!!((d)->arch.emulation_flags & X86_EMU_PIT))
>>  #define has_pirq(d)        (!!((d)->arch.emulation_flags & 
>> X86_EMU_USE_PIRQ))
>>  
>> +#define arch_needs_vpci(d) ({ (void)(d); false; })
> 
> See my comments on the v5 thread on both this and ...

So, the goal here is to return true for a PVH dom0, and false otherwise (for 
now). Since dom0 can't feasibly be full HVM, and is_hvm_domain(d) returns true 
for PVH, how about the following?

/* TODO: re-visit when vPCI is enabled for PVH domUs. */
#define arch_needs_vpci(d) ({                       \
    const struct domain *_d = (d);                  \
    is_hardware_domain(_d) && is_hvm_domain(_d); })


Link to v5 thread for reference [1]
[1] https://lists.xenproject.org/archives/html/xen-devel/2023-11/msg00968.html

> 
>> --- a/xen/drivers/passthrough/pci.c
>> +++ b/xen/drivers/passthrough/pci.c
>> @@ -1542,6 +1542,18 @@ void iommu_dev_iotlb_flush_timeout(struct domain *d, 
>> struct pci_dev *pdev)
>>      pcidevs_unlock();
>>  }
>>  
>> +static bool needs_vpci(const struct domain *d)
>> +{
>> +    if ( is_hardware_domain(d) )
>> +        return false;
> 
> ... this.

I'll move this check to the Arm arch_needs_vpci() in 
xen/arch/arm/include/asm/domain.h

> (It is generally a good idea to wait a little with sending new
> versions, when you can't be sure yet whether the earlier discussion has
> settled.)

(Sorry, I'll be better about this going forward.)

> 
> Jan



 


Rackspace

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