|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v8 2/5] xen/arm: Enable the existing x86 virtual PCI support for ARM
Hi, Jan!
On 18.10.21 10:47, Jan Beulich wrote:
> On 15.10.2021 18:51, Bertrand Marquis wrote:
>> --- /dev/null
>> +++ b/xen/arch/arm/vpci.c
>> @@ -0,0 +1,77 @@
>> +/*
>> + * xen/arch/arm/vpci.c
>> + *
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License as published by
>> + * the Free Software Foundation; either version 2 of the License, or
>> + * (at your option) any later version.
>> + *
>> + * This program is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
>> + * GNU General Public License for more details.
>> + */
>> +#include <xen/sched.h>
>> +#include <xen/vpci.h>
>> +
>> +#include <asm/mmio.h>
>> +
>> +static int vpci_mmio_read(struct vcpu *v, mmio_info_t *info,
>> + register_t *r, void *p)
>> +{
>> + pci_sbdf_t sbdf;
>> + /* data is needed to prevent a pointer cast on 32bit */
>> + unsigned long data;
>> +
>> + /* We ignore segment part and always handle segment 0 */
>> + sbdf.sbdf = VPCI_ECAM_BDF(info->gpa);
>> +
>> + if ( vpci_ecam_read(sbdf, ECAM_REG_OFFSET(info->gpa),
>> + 1U << info->dabt.size, &data) )
>> + {
> Here it is quite clear that the SBDF you pass into vpci_ecam_read() is
> the virtual one.
Not really yet
> The function then calls vpci_read(), which in turn
> will call vpci_read_hw() in a number of situations (first and foremost
> whenever pci_get_pdev_by_domain() returns NULL). That function as well
> as pci_get_pdev_by_domain() use the passed in SBDF as if it was a
> physical one; I'm unable to spot any translation. Yet I do recall
> seeing assignment of a virtual device and function number somewhere
> (perhaps another of the related series), so the model also doesn't
> look to assume 1:1 mapping of SBDF.
>
At the time of this patch we do not yet have a virtual topology
implemented which is added at a later stage.
So, when a DomU performs PCI enumeration it sees all the real
PCI HW and thus discovers all PCI devices with their *real SBDFs*,
e.g. just like we pass through all the topology to the guest.
So, in the question, SBDFs are physical
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |