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

Re: [PATCH v5 08/11] xen/arm: Enable the existing x86 virtual PCI support for ARM.


  • To: Julien Grall <julien@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Tue, 12 Oct 2021 14:34:45 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.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:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0/OPZo2EJLtwgu0qtytCBTTOfvDfWlVEMa5hLZsP31E=; b=NS50L8N/3g7ecMHaUwotxBFalXgl/5t4qSWCcHc2JeJ0xICVhyBTTubAbR4LCwpM1mR0V1R4yBahuDWVT7w7qe9ckND3mQC3oOtDXD4easS9JUFAMEXqz82yACC2rMkS1O8UzC7qa+cMj8UNTM7JjP/fuzaY/2k2beVjCx+8ttQ9xExgxazayNCjsifYVlB3kUzviJgqZoWIry4xiWXEbsdLelFhS3rFAbXa6f3T2RGb1FxAYLzbRout7RAmSyxHP2+wSa41rH3PfgzK6UC6SBJ1XC9ToiZLyMbjcHiOLgFtQQuSIOGIDm2+FO16nl3i5TXrxHaO/tN/ZRXPI+BPeA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GmDLVRMmgKzX0CbWBuPn9c04w6p6SuI8GpOTHS3hBJU93fL5z733LFKPh8E65XOhXmxbrxjMxUf/OB+ISzODKekAd/h4eLSa8vU7QrT5vxogTyd05KGxDwhjVM4GKoOU5Dy6uMhNzftvl1k4hNm9vR30B/JD/a1WEnu8mzO2bucg4eTKFtvNZfZN/CArQPuxMk4c3vRPziv7VCwWqt6hIqm43K2NyaPBZwny3HcbNrnRYALwMeKQiELy48B2/vd71xEDVAsGIjHhdazzD6gZCn+immTBMcb6JzXi+GC2ImCjb0visKydUDzE59l6u80E+5CSGrSWSh+f7CxNRn7AwA==
  • Authentication-results-original: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Cc: Rahul Singh <Rahul.Singh@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andre Przywara <Andre.Przywara@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Wei Liu <wl@xxxxxxx>, Paul Durrant <paul@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Tue, 12 Oct 2021 14:35:03 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHXutl3YqS5dHXsYk6KpdKt4d14RavPdjAAgAAAt4A=
  • Thread-topic: [PATCH v5 08/11] xen/arm: Enable the existing x86 virtual PCI support for ARM.

Hi Julien,

> On 12 Oct 2021, at 15:32, Julien Grall <julien@xxxxxxx> wrote:
> 
> Hi Rahul,
> 
> On 06/10/2021 18:40, Rahul Singh wrote:
>> diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
>> index c9277b5c6d..91d614b37e 100644
>> --- a/xen/include/asm-arm/domain.h
>> +++ b/xen/include/asm-arm/domain.h
>> @@ -2,6 +2,7 @@
>>  #define __ASM_DOMAIN_H__
>>    #include <xen/cache.h>
>> +#include <xen/nospec.h>
>>  #include <xen/timer.h>
>>  #include <asm/page.h>
>>  #include <asm/p2m.h>
>> @@ -262,7 +263,11 @@ static inline void arch_vcpu_block(struct vcpu *v) {}
>>    #define arch_vm_assist_valid_mask(d) (1UL << 
>> VMASST_TYPE_runstate_update_flag)
>>  -#define has_vpci(d)    ({ (void)(d); false; })
>> +/*
>> + * For X86 VPCI is enabled and tested for PVH DOM0 only but
>> + * for ARM we enable support VPCI for guest domain also.
>> + */
> 
> This is the sort of comment that will easily get rot if we change the 
> behavior on x86. But I find a bit odd to justify the implementation based on 
> x86. Can we simply avoid to mention x86?

Yes I will remove the x86 part of it.

Cheers
Bertrand

> 
>> +#define has_vpci(d) evaluate_nospec((d)->options & XEN_DOMCTL_CDF_vpci)
>>    #endif /* __ASM_DOMAIN_H__ */
>>  diff --git a/xen/include/asm-x86/pci.h b/xen/include/asm-x86/pci.h
>> index e076951032..c4a4fdcbc2 100644
>> --- a/xen/include/asm-x86/pci.h
>> +++ b/xen/include/asm-x86/pci.h
>> @@ -6,8 +6,6 @@
>>  #define CF8_ADDR_HI(cf8) (  ((cf8) & 0x0f000000) >> 16)
>>  #define CF8_ENABLED(cf8) (!!((cf8) & 0x80000000))
>>  -#define MMCFG_BDF(addr)  ( ((addr) & 0x0ffff000) >> 12)
>> -
>>  #define IS_SNB_GFX(id) (id == 0x01068086 || id == 0x01168086 \
>>                          || id == 0x01268086 || id == 0x01028086 \
>>                          || id == 0x01128086 || id == 0x01228086 \
>> diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
>> index d46c61fca9..44be337dec 100644
>> --- a/xen/include/public/arch-arm.h
>> +++ b/xen/include/public/arch-arm.h
>> @@ -418,6 +418,13 @@ typedef uint64_t xen_callback_t;
>>  #define GUEST_GICV3_GICR0_BASE     xen_mk_ullong(0x03020000) /* vCPU0..127 
>> */
>>  #define GUEST_GICV3_GICR0_SIZE     xen_mk_ullong(0x01000000)
>>  +/*
>> + * 256 MB is reserved for VPCI configuration space based on calculation
>> + * 256 buses × 32 devices × 8 functions × 4 KB = 256 MB
>> + */
>> +#define GUEST_VPCI_ECAM_BASE    xen_mk_ullong(0x10000000)
>> +#define GUEST_VPCI_ECAM_SIZE    xen_mk_ullong(0x10000000)
>> +
>>  /* ACPI tables physical address */
>>  #define GUEST_ACPI_BASE xen_mk_ullong(0x20000000)
>>  #define GUEST_ACPI_SIZE xen_mk_ullong(0x02000000)
>> diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h
>> index 70ac25345c..43b8a08170 100644
>> --- a/xen/include/xen/pci.h
>> +++ b/xen/include/xen/pci.h
>> @@ -40,6 +40,8 @@
>>  #define PCI_SBDF3(s,b,df) \
>>      ((pci_sbdf_t){ .sbdf = (((s) & 0xffff) << 16) | PCI_BDF2(b, df) })
>>  +#define MMCFG_BDF(addr)  (((addr) & 0x0ffff000) >> 12)
>> +
>>  typedef union {
>>      uint32_t sbdf;
>>      struct {
> 
> Cheers,
> 
> -- 
> Julien Grall


 


Rackspace

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