Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp531271rwb; Fri, 7 Oct 2022 00:00:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5fTHTkJPnIIVyOGUh5lpJipJS3tM1BCRnb/LI3EQ39FDNZsJ5x7MUKuhu0e6o8FlRgoBNm X-Received: by 2002:a17:907:2ce8:b0:78d:49a8:4f54 with SMTP id hz8-20020a1709072ce800b0078d49a84f54mr2820453ejc.577.1665126019043; Fri, 07 Oct 2022 00:00:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665126019; cv=none; d=google.com; s=arc-20160816; b=X/Ze9BQVdLgW508tmYcpJ8zE7/PgT5r5oX//RjMdsHBxSe0AG+AWTxtfN9QbMz8qWr zQtRNhuvyl1wZNVovgL9gh/DybZvuUWPBKK2tNCCPsqNYQbRMy6ezqf26QQ62rvH7poh oEi2WigOqyxzLJOmcGi9cbjnRKq5y8ivfoUyyTksaDicZ0AhWeGIbIpWby0YwcaK2PXZ 2C3Ad+WP66hiMdlIUNktYSY+CIfRcXR6VlodU0dq2rXhpIzRZn0nplCFlYlh/PArwtp/ 4ucaTyNOOB+/toKj6VzAkzKvGT2KBpN8rs/7eeEIHzmH54W+SWS80gJKLbxLgYAk0Jb6 qtLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ubZ+4Ck86Ph/G26SuwNF8h0CjJlNbh0F0U0WIgCgLNk=; b=yo5B68KOlAvGRIRJ0kp4I1uoJ29Cp/ms30J1+kuT5j4r0AayKdWSs8qGsXZIp8y0ac GqJh7q/UFyIZTIDdrmjzm78OnL8ldf5k7Tygm5u6Wd5ZcBbkYTdLLXURs9b/5Ns446Px wA0/JdjX3AKjCrYyjZBP6EiKMrxSSyLgWaekpTD2J7fayrJm5Vn+K9AKfzB+zsUpTHay qzHvhvUZNV20TEwu3lXoJJLXr+az21wcdVPrfHE1jmvlvzhvOvygTxm9K1iIjlV74YQQ 2pc55hKNBdfoz+YiN55FXiNlL/PR2tQOkwIkRtgo5nf503Kqk+sAqoqEEd06v+ExcrH5 eqfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=u0B1gOZK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eg46-20020a05640228ae00b00459a58216d8si1170015edb.504.2022.10.06.23.59.48; Fri, 07 Oct 2022 00:00:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=u0B1gOZK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229693AbiJGGmE (ORCPT + 99 others); Fri, 7 Oct 2022 02:42:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229623AbiJGGmB (ORCPT ); Fri, 7 Oct 2022 02:42:01 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48556112AB7 for ; Thu, 6 Oct 2022 23:41:59 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 5BC7C21921; Fri, 7 Oct 2022 06:41:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1665124917; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ubZ+4Ck86Ph/G26SuwNF8h0CjJlNbh0F0U0WIgCgLNk=; b=u0B1gOZKRfVtDSiWXK3FHZ+7ZuhS2wNNXD2scXaLTkjdp0U2MWi81cz5CIcqR4f3bUYv8g jBnNrjXqx/FvjTozEfvlu2sla1YODh2H6SsLXM8Wx9NXvu+jcHK0gNago1wWy0qFR2qe/S z8XGz3kjUOzbP5zxy3/AUWO6neU04g0= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 26A1513A3D; Fri, 7 Oct 2022 06:41:57 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id VkUHCDXKP2P2SQAAMHmgww (envelope-from ); Fri, 07 Oct 2022 06:41:57 +0000 From: Juergen Gross To: linux-kernel@vger.kernel.org Cc: Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , xen-devel@lists.xenproject.org Subject: [PATCH v2 2/3] xen/virtio: use dom0 as default backend for CONFIG_XEN_VIRTIO_FORCE_GRANT Date: Fri, 7 Oct 2022 08:41:42 +0200 Message-Id: <20221007064143.10049-3-jgross@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20221007064143.10049-1-jgross@suse.com> References: <20221007064143.10049-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With CONFIG_XEN_VIRTIO_FORCE_GRANT set the default backend domid to 0, enabling to use xen_grant_dma_ops for those devices. Signed-off-by: Juergen Gross Reviewed-by: Oleksandr Tyshchenko Acked-by: Stefano Stabellini --- drivers/xen/grant-dma-ops.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/xen/grant-dma-ops.c b/drivers/xen/grant-dma-ops.c index 646ca913c05c..c703b77b33c9 100644 --- a/drivers/xen/grant-dma-ops.c +++ b/drivers/xen/grant-dma-ops.c @@ -349,6 +349,9 @@ void xen_grant_setup_dma_ops(struct device *dev) if (dev->of_node) { if (xen_dt_grant_init_backend_domid(dev, data)) goto err; + } else if (IS_ENABLED(CONFIG_XEN_VIRTIO_FORCE_GRANT)) { + dev_info(dev, "Using dom0 as backend\n"); + data->backend_domid = 0; } else { /* XXX ACPI device unsupported for now */ goto err; -- 2.35.3