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

[RFC XEN PATCH 2/6] vpci: accept BAR writes if dom0 is PVH


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "Anthony PERARD" <anthony.perard@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Huang Rui <ray.huang@xxxxxxx>
  • Date: Sun, 12 Mar 2023 15:54:51 +0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=citrix.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=7H1lvZLVrUyYMTjixlNAUXTLFqacVwjL/tsS+Mp+YSE=; b=oMZQKfSHyPDFMz/WgFcDqzwFhJIvf9zxOi2Or+mafz/UDV5aum9jp0lIYwLxCbHzRV6X9t7T7iFd0aZnJLqdoPclInQHzacw+pg+eD9DbNVd8yfxHgA9D2gV9ypLwck7z6wgrHeLuKXN6z6VZepPM/Cw/DVwmvTjLIjogrX9PwAe7Dt+34W4pTxOuRTstKMm0NyZO5huqDVBoVSdEOd1WzojpEf9dkFVlyWFLyn6O5LhwoVqJx4Vp/67CV8tbz/fcw4CqUzFr0uCquyyg7rYQjvLXpBueA+sEgpCiiEPy6n4Fe+DI285OjYGPjNtRztbCQ8QXswmzCWcEe8tNBe4zg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PjMwgE8mPP0SiC4FrlJnrf//RiKlmVb/kwUWp0dOLZI3XpNR/I58JUdHTN0+sNm2XMb8jTrDu7rst67z6Q0Qc+Q4QdnpUNT+ojYicyFS68w4nVp8nOvzRSYAZZSzB7DCZhF5tsX4UHvl2d3aPPe9jjMt6fRTZt+ymazWBvqFQS7sG6kR2uuPVgR4ERTjUO64AZ3SCEqCz8Ffw40A4UEfPvWiWB1l/Po6JpSoBPp5j3D3PevS5lDVq6S3O4aspk34m6DXpZAOWc3Zv7Xe7NkhFrOKc2A8hnH39MuCF59b7CWVHcusaxO1z/z5g+8MD5GkBrmrRsQyQdT07S6xpJjytw==
  • Cc: Alex Deucher <alexander.deucher@xxxxxxx>, Christian König <christian.koenig@xxxxxxx>, "Stewart Hildebrand" <Stewart.Hildebrand@xxxxxxx>, Xenia Ragiadakou <burzalodowa@xxxxxxxxx>, Honglei Huang <honglei1.huang@xxxxxxx>, Julia Zhang <julia.zhang@xxxxxxx>, Chen Jiqian <Jiqian.Chen@xxxxxxx>, Huang Rui <ray.huang@xxxxxxx>
  • Delivery-date: Sun, 12 Mar 2023 07:55:47 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

From: Chen Jiqian <Jiqian.Chen@xxxxxxx>

When dom0 is PVH and we want to passthrough gpu to guest,
we should allow BAR writes even through BAR is mapped. If
not, the value of BARs are not initialized when guest firstly
start.

Signed-off-by: Chen Jiqian <Jiqian.Chen@xxxxxxx>
Signed-off-by: Huang Rui <ray.huang@xxxxxxx>
---
 xen/drivers/vpci/header.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
index ec2e978a4e..918d11fbce 100644
--- a/xen/drivers/vpci/header.c
+++ b/xen/drivers/vpci/header.c
@@ -392,7 +392,7 @@ static void cf_check bar_write(
      * Xen only cares whether the BAR is mapped into the p2m, so allow BAR
      * writes as long as the BAR is not mapped into the p2m.
      */
-    if ( bar->enabled )
+    if ( pci_conf_read16(pdev->sbdf, PCI_COMMAND) & PCI_COMMAND_MEMORY )
     {
         /* If the value written is the current one avoid printing a warning. */
         if ( val != (uint32_t)(bar->addr >> (hi ? 32 : 0)) )
-- 
2.25.1




 


Rackspace

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