[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:04:39 +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=Dv9zJQPL3nIqemrx8qq+x7E+SZ8svFnEHALGKBzaTDE=; b=aiA6fuIU+6SDyUIQc6fMelFhv9XsZPObGmUKK9Y2okfgVDp3hIS/M6YFSME+mAhUcveMRw8CtC8V9vi4ZbBgfyQE5JX3ZfaslTtCFf2vteoIPL+sXFBNw04m23NoAZANLRqcjOH6I9But7VPQRvxfLl6E390tydsexjxolAWqH4jkh0Uaz9GwE/6pLkv5W3TYC6qVIyDKJ8efTlcrlKv66TPisoY+B4mvlUZo+kl7C0nDIIkosF0j+KcTzy411oTg8XVh0ryiGhc4c7nMAgxTOnGFNwD0f9yJSZJxEJd0ERQWBm8sCnQ5ZNVSZks3b1A1gPKO6TQJYw5cMG0UYZhRA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U0Gv+Q9cBwpSno8syZtRhOvIgsm+AvcUGhpaxfb8Ab/OrPgEnKaMfMn4yEHGG2mm3DPrBIuHr7D5IgRShqzeQ9imyazNs4JsQqNhfhEM8vN89XzqsIH4xwmSwDedSo7E3OV3xk8JilJqpa7NQ9BbLSRYn1x38QtLiRd8iJvcXtTzPzgxl+egeiE3RWJupxBJJpxBpCdiqm2HgUzTT4ljLHs1B40/v28fWL2SIOtzqVMhZVVKOZ1pqmIgcoXF+qMh07bgXtbdRA8it4RhKFIgnSudFIrbrxhDH4BRwnkCqpLg7zJDP1MfL8rD/as9bWhcCsjn3+FOyKZhLyAuY1P7BA==
  • 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:04:58 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHXyww6rKHs3LJru0q52eLUia+oNavmi9YAgAABaAA=
  • Thread-topic: [PATCH] xen/arm: fix SBDF calculation for vPCI MMIO handlers

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.
>
> Thanks, Roger.
>
> [0] 
> https://lore.kernel.org/xen-devel/YWlnc3b0sj4akUWa@MacBook-Air-de-Roger.local/
Thank you,
Oleksandr

P.S. Sorry I failed to mark this patch as a fix for 4.16 and explain why it is
a good candidate for 4.16 inclusion

 


Rackspace

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