[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC XEN PATCH 2/6] vpci: accept BAR writes if dom0 is PVH
- To: Huang Rui <ray.huang@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- From: Christian König <christian.koenig@xxxxxxx>
- Date: Mon, 13 Mar 2023 08:23:01 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.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=vlJ4v+r0McIcfyEiKv4x1zw5gUvPSBstkFAYS/R5vzo=; b=e9KwaT5w9sopSUI2EV1t4Vz/E4nTNd5NTNBs6WOKDND6VWHEFjOgGoZPz7IqzrV7hLYcONOXnKezLjKvZwBPYXEsCcQUw8XaJb64Vtd5A/rzsdB3cxCNuQz20FF6aOH4LwDZPX5zsd3JvClXxhmQCzZm+vGE5XSgCdWZNIb1JKLIu4q4cyA3fuOeEQbe6NWuKibpkXLblZPnpV/3T/9aJzrRPkCz0zV412hHYB2dq99UeEmfRTw1YYXk32vM2U8VAO3+q7KGbddDrSoP3c4ih4bWvcgUHk3ffDyg1n6lphgTMapKEqbz/R6tLHAlIUlVTYL5lJRHg8REQGIkaFv67g==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Spi8tUsYkVWK4aIsLmwhCMO9w2ANLN45LSdjle4EB4RaFQZL6MCoKb3zAusOvAcp7LMmj144pTrhSHPYTrNWcepeQcvF9obuCQDH4O9OiEjD+b49Wo5Up1C52i10cTPOReZMl76j3xcdbnUMweOAemPXuucmHdl35anep8viQK4GoI8ZwEiQPvxzObu5OMKSS0bv1yB9zDU1h1Re4WQlZgbo6NLhHaONacTjkHX8k9xghwp9MUWvXntmJHAP1lVTHYVlvleS0OJisdsjcuuHb1TjAQfJN+D7ebaVXMrV/ekZm7A097Ryar/j7jG/ctdWJdKMH/Vz+o99Rlwl8y5+vw==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
- Cc: Alex Deucher <alexander.deucher@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>
- Delivery-date: Mon, 13 Mar 2023 07:23:34 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
Am 12.03.23 um 08:54 schrieb Huang Rui:
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 )
Checkpath.pl gives here:
ERROR: space prohibited after that open parenthesis '('
#115: FILE: xen/drivers/vpci/header.c:395:
+ if ( pci_conf_read16(pdev->sbdf, PCI_COMMAND) & PCI_COMMAND_MEMORY )
Christian.
{
/* If the value written is the current one avoid printing a warning.
*/
if ( val != (uint32_t)(bar->addr >> (hi ? 32 : 0)) )
|