From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj2-f42.google.com (mail-pj2-f42.google.com [74.125.227.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8598C4D17A8 for ; Mon, 21 Sep 2026 15:47:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.227.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790005681; cv=none; b=hIJGhphx/uRyFqCFRuf5SeprcuoqNIBOjMPetho432FAY/Z79V3Cq5M8LQ9yFHIWVzbVVYMIWSDKHaxCXBGwtRt+/ZOHyy9B1XxYy5y9pftXiM5KTM76GDFX03/9wQazUjPGp/HkYXVE6QIho1pUTs+9hu32fskF9JMpo7+P7N0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790005681; c=relaxed/simple; bh=xGLfA1m+bcd6cQO4yshQSi+ud4HVrdOAi+ou2Af706o=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LD2XMl0Pm78qUyokXPx8kavVlH89kftAswuKDQebTdDk7NF3+yKv3oStXi5CDitLarThNYqK11Z9FBfyxVLH0q4sB2Z++/J5bUiD5cOT4u1fhePlhoiYZF1KkXSqkzXXA8OfKHGYWvUlnZDueYpjWbW4Wf2d27AuR/KKVkeIe4w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=IdgbYm0D; arc=none smtp.client-ip=74.125.227.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="IdgbYm0D" Received: by mail-pj2-f42.google.com with SMTP id 98e67ed59e1d1-396ccafb74fso3054525a91.3 for ; Mon, 21 Sep 2026 08:47:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1790005678; x=1790610478; darn=lists.linux.dev; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=NymQllFGW/d7T1ecbWk0XQBpiDM3En0PKGwwReZs9hI=; b=IdgbYm0DUM2tBR7WhX9ieXDvGpS8Hx18CY7oMfYWl5uFYyEp2rH/IhW2qMhXuJvhB+ 4G8ZRUjlYziuRMcdkne7Gg6mTf8U5NcKXRKbDNyiBW7bbSIgzWVn1OL5vr3Ih+HqwZO+ 0fLQ+ZkI9wH5hFMe6kZb1uo2E8dliaE0+CW7IlUjdTuLWJDMvG2V/IRAAXkZ3RxZy5xk GKCEUA2jeM0Z5+70PiuiggD5b4LM2JSouZrzHvZRWiG+YjaIfsukQAvP1JFdz6oD4O95 +MspiJS5Mr/pQ37WG5UQ6U2DTj0opbYW/yrWal3iFaz5p+CZ/8zu4GqNG0mIgtNIsWIt ZWxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790005678; x=1790610478; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=NymQllFGW/d7T1ecbWk0XQBpiDM3En0PKGwwReZs9hI=; b=RcCEZno6bqaB7EDRKc64Btcl/CzA0m664wE7lqezsqMNobB42GIlHRYm0culDhlexj N8dgvOeaAz5EUeT0LFzXX5I0w+IMYFwUnfGRS5USRG91w5/T5I0/wuwCBKcWkQigoy4U Mr1XNh3AyhGNGPvn4Z7C2zDpgleTCCmdgYE+hOeS9oLH+gFUeIqHyXbZWGPwW/A9drLQ JLgPW5gs65y4s/NilZFZ9MLeWbd8/ANiXM+jkjU9rHCQD5E3FZuKAqdnZGwCz7fN/auv TUzrf+FVVTpeJbbLzaIrA3bCpE8FT31YHqpAtfyFcDJev4MBVkxUfX36XwzvXC6R4NJi IaNQ== X-Forwarded-Encrypted: i=1; AKwUvBzEgzjPnS4QeloMZGvs/ETUzZbrRWz431X1xu5wFFLWULbS5QNNmeMQn+rsafQOJsGpC1znNg==@lists.linux.dev X-Gm-Message-State: AFuF++mmsr/yVM0XyW+B3PDDAc9Oh3D7ZNGPdMoiL8BFXxUD6GdzvXiK xDLJdAJJQLTk4NY11xfresdVsqkd7QwlzLX6UfCYx+tf3vHUXaBp7KWWzpW1qh1PNck= X-Gm-Gg: AYBFou2HxPcVA1qLz4vVUbpA0q2Da6xTbBJ5mzDDbDG7dyF/UszZwBJiTFC3d3imTgF uZHvHYhcD4SlJ5FtSAJxN0e0s4Enh85iEzxsGILW0Dpmbtc1NeAwL9tvfHXodgTE7EY0u5Kc9CP ehgzIt8iRRUWr9opgMvoWM6IPmj/rC093o4MsVtikjH2PZGjzhA7hI0u7btwSEtOhNo9AyEPnue j2x+8iK+5cEbi1/AxiI/PXo7PJW0x9KMV3HzXLkxG3jpLzCIriezIUBT7uupUIGzFubP+b+u0tM gmkB3ka2eUqP08TT7THwSQCy/AHNv9MJebgGGdyZcWuK5Y4oz0UJwaN47woUhrJBNw4XzjIThzv /s0F7rPi4ifeUUcqoPw86+3NnDdn/mhmN5qyZR/GFQsCJSsCLN0bOZxMF7yP2Ifk7invOHw/5VJ x3283iKK/PZ3+ETzOMX1LkSjCJ9CyIp/OhWq4oF0S4Q0SCEgauTUYZqjmunttNlYG7wYN0AgscU g== X-Received: by 2002:a17:90b:2750:b0:39e:6c69:776f with SMTP id 98e67ed59e1d1-39e6c697934mr11058030a91.24.1790005677565; Mon, 21 Sep 2026 08:47:57 -0700 (PDT) Received: from p14s ([2604:3d09:148c:c800:a714:d1ef:56ba:be47]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-39e55c9cabdsm7471419a91.0.2026.09.21.08.47.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Sep 2026 08:47:57 -0700 (PDT) Date: Mon, 21 Sep 2026 09:47:54 -0600 From: Mathieu Poirier To: Francesco Valla Cc: Bjorn Andersson , Kees Cook , "Gustavo A. R. Silva" , Marek Szyprowski , Robin Murphy , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Frank Li , Peng Fan , Sascha Hauer , linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, virtualization@lists.linux.dev, imx@lists.linux.dev, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH RFC 05/12] remoteproc: always report VIRTIO_F_VERSION_1 feature Message-ID: References: <20260916-remoteproc_virtio_map-v1-0-dac8c5eb4aa9@valla.it> <20260916-remoteproc_virtio_map-v1-5-dac8c5eb4aa9@valla.it> Precedence: bulk X-Mailing-List: iommu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260916-remoteproc_virtio_map-v1-5-dac8c5eb4aa9@valla.it> On Wed, Sep 16, 2026 at 11:10:50PM +0200, Francesco Valla wrote: > There is currently no way to report the VIRTIO_F_VERSION_1 using the > resource table alone, as the per-vdev feature array is limited to 32 > bits. > > Considering that the VirtIO 1.0 specification is now ~10 years old, > always report the VIRTIO_F_VERSION_1 feature, as some drivers depend on > it. > > Signed-off-by: Francesco Valla > --- > drivers/remoteproc/remoteproc_virtio.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/drivers/remoteproc/remoteproc_virtio.c b/drivers/remoteproc/remoteproc_virtio.c > index 74e0da970f1d..cfd66d9d1c9e 100644 > --- a/drivers/remoteproc/remoteproc_virtio.c > +++ b/drivers/remoteproc/remoteproc_virtio.c > @@ -249,7 +249,7 @@ static u64 rproc_virtio_get_features(struct virtio_device *vdev) > > rsc = (void *)rvdev->rproc->table_ptr + rvdev->rsc_offset; > > - return rsc->dfeatures; > + return rsc->dfeatures | (1ULL << VIRTIO_F_VERSION_1); I understand this. > } > > static void rproc_transport_features(struct virtio_device *vdev) > @@ -275,14 +275,16 @@ static int rproc_virtio_finalize_features(struct virtio_device *vdev) > /* Give virtio_rproc a chance to accept features. */ > rproc_transport_features(vdev); > > - /* Make sure we don't have any features > 32 bits! */ > - BUG_ON((u32)vdev->features != vdev->features); > + /* Make sure we don't have any features > 32 bits except VIRTIO_F_VERSION_1 */ > + if (WARN_ON_ONCE((u32)vdev->features != > + (vdev->features & ~(1ULL << VIRTIO_F_VERSION_1)))) > + return -1; And this. > > /* > * Remember the finalized features of our vdev, and provide it > * to the remote processor once it is powered on. > */ > - rsc->gfeatures = vdev->features; > + rsc->gfeatures = vdev->features & ~(1ULL << VIRTIO_F_VERSION_1); > But I'm having trouble with this one. First bit 32 of vdev->features gets cleared and then bit 0 to 31 are assigned to rsc->gfeatures. Why bother with clearing bit 32? > return 0; > } > > -- > 2.55.0 >