Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp4004514rwb; Tue, 16 Aug 2022 12:33:58 -0700 (PDT) X-Google-Smtp-Source: AA6agR70GibjHfFlR6UYH5aPlCB5fHyUn+bum/MzDYLYGeRdwk7+S+DIPZXK/UqUakjDf1p7n4+Y X-Received: by 2002:aa7:c14e:0:b0:43d:7bad:b53e with SMTP id r14-20020aa7c14e000000b0043d7badb53emr20202949edp.353.1660678438617; Tue, 16 Aug 2022 12:33:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660678438; cv=none; d=google.com; s=arc-20160816; b=XtPKfLnHuICh4T0vwaWbKX2Lu49xuVQUqgAQVYXhguzc1KlNLhShR+ZDDGh9FzV34a RpSxuouL0MBW6CmB6j1lLY0B1u7C26CL8YlVAZ9/ODm5bO00acoX2igDJil9FJYTds2A 8m2xGHUF7hG+8lMPs9w3oX7SBP8DpG1fb489T29WvM4eZ/F724N1N1ijky0joR5oDRTc tXi+toy2NXkVLR+m0cyNU0PhgzbvqUKf5HP9wpN50sCMuRJsGyFgX4v1x6PlCXNAaxlw Uf2lVudqYqFTQkrKjhnmXO2h5dW+/HZelQuT8bqNjAlTG2fI6MkFi0kwKi3+ZWeWlAoV OHPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=/IC0HnZmVrkoH3nvGfIyhZkes4sS84DBqU1XHr/AIAY=; b=rCUzam0Du/43aRSgALdlTgQVqrxzaEiWm2v2gEgyAulv5qpghTLPz7YHqPdfSpB0dJ A3M7mgU+ugxTRJ+Ci2Qr0jP4N6qHPybD/hyonHWMlUal+KQ5IIwnJT84/XUowfPC4XBC nvoDm0zIqtDVtHjQlgq8AVrvPtA0LlFwFzy9ZfjutZJUHB5ndYG1JBEoFASdWju8ikUW zqfxYl412MS15QLpAxRnn2puTIUP4LYDeQ+1p4RkGiWCOu02mzEcnUVP6KerRrjaFLJX hgg3ozxm7FS3w64iv8OkJLOVrIlYRwgO/c5TlAfD8KBit4a/dQkG91kwf7IY78OF8ARl rANg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=N1cUoRae; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ga7-20020a1709070c0700b00730d34ce2aasi13557250ejc.988.2022.08.16.12.33.32; Tue, 16 Aug 2022 12:33:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=N1cUoRae; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237112AbiHPTXM (ORCPT + 99 others); Tue, 16 Aug 2022 15:23:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237041AbiHPTXJ (ORCPT ); Tue, 16 Aug 2022 15:23:09 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FA42325 for ; Tue, 16 Aug 2022 12:23:07 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id q7-20020a17090a7a8700b001f300db8677so10552494pjf.5 for ; Tue, 16 Aug 2022 12:23:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc; bh=/IC0HnZmVrkoH3nvGfIyhZkes4sS84DBqU1XHr/AIAY=; b=N1cUoRaeDy5uzXUXUPkEjxLp/Fpa/P2h7JZmGiv4lZH3ufQNFSB5FmeRsupLY3TmGD 0rwqVQ+2bCj6jDClbfXOeQ79PQta/n52qMBrzYoJuyqvvnouSwhu/J4KV6NynMh7B4LG udiQIvlFpVasDmPiKCLc/cIlh3zywruGDZtOCqRIFhDxNsb5y39OEJuliFwp1a43LpkA yHNXwDye3+dxHn7UO2UzNhpxnZxZfA3tw3EzJthKOdtyjgE6CxmwXoZWcdjavJ4QgxhR GJpV19gk+0P199H89gvQecShykwJ5wJ2H6722vpfQQ6a+eL745KeDyGinoZ2dzG+9s+5 jrXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=/IC0HnZmVrkoH3nvGfIyhZkes4sS84DBqU1XHr/AIAY=; b=i5tle5dJx4W91NU4QXPt1aUjC/8vyFRVMgD/+XUD8UKOQiVObJyP5ezdID4QSkIIiC EdwQmcT/dD0PWSY2aNU/2TNIcL0NbwnAF28angWcoHCNmV+4/UfcLiHaKkj5r1p5RX4j 7II0brWdbDp2ZrytCvbuDknXSTxXz/Bn3y2CdTdFeQKn1w4kH6oHf1TyB4uV+aCKPwqe oNQmjGoxCItZR4TBZoIe0kmoCwA189FKAcvs+zH4Lzii//a059jbQ7ljJwKkNIky/I3v yN8nkyea52b+pdsNHm4ifD+SabBZmNYD94YsjYkbec7R3a0YBfOu7cDhWGp941uDsPur wtcA== X-Gm-Message-State: ACgBeo0145NA8TxW4EiASKTHPDkzOH8RvcHbw62YcaTd1C2gHhiGwLIh sLieaP0WtPOPHNUhWq5CJnc9Vg== X-Received: by 2002:a17:902:f641:b0:172:9642:1bf1 with SMTP id m1-20020a170902f64100b0017296421bf1mr826786plg.36.1660677786991; Tue, 16 Aug 2022 12:23:06 -0700 (PDT) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id g23-20020a63e617000000b0041cd2417c66sm7832661pgh.18.2022.08.16.12.23.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Aug 2022 12:23:06 -0700 (PDT) Date: Tue, 16 Aug 2022 19:23:02 +0000 From: Sean Christopherson To: Oliver Upton Cc: Paolo Bonzini , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, syzbot+744e173caec2e1627ee0@syzkaller.appspotmail.com, David Matlack Subject: Re: [PATCH 3/3] KVM: Move coalesced MMIO initialization (back) into kvm_create_vm() Message-ID: References: <20220816053937.2477106-1-seanjc@google.com> <20220816053937.2477106-4-seanjc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-14.4 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,FSL_HELO_FAKE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 16, 2022, Oliver Upton wrote: > On Tue, Aug 16, 2022 at 05:39:37AM +0000, Sean Christopherson wrote: > > Invoke kvm_coalesced_mmio_init() from kvm_create_vm() now that allocating > > and initializing coalesced MMIO objects is separate from registering any > > associated devices. Moving coalesced MMIO cleans up the last oddity > > where KVM does VM creation/initialization after kvm_create_vm(), and more > > importantly after kvm_arch_post_init_vm() is called and the VM is added > > to the global vm_list, i.e. after the VM is fully created as far as KVM > > is concerned. > > > > Originally, kvm_coalesced_mmio_init() was called by kvm_create_vm(), but > > the original implementation was completely devoid of error handling. > > Commit 6ce5a090a9a0 ("KVM: coalesced_mmio: fix kvm_coalesced_mmio_init()'s > > error handling" fixed the various bugs, and in doing so rightly moved the > > call to after kvm_create_vm() because kvm_coalesced_mmio_init() also > > registered the coalesced MMIO device. Commit 2b3c246a682c ("KVM: Make > > coalesced mmio use a device per zone") cleaned up that mess by having > > each zone register a separate device, i.e. moved device registration to > > its logical home in kvm_vm_ioctl_register_coalesced_mmio(). As a result, > > kvm_coalesced_mmio_init() is now a "pure" initialization helper and can > > be safely called from kvm_create_vm(). > > > > Opportunstically drop the #ifdef, KVM provides stubs for > > kvm_coalesced_mmio_{init,free}() when CONFIG_KVM_MMIO=n (arm). > ^^^ > We have CONFIG_KVM_MMIO=y on arm64. Is it actually s390? Yes, I apparently can't read.