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.133.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 A813A257435 for ; Mon, 17 Nov 2025 10:50:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763376628; cv=none; b=AYOGPPHxMju1TdloQrdFXnhr262R9qTR053BemmBdA11gy3cqiDfg5AYqL9d7KfrxVG0KGhwJCDjl0eIsXmF6XAhIZDmJcSp+H8dgvAXbLmckxbFJMc/8hMf5x0c+Lq277ITfgRQy8FArrEE9Ryq6pnOxwIzliMNIrhqTtits+E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763376628; c=relaxed/simple; bh=mg5Q+IpRVr3OMWZZo+BKznwgFoJqhrDbBw/ilxIPjF8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=O4IVT4AvAk136/sOSS/xB1x9+Em6qLEZ4CsxYMZWTK9JDmZoklFpbm/i1Lw+K581qOq0MfKZw8Elz9xM7TiyqFrSDaJLuaVsvbKnxwC5hIE/X9sdkAAoK/tmT7pxKvgK92wrwBE9a73D90i0rdUttEQJ1a0mL8H7vv3a96MajM4= 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=ZvK+LYAz; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=J/U4xc4e; arc=none smtp.client-ip=170.10.133.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="ZvK+LYAz"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="J/U4xc4e" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1763376625; 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=nuX0aPSVd/d7iLB6bbasM0NpI015d3K/jXv3pcQh+us=; b=ZvK+LYAzo1/Jp0udRUHe/pQdrxLrUMIklr9fOR3J+2fSr0hFj9ni7DA3QWpyktHH2QC2fg b9tu9362KLayLE+7mST20pZDGpOdIGpTSN21a4+YA8TOmQlBXzzmWgFqZHc8L9VdWYLq5f FAcbpU15RusH+1qHGnO4Jg3FASa45QE= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-60-plsWtcH3Ml2QQv72V_xw4w-1; Mon, 17 Nov 2025 05:50:24 -0500 X-MC-Unique: plsWtcH3Ml2QQv72V_xw4w-1 X-Mimecast-MFC-AGG-ID: plsWtcH3Ml2QQv72V_xw4w_1763376623 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4779edba8f3so7765075e9.3 for ; Mon, 17 Nov 2025 02:50:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1763376623; x=1763981423; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=nuX0aPSVd/d7iLB6bbasM0NpI015d3K/jXv3pcQh+us=; b=J/U4xc4eP3w+YeYenQ2AoITZtkiAu3pERVCDMMqYuLv/HE6VDaFnuFLHA+5xirBKZk iN0sXZcxAbMhicMORONLQZfYj+jap+Gi+SZVCWhu0IaVVWHPd4atUO31/pXzs8QrQWWK DcVBIwVutYt5EqGAu0OEQ4pSpizdXmH/bC90nJ3ZLd4nl9+VvsQxPdOHqzThVIPVLs6b RlZUlsUnsEE4+bp3V+eieKPiJaNJrvSCGrIJx9TAeDFYJUNsO0Vjv0y4bcCDB6u+KQRc h85Ql8YFbtH4mCWKXGerSSirLgDm73JJcZSQAX6eswiLpB4r/HL3R7iuHDvgBm+/Jk9b D+nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763376623; x=1763981423; h=in-reply-to:content-disposition: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; bh=nuX0aPSVd/d7iLB6bbasM0NpI015d3K/jXv3pcQh+us=; b=E3SOQ4sXgtbtHyTtm5Uy05eQkmgHveaZNQes/WRKLQA/RR1dePfttL4iQZOneIzBcP 9N9wRaKY+CU7UTZPM073hWafcdptuiUHeolcKL8yDBilnYJcsVNzVwYcs+HBUOICo4e9 12btav8kzKfjtCAn3Xpx5ZEYsdflopSsmlRdnXw8aomQ231mfDunL1Amcf46ZWBCZU2G PiMRw4eVNk70gN6PPJCHNDj8BzZsP7QaUfl98Qq1xBTGgQeciLfKer/Oa5i0Tpj70K14 ZvL985sra7QEMgMCORaTOMQHnumIRdVaQTp7t/GgB82gU3rMDMwUnV0SYamP5bSnfl85 YwIQ== X-Forwarded-Encrypted: i=1; AJvYcCWIsXrRjpKt0Ov5TCL+1DvIn0B8abeHC4x5ZBwgi68fJzV8DZUX39ssBR1RPOGcE83BNxMDEZT/ufeIeVg=@vger.kernel.org X-Gm-Message-State: AOJu0YwIOH949WDw52aCwhbhWw/QAvhRkQemKXTsfidVIhOe7wIkgJeD +t37sBPt5ZCwkSx5ydOps61kNYqwvngHGA3qoySefRII/t5QH3rD75lwOxW3cGEd6kS1HB2okZk GWmkMW7WV3l25buUc02e6ktGFMt2s/trIUfhYteOfPsEHBxeGth1iqIEyX7fbrpPckA== X-Gm-Gg: ASbGncv2ip4ShAet1gMisXj23lqEY7z1K40PQiGZxmgC7qs3SwHKX2Ym5dMKAbUz/rG pcl4Ri8RI7P2c+SofCo1Ke8TO/WfHvLvfwBsbVfm2UTGPjUxEJs/EatW//QEaHoUxMfITSKiT7N jAn/1VHknfMbJPPBh3NNGi6Eiih/wGRirn8x5SHvIrqUi0Zxy+nwSwgrAey5BCTfROmiCOQJnMm BShoxtUlFCuSPKB9f/AHHgGXFJ9V4OhY+gDHh/F/E5WGH5Nj8nzWYO5OGegR8/fnvsEZhcXUc4N Lj4UAd+C3De9LZ2ku2QpgX3VtvErbSe/ycr2PxtyZCKqfLJUinn+GxKpALNQaI3vC6luQ8pc2Wh Q92RHXoaZYSu9ExamfOU= X-Received: by 2002:a05:600c:1c0f:b0:477:9cdb:e337 with SMTP id 5b1f17b1804b1-4779cdbe7e1mr63411345e9.7.1763376622781; Mon, 17 Nov 2025 02:50:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IFUG/kfaguZEJ7FDbwjxH60OTb7c2HOk6fwWxSJhNyaPv2yIbfRnBhN8Ld7zJ4gfuJClKT3eA== X-Received: by 2002:a05:600c:1c0f:b0:477:9cdb:e337 with SMTP id 5b1f17b1804b1-4779cdbe7e1mr63410945e9.7.1763376622277; Mon, 17 Nov 2025 02:50:22 -0800 (PST) Received: from redhat.com (IGLD-80-230-39-63.inter.net.il. [80.230.39.63]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47795272c53sm162240925e9.9.2025.11.17.02.50.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Nov 2025 02:50:21 -0800 (PST) Date: Mon, 17 Nov 2025 05:50:19 -0500 From: "Michael S. Tsirkin" To: Eugenio Perez Martin Cc: Jason Wang , Laurent Vivier , virtualization@lists.linux.dev, Maxime Coquelin , Cindy Lu , linux-kernel@vger.kernel.org, Yongji Xie , Xuan Zhuo , Stefano Garzarella Subject: Re: [PATCH v9 5/6] vduse: add vq group asid support Message-ID: <20251117054850-mutt-send-email-mst@kernel.org> References: <20251113115558.1277981-1-eperezma@redhat.com> <20251113115558.1277981-6-eperezma@redhat.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 Content-Disposition: inline In-Reply-To: On Fri, Nov 14, 2025 at 12:25:03PM +0100, Eugenio Perez Martin wrote: > RCU is protecting that the address space pointer of the vq group is > not modified concurrently with the access. Ideally, this should be a > full lock, but just making sure that all accesses from the reader are > coherent is enough. Userspace should expect nothing if it uses the map > and modifies the vq group ASID at the same time anyway, but the kernel > needs to be sure that it does not see intermediate states. TBH, we > could move to a READ_ONCE / WRITE_ONCE, would that be more clear? generally rcu itself does not need ONCE macros. these are for funky lockless things, and rcu can be seen as a kind of lock, after all. -- MST