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

Re: PCI passthrough: possible bug in memory relocation


  • To: Mateusz <mati7337@xxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 4 Apr 2022 15:03:41 +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=6+2xlrgRHzQbJ4h/+EbSyZ1KEG/IJVa9mrLfiMZpFD0=; b=HYKRMCP7AD8L607Lcx8vPRBpuFb7PnvUpYASHc23c20i/NlndrfxatZr+CXvYEyQim+e12dLYodREIQ6TeO+7Bx9lMyq8gB4dGzZyfOrxTfsZtYH97iCC1Xrs6/OjFo7UWMCRInfa7B0nvlsCwSxvRX+PAewFUetLxnkhEB72BjBQxQ4VmPPjczBcGekImXkpBeTh3aADMN7ao7h+yokeQE1JuqgB1MdmOP+D88WZgUVgs9ec3sNNndqLQvprFVgOyyRiazC35Dk/uBPmqKzi+q6ysht6ULlPGMv1UTySX1IYmIFi9hkqB3NWcMkZv8fFlzBCm1Q7b+ZoV2k79JqKQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mgTsLv3mPA86twYextMKvsnZkdxefdRqJShe3ptpSNAnJTqSBp2y8MqN1UX2Ac4KzSohLF1HVCUC1JEKGj/u4SL+UQtj/JxSOBkVV/LHwZkkohSV41KW3ngOJYgFB5NmWYT6OojKUObMm7e3XqRC3mu74piLqzDOmhAxSWBeMeJgsrIc30tKQC3GbHx8A3by622YaMyy8VGP5TPVyVfLdKJ+uIvMC7NWrC0hDy7JheHTSgaDrPXZEZ40hCFaIxGC3lkE2ClerNHaPXrQMX4KjJh19DqeNXdxlOx2Wsx8tXCC/q0GUzk66rtqvgmbx8UHhpnLwHI+Sh6VTN/mzh2GpQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 04 Apr 2022 13:03:52 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 04.04.2022 01:24, Mateusz wrote:
> Hello,
> I'm working on resolving a bug in Qubes OS. The problem is that
> when someone gives a VM too much RAM the GPU passthrough doesn't
> work as intended. I think it's because in these cases RAM overlaps
> with PCI addresses and memory relocation doesn't work in Xen.
> 
> Here are the memory BARs of the GPU I've tried to passthrough:
> Memory at f3000000 (32-bit, non-prefetchable) [size=16M]
> Memory at e0000000 (64-bit, prefetchable) [size=256M]
> Memory at f0000000 (64-bit, prefetchable) [size=32M]
> 
> The interesting thing is that in xl dmesg hvmloader prints these
> lines:
> (d1) Relocating 0xffff pages from 0e0001000 to 187000000 for lowmem MMIO hole
> (d1) Relocating 0x1 pages from 0e0000000 to 196fff000 for lowmem MMIO hole
> so it looks like it tries to move these pages to a different address
> to make space for PCI memory, but for some reason it doesn't work.
> Changing TOLUD to 3.5G solves the problem.
> I tested it on xen 4.14.3
> Here's the issue on github regarding this problem:
> https://github.com/QubesOS/qubes-issues/issues/4321
> 
> Is it a bug in Xen and fixing it would fix the problem or is there
> something I'm missing?

I'm afraid answering this requires debugging the issue. Yet you don't
share any technical details (as to how things don't work, logs, and
alike), and the provided link also doesn't look to point to any such
information (and as an aside I consider it somewhat unfriendly to
point at such a bug as an information source, not just for reference).
I'm pretty sure this code in hvmloader did work at some point, but
since it may be used quite rarely I could see that it might have got
broken.

Jan




 


Rackspace

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