Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp570266rwb; Thu, 6 Oct 2022 01:03:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6Qdi1+pMGVCOQajRMa6oK+yxeUsTwr8C7Rc0dZo3Dw69aLc/Asz7rHGUtozaFeKBoB1iOn X-Received: by 2002:a17:907:628a:b0:781:bbff:1d42 with SMTP id nd10-20020a170907628a00b00781bbff1d42mr2867682ejc.375.1665043390335; Thu, 06 Oct 2022 01:03:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665043390; cv=none; d=google.com; s=arc-20160816; b=uB0/LZGvJo55HV4KOwH5dwuwsfM/7J8EyVUKBHBXcl7hWeQE48Wb4ZMKNrBo47kZQc Yi7eoj675cTlZuTpwD4rRykg4NF/KR5qx9bPGHUvVceYgTRodxBb7EgGp/Yt8ZFOMYb3 FLx3zEnNe66Dq0h1f9Sd7DrFkYFqZWRiH3Kzaja3uPNEqsgJ+2FVVywcvipXRLupTV6p G3qoSXXav4sF0zxyIxjqgrvUzl/Hc5pLjPJlh9LucJmTqA0dle3OuAUlvaa+rtEgB9vp cFYaIwjXHKG7Yf3nwIlO0FkDZfXRCHmbjHLoJ6TuqAbC0RpVhBYg2awd0GxVHh8Fq/PZ f2Pg== 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=0CshijtaHr92stGSDZHMzCA/tn87geqWqdgj21TRuNc=; b=Wtiw5JuWXjw3vxzYkgE08bzyyyb6H6AjcORMJRmGixvNKZ43Yn3SO20AYg08gSZzZ8 9Xx2+PXbyfHtERGtLXPNWn0bjcOZ2bEgIZAVK0HsaGuLk/Sehn07nfDM2A0OBlhDvBGn VnCRkpidI7hD08JZg0ktLxX5Zshw2TIqM+0kYMQnR80fY0dAKsXa8B+6hjHxEmYunrSd vWpJGO933gSAypZNPbOHtZ5uwtv3dLHTugjkNKUWR3/hnSIa3bBfuLnTMHS2QLOHs3C/ GTcUjripQjAVjHmh9CCNd6Hctabs8y3DXG/1mEWc5iKowo51tuzcPn4iR7Hv7p+9QsXb XhAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=XcbUCD9o; 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 s3-20020a17090699c300b00770d9e664f8si15671129ejn.152.2022.10.06.01.02.27; Thu, 06 Oct 2022 01:03:10 -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=XcbUCD9o; 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 S230202AbiJFHPZ (ORCPT + 99 others); Thu, 6 Oct 2022 03:15:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230038AbiJFHPR (ORCPT ); Thu, 6 Oct 2022 03:15:17 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E35817A9D for ; Thu, 6 Oct 2022 00:15:15 -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-out2.suse.de (Postfix) with ESMTPS id 547FD1F8C8; Thu, 6 Oct 2022 07:15:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1665040514; 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=0CshijtaHr92stGSDZHMzCA/tn87geqWqdgj21TRuNc=; b=XcbUCD9o3PCb96W7Lx2pJ43DcJkjWoXykE9e7nTT/kS3m1zFb9YDxpuUVs2na45rQC+PCh sSh5iPuz1gLVgaZnLLoLdLvXZkXtz3YLIoZEYeZhhm6DGcwghEs1QYGawjNYkSah65JQsq EYuLVLQs3J+dFpZRCHv148T+yFFyXM4= 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 17F3B1376E; Thu, 6 Oct 2022 07:15:14 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 7+JTBIKAPmM+EwAAMHmgww (envelope-from ); Thu, 06 Oct 2022 07:15:14 +0000 From: Juergen Gross To: linux-kernel@vger.kernel.org Cc: Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , xen-devel@lists.xenproject.org Subject: [PATCH 2/3] xen/virtio: use dom0 as default backend for CONFIG_XEN_VIRTIO_FORCE_GRANT Date: Thu, 6 Oct 2022 09:14:59 +0200 Message-Id: <20221006071500.15689-3-jgross@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20221006071500.15689-1-jgross@suse.com> References: <20221006071500.15689-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 --- 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 f29759d5301f..a00112235877 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_setup_dma_ops(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