From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (mail.openvz.org [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id 7E8CC811BB for ; Thu, 5 Nov 2026 12:55:50 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6A5CsXBq005021; Thu, 5 Nov 2026 15:54:34 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6A5CsXBq005021 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="RmquuXPS" Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6A5CsQWq005004 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Thu, 5 Nov 2026 15:54:27 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6A5CsQWq005004 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4a16dc2323cso20886135e9.3 for ; Thu, 05 Nov 2026 04:54:27 -0800 (PST) X-Gm-Message-State: APuU4Z+y6BXOsar9didvpaZwXKZHWapLI6YetlTjNnhvyCm108yAwxph s3akeZpEioIcPQ3GK+ZrcQq7+geLSCckV0WBXWFSjRmJStoY9lLfn+T9rDnpu1dDMs119n2mYHB KW+LOtJKSS9gt+3DtSlkfNH9w+SVr+FUipkXT7ACtO1A1P47iHw60Xg== X-Gm-Gg: AYBFou3CkZpS71Vl1TGQKTm4W0tr6QxHkmGrY+kw474Cd607Jclq0WWjR90vlPLIRH2 wXyZ/8TitX1rnYFJDjQadwLlv4eGJQ+MnsJ9X+L0sHp9GM8NuXVuN9MAgCrDioB1OGD8p05h5uV uVwtmR4jpgXpsBaYQiAaSdola1+XJ9A/U/qa1TmJ5e+vfGAqwF8OZOQXqiTdOMvpJjGC8lpQFcZ DdBqkqm3/NVUbV0p67tHE5FQ+xOuXnWDwsi/OZTStsDtGeEH2HY1vc9kO3s6Oc+Q0eK9aFcVzXU 1p2vFKhQE8ElzN5w4zfBse1rLl8ylLCmbOl6VMd8tUgKvGs2krwEAmZ8A9LtGP3SomNZgctqw6y i4MlJoBqvl/z5+4Qz X-Received: by 2002:a05:600c:6306:b0:4aa:15b1:d4fa with SMTP id 5b1f17b1804b1-4ac17b2ce91mr453477545e9.5.1793883266436; Thu, 05 Nov 2026 04:54:26 -0800 (PST) X-Received: by 2002:a05:600c:6306:b0:4aa:15b1:d4fa with SMTP id 5b1f17b1804b1-4ac17b2ce91mr453477125e9.5.1793883265938; Thu, 05 Nov 2026 04:54:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1793883265; cv=none; d=google.com; s=arc-20260327; b=PtACVMpPu4Byp/icrPTrxDvRHFiHZwYXTJreIAwG5TsIxBv9cWsjnHClPOGQyAhS9G YHYewOr3wqp1wL0/QYhnT/+mNE/4f9WbKOdTiu604MTdNjrLK9PI2JNHvOXd3T1/9oN2 kqZPlMJ82mHZcPwUiYeCTRPB8mS8hJ+1eNitztm0WE7J2up5Rr+kGqLLpo/1d9CF9uRl h9GzqTdWfSsvINeNUAvZjS6a9+lRyM/FBG8PeLMy7wfX+RlTN7n7//LdMRLfNlErfpMJ BYK4qB6NeJJroJIvdk9KkrB27Iq71XPslLcStTAF98ONy3jvn4UNEpM5IRXSuI3xwZ6E shyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=message-id:date:references:in-reply-to:cc:to:from:subject :content-transfer-encoding:mime-version:dkim-signature; bh=7RER7fzT0N1sIs58qtaYieM4zp+n7crQURiuNFcMZrQ=; fh=5AmFLEo6nHxL6WDW39LXC01IwU+CKjcYMpOuqqVTSIM=; b=sAq6TzRbRFtU2ma4XFzo5oO0rfmUrL5D0bBM6eI4YAGApSYh/LhYJBrb66WvQSx9Dw WzUWRMAe1aUTAbnpfOPw3znmF/62QtdxFSE4Q1UN5z7JOZGedBL6TdnQht6/d78zOTQE ZTmLm/rqPcD8JUQNCmLewEYISg78VGXTSA1KkBtkOoIL4H7hlz2ShOIV+n3ptsoz2lBt O8EtDmSy1X4+7qO3v6NQ6dx82PtB0yASt4b1FIBrDN8beRmjLHF2Ur/WalL0n9o1+fWc WSNksfZiP8fOwx80cjb8L0rz5+MviyNFIoQ5FZHRMmLRektV7zMwC/V/oCA00l7cIBQC aZ+w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=RmquuXPS; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from relay.virtuozzo.com (relay.virtuozzo.com. [130.117.225.111]) by mx.google.com with ESMTPS id ffacd0b85a97d-48fed928413si10378105f8f.177.2026.11.05.04.54.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2026 04:54:25 -0800 (PST) Received-SPF: pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) client-ip=130.117.225.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=RmquuXPS; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=Message-Id:Date:From:Subject:Content-Type: MIME-Version; bh=7RER7fzT0N1sIs58qtaYieM4zp+n7crQURiuNFcMZrQ=; b=RmquuXPSTCVg r/Rn1kWSV4l5C2ITGlWWEvFvbhjmDJkT0H7LmCBx18OEz2zJYoBMNyxLaBfqrG2yqnOiKtF+ClkEH ExoLw5GmWHpZBnQURCaJ3wDu/urq1igDZ6sW2qzO7dbjpYwhYRORKYuTG4F8LbW+xvNee3QSqLlCt rC7YodV8Wjj1iS9ezlwcsum/NSmr2XUaSgDiY5u19Q+TjFy9JmHAH7vVhuzPBRZdtGwz5umQQcHiR UcP6JjOLX62JBTDUnK1gV9ndwnlqdMIZBmF644t3eEGk7AuycAcaMacKlvuIMxbezBM5NhasWSxUX WC7vhwYclXRZvhe1WeXI6Q==; Received: from ch-demo-asa.virtuozzo.com ([130.117.225.8] helo=f0.sw.ru) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1xOwv4-000XtP-2L; Thu, 05 Nov 2026 13:54:22 +0100 MIME-Version: 1.0 From: Konstantin Khorenko To: Andrey Drobyshev In-Reply-To: <20261105121733.643754-2-andrey.drobyshev@virtuozzo.com> References: <20261105121733.643754-1-andrey.drobyshev@virtuozzo.com> <20261105121733.643754-2-andrey.drobyshev@virtuozzo.com> Date: Thu, 05 Nov 2026 13:54:22 +0100 Message-Id: <179388326205.2823727.6310123298126061442.b4-review@b4> X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1718; i=khorenko@virtuozzo.com; h=from:subject:message-id; bh=2nkvXq33U5Yc74m7TwrNl/dHkiDCOBKvR/BkeVIW7g8=; b=owEBbQKS/ZANAwAKAVGWCkf5YVwqAcsmYgBq7HyAJdbSJ0BpRvQ4Jv9rGnusGIaY7vU4PXsMn 9WixQVnZYyJAjMEAAEKAB0WIQRWD23IPcXT0GO9CCxRlgpH+WFcKgUCaux8gAAKCRBRlgpH+WFc Kh3aEACO0UNgvzhRNMRYTsD+Qs5KVmtInzOmtThPboj3XeHzdrD+KArlxj21iNCWu544Tj7VUGi wRNlUicY5fuGG1YBPOqHt+hZis4SXvNv9IkuXKQetAmd3wHL68I+Jkaty3LdPGGHfQl35YPBZYk LcaaeQpUcBMeYmy1FGcmgOIFOEe0xmG84RKQz5W6WrcpFGdsauxsh6t8f5ciejO89e1RHQ4UQhY P851kFQgpaF1fay3pnOx9bQFYXYwNj/IiY/bhnI8I2lDBWM+wQItua8UxOcE3+66s2BJOr/4xXC LS+xRKAm9tr4w2y4bCAdC3inswUGSgQQO+jm2h0+GmlDzJl7Z30LY8G7dJgWvaVWjSwhcODvIHz aE3scg5wgz6sz5wxYiNil+EQSwz80kdvngjsQ65ZUml2yzDiNJ+Lm9A9W2ylnZZfXXxMbBNfVDq vwFlkUlOltapqPSAFDqh6fID5gmb0/dG5+sq8cxTLBZo2ENfK9CL8UmcV3y5yWwhGoIqjGiVXRr ik7q0MTaIXI058fWABr+r9NDuQss8X5inwFlmsNxSkJldrBqLPMxtocsYlwgoJAnapuxwzO01gd uE158CjpSkEVybKqLqUFm01gaUFl+ZjasUvkjwD/OzdFbDGk4y088Ulu8hUXGd8a+FHq34dtURQ Ukest8nFMfR/XoA== X-Developer-Key: i=khorenko@virtuozzo.com; a=openpgp; fpr=560F6DC83DC5D3D063BD082C51960A47F9615C2A X-OZ-Fwd: true Cc: devel@openvz.org Subject: Re: [Devel] [PATCH hci-8.1 1/2] vfio: take the kvm reference only for drivers that read device->kvm X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org I won't apply this version, please send v3 with the changes below. On Thu, 5 Nov 2026 14:17:32 +0200, Andrey Drobyshev wrote: > Only three drivers read device->kvm after open_device(): KVMGT, > vfio_ap and vfio-pci's zdev support. Let them say so with > needs_kvm_ref, and take no reference for the others, which then can't > keep a VM alive. Tested with nvidia-vgpu-vfio 595.71.03 on RTX 6000 > Ada SR-IOV VFs, a vfio-pci variant driver that doesn't read the > pointer. Item 1 of the cover letter reply: "after open_device()" becomes "in open_device()", and say that device->kvm stays NULL without the flag. Why: all three read the pointer in open_device(). vfio_ap reads it only there and fails the open with -EINVAL when it is NULL. And vfio_device_get_kvm_safe() returns before it sets device->kvm, so a driver without the flag gets no pointer at all, not just no reference. An out-of-tree driver that reads it now sees NULL. Item 2 of the cover letter reply: say how you checked that nvidia-vgpu-vfio does not read device->kvm. Why: that driver is the one this change is for, and its source is not in our tree. If it does read the pointer, it now gets NULL. > + /* > + * Set before registration by a driver that reads device->kvm after > + * open_device(): the core then keeps the KVM the device was opened > + * with referenced until close_device(). > + */ Item 1 of the cover letter reply: the same two fixes in this comment. > Feature: fix ms/vfio > > Assisted-by: LLM Item 5 of the cover letter reply: drop the Assisted-by line here, it goes into the cover letter. Put a blank line before Feature:. -- Konstantin Khorenko, Virtuozzo Linux Kernel Team _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel