On 10/23/23 06:27, Anthony PERARD wrote:
> On Mon, Oct 09, 2023 at 03:57:44PM -0400, Stewart Hildebrand wrote:
>> Select HAS_VPCI_GUEST_SUPPORT in Kconfig for enabling vPCI in domUs.
>>
>> Set the pci flags in xen_arch_domainconfig to enable vPCI if a pci device has
>> been specified in the xl domain config file.
>>
>> Signed-off-by: Stewart Hildebrand <stewart.hildebr...@amd.com>
>> ---
>> As the tag implies, this patch is not intended to be merged (yet).
>>
>> Note that CONFIG_HAS_VPCI_GUEST_SUPPORT is not currently used in the upstream
>> code base. It will be used by the vPCI series [1]. This patch is intended to 
>> be
>> merged as part of the vPCI series. I'll coordinate with Volodymyr to include
>> this in the vPCI series or resend afterwards. Meanwhile, I'll include it here
>> until the Kconfig and xen_arch_domainconfig prerequisites have been 
>> committed.
>>
>> v2->v3:
>> * set pci flags in toolstack
>>
>> v1->v2:
>> * new patch
>>
>> [1] 
>> https://lists.xenproject.org/archives/html/xen-devel/2023-08/msg02361.html
>> ---
>>  tools/libs/light/libxl_arm.c | 3 +++
>>  xen/arch/arm/Kconfig         | 1 +
> 
> Can we have two different patch? One for the hypervisor, one for the
> tools.

Yes.

> Or does the both depends on each other, somehow?

They will both be needed for enabling vPCI in a domU on ARM with assigned PCI 
device(s).

> 
> Is guest creation going to fails if we set XEN_DOMCTL_CONFIG_PCI_VPCI
> without HAS_VPCI_GUEST_SUPPORT ?

No, currently the guest will still run, it just won't be able to probe any 
assigned PCI devices.

> 
> Is the guest is going to fail to run, or fail at creation if the
> hypervisor HAS_VPCI_GUEST_SUPPORT, but we didn't set
> XEN_DOMCTL_CONFIG_PCI_VPCI?

Assuming num_pcidevs > 0, the guest will be created but fail to boot as it will 
try to access the vPCI configuration space, but it will trap and panic.

In both cases, I think I can do more on the hypervisor side to check for an 
invalid configuration and refuse the domain creation with a helpful error 
message.

In either case, if a user does not try to assign a PCI device (i.e. num_pcidevs 
== 0), then the guest will run fine.

> 
> Thanks,
> 
> --
> Anthony PERARD

Reply via email to