Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4307622pxv; Tue, 20 Jul 2021 00:00:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhOGYjTxhVDwliEYE1xi43yj8/7nfoebqhMEqNtBr2Mpr+9HEBR6xZYqlaSmeUBBGN3sk1 X-Received: by 2002:aa7:c043:: with SMTP id k3mr38033881edo.160.1626764428036; Tue, 20 Jul 2021 00:00:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626764428; cv=none; d=google.com; s=arc-20160816; b=y1fbDIXiB+MnnGTf5IfC0vBWwRBJe7RfQNvs0tBwjds4ZcTheUZgvJulua5uOMiGNZ wHcEaxHfALUn5So4iOUieG3QMt7Vx/Zup76yQTvopQ+GYyPMEw1PSu0t93ae4cP1UYAx LNEHC4OwFtN9lxepgRIAXcpmMqNpONUCN1dNvRbz0er5wxz/zMH46A769a4OdgwxYro9 vrumuGBxAMRaG2LKSB9rbU3vEuvklXTyv9kqn8HhTnol2M3CaiRkml2YsPG8li+52J5P 5v4zBDsa0KGihEOhSUg3TYpN9TyA62AB8ds7kSruEqhi3ppROYb4z/obGIN4AuxwxF2K xSGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=aATh9Mp3JsAAK9AMXlEVTfSs9zkYB1yHocq5Q1WegPs=; b=N5vbs/einoIaC9COrkpfwb7Sh9Nfx5BX5hVIPXlC/mYNJoXnUN4WX1RJXy5Sh+iwDX oHZmvCRwSrJptymkcGo5PZw0YPTFHZmSq3by0ixDZ2DU0QLZymhV0MIqTQl8VpTatj4v FExSajY98whgKs+AQsYpgjuGste00+TbVidjc2X/Y8zK3tzF/WclyPnlcY+pQ8M9LrqY vqvqef/Q/JIJXHlGLPWs317jf731puronrGEfNgwIwttIjxboVgNi/+ceZuuLq6NLW2K afHMyJBEHJ5gC2v3JSN2c8ZocroMagqQQV9352dLe+dUQqgFDRom7RtCzHj72xHTCV2c JDMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VSB4Hu0t; 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 ck13si15364410ejb.145.2021.07.20.00.00.05; Tue, 20 Jul 2021 00:00:28 -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=VSB4Hu0t; 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 S242988AbhGTGR3 (ORCPT + 99 others); Tue, 20 Jul 2021 02:17:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:56971 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242791AbhGTGRH (ORCPT ); Tue, 20 Jul 2021 02:17:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626764265; 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=aATh9Mp3JsAAK9AMXlEVTfSs9zkYB1yHocq5Q1WegPs=; b=VSB4Hu0tuinhYnu225tabittNwlQKIIs0FXTNvI6FqD59mSHU/zqU+31UVvRMV6NcqM78F 1fy8kF/8lqBRLxpEg0dihkZLKlUva2+OTO1IRp6hsYCfi5QoYO46Prs1qRjMfOOPT+i6kQ sN2p3DxfkQkEZrhdKyg4HgU04ysAYI0= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-402-bwHlG480MpiIgaVtCuUn6Q-1; Tue, 20 Jul 2021 02:57:44 -0400 X-MC-Unique: bwHlG480MpiIgaVtCuUn6Q-1 Received: by mail-ed1-f71.google.com with SMTP id f20-20020a0564020054b0290395573bbc17so10390393edu.19 for ; Mon, 19 Jul 2021 23:57:44 -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=aATh9Mp3JsAAK9AMXlEVTfSs9zkYB1yHocq5Q1WegPs=; b=RDE2wNHlACg+8WrgKwjfIdtHuNlPeWAB3CNt69Zlr/mEy4fHvwf0jJAnDExilWtaeN ievH9Jdqt2mL/mcM3uNMfOhVhii6/h/EalLPkKm/hWHAtO2lyX37v7ml9gSkesj8GQxp ZEK+mIcxYygWEvxguM+ZcVT7bzS2kV544dMrdhj3w6mFl7acsZPU5NIKhM+flwQRjeqx sbFgEGFr1oFfR+ZghM6vruClZH4tNR21CJ78tAmDKp5HqlsZ1ZlALcLO0Q14HskWKcIf ivwsmjyB8GownBioBfGnMZEN/S/2lQg+9nHh1fH/LVGnDOuNJq0rsY7YavyN1Z/0NdNV cMGg== X-Gm-Message-State: AOAM532qQx6t7//FVCKMGExUJs5A/XfxVH7ydMVWxqmzXI0lcg/KV0dm bt+FJ9O+iIwB3bTFcOk88s15Rw7DB3Z9xAeaGY/eTU8p6D4VTKN94i4ckBrxslXItaiRuz9Mx/0 OmeWTQBl3gEuMcwqSnFZ/lv1T X-Received: by 2002:a17:906:7716:: with SMTP id q22mr7514348ejm.457.1626764263338; Mon, 19 Jul 2021 23:57:43 -0700 (PDT) X-Received: by 2002:a17:906:7716:: with SMTP id q22mr7514338ejm.457.1626764263190; Mon, 19 Jul 2021 23:57:43 -0700 (PDT) Received: from steredhat (host-79-18-148-79.retail.telecomitalia.it. [79.18.148.79]) by smtp.gmail.com with ESMTPSA id q9sm6758618ejf.70.2021.07.19.23.57.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jul 2021 23:57:42 -0700 (PDT) Date: Tue, 20 Jul 2021 08:57:40 +0200 From: Stefano Garzarella To: Eli Cohen Cc: mst@redhat.com, jasowang@redhat.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1] vdpa/vdpa_sim: Use the negotiated features when calling vringh_init_iotlb Message-ID: <20210720065740.56udn3ndebzvu26o@steredhat> References: <20210720052533.415991-1-elic@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20210720052533.415991-1-elic@nvidia.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 20, 2021 at 08:25:33AM +0300, Eli Cohen wrote: >When calling vringh_init_iotlb(), use the negotiated features which >might be different than the supported features. > >Fixes: 2c53d0f64c06f ("vdpasim: vDPA device simulator") >Signed-off-by: Eli Cohen >--- >v0 --> v1: >Update "Fixes" line > > drivers/vdpa/vdpa_sim/vdpa_sim.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c >index 14e024de5cbf..89a474c7a096 100644 >--- a/drivers/vdpa/vdpa_sim/vdpa_sim.c >+++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c >@@ -66,7 +66,7 @@ static void vdpasim_queue_ready(struct vdpasim *vdpasim, unsigned int idx) > { > struct vdpasim_virtqueue *vq = &vdpasim->vqs[idx]; > >- vringh_init_iotlb(&vq->vring, vdpasim->dev_attr.supported_features, >+ vringh_init_iotlb(&vq->vring, vdpasim->features, > VDPASIM_QUEUE_MAX, false, > (struct vring_desc *)(uintptr_t)vq->desc_addr, > (struct vring_avail *) >@@ -86,7 +86,7 @@ static void vdpasim_vq_reset(struct vdpasim *vdpasim, > vq->device_addr = 0; > vq->cb = NULL; > vq->private = NULL; >- vringh_init_iotlb(&vq->vring, vdpasim->dev_attr.supported_features, >+ vringh_init_iotlb(&vq->vring, vdpasim->features, vdpasim_vq_reset() is called while resetting the device in vdpasim_reset() where we also set `vdpasim->features = 0` after resetting the vqs, so maybe it's better to use the supported features here, since the negotiated ones are related to the previous instance. Thanks, Stefano