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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06D9FC4332F for ; Thu, 3 Nov 2022 12:47:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231206AbiKCMri (ORCPT ); Thu, 3 Nov 2022 08:47:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231171AbiKCMrf (ORCPT ); Thu, 3 Nov 2022 08:47:35 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 403F8140B7 for ; Thu, 3 Nov 2022 05:46:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667479594; 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=bdCwcm5nZUB2YHeiOgAVvFlOaWgDYWbdRdtC9vUfMitMaB5n7hKiEsIngSi5eCGSYh9eFW QMNuqcKlpeXGKmJ2MVu0Nbf10fJoVpLHanJEZ2J7hRtzGL/EvDYpsiZqvEfh6ora7nkPzM 68G6czASWL9owzLCzEiXYPHuEhjwKUg= 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 Content-Type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.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