From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cornelia Huck Date: Thu, 03 Nov 2022 13:46:28 +0100 Subject: [PATCH 04/44] KVM: Teardown VFIO ops earlier in kvm_exit() In-Reply-To: <20221102231911.3107438-5-seanjc@google.com> References: <20221102231911.3107438-1-seanjc@google.com> <20221102231911.3107438-5-seanjc@google.com> Message-ID: <87edukxl23.fsf@redhat.com> List-Id: To: kvm-riscv@lists.infradead.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Wed, Nov 02 2022, Sean Christopherson wrote: > Move the call to kvm_vfio_ops_exit() further up kvm_exit() to try and > bring some amount of symmetry to the setup order in kvm_init(), and more > importantly so that the arch hooks are invoked dead last by kvm_exit(). > This will allow arch code to move away from the arch hooks without any > change in ordering between arch code and common code in kvm_exit(). > > That kvm_vfio_ops_exit() is called last appears to be 100% arbitrary. It > was bolted on after the fact by commit 571ee1b68598 ("kvm: vfio: fix > unregister kvm_device_ops of vfio"). The nullified kvm_device_ops_table > is also local to kvm_main.c and is used only when there are active VMs, > so unless arch code is doing something truly bizarre, nullifying the > table earlier in kvm_exit() is little more than a nop. > > Signed-off-by: Sean Christopherson > --- > virt/kvm/kvm_main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Looks safe to me. Reviewed-by: Cornelia Huck From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45ABAC4332F for ; Thu, 3 Nov 2022 12:46:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 9E4DE4B64A; Thu, 3 Nov 2022 08:46:39 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@redhat.com Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WeqE317XW22M; Thu, 3 Nov 2022 08:46:38 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 7149C4B62E; Thu, 3 Nov 2022 08:46:38 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id B05384B0B9 for ; Thu, 3 Nov 2022 08:46:36 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sWLFbCaRH+9z for ; Thu, 3 Nov 2022 08:46:35 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 93B9A4A49C for ; Thu, 3 Nov 2022 08:46:35 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667479595; 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=6Lh+aq0KrT7YT7zq9EYFKfpsO05/wse1gFPTUN4LGR8=; b=OGcOkRMzvKi9W8TFAkyajOiurd/jzR3FxYOv+VxAk2Mp6OYk5SpPTnr0UJ6sCQPonK60+J /zM4YRqrcRWv24MKcrHyRIs3W/ByN6HuMSkCjWlHG5fS5EimZmyiWoMJAbzz6MECao+s8R voNDIw3orFR2OKtDjhryJQ4hxBCqr7k= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-425-rDTZzCaNMfqkeMoeZ1x5EQ-1; Thu, 03 Nov 2022 08:46:33 -0400 X-MC-Unique: rDTZzCaNMfqkeMoeZ1x5EQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 145AE823F77; Thu, 3 Nov 2022 12:46:31 +0000 (UTC) Received: from localhost (unknown [10.39.193.104]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5E6A2492B06; Thu, 3 Nov 2022 12:46:30 +0000 (UTC) From: Cornelia Huck To: Sean Christopherson , Paolo Bonzini , Marc Zyngier , Huacai Chen , Aleksandar Markovic , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , Matthew Rosato , Eric Farman , Sean Christopherson , Vitaly Kuznetsov Subject: Re: [PATCH 04/44] KVM: Teardown VFIO ops earlier in kvm_exit() In-Reply-To: <20221102231911.3107438-5-seanjc@google.com> Organization: Red Hat GmbH References: <20221102231911.3107438-1-seanjc@google.com> <20221102231911.3107438-5-seanjc@google.com> User-Agent: Notmuch/0.37 (https://notmuchmail.org) Date: Thu, 03 Nov 2022 13:46:28 +0100 Message-ID: <87edukxl23.fsf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 Cc: kvm@vger.kernel.org, David Hildenbrand , Atish Patra , linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-s390@vger.kernel.org, Michael Ellerman , Chao Gao , Yuan Yao , kvmarm@lists.linux.dev, Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Isaku Yamahata , Fabiano Rosas , linux-mips@vger.kernel.org, kvm-riscv@lists.infradead.org, linuxppc-dev@lists.ozlabs.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Wed, Nov 02 2022, Sean Christopherson wrote: > Move the call to kvm_vfio_ops_exit() further up kvm_exit() to try and > bring some amount of symmetry to the setup order in kvm_init(), and more > importantly so that the arch hooks are invoked dead last by kvm_exit(). > This will allow arch code to move away from the arch hooks without any > change in ordering between arch code and common code in kvm_exit(). > > That kvm_vfio_ops_exit() is called last appears to be 100% arbitrary. It > was bolted on after the fact by commit 571ee1b68598 ("kvm: vfio: fix > unregister kvm_device_ops of vfio"). The nullified kvm_device_ops_table > is also local to kvm_main.c and is used only when there are active VMs, > so unless arch code is doing something truly bizarre, nullifying the > table earlier in kvm_exit() is little more than a nop. > > Signed-off-by: Sean Christopherson > --- > virt/kvm/kvm_main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Looks safe to me. Reviewed-by: Cornelia Huck _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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 531556FC3 for ; Thu, 3 Nov 2022 12:46:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667479596; 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=6Lh+aq0KrT7YT7zq9EYFKfpsO05/wse1gFPTUN4LGR8=; b=GMSdX3cPDluh9oLoXHYm4jnRKUMGsO1JxQ1RIlWNUCTDrhb2RDcDXjld3MvCGqGEJOSKNO bsyphQZedinPg2D8t7gMXtB/BOgcWvZCZAyAGRvlWACH6nVhj5yXlm1X2/0aCzQaDifBps L1DLZ9j9RVXu835mLTmENv78MlIXgn8= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-425-rDTZzCaNMfqkeMoeZ1x5EQ-1; Thu, 03 Nov 2022 08:46:33 -0400 X-MC-Unique: rDTZzCaNMfqkeMoeZ1x5EQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 145AE823F77; Thu, 3 Nov 2022 12:46:31 +0000 (UTC) Received: from localhost (unknown [10.39.193.104]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5E6A2492B06; Thu, 3 Nov 2022 12:46:30 +0000 (UTC) From: Cornelia Huck To: Sean Christopherson , Paolo Bonzini , Marc Zyngier , Huacai Chen , Aleksandar Markovic , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , Matthew Rosato , Eric Farman , Sean Christopherson , Vitaly Kuznetsov Cc: James Morse , Alexandru Elisei , Suzuki K Poulose , Oliver Upton , Atish Patra , David Hildenbrand , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, Isaku Yamahata , Fabiano Rosas , Michael Ellerman , Chao Gao , Thomas Gleixner , Yuan Yao Subject: Re: [PATCH 04/44] KVM: Teardown VFIO ops earlier in kvm_exit() In-Reply-To: <20221102231911.3107438-5-seanjc@google.com> Organization: Red Hat GmbH References: <20221102231911.3107438-1-seanjc@google.com> <20221102231911.3107438-5-seanjc@google.com> User-Agent: Notmuch/0.37 (https://notmuchmail.org) Date: Thu, 03 Nov 2022 13:46:28 +0100 Message-ID: <87edukxl23.fsf@redhat.com> Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 Message-ID: <20221103124628.6cAG2iYRZEoKjmmdKVWxbAL8ZXeqt-M2Zf-o-8mDugg@z> On Wed, Nov 02 2022, Sean Christopherson wrote: > Move the call to kvm_vfio_ops_exit() further up kvm_exit() to try and > bring some amount of symmetry to the setup order in kvm_init(), and more > importantly so that the arch hooks are invoked dead last by kvm_exit(). > This will allow arch code to move away from the arch hooks without any > change in ordering between arch code and common code in kvm_exit(). > > That kvm_vfio_ops_exit() is called last appears to be 100% arbitrary. It > was bolted on after the fact by commit 571ee1b68598 ("kvm: vfio: fix > unregister kvm_device_ops of vfio"). The nullified kvm_device_ops_table > is also local to kvm_main.c and is used only when there are active VMs, > so unless arch code is doing something truly bizarre, nullifying the > table earlier in kvm_exit() is little more than a nop. > > Signed-off-by: Sean Christopherson > --- > virt/kvm/kvm_main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Looks safe to me. Reviewed-by: Cornelia Huck From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1CFCDC433FE for ; Thu, 3 Nov 2022 12:48:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:References :In-Reply-To:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Y6r2g0hglC+o1V08NgS6D6weZqsg/g+Z981yKPPVR28=; b=roSGITwwo4efcm 0do8F/MNNFYhnFkanoSrdcnMTFVH93vS9mAMcvjZKnk2W8rwpRBB3wcHxXqbSkwVmT2iY7jF0o2PP s2OQaEZiV2xpOTAlsMWPfP+z1RXEcyhGOui59THVqpzaGpeVKVdvECrhp0vG8ziRmeraakCEQ5DQt F0wOQ8RaTi0yi1z4MPMdDcl6BsrPQcQtCLO+SbCxycPgwNZyi97aVhMFArlvFkzXmNPwUHuMYV1sa 8TU1ltCxBYShhEsGTjgF0wDZ9ZpcXelghDiIwloXjhCUQRNn1YPXCSl/Bg83XzjQPWHzoTE+wyrET CLaP2HIOhE7INHDNZ5CA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqZdy-00HOS8-Me; Thu, 03 Nov 2022 12:48:26 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqZdp-00HOOk-5u for linux-riscv@lists.infradead.org; Thu, 03 Nov 2022 12:48:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667479689; 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=6Lh+aq0KrT7YT7zq9EYFKfpsO05/wse1gFPTUN4LGR8=; b=eKkwDi0tCXUU9QQ/PQIUW4IMURnfh9vlvg80WCjYUGut/ZBe7Fbydk86evtQoScZgPnK80 5TrhjY0llkObh568owG1UPHjU+911RE383sM9s8H5hNCEC1/DIS3qrS4SHzbmjtV5c334j 2J1GGJIlvSdCIeQ4zp1eDJ+JN4sj/+Y= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-425-rDTZzCaNMfqkeMoeZ1x5EQ-1; Thu, 03 Nov 2022 08:46:33 -0400 X-MC-Unique: rDTZzCaNMfqkeMoeZ1x5EQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 145AE823F77; Thu, 3 Nov 2022 12:46:31 +0000 (UTC) Received: from localhost (unknown [10.39.193.104]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5E6A2492B06; Thu, 3 Nov 2022 12:46:30 +0000 (UTC) From: Cornelia Huck To: Sean Christopherson , Paolo Bonzini , Marc Zyngier , Huacai Chen , Aleksandar Markovic , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , Matthew Rosato , Eric Farman , Sean Christopherson , Vitaly Kuznetsov Cc: James Morse , Alexandru Elisei , Suzuki K Poulose , Oliver Upton , Atish Patra , David Hildenbrand , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, Isaku Yamahata , Fabiano Rosas , Michael Ellerman , Chao Gao , Thomas Gleixner , Yuan Yao Subject: Re: [PATCH 04/44] KVM: Teardown VFIO ops earlier in kvm_exit() In-Reply-To: <20221102231911.3107438-5-seanjc@google.com> Organization: Red Hat GmbH References: <20221102231911.3107438-1-seanjc@google.com> <20221102231911.3107438-5-seanjc@google.com> User-Agent: Notmuch/0.37 (https://notmuchmail.org) Date: Thu, 03 Nov 2022 13:46:28 +0100 Message-ID: <87edukxl23.fsf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221103_054824_161881_61646851 X-CRM114-Status: GOOD ( 16.50 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Wed, Nov 02 2022, Sean Christopherson wrote: > Move the call to kvm_vfio_ops_exit() further up kvm_exit() to try and > bring some amount of symmetry to the setup order in kvm_init(), and more > importantly so that the arch hooks are invoked dead last by kvm_exit(). > This will allow arch code to move away from the arch hooks without any > change in ordering between arch code and common code in kvm_exit(). > > That kvm_vfio_ops_exit() is called last appears to be 100% arbitrary. It > was bolted on after the fact by commit 571ee1b68598 ("kvm: vfio: fix > unregister kvm_device_ops of vfio"). The nullified kvm_device_ops_table > is also local to kvm_main.c and is used only when there are active VMs, > so unless arch code is doing something truly bizarre, nullifying the > table earlier in kvm_exit() is little more than a nop. > > Signed-off-by: Sean Christopherson > --- > virt/kvm/kvm_main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Looks safe to me. Reviewed-by: Cornelia Huck _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 20AD6C4332F for ; Thu, 3 Nov 2022 12:47:34 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4N33SN45Dgz3cJQ for ; Thu, 3 Nov 2022 23:47:32 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=OGcOkRMz; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=OGcOkRMz; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=redhat.com (client-ip=170.10.129.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=cohuck@redhat.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=OGcOkRMz; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=OGcOkRMz; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4N33RM3dWlz2xJR for ; Thu, 3 Nov 2022 23:46:38 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667479595; 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=6Lh+aq0KrT7YT7zq9EYFKfpsO05/wse1gFPTUN4LGR8=; b=OGcOkRMzvKi9W8TFAkyajOiurd/jzR3FxYOv+VxAk2Mp6OYk5SpPTnr0UJ6sCQPonK60+J /zM4YRqrcRWv24MKcrHyRIs3W/ByN6HuMSkCjWlHG5fS5EimZmyiWoMJAbzz6MECao+s8R voNDIw3orFR2OKtDjhryJQ4hxBCqr7k= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667479595; 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=6Lh+aq0KrT7YT7zq9EYFKfpsO05/wse1gFPTUN4LGR8=; b=OGcOkRMzvKi9W8TFAkyajOiurd/jzR3FxYOv+VxAk2Mp6OYk5SpPTnr0UJ6sCQPonK60+J /zM4YRqrcRWv24MKcrHyRIs3W/ByN6HuMSkCjWlHG5fS5EimZmyiWoMJAbzz6MECao+s8R voNDIw3orFR2OKtDjhryJQ4hxBCqr7k= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-425-rDTZzCaNMfqkeMoeZ1x5EQ-1; Thu, 03 Nov 2022 08:46:33 -0400 X-MC-Unique: rDTZzCaNMfqkeMoeZ1x5EQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 145AE823F77; Thu, 3 Nov 2022 12:46:31 +0000 (UTC) Received: from localhost (unknown [10.39.193.104]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5E6A2492B06; Thu, 3 Nov 2022 12:46:30 +0000 (UTC) From: Cornelia Huck To: Sean Christopherson , Paolo Bonzini , Marc Zyngier , Huacai Chen , Aleksandar Markovic , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , Matthew Rosato , Eric Farman , Sean Christopherson , Vitaly Kuznetsov Subject: Re: [PATCH 04/44] KVM: Teardown VFIO ops earlier in kvm_exit() In-Reply-To: <20221102231911.3107438-5-seanjc@google.com> Organization: Red Hat GmbH References: <20221102231911.3107438-1-seanjc@google.com> <20221102231911.3107438-5-seanjc@google.com> User-Agent: Notmuch/0.37 (https://notmuchmail.org) Date: Thu, 03 Nov 2022 13:46:28 +0100 Message-ID: <87edukxl23.fsf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kvm@vger.kernel.org, David Hildenbrand , Atish Patra , linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-s390@vger.kernel.org, Chao Gao , Suzuki K Poulose , Yuan Yao , kvmarm@lists.linux.dev, Thomas Gleixner , Alexandru Elisei , linux-arm-kernel@lists.infradead.org, Isaku Yamahata , Fabiano Rosas , linux-mips@vger.kernel.org, Oliver Upton , James Morse , kvm-riscv@lists.infradead.org, linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Wed, Nov 02 2022, Sean Christopherson wrote: > Move the call to kvm_vfio_ops_exit() further up kvm_exit() to try and > bring some amount of symmetry to the setup order in kvm_init(), and more > importantly so that the arch hooks are invoked dead last by kvm_exit(). > This will allow arch code to move away from the arch hooks without any > change in ordering between arch code and common code in kvm_exit(). > > That kvm_vfio_ops_exit() is called last appears to be 100% arbitrary. It > was bolted on after the fact by commit 571ee1b68598 ("kvm: vfio: fix > unregister kvm_device_ops of vfio"). The nullified kvm_device_ops_table > is also local to kvm_main.c and is used only when there are active VMs, > so unless arch code is doing something truly bizarre, nullifying the > table earlier in kvm_exit() is little more than a nop. > > Signed-off-by: Sean Christopherson > --- > virt/kvm/kvm_main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Looks safe to me. Reviewed-by: Cornelia Huck From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B9A3BC433FE for ; Thu, 3 Nov 2022 12:49:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:References :In-Reply-To:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vng6VIv1I/m3HSe0Y0BAJaQ/3gntzrEtH4XpcFMlymY=; b=mGAEudFe1nfqF2 2gu5SJ3QVIYGAL1hKw+cc/pIuwsTo0A16msWNmrcqaGRQKiPJk1UM/+O2XsHL7gKCPf79KdC7XOtQ 7hHsblgV98ar/gvPuBOoQDH5m4Dr9r/nEDP/jgPIk8Jb9+oUAjYEyK3RuNr1tqIVwUOoZsGR1eycj xfcJra/rcHFfcWBjpPlYEnZSRrEND9F2YX1BqAe3hRsZdJRFLHZqgGqcW89ANPNsijq9lT3bR4+sd CqrYmV6dRIuQYI2XAtvJSCOTfC+Nup7cw30jEvsdz48kOLTd9vgypan97RxOJ/NouqzYOyCKQ9R3S xTeCH//jRIEvGF0n3Xvw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqZe1-00HOTE-Jr; Thu, 03 Nov 2022 12:48:29 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqZdv-00HOPd-7c for linux-arm-kernel@lists.infradead.org; Thu, 03 Nov 2022 12:48:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667479692; 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=6Lh+aq0KrT7YT7zq9EYFKfpsO05/wse1gFPTUN4LGR8=; b=SEjHZcPtmr8FtqnCGih3ADpIy/GYRxljDK/cHBHK8PRvTzFoUwgMdixNZPchYzFjEbP/yW qeZi7r4YtlB2/0JY14hOFVW5lX1NT+eu2NlqZ0Ug+vhMcWLN0tv45+d/+9bmiVYatE39R1 Yp0xtFTGR6ewNPLbeTQzaTq4YNvBcBM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-425-rDTZzCaNMfqkeMoeZ1x5EQ-1; Thu, 03 Nov 2022 08:46:33 -0400 X-MC-Unique: rDTZzCaNMfqkeMoeZ1x5EQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 145AE823F77; Thu, 3 Nov 2022 12:46:31 +0000 (UTC) Received: from localhost (unknown [10.39.193.104]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5E6A2492B06; Thu, 3 Nov 2022 12:46:30 +0000 (UTC) From: Cornelia Huck To: Sean Christopherson , Paolo Bonzini , Marc Zyngier , Huacai Chen , Aleksandar Markovic , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , Matthew Rosato , Eric Farman , Sean Christopherson , Vitaly Kuznetsov Cc: James Morse , Alexandru Elisei , Suzuki K Poulose , Oliver Upton , Atish Patra , David Hildenbrand , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, Isaku Yamahata , Fabiano Rosas , Michael Ellerman , Chao Gao , Thomas Gleixner , Yuan Yao Subject: Re: [PATCH 04/44] KVM: Teardown VFIO ops earlier in kvm_exit() In-Reply-To: <20221102231911.3107438-5-seanjc@google.com> Organization: Red Hat GmbH References: <20221102231911.3107438-1-seanjc@google.com> <20221102231911.3107438-5-seanjc@google.com> User-Agent: Notmuch/0.37 (https://notmuchmail.org) Date: Thu, 03 Nov 2022 13:46:28 +0100 Message-ID: <87edukxl23.fsf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221103_054824_169524_C6D444B0 X-CRM114-Status: GOOD ( 17.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Nov 02 2022, Sean Christopherson wrote: > Move the call to kvm_vfio_ops_exit() further up kvm_exit() to try and > bring some amount of symmetry to the setup order in kvm_init(), and more > importantly so that the arch hooks are invoked dead last by kvm_exit(). > This will allow arch code to move away from the arch hooks without any > change in ordering between arch code and common code in kvm_exit(). > > That kvm_vfio_ops_exit() is called last appears to be 100% arbitrary. It > was bolted on after the fact by commit 571ee1b68598 ("kvm: vfio: fix > unregister kvm_device_ops of vfio"). The nullified kvm_device_ops_table > is also local to kvm_main.c and is used only when there are active VMs, > so unless arch code is doing something truly bizarre, nullifying the > table earlier in kvm_exit() is little more than a nop. > > Signed-off-by: Sean Christopherson > --- > virt/kvm/kvm_main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Looks safe to me. Reviewed-by: Cornelia Huck _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel