Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp630971ybt; Wed, 1 Jul 2020 06:37:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwoQQHa9waS/E2FZbJhLfEKBqjpb9AP7Z2K2BAkp2tv/AI1+Y1O29pOIaEmQ19WKldDyHET X-Received: by 2002:a17:906:4447:: with SMTP id i7mr14398893ejp.191.1593610666187; Wed, 01 Jul 2020 06:37:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593610666; cv=none; d=google.com; s=arc-20160816; b=vJe/ab2xpG8npXgQp5Dy6c47D5009Qjpxv+rj/ES09Z4/inkEmULYKkoqfSR0okExB HftTrJttws/FzBZm2ECpl5WRUU0hAwl4W61L3zf8wT8VljVWjvmsb4S/4uhrJhjbBtnB fKcSeLbTBat6lMyWHIETTvDIXXJgMKbEDM61ndMDzhwFVRdCJ1wEoTQQD2zFm99G2FTq n2N7FajbT9FzPsBQsAWTeorLcvQOdn35C2JtvrKtDvJ+NvjC3iPvf6KeosgaMQQlpcIe YHTYzYc6zL50ge8JG2F/zF9vb5lneSX9r1+4ilao8p47B01KrXvNqw0W09oOmfqBY68J U3og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=6o0bqYA9UibQkqr/MmLZIfw1Phn9yQ8zQ1ln3u9Cm/E=; b=JnGJfr3etFNuh1W55952j8lSjxjZ80uX3BNZdnlQgb+rCunn33UpWj1jnrFV8wJ+C0 qZyhPq4HyplyP4fYxm5AeAUB0hHw8MkP6GtylQ9snCDhGb3bZl4T1vF9pW+F2OqVOyA7 9p0Mr76NafSbhx+477qeAw4dJaAEBxSpLCdIRqDb1xsL4rBTK5SuwHWHzerG1uspv0pl txLJrb+FRt0acaYIiefyvjSe/YSavNaCZ2UotFj4IV8It+rtrf0qOAAIfX1HwG5oc3W9 x8hKmYxAqDhUm4PL/2Dj9w27dZQo9qPM/nzJaOwfOQAatnU5Ir3+PQqTAjBaWPkXRnPJ lREA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=hlKDnjFX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t13si3922666edj.100.2020.07.01.06.37.23; Wed, 01 Jul 2020 06:37:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=hlKDnjFX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731107AbgGANfM (ORCPT + 99 others); Wed, 1 Jul 2020 09:35:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730916AbgGANfM (ORCPT ); Wed, 1 Jul 2020 09:35:12 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1793DC08C5C1 for ; Wed, 1 Jul 2020 06:35:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=6o0bqYA9UibQkqr/MmLZIfw1Phn9yQ8zQ1ln3u9Cm/E=; b=hlKDnjFXs/Y5WjrWNNgSQ+2Cvd RvsmfMbhXkV1KC+OK+5x7CGESEtA1Qk4HZeAu6Yaz/UH9zEAUbNa9FVjAhV4Duiv/yAyXRv3/1ni3 CSmwa08RJtybgECUGXsj6t5Ikz9WU8jXnEjZhSsiO4Cce5bMLn+ryrsvUEQAfHt3Y/kj2M4b29Xj0 2lORXLltD3a0Za4R4fVC/+lv0bptUhSUEHkFmEDfSV3phIa7QD/g3Q2Zle+t27uSL2Zcfg1ARrlES xPbJ0Leq9BQuYJ3vQmrkn81G/oqYWCgAUIa51MwnCk73e/oMjUpHEK7/k+Ajj3vJC3XBgczD+ReMg 1fAQgQbQ==; Received: from hch by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jqct6-0006Qi-2K; Wed, 01 Jul 2020 13:34:56 +0000 Date: Wed, 1 Jul 2020 14:34:56 +0100 From: Christoph Hellwig To: Stefano Stabellini Cc: "Michael S. Tsirkin" , Peng Fan , boris.ostrovsky@oracle.com, jgross@suse.com, konrad.wilk@oracle.com, jasowang@redhat.com, x86@kernel.org, xen-devel@lists.xenproject.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, virtualization@lists.linux-foundation.org, linux-imx@nxp.com Subject: Re: [PATCH] xen: introduce xen_vring_use_dma Message-ID: <20200701133456.GA23888@infradead.org> References: <20200624091732.23944-1-peng.fan@nxp.com> <20200624050355-mutt-send-email-mst@kernel.org> <20200624163940-mutt-send-email-mst@kernel.org> <20200624181026-mutt-send-email-mst@kernel.org> <20200626110629-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 29, 2020 at 04:46:09PM -0700, Stefano Stabellini wrote: > > I could imagine some future Xen hosts setting a flag somewhere in the > > platform capability saying "no xen specific flag, rely on > > "VIRTIO_F_ACCESS_PLATFORM". Then you set that accordingly in QEMU. > > How about that? > > Yes, that would be fine and there is no problem implementing something > like that when we get virtio support in Xen. Today there are still no > virtio interfaces provided by Xen to ARM guests (no virtio-block/net, > etc.) > > In fact, in both cases we are discussing virtio is *not* provided by > Xen; it is a firmware interface to something entirely different: > > 1) virtio is used to talk to a remote AMP processor (RPMesg) > 2) virtio is used to talk to a secure-world firmware/OS (Trusty) > > VIRTIO_F_ACCESS_PLATFORM is not set by Xen in these cases but by RPMesg > and by Trusty respectively. I don't know if Trusty should or should not > set VIRTIO_F_ACCESS_PLATFORM, but I think Linux should still work > without issues. > Any virtio implementation that is not in control of the memory map (aka not the hypervisor) absolutely must set VIRTIO_F_ACCESS_PLATFORM, else it is completely broken. > The xen_domain() check in Linux makes it so that vring_use_dma_api > returns the opposite value on native Linux compared to Linux as Xen/ARM > DomU by "accident". By "accident" because there is no architectural > reason why Linux Xen/ARM DomU should behave differently compared to > native Linux in this regard. > > I hope that now it is clearer why I think the if (xen_domain()) check > needs to be improved anyway, even if we fix generic dma_ops with virtio > interfaces missing VIRTIO_F_ACCESS_PLATFORM. IMHO that Xen quirk should never have been added in this form..