Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2404004lqp; Sun, 24 Mar 2024 18:05:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVLtCCz1+aP3fFgZXchtWaqtjykH4CNRMCwr9EUO42SZQTPQ9pjfjatrLp/0rKGBfgob/9DE2MmAGNLZ2r/2fdehf2xgmREfPRyLrJCpA== X-Google-Smtp-Source: AGHT+IEB0gLe/zp4UV9D6UQYRkC8PPC3EKIdc8/TcgTIZt/bEIT+1L2NEDtitEtwnJT38jXKf8X3 X-Received: by 2002:a17:906:c105:b0:a47:4c52:8083 with SMTP id do5-20020a170906c10500b00a474c528083mr2454128ejc.10.1711328758329; Sun, 24 Mar 2024 18:05:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711328758; cv=pass; d=google.com; s=arc-20160816; b=hPqngddtfr2dSOPJAVN0LmkwhJmCE3RRA9s+cw6UavojurB/3h27AxejZc4bvafY3t Qf3Q3fB+3dvKX1ziTNQdQmh5iLcSoI2Wfy8yl+M3cZWc7mc0KwX8dTU5RxIkaRMHPH/Y Md3gKJtgGngLxRRvKswRqmaOqxD94ghwX/9XgMNJROpkcfC1H2ammi+6tRm7q/ZfBnY2 +yrrTgnZnUiVRsPUw79xepcGwriDUIl4hACHYB6w+BHnFiDaRWYPCUUy1NWJP4FDZ+bA c+T8/XwQmccIPJyMkbtjIMzxgbn3z0P6OXG7/jTpN5j5sH3TY/jbZGVtPMYFrbQHhtVb h4LA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=rd+8Y+qtMQ1y6Ro4DkZeaUmKPEooIauJD1n5o++ivWc=; fh=NLKCBiMkCEkusqoShKqXo1IBGNU8+2tPLOABJMbhfIA=; b=UwC/2lLBSx7KDfr0aRjdiCaD/T+DJJa3PEeflP1FYg/D+h/3dTCMT+E3M8Ra6iessH re5eEl7Xlsuy9jP3F+ArOQITxTgZuGhWVfSaWepimbBk427gNU+5uK2FFOMU6GhFxnkI b3EJG9K/6xMmbOD8yyHZ6yZJYJxqibZYHPVXcYl/vmRcqnMMKSlw9hAW8r7OLwyhTBcL bE4K0+WWzr0pFuz2JvPvWgKvzJ7G4Us8HyN83M4P98S4kDHkmooVxhszXnIXEfhx5ElM yPCvqqBVTltsZ6hKVhhB6WIUWXPR2CBq9eOjMeeyekG7fBQ3GUZrZNDlu5p5aceooMWa k4og==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=k3Nfvk7l; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113569-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113569-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id f11-20020a170906c08b00b00a4a38027bdcsi258175ejz.706.2024.03.24.18.05.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 18:05:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113569-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=k3Nfvk7l; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113569-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113569-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 145111F23706 for ; Mon, 25 Mar 2024 01:05:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 01E8E74BFE; Sun, 24 Mar 2024 22:46:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="k3Nfvk7l" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 18C741C7B85; Sun, 24 Mar 2024 22:46:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320372; cv=none; b=SZWcxOZ0SP5fGw1nDoi27eY1zfPlBI6LcjN1qX269MU9MTrA/vX7wXI3J5VJs4tIlQBXZdgG5vgJHJ9Fj6K1G5/6F0tSEm07W37RCnPWGJ6GesF8s0Tq1/3lSLZYXoCeapuhdFFH0IgKUbxFjdqv5JjlrHws5pcezJ2u6Rp9hdk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320372; c=relaxed/simple; bh=+3gwlDMFRgQgCGds7eNxqdW02deBnkNTGEUfDpFo1d4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KM/ILXkHOzqp9x0yj/VRFvpLdvKJTEgl5l3tH/5yuprBB0eBlCcRtB9GRMYj863wW3HtOAsJjw/XI5+5Grvjkgi0wYUMT+y/4hQAFPo5dyFx/HkSGg2Wm+307f+L7qKvo1PPm2jFRm4OWIfHW9WupCi5+gpeWupYUlL6A2rGn6s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=k3Nfvk7l; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29D2AC433F1; Sun, 24 Mar 2024 22:46:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320372; bh=+3gwlDMFRgQgCGds7eNxqdW02deBnkNTGEUfDpFo1d4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k3Nfvk7lZr5jGwfsiY/dK4n+OtaCD90bFsoFtHpYA8R0FbxlnM2JzoPruBLsnXucc qHSV9FeoMk/jOqJpp53iULtLGpEOBCOxgx0Xu2Ks9OUTMA2Kk4tRO3C6Y+jBR3+Poz +mDiBlImoziR1oU8mwBeKuHGS/ED1lo0vHRAT5rBtRoz4d1b9ieEDCejCz+5c9BqfL RcyhJlyyRGiX8fYE2vMd6GZkcS53HWR05SGEXFUyt71k6Xo7Amd+pe64+fN04XwPIb nb8f/wBqtshfaeZ6tV37kxbpNWCEY3EJVvkMziS/5T9Wbrv4Ih9ZMy4wPrs74INtFw tLARuuFJw99sQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Steve Sistare , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Jason Wang , "Michael S . Tsirkin" , Sasha Levin Subject: [PATCH 6.8 678/715] vdpa_sim: reset must not run Date: Sun, 24 Mar 2024 18:34:17 -0400 Message-ID: <20240324223455.1342824-679-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Steve Sistare [ Upstream commit 9588e7fc511f9c55b9835f14916e90ab940061b7 ] vdpasim_do_reset sets running to true, which is wrong, as it allows vdpasim_kick_vq to post work requests before the device has been configured. To fix, do not set running until VIRTIO_CONFIG_S_DRIVER_OK is set. Fixes: 0c89e2a3a9d0 ("vdpa_sim: Implement suspend vdpa op") Signed-off-by: Steve Sistare Reviewed-by: Eugenio PĂ©rez Acked-by: Jason Wang Message-Id: <1707517807-137331-1-git-send-email-steven.sistare@oracle.com> Signed-off-by: Michael S. Tsirkin Signed-off-by: Sasha Levin --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c index be2925d0d2836..18584ce70bf07 100644 --- a/drivers/vdpa/vdpa_sim/vdpa_sim.c +++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c @@ -160,7 +160,7 @@ static void vdpasim_do_reset(struct vdpasim *vdpasim, u32 flags) } } - vdpasim->running = true; + vdpasim->running = false; spin_unlock(&vdpasim->iommu_lock); vdpasim->features = 0; @@ -483,6 +483,7 @@ static void vdpasim_set_status(struct vdpa_device *vdpa, u8 status) mutex_lock(&vdpasim->mutex); vdpasim->status = status; + vdpasim->running = (status & VIRTIO_CONFIG_S_DRIVER_OK) != 0; mutex_unlock(&vdpasim->mutex); } -- 2.43.0