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

Re: [PATCH] xen/arm: fix SBDF calculation for vPCI MMIO handlers


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • Date: Wed, 27 Oct 2021 09:46:06 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.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=rWcTn89i7Mn/dAYxkBX410tb9WadxnadmchSVN5TjUY=; b=KNdY9wkWxPHLUeY3VUfDbW7cX6OAYsOFtnvO3NgxbzsA7r5S3Fp0RTEyipwx3Uu2+JiKwr68GbiSOEiUiPj7TqipUUdHBNkGXRvHetBS3xuoFdSsBH/0fL0pAnK+eYd2nz/b6WfgdNdjuVeloht+SVBbDS4zzX7XhASnJjkW7yxZBHyD03vafNCdOhyoq9A0THF+aVijDEKukrivigS4AAZSg0Rxv2lp4CaknzWTYgryYBahQcgYi0LmMACthqZcxKZVz0dICrF01eux8HAPsDOFUAxBedoYqGBL9QujVpSyIJU5NNoO6cHToS1AJ2aOMT7daYJPByQcKfBHjKpBDw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hW76mk+6I5xpfyvC+8t8ICHgWvUuctkINpzoUM9dAJvQTban+KU2fl8vjQcyxb9aF1bxDLlE0eDVHRbAd8N8qSMwJY/2yZn39//4hYRGIJJ0dot4KimhNz5rHSX/sJa1YtoENzDzRomNqolwa33fFL/D3O9peQO8p+kdOU1xzpO8DB8UrjWvPxyKoXjF8IwNitk+EUmDuVP/eAe+N+sXbSwifADHVLC0kveQ5gJe8j/9vqo0VnN8MdqhvihiomZlu8pmzPeJ82HfAfRYziuL7Ysfqqx40yeHrPCuUMPbXK+sKbqZc9dn9OcaLOaOZ11DvMwMpN9PBUkmz7lrH7iZmw==
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "julien@xxxxxxx" <julien@xxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, "iwj@xxxxxxxxxxxxxx" <iwj@xxxxxxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Rahul Singh <rahul.singh@xxxxxxx>, Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • Delivery-date: Wed, 27 Oct 2021 09:46:19 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHXyww6rKHs3LJru0q52eLUia+oNavmi9YAgAABaACAAAVYAIAABjyA
  • Thread-topic: [PATCH] xen/arm: fix SBDF calculation for vPCI MMIO handlers


On 27.10.21 12:23, Roger Pau Monné wrote:
> On Wed, Oct 27, 2021 at 09:04:39AM +0000, Oleksandr Andrushchenko wrote:
>> Hi, Roger!
>>
>> On 27.10.21 11:59, Roger Pau Monné wrote:
>>> On Wed, Oct 27, 2021 at 11:25:33AM +0300, Oleksandr Andrushchenko wrote:
>>>> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>
>>>>
>>>> While in vPCI MMIO trap handlers for the guest PCI host bridge it is not
>>>> enough for SBDF translation to simply call VPCI_ECAM_BDF(info->gpa) as
>>>> the base address may not be aligned in the way that the translation
>>>> always work.
>>> I think I've already raised this during review [0]. But this is only a
>>> problem if you change the current value of GUEST_VPCI_ECAM_BASE
>>> AFAICT, as the current value has bits [0,27] clear.
>> Exactly, so we were just lucky not to hit this before
>>> I assume this is a problem for the hardware domain that needs to trap
>>> random base addresses as present on hardware, but that code hasn't
>>> been committed yet.
>> Yes, I am facing this on the real HW when Dom0's access is trapped
>> and the base is not taken into account. So, I have a patch for the
>> future upstream which subtracts the relevant base from the gpa,
>> e.g. either GUEST_VPCI_ECAM_BASE or bridge->cfg->phys_addr
>>> If that's indeed the case, please expand the commit message to contain
>>> this information.
>> I can only mention about "the current value of GUEST_VPCI_ECAM_BASE
>> AFAICT, as the current value has bits [0,27] clear" as of now because
>> Dom0 traps are not yet there.
> Indeed, I would rather mention both cases, ie:
>
> "This change is not strictly required given the current value of
> GUEST_VPCI_ECAM_BASE which has bits 0 to 27 clear, but could cause
> issues if such value is changed, or when handlers for dom0 ECAM
> regions are added as those will be mapped over existing hardware
> regions that could use non-aligned base addresses."
Sounds good, will add
>
> Regards, Roger.
Thank you,
Oleksandr

 


Rackspace

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