From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 5DD0147141A for ; Wed, 22 Jul 2026 09:44:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784713443; cv=none; b=SpqPCwJOPaXGGGQuTTM3A/S2CByvzk/iqYiWJny1JfXXt3gYCHz7xlZ6D3bEG7D5kcHv0sPYUgDr+Y3bnKKuVC3y/PnbM8FQ20Kg4MaCtynEygnTU2h8JgICrk3SSbeayF0DcthMCcwNKlZ58I0IDdzgbI4MUbh5MZ4TM2p2y9U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784713443; c=relaxed/simple; bh=lOwARzZKfPn8sQ+Z5RWIh2PjsWgxiRWHG5/38qBJEHI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KW/uwzLFQhUvwCc1NpTYyw0lyciEx7TFHl+10UPDi3gNt6Ahvm75lo10wGg7rkf23xcNmiUvblp6EE09ffVIuS1XYnalOFOOkZIDWvmWS9UYfXM5ZcBTTLb75pNXFbHNQYMX+PkNnvbuL/x1G/Xy/FyoN0VKwydREFE6CYYUkO0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=PA92zjp7; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=lUaSeldw; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="PA92zjp7"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="lUaSeldw" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1784713440; 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=P6FuAEzBLuYs8iPbKk5rWp3C26BiKFrVufL8wR17fYA=; b=PA92zjp7tfXYn3OdxQeD79emewlOpO0PD9NEdqlVOKY/e3nfiTskiplcxvQaiwy4A6+lqk VuqxT04ukf84UVLsOo2tSmvy8Q2pmtngwa+L/ngvJcfb42M0rwSCiW031Hc6b2n4yLhCEi wKVc+BFG++MYQVDhQEN8OvsedivYUPs= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-475-5AT83cnoPyCs2L5RiQobZA-1; Wed, 22 Jul 2026 05:43:59 -0400 X-MC-Unique: 5AT83cnoPyCs2L5RiQobZA-1 X-Mimecast-MFC-AGG-ID: 5AT83cnoPyCs2L5RiQobZA_1784713438 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-493bfc3b84aso66348275e9.0 for ; Wed, 22 Jul 2026 02:43:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1784713438; x=1785318238; darn=vger.kernel.org; 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=P6FuAEzBLuYs8iPbKk5rWp3C26BiKFrVufL8wR17fYA=; b=lUaSeldwe+nk3/7oJfPwFP1RUotiGuEBl2au7YaJ/wB5fAcRK6i8JlGzMd9TifetEt 1fDYb5bIKVQkHPe86k2QHbjZoqiTegLaCWFDBygQJspP35SuuW6ZF0nWhzFTSTWXEwk/ 6l+23ZxbAWQSJNpE4NLN+z6AeewRHUMMUUWoHD8l4/+rkKicOzn+Q6toQ3MqapyeMUMI GKJZljx/1Q8lJWqQVJ+OVbRtVV8FSyOI9rTOENnBqitSR0EP2HEHk/8AJ4DOca86ImQJ Xhe41bFiJcPXm4QkoYdT/fVAyJxedMZ7G2Aa6acKNTlX2t+pcX5Rlo/a1H3xisnSQurH /0sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784713438; x=1785318238; 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=P6FuAEzBLuYs8iPbKk5rWp3C26BiKFrVufL8wR17fYA=; b=LLPmpC5JIEDB0+NG9KRavITi5efxLC98g9bwCCo8LkTsjfs8F95KJnQltPyO2GY3b1 EkTqfrxuI3UytIDrUt8rNw1XseKiUR70b+9tusuVcspwT1qE9byxRohQMS5xac8dZSbt 8vvzLEbNsGmcCA502ROpNthuyStXni4/sThEdrekTnyWLkbhBRoN6EQMGHOvZLU3J0ow XxL/fCYdwuN6c+aM/tj+jMLgWpsiBJtSNXqwF80DQDdSaLFob5FLqkNGETOxGjuVVc8y msJ30z6xZUsVcRVEhiV4MEr41rStpBIVjGNILP9+wzBkRSDLu7FwG801jWvfXiYlgn9D 1qvQ== X-Gm-Message-State: AOJu0YyU4XPsPfUAcBAk4fC5cqz3q6aIvLUa29t76NgUGa8iMWne2RGM RWNeQCgT5/7Aj6Qiquwf+lluzS89Qlh/7IRnVm/jVybS6U9O7/IDIXcciPPvH0TsDpIgsU6WMtl cNGI8Ix2rd9QrjgUZtOkEcU2aULz7RIYbC6omfnUAXrDLfXpnljOeVKmUkIDLsRVCiA== X-Gm-Gg: AR+sD11mOOzMiRztorVOKfSHKZoRL9QZR4mEJY88uYkCMf/bR8Pjw48AvlPSIysgutI khjJzSczznTABTvTsXN67zWLoKvytZjbL3OdftS+EZM5p2XU4+3mxWtSFWkHEw1XjKgo5f1oRdd ycXbTmlgRACIsR+6X/3NtT3KeaWpDowPCVCFSy90KVVMvDXLBGo0Yo6ofaKVDcMaGHsweUMsNbe jM6tBnIkA0txe59xzq6WHvd+TyaGmai9XU1JbZkqRuPrkw/7fF/Vl0LRkeLn7+DQsASbKYBvNgy s3szebli/2x+QDMNIJ5ad8yUmR+tl1ThHEX5wKWl7jYIG+h7cQZPvGHuO8ArOUYM/8jzpCkTt59 TvZutGOdjW/2gaI8BvnD91ycjucs9GYvxckErWgx5ThFI22yZlQ== X-Received: by 2002:a05:600c:d4:b0:493:cc25:9c0e with SMTP id 5b1f17b1804b1-4954a3dc3admr173160715e9.14.1784713438319; Wed, 22 Jul 2026 02:43:58 -0700 (PDT) X-Received: by 2002:a05:600c:d4:b0:493:cc25:9c0e with SMTP id 5b1f17b1804b1-4954a3dc3admr173160315e9.14.1784713437719; Wed, 22 Jul 2026 02:43:57 -0700 (PDT) Received: from sgarzare-redhat (host-82-53-135-65.retail.telecomitalia.it. [82.53.135.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4956537c6besm124593995e9.8.2026.07.22.02.43.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jul 2026 02:43:57 -0700 (PDT) Date: Wed, 22 Jul 2026 11:43:54 +0200 From: Stefano Garzarella To: Andrey Drobyshev Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux.dev, netdev@vger.kernel.org, mst@redhat.com, stefanha@redhat.com, dongli.zhang@oracle.com, maciej.szmigiero@oracle.com, bchaney@akamai.com, mark.kanda@oracle.com, ptikhomirov@virtuozzo.com, den@openvz.org Subject: Re: [PATCH v5 5/5] vhost/vsock: add VHOST_RESET_OWNER ioctl Message-ID: References: <20260720102241.371610-1-andrey.drobyshev@virtuozzo.com> <20260720102241.371610-6-andrey.drobyshev@virtuozzo.com> 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=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20260720102241.371610-6-andrey.drobyshev@virtuozzo.com> On Mon, Jul 20, 2026 at 01:22:41PM +0300, Andrey Drobyshev wrote: >From: Pavel Tikhomirov > >This ioctl is needed for QEMU's CPR (checkpoint-restore) migration of >the guest with vhost-vsock device. For this to work, we need to reset >the device ownership on the source side by calling RESET_OWNER, and then >claim it on the dest side by calling SET_OWNER. We expect not to lose any >AF_VSOCK connection while this happens. > >To that end, unlike the release path, RESET_OWNER keeps the guest CID >hashed: established connections survive, and host sends issued while >the device is between owners simply stay on send_pkt_queue until the >next device start drains them. > >Since the device stays reachable through the CID hash, the lockless >send/cancel paths can race with the worker teardown in >vhost_workers_free(). The previous commit ("vhost: synchronize with >RCU readers when freeing workers") makes that safe. > >Signed-off-by: Pavel Tikhomirov >Signed-off-by: Andrey Drobyshev >--- > drivers/vhost/vsock.c | 25 +++++++++++++++++++++++++ > 1 file changed, 25 insertions(+) Reviewed-by: Stefano Garzarella