From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26779C433DF for ; Wed, 24 Jun 2020 09:06:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EFC0420823 for ; Wed, 24 Jun 2020 09:06:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="CGhN7dyV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388799AbgFXJG5 (ORCPT ); Wed, 24 Jun 2020 05:06:57 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:32831 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728463AbgFXJG5 (ORCPT ); Wed, 24 Jun 2020 05:06:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592989615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BWweQzpvz5qRvsYocQLFZ/CEELAJfUtNzgc7NW2oHMc=; b=CGhN7dyV+qMddUF4oBDwNhIkVao2HbnxaoePCr1VSfgO7bHrW/RfIy1dolC+IMQoYJpN/F xTj/RKsjY1TxQiMhxaj8IoJZ1zmGBJ4RwuOdkshKlKvtM5M3Qc5cxCTEUTPWUbMeHiJcDk ptgr8/KgF45U0nr2HI0tuFwQDy/wLFA= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-30-qlgsM7iXMgKv59FCCcEBAA-1; Wed, 24 Jun 2020 05:06:54 -0400 X-MC-Unique: qlgsM7iXMgKv59FCCcEBAA-1 Received: by mail-wm1-f72.google.com with SMTP id g187so2098932wme.0 for ; Wed, 24 Jun 2020 02:06:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=BWweQzpvz5qRvsYocQLFZ/CEELAJfUtNzgc7NW2oHMc=; b=Nh/iBRe5LRNHbvm5Ui140vR52LHAk7jNtRlwqsQPMzuBinyf2i3FqV8RQtktD3SXGI O+CYiPLMuoOZ+V20rXVMmV9qvMYVKYe/lUG6Mx0TZY3TxlQTvUNNRiGgZQZY2aZFE+yV M+vbl1jkq5riilKVl0KW1aKKtLRnjrkEqo3Eq/egx9q+pcwxsGxlulSHILT6t+An2DV5 uwUgksG/rROkvCOFtx7jgSI3dgwtiG2AVOrXRTZY4DBmNhJdaWpen9OA/U+Kz3Sg+5RT xUJtm35CPyHLxHIaqmitz6gHq/Cqf+ymxw0me4CM4n+NDkuu1RlxL8YZF6NRAZwBwjzU 01KA== X-Gm-Message-State: AOAM532d45XJP+CHIi6Brpml/FNdVqEGDyMRCM32hYGqcKL71IdN87f2 2bre6utwSoMDTNXVfHA75B1TjBmEGW3XbTdDZ/1V4ILK7nZ2iIH0n6rSnO2m7FEu/CD9ngrgVql 8Mke+mrC8MjtMGZsK8cMLrSsE X-Received: by 2002:a7b:c4d6:: with SMTP id g22mr276001wmk.170.1592989612933; Wed, 24 Jun 2020 02:06:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCjnIRq0GLGlJ0yYJ0oEVhHQJi+H1TnyLeWn06GTYZrPy1eSbfHNnWW2xTl+/KbPsMMBv1Rw== X-Received: by 2002:a7b:c4d6:: with SMTP id g22mr275986wmk.170.1592989612754; Wed, 24 Jun 2020 02:06:52 -0700 (PDT) Received: from redhat.com ([82.166.20.53]) by smtp.gmail.com with ESMTPSA id n189sm7181712wmb.43.2020.06.24.02.06.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 02:06:51 -0700 (PDT) Date: Wed, 24 Jun 2020 05:06:48 -0400 From: "Michael S. Tsirkin" To: Peng Fan Cc: sstabellini@kernel.org, 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: <20200624050355-mutt-send-email-mst@kernel.org> References: <20200624091732.23944-1-peng.fan@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200624091732.23944-1-peng.fan@nxp.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 24, 2020 at 05:17:32PM +0800, Peng Fan wrote: > Export xen_swiotlb for all platforms using xen swiotlb > > Use xen_swiotlb to determine when vring should use dma APIs to map the > ring: when xen_swiotlb is enabled the dma API is required. When it is > disabled, it is not required. > > Signed-off-by: Peng Fan Isn't there some way to use VIRTIO_F_IOMMU_PLATFORM for this? Xen was there first, but everyone else is using that now. > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > index a2de775801af..768afd79f67a 100644 > --- a/drivers/virtio/virtio_ring.c > +++ b/drivers/virtio/virtio_ring.c > @@ -252,7 +252,7 @@ static bool vring_use_dma_api(struct virtio_device *vdev) > * the DMA API if we're a Xen guest, which at least allows > * all of the sensible Xen configurations to work correctly. > */ > - if (xen_domain()) > + if (xen_vring_use_dma()) > return true; > > return false; The comment above this should probably be fixed. -- MST From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4CCC0C433E0 for ; Wed, 24 Jun 2020 09:06:59 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1543220885 for ; Wed, 24 Jun 2020 09:06:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="CGhN7dyV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1543220885 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 0330F87514; Wed, 24 Jun 2020 09:06:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xxB2JBTMGyBK; Wed, 24 Jun 2020 09:06:58 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8EC498742C; Wed, 24 Jun 2020 09:06:58 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 76D18C0888; Wed, 24 Jun 2020 09:06:58 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id B251CC016F for ; Wed, 24 Jun 2020 09:06:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 99F6F881ED for ; Wed, 24 Jun 2020 09:06:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ietqjhjcYNDF for ; Wed, 24 Jun 2020 09:06:57 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by whitealder.osuosl.org (Postfix) with ESMTPS id EE3E5880E9 for ; Wed, 24 Jun 2020 09:06:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592989615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BWweQzpvz5qRvsYocQLFZ/CEELAJfUtNzgc7NW2oHMc=; b=CGhN7dyV+qMddUF4oBDwNhIkVao2HbnxaoePCr1VSfgO7bHrW/RfIy1dolC+IMQoYJpN/F xTj/RKsjY1TxQiMhxaj8IoJZ1zmGBJ4RwuOdkshKlKvtM5M3Qc5cxCTEUTPWUbMeHiJcDk ptgr8/KgF45U0nr2HI0tuFwQDy/wLFA= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-475-9V2x0bw_P76jM7nTFiEftA-1; Wed, 24 Jun 2020 05:06:54 -0400 X-MC-Unique: 9V2x0bw_P76jM7nTFiEftA-1 Received: by mail-wr1-f72.google.com with SMTP id a18so2264233wrm.14 for ; Wed, 24 Jun 2020 02:06:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=BWweQzpvz5qRvsYocQLFZ/CEELAJfUtNzgc7NW2oHMc=; b=ukJZ4di/SIZjTQfCwCpQRpRzXqzugcKCzdFhvLGRMuns96ot+hj7khcSK2StsIhI+m PjOvI+p/Of0LTkITOsmFpLiv4vv+YmCqvZ7jlSG2SOwvjrnIElZGtztrtLzzGvZYoOZf GdR6p/ia290L4ctybpX+Dz1QNpgyQ70O9n6jl1YQKWyCLaSvAhr9q9er45qNc7Xtmbvm 7/0dujrbR8nce09PiMy1DlVDbmUXbeiXYRdZq8FDKRAOB4tFiPQrwOZo1RnvG/TC6tF+ dPY1HLspMcwoz+zg9EiHOI6Sc6zpiCDx/Qhag3d10yocHZTZc0fMT23GoCqyF0ngxV+9 s6pA== X-Gm-Message-State: AOAM531gAQjcQzvoFBH7edCLyEoLv26Wu86BOAdV+i4JmkY6q3zIOh2a glCAGfUR0uOoeYOhfUD4gycxoIYcQv8WtpQc2NiAu9pOKJtMKFt1NKZS69GDtryNG48aAC9yFyz fDecW4Qkpgb4sSEd4JNX4jXI++73pzw== X-Received: by 2002:a7b:c4d6:: with SMTP id g22mr276010wmk.170.1592989612963; Wed, 24 Jun 2020 02:06:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCjnIRq0GLGlJ0yYJ0oEVhHQJi+H1TnyLeWn06GTYZrPy1eSbfHNnWW2xTl+/KbPsMMBv1Rw== X-Received: by 2002:a7b:c4d6:: with SMTP id g22mr275986wmk.170.1592989612754; Wed, 24 Jun 2020 02:06:52 -0700 (PDT) Received: from redhat.com ([82.166.20.53]) by smtp.gmail.com with ESMTPSA id n189sm7181712wmb.43.2020.06.24.02.06.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 02:06:51 -0700 (PDT) Date: Wed, 24 Jun 2020 05:06:48 -0400 From: "Michael S. Tsirkin" To: Peng Fan Subject: Re: [PATCH] xen: introduce xen_vring_use_dma Message-ID: <20200624050355-mutt-send-email-mst@kernel.org> References: <20200624091732.23944-1-peng.fan@nxp.com> MIME-Version: 1.0 In-Reply-To: <20200624091732.23944-1-peng.fan@nxp.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Cc: jgross@suse.com, sstabellini@kernel.org, konrad.wilk@oracle.com, jasowang@redhat.com, x86@kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, iommu@lists.linux-foundation.org, linux-imx@nxp.com, xen-devel@lists.xenproject.org, boris.ostrovsky@oracle.com, linux-arm-kernel@lists.infradead.org X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On Wed, Jun 24, 2020 at 05:17:32PM +0800, Peng Fan wrote: > Export xen_swiotlb for all platforms using xen swiotlb > > Use xen_swiotlb to determine when vring should use dma APIs to map the > ring: when xen_swiotlb is enabled the dma API is required. When it is > disabled, it is not required. > > Signed-off-by: Peng Fan Isn't there some way to use VIRTIO_F_IOMMU_PLATFORM for this? Xen was there first, but everyone else is using that now. > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > index a2de775801af..768afd79f67a 100644 > --- a/drivers/virtio/virtio_ring.c > +++ b/drivers/virtio/virtio_ring.c > @@ -252,7 +252,7 @@ static bool vring_use_dma_api(struct virtio_device *vdev) > * the DMA API if we're a Xen guest, which at least allows > * all of the sensible Xen configurations to work correctly. > */ > - if (xen_domain()) > + if (xen_vring_use_dma()) > return true; > > return false; The comment above this should probably be fixed. -- MST _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7EF89C433DF for ; Wed, 24 Jun 2020 09:10:16 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4D9CE206FA for ; Wed, 24 Jun 2020 09:10:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="yuZGRx5F"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="CGhN7dyV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D9CE206FA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=KbiBAzHZAnTOoxnWH+Xex4p0sHf4fBqLlqUS+VcmhMA=; b=yuZGRx5FWJUQ9dl5gmzbStZK1 ub8PxE+jFqTXTmKLmA2NkgI1NBSyPC3ughFzeqosHkveGbBlsn4l2gqf4MMx+ejMvJDfGc3EUTUDg X4cjEyDTInYGX1EWVuu/IOT81k/m3ed8wk/7OOW94y1F2ynvI1jI8Mrie/IWFBmMN4ZiLo1EGCrO8 8tnjZKwvaEyJjA3ChePOB+Ob0ks5qZCRmGpcuajF7gjKc5Q1e4rP403QQokMIVhOgG6JXn1g/6ESl Z4Fgdippt7oecFm6ONV15FsioHegNHnVp0paXSR7tdjhynEOQx11oPieUV4eLobbsrXn2REnCOA/Q iJ91+OLBQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jo1Mz-00024E-BI; Wed, 24 Jun 2020 09:07:01 +0000 Received: from us-smtp-2.mimecast.com ([207.211.31.81] helo=us-smtp-delivery-1.mimecast.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jo1Mw-00023T-1C for linux-arm-kernel@lists.infradead.org; Wed, 24 Jun 2020 09:06:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592989615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BWweQzpvz5qRvsYocQLFZ/CEELAJfUtNzgc7NW2oHMc=; b=CGhN7dyV+qMddUF4oBDwNhIkVao2HbnxaoePCr1VSfgO7bHrW/RfIy1dolC+IMQoYJpN/F xTj/RKsjY1TxQiMhxaj8IoJZ1zmGBJ4RwuOdkshKlKvtM5M3Qc5cxCTEUTPWUbMeHiJcDk ptgr8/KgF45U0nr2HI0tuFwQDy/wLFA= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-475-Zti4SUOoMr2DZKg6p_7vpw-1; Wed, 24 Jun 2020 05:06:53 -0400 X-MC-Unique: Zti4SUOoMr2DZKg6p_7vpw-1 Received: by mail-wm1-f72.google.com with SMTP id p24so2068553wma.4 for ; Wed, 24 Jun 2020 02:06:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=BWweQzpvz5qRvsYocQLFZ/CEELAJfUtNzgc7NW2oHMc=; b=BuEnAEW3Vjp1vHnPAznKo1u/Nh1WblZfsZa7lzhWbBp8AIXOs513Kappdn1yTsClTP 0qXUGheXzouYo7f6LQsJZy5fHivvweL7y1wASeQIvKuArLtp0N+4oMY3XW1mhrCan8td yeRSKstKvdMJnMCzgO3nKtBE1Ew1kmil+PQOETMvM1oeZGjyYvxciXAFnhl1b7ijl5yx xI/Ob4R4uTYDWfwwnAcZAVLDnCGAoPxLSLmCXIPnAlrmWrtqkjNQ6dTv4N99auLdX7Na F8tBR9t38C5GRrla9v71X02g7s1PNRrLFTY6K8ADGlB6TkvgQkkJ5/x6do6n/jb74hK5 sKLQ== X-Gm-Message-State: AOAM533gmy3FQLw2LIi77s/AUKaqsre5aVkr7amHpfHOe1BHg9TpaX6t 2WDMGftaDzlZE8jFcKd41DIE8wMC8w/zEeHxSKrQ1qrRDDpxbWNiKMW3pG3oUNxAI99cKR9fy4R 1P0DqLlL7cKCwIhs0BbpCrhMGbxmmxNySukM= X-Received: by 2002:a7b:c4d6:: with SMTP id g22mr275999wmk.170.1592989612933; Wed, 24 Jun 2020 02:06:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCjnIRq0GLGlJ0yYJ0oEVhHQJi+H1TnyLeWn06GTYZrPy1eSbfHNnWW2xTl+/KbPsMMBv1Rw== X-Received: by 2002:a7b:c4d6:: with SMTP id g22mr275986wmk.170.1592989612754; Wed, 24 Jun 2020 02:06:52 -0700 (PDT) Received: from redhat.com ([82.166.20.53]) by smtp.gmail.com with ESMTPSA id n189sm7181712wmb.43.2020.06.24.02.06.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 02:06:51 -0700 (PDT) Date: Wed, 24 Jun 2020 05:06:48 -0400 From: "Michael S. Tsirkin" To: Peng Fan Subject: Re: [PATCH] xen: introduce xen_vring_use_dma Message-ID: <20200624050355-mutt-send-email-mst@kernel.org> References: <20200624091732.23944-1-peng.fan@nxp.com> MIME-Version: 1.0 In-Reply-To: <20200624091732.23944-1-peng.fan@nxp.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jgross@suse.com, sstabellini@kernel.org, konrad.wilk@oracle.com, jasowang@redhat.com, x86@kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, iommu@lists.linux-foundation.org, linux-imx@nxp.com, xen-devel@lists.xenproject.org, boris.ostrovsky@oracle.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jun 24, 2020 at 05:17:32PM +0800, Peng Fan wrote: > Export xen_swiotlb for all platforms using xen swiotlb > > Use xen_swiotlb to determine when vring should use dma APIs to map the > ring: when xen_swiotlb is enabled the dma API is required. When it is > disabled, it is not required. > > Signed-off-by: Peng Fan Isn't there some way to use VIRTIO_F_IOMMU_PLATFORM for this? Xen was there first, but everyone else is using that now. > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > index a2de775801af..768afd79f67a 100644 > --- a/drivers/virtio/virtio_ring.c > +++ b/drivers/virtio/virtio_ring.c > @@ -252,7 +252,7 @@ static bool vring_use_dma_api(struct virtio_device *vdev) > * the DMA API if we're a Xen guest, which at least allows > * all of the sensible Xen configurations to work correctly. > */ > - if (xen_domain()) > + if (xen_vring_use_dma()) > return true; > > return false; The comment above this should probably be fixed. -- MST _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE597C433DF for ; Wed, 24 Jun 2020 09:07:16 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8674220823 for ; Wed, 24 Jun 2020 09:07:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="CGhN7dyV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8674220823 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jo1Mx-0004o2-CX; Wed, 24 Jun 2020 09:06:59 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jo1Mv-0004nx-I5 for xen-devel@lists.xenproject.org; Wed, 24 Jun 2020 09:06:57 +0000 X-Inumbo-ID: 0d7bce02-b5fa-11ea-8496-bc764e2007e4 Received: from us-smtp-delivery-1.mimecast.com (unknown [205.139.110.120]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id 0d7bce02-b5fa-11ea-8496-bc764e2007e4; Wed, 24 Jun 2020 09:06:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592989615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BWweQzpvz5qRvsYocQLFZ/CEELAJfUtNzgc7NW2oHMc=; b=CGhN7dyV+qMddUF4oBDwNhIkVao2HbnxaoePCr1VSfgO7bHrW/RfIy1dolC+IMQoYJpN/F xTj/RKsjY1TxQiMhxaj8IoJZ1zmGBJ4RwuOdkshKlKvtM5M3Qc5cxCTEUTPWUbMeHiJcDk ptgr8/KgF45U0nr2HI0tuFwQDy/wLFA= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-458-qxNUxnGHObmsdMbvfjqgcw-1; Wed, 24 Jun 2020 05:06:54 -0400 X-MC-Unique: qxNUxnGHObmsdMbvfjqgcw-1 Received: by mail-wr1-f72.google.com with SMTP id a6so2292773wrq.3 for ; Wed, 24 Jun 2020 02:06:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=BWweQzpvz5qRvsYocQLFZ/CEELAJfUtNzgc7NW2oHMc=; b=M5dtTT2qu3QgcuCMr15YR8RTlZ/FpqLZcjTrvn6kdmNMfNyXTvNv60s8nw5hCqlsZn MrL7s6FnntBYqmrpQPlhJ0tOKv1o81OpgPGRT5uz92+e3aiD+eygSefLsj+9OIFJmOR+ JUX8TS8ZmWZ12oWfA6O9jy7dBhlXftl8jXdk/soZTn53dsvqHW4CbU58g6X0DDbWqEir 8D8UNzVc3i4NS0QmMYZ/o5nD3fpXA/97Sd5lQPeSYlKySglM6/3M7tUgOrdENkcpGOAG BoH0pAajinsO6zAIbElvph6MKJPJMEusDQ1vVu6MkSlSJX0B0q5Bgg7aHLxW+Gq5mpgV fB2Q== X-Gm-Message-State: AOAM533a2Hw0HbOzStfZM71edmHNhHEf6iZO9stTItppGbYkqJZuue5i bwdIKPX4knIl2Zwg2rjLCaHcsT1REkieF85Cq2/n+XAqdkVzViUjSdJ07G8MQrWAvJbi2CsEcTk ROg2lvE+Q00DJLRxoBy1voNnikCE= X-Received: by 2002:a7b:c4d6:: with SMTP id g22mr276000wmk.170.1592989612933; Wed, 24 Jun 2020 02:06:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCjnIRq0GLGlJ0yYJ0oEVhHQJi+H1TnyLeWn06GTYZrPy1eSbfHNnWW2xTl+/KbPsMMBv1Rw== X-Received: by 2002:a7b:c4d6:: with SMTP id g22mr275986wmk.170.1592989612754; Wed, 24 Jun 2020 02:06:52 -0700 (PDT) Received: from redhat.com ([82.166.20.53]) by smtp.gmail.com with ESMTPSA id n189sm7181712wmb.43.2020.06.24.02.06.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 02:06:51 -0700 (PDT) Date: Wed, 24 Jun 2020 05:06:48 -0400 From: "Michael S. Tsirkin" To: Peng Fan Subject: Re: [PATCH] xen: introduce xen_vring_use_dma Message-ID: <20200624050355-mutt-send-email-mst@kernel.org> References: <20200624091732.23944-1-peng.fan@nxp.com> MIME-Version: 1.0 In-Reply-To: <20200624091732.23944-1-peng.fan@nxp.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: jgross@suse.com, sstabellini@kernel.org, konrad.wilk@oracle.com, jasowang@redhat.com, x86@kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, iommu@lists.linux-foundation.org, linux-imx@nxp.com, xen-devel@lists.xenproject.org, boris.ostrovsky@oracle.com, linux-arm-kernel@lists.infradead.org Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" On Wed, Jun 24, 2020 at 05:17:32PM +0800, Peng Fan wrote: > Export xen_swiotlb for all platforms using xen swiotlb > > Use xen_swiotlb to determine when vring should use dma APIs to map the > ring: when xen_swiotlb is enabled the dma API is required. When it is > disabled, it is not required. > > Signed-off-by: Peng Fan Isn't there some way to use VIRTIO_F_IOMMU_PLATFORM for this? Xen was there first, but everyone else is using that now. > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > index a2de775801af..768afd79f67a 100644 > --- a/drivers/virtio/virtio_ring.c > +++ b/drivers/virtio/virtio_ring.c > @@ -252,7 +252,7 @@ static bool vring_use_dma_api(struct virtio_device *vdev) > * the DMA API if we're a Xen guest, which at least allows > * all of the sensible Xen configurations to work correctly. > */ > - if (xen_domain()) > + if (xen_vring_use_dma()) > return true; > > return false; The comment above this should probably be fixed. -- MST