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

Re: [PATCH for-4.17 v3 1/2] pci: do not disable memory decoding for devices


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 27 Oct 2022 16:29:05 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=25kprHdriuNril/eVKR4vAB0OGMSnilqE15qTFK8Gio=; b=HNA0/StC3ZfaJ6NrMTfP0ZNn1XW+NPOgUoqfGWGQolvxBaQwHxQlWAUamYsU8cYhSFt4NzFYr4sUUPwHBxZgimUQ8z3o70+L3hCyNM1TsQGzXT7SJvV4pACIyNclWuaHde3rGREXJe2b+1FhdC0T1B/tsCNWSRFoz6O8X6crI/wpg6Pc9LGuKBZ3tOL4QXyRWQYXCk4A1RR1hjPNq4h/FQhWtpNL8Z2jHLPaVNLM/HeVHcn3waPzkvBa4wKVm3D1Xj+Dag5Pb4zU+UkO14CY8pVfMo4Cd7SXqZNCEnMalXHbcZmXRwHLzJnGG4UcqzRrAljldX2Hb8aDv9WHSERv5w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gGKrn/G9fock1u8k06sqA2WtvBa/vwNueCuJqPoa+7paeBMD3HRLEKUOXXPIO9Da+11MgAiRZ2xNS1s7+eApxLdv8Q744Ha+CQOHGueOIVxeHwjfe5CdvNh2uXQBkpBmb5vuZ0B0x/8Z870Gnsk1nlQKY8tVHY27o3BiVxgBe8qTVx4Cs5jDDIfOIepc4XlEcrAPieazbWXFAh1kxRKtxWMrC6QeyrIBk6qhStnwLJApA6pcfkMloq3/DKITmZi0cf+p+gzhIx30PfIrMrjeJ93lY7mpZA9OFAHA8FV/7wlpzN02rufDwdgWAAz6/YVt6/cfA+tNO1t+iGXbZEM1QA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Henry.Wang@xxxxxxx, Paul Durrant <paul@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 27 Oct 2022 14:29:18 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 27.10.2022 15:23, Roger Pau Monne wrote:
> Commit 75cc460a1b added checks to ensure the position of the BARs from
> PCI devices don't overlap with regions defined on the memory map.
> When there's a collision memory decoding is left disabled for the
> device, assuming that dom0 will reposition the BAR if necessary and
> enable memory decoding.
> 
> While this would be the case for devices being used by dom0, devices
> being used by the firmware itself that have no driver would usually be
> left with memory decoding disabled by dom0 if that's the state dom0
> found them in, and thus firmware trying to make use of them will not
> function correctly.
> 
> The initial intent of 75cc460a1b was to prevent vPCI from creating
> MMIO mappings on the dom0 p2m over regions that would otherwise
> already have mappings established.  It's my view now that we likely
> went too far with 75cc460a1b, and Xen disabling memory decoding of
> devices (as buggy as they might be) is harmful, and reduces the set of
> hardware on which Xen works.
> 
> This commits reverts most of 75cc460a1b, and instead adds checks to
> vPCI in order to prevent misplaced BARs from being added to the
> hardware domain p2m.  Signaling on whether BARs are mapped is tracked
> in the vpci structure, so that misplaced BARs are not mapped, and thus
> Xen won't attempt to unmap them when memory decoding is disabled.
> 
> This restores the behavior of Xen for PV dom0 to the state it was
> previous to 75cc460a1b, while also introducing a more contained fix
> for the vPCI BAR mapping issues.
> 
> Fixes: 75cc460a1b ('xen/pci: detect when BARs are not suitably positioned')
> Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>




 


Rackspace

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