Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1897862pxa; Thu, 6 Aug 2020 20:02:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxF2tG3An9jdXA9Eq+qkHxlouKmU+iBSQjXUREPDKSQ84AZ0O8B2avJekFu5U46pg5iqEx X-Received: by 2002:a05:6402:17f7:: with SMTP id t23mr6997361edy.301.1596769358953; Thu, 06 Aug 2020 20:02:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596769358; cv=none; d=google.com; s=arc-20160816; b=qxejwGQkbT0NOYhwt2EI8AIaSgg42dxaA1H2iaQrIMgXs9oznp+yAJ6CnzGfYfZyTP xUlBTBUGgfIu2763KEQDTZPysIz/sYTfEJ0jdBs5t9JBawXuBxofzaTpTO89ILsqLSrN +YXisyuuijNHI/m5ZHPAmuoJuJrKc2nQV3xi2+d2cRpkiAImvQ24KK+j84NRVL34e3nA Kpu8KV6uo57sy06oBFyZjymfAl+h0Y2cskmSDNkw5xNTYNbGAORfamdYjP5qKKAmQQUw JDBK15YjeXt+eBi0EbCBV22hseb5Pwfyjw14G0ISwRyGvnXyziSrqjO2ZQwxP4EnZfB9 FzYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=N8hjLpt/QzD6v1/2A6T4AsRXxZwxHTWi0Mqm+X07ilg=; b=QL3DqvlX47wE69mxVKzO9ZoiqUGI2q+R0uYxzcvhbU0vWbVUO73qFcWWnQWoOi67CN 5uQCyew2ita4xYeE0OLfR5DBY9u7F1bSnp3vnpRUvi1I+DqtA0B9SKPx8bBOrL/MW9bh iSNveNc5Efhfe3AobLoO8/Amh8oFLTl7BE5my+qCs1Q/w+qT2BQJzsrgOwsaKkwhmEDk JazyCGaydS+/St1yW+eI3OqetdLLV9Od8hbhEbmxusJXu0961brd/S6HUFm1az9XCFJt FxwjJK9cgYo9CLlj2W1enQuzMSk786tzk5P7kg93DwEo1jTsMpsuD2uGozCFSKnk/umM 7Mig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JJODXl5j; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id uz17si4341132ejb.63.2020.08.06.20.02.16; Thu, 06 Aug 2020 20:02:38 -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=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JJODXl5j; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726149AbgHGDAz (ORCPT + 99 others); Thu, 6 Aug 2020 23:00:55 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:21304 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726058AbgHGDAy (ORCPT ); Thu, 6 Aug 2020 23:00:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596769253; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=N8hjLpt/QzD6v1/2A6T4AsRXxZwxHTWi0Mqm+X07ilg=; b=JJODXl5j2sIeU+ioPhbippRoV2n03GtvwgVs8MuDv2tSKZluemYbhp2eSIhFOiGFBg9c63 allX0psM71mcT9EGkOzwbktk2YGmzPjnVkdpHKgUCuIGNwXLP5syAUY/rVUZMw3dZUoXAC zAJa16N/ANnhwIM3OxXYUfAb05olA2o= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-228-e_JvTdG1PZ2e1KyXcm5FTQ-1; Thu, 06 Aug 2020 23:00:51 -0400 X-MC-Unique: e_JvTdG1PZ2e1KyXcm5FTQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6637A106B242; Fri, 7 Aug 2020 03:00:50 +0000 (UTC) Received: from [10.72.13.215] (ovpn-13-215.pek2.redhat.com [10.72.13.215]) by smtp.corp.redhat.com (Postfix) with ESMTP id 34E895D9DD; Fri, 7 Aug 2020 03:00:45 +0000 (UTC) Subject: Re: [PATCH v2 19/24] vdpa: make sure set_features in invoked for legacy To: "Michael S. Tsirkin" Cc: linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org References: <20200803205814.540410-1-mst@redhat.com> <20200803205814.540410-20-mst@redhat.com> <9e47d227-f220-4651-dcb9-7a11f059a715@redhat.com> <20200805073929-mutt-send-email-mst@kernel.org> <20200806015112-mutt-send-email-mst@kernel.org> <20200806055818-mutt-send-email-mst@kernel.org> From: Jason Wang Message-ID: <5261b78d-f2db-0f80-34ac-1a834353b13a@redhat.com> Date: Fri, 7 Aug 2020 11:00:44 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200806055818-mutt-send-email-mst@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/8/6 下午6:00, Michael S. Tsirkin wrote: > On Thu, Aug 06, 2020 at 03:27:38PM +0800, Jason Wang wrote: >> On 2020/8/6 下午1:53, Michael S. Tsirkin wrote: >>> On Thu, Aug 06, 2020 at 11:23:05AM +0800, Jason Wang wrote: >>>> On 2020/8/5 下午7:40, Michael S. Tsirkin wrote: >>>>> On Wed, Aug 05, 2020 at 02:14:07PM +0800, Jason Wang wrote: >>>>>> On 2020/8/4 上午5:00, Michael S. Tsirkin wrote: >>>>>>> Some legacy guests just assume features are 0 after reset. >>>>>>> We detect that config space is accessed before features are >>>>>>> set and set features to 0 automatically. >>>>>>> Note: some legacy guests might not even access config space, if this is >>>>>>> reported in the field we might need to catch a kick to handle these. >>>>>> I wonder whether it's easier to just support modern device? >>>>>> >>>>>> Thanks >>>>> Well hardware vendors are I think interested in supporting legacy >>>>> guests. Limiting vdpa to modern only would make it uncompetitive. >>>> My understanding is that, IOMMU_PLATFORM is mandatory for hardware vDPA to >>>> work. >>> Hmm I don't really see why. Assume host maps guest memory properly, >>> VM does not have an IOMMU, legacy guest can just work. >> >> Yes, guest may not set IOMMU_PLATFORM. >> >> >>> Care explaining what's wrong with this picture? >> >> The problem is virtio_vdpa, without IOMMU_PLATFORM it uses PA which can not >> work if IOMMU is enabled. >> >> Thanks > So that's a virtio_vdpa limitation. Probably not, I think this goes back to the long debate of whether to use DMA API unconditionally. If we did that, we can support legacy virtio driver. The vDPA device needs to provide a DMA device and the virtio core and perform DMA API with that device which should work for all of the cases. But a big question is, do upstream care about out of tree virtio drivers? Thanks > In the same way, if a device > does not have an on-device iommu *and* is not behind an iommu, > then vdpa can't bind to it. > > But this virtio_vdpa specific hack does not belong in a generic vdpa code. > >>> >>>> So it can only work for modern device ... >>>> >>>> Thanks >>>> >>>> >>>>>