Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp2023471rwi; Thu, 3 Nov 2022 11:42:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6VOCCJLVTt7PktRqRoXBqmnnqhWdwNlsYNt7Xv4g8Olp5AemCKmIAG9EaWI/d5pGb66TVi X-Received: by 2002:a17:90b:384f:b0:216:7247:4b86 with SMTP id nl15-20020a17090b384f00b0021672474b86mr2498936pjb.50.1667500975851; Thu, 03 Nov 2022 11:42:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667500975; cv=none; d=google.com; s=arc-20160816; b=Xbq6Ffu0hnMo6Ghw0aPhVpuM9eXRakcPggr5FgpyTJi9/rpJpCwN7hGye3to/vUr0Z 7XbQGRBIbLnciVN2qzwy9/G+XudqXA2fwNPFGNvQzV8JwMKSg1wiQ4hTIu01IqwqoYMM NRnxLBJsDFGQ5Mmo4H0OjO2Q6TaotELNMQ2TvdoESi+hQlP5tpo1gSi+xSry/nZSHGdd hrwPU+of/+Cy0XvCMdVi+qcA08k/EtFaQiqNURsKCOkg3MUBWbiXDn75xNolshrzl5Qk X9x78dt1Sgg7BIaC1SyEFXCjI1PLvM2C/cHO39qRdcY8fXLuF6K1ITdpFburu0wCPy9h Mxzw== 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=cK19xZ8r/JxZ6zrZk59CGRO4XALiFfw/k+DEo690ifc=; b=L6JWR9J4OZTsqyTLTnMNR32wFO3Dm3Qbpk6JRRzXrUlj4Sg9+X2fSdBaVztEBB+6Qg JZjSmkIoPcxtIe0hcay2GMZ6IYmJPXG4bnrASj9AVlFKp3JPEkLs1zZ5DaA6ySghUYRh HKLb2scD4aXuGtjLTUo6+4GSkTHr85DzJBfiOVgy1fGj4P8BAaJQXv1aSUetGa36YSNW AF67brW3CS8AvXiIJG2zuyeGV7XWkO3qML/lTxWqPTVjc4ArDegWwubYpdH1XXT8TDTX Tk3Zv+QMz1nGJNTl3IYtoToYPxI/jHEp3J+Xmn6ZsXAPSdT6DI1KYKhCDvxTIBK3F6OE QGoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=AMXkMgBJ; 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 nn6-20020a17090b38c600b0020de216d0c4si822831pjb.61.2022.11.03.11.42.41; Thu, 03 Nov 2022 11:42:55 -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=AMXkMgBJ; 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 S231387AbiKCRo7 (ORCPT + 97 others); Thu, 3 Nov 2022 13:44:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231226AbiKCRo5 (ORCPT ); Thu, 3 Nov 2022 13:44:57 -0400 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E69D21A813 for ; Thu, 3 Nov 2022 10:44:56 -0700 (PDT) Received: by mail-pj1-x102d.google.com with SMTP id v4-20020a17090a088400b00212cb0ed97eso2485482pjc.5 for ; Thu, 03 Nov 2022 10:44:56 -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:subject:date:message-id:reply-to; bh=cK19xZ8r/JxZ6zrZk59CGRO4XALiFfw/k+DEo690ifc=; b=AMXkMgBJe864E9ylH4eLhcV4DnnmpnUZQciwStcW/fWfVy8vl8xbyLHXqWoh/4n8QF bRAhsfNtOcglKLMhK6Nb/v5AF7HvdYNYuPv80cwXOHPX5E9n4f4rIwmSH2XAdpFIqhuj sSsx/7sAKHM3fmeDS7xyNpoxOPMcbkwOVVWM5XBPQcjHKuBxYoH5JxFh6oDyEgClSLr4 VePL27iqi0rk5/s+JivkXFUi7OtMXJLNacJQMnJ3M4obYSjfplMj8jxI5D4RNhWTNCit VmDRgbq4Pt+ph415Zp0hH77zR2JN9eVpsj1xI6CTZrVgir1QKlQnpGg6QTPI6wKdJ0ls 3hyg== 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:subject:date :message-id:reply-to; bh=cK19xZ8r/JxZ6zrZk59CGRO4XALiFfw/k+DEo690ifc=; b=SrsfYff/55c6OmLmoTYxW8w/APpd/4Vx6SxU/mhf164MTQU7z117FyWnrqVh8mugaa L/vO3fdlmw2AtE9jquAC1FLCWJPxlddC4g5w+bhkMRnNfAZb1QIrpT02KuxxUUpIGE+6 +7gb7POJZY3DmUkKDYs3PYhLMB/c7i6IzjzQeEynaXIUALI8cbVYxuTEUJp/WTY8HR8u R+L9D6GsdhwPGmcTpTICtTYyt8LVLThPd30A8JJjwVcfU/FM6A6gvA+XUi4czxmw/Hoe Ur3v7z2Q5eXcuf9oEFMBmSlbh46DXNuLnuszIAYQgOKlBHdNH0pnzC2ylNTOETvxGDyv khUA== X-Gm-Message-State: ACrzQf3DmOAzjPyjy0UsWbLwD1Ne1zpekECTpknoswMQ72a7I2bEdkJY lEDWMDX7avXViKbJEx//5Oapew== X-Received: by 2002:a17:90a:d24d:b0:213:d3e4:677a with SMTP id o13-20020a17090ad24d00b00213d3e4677amr24629292pjw.101.1667497496277; Thu, 03 Nov 2022 10:44:56 -0700 (PDT) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id i7-20020a17090332c700b00178aaf6247bsm1004862plr.21.2022.11.03.10.44.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 10:44:55 -0700 (PDT) Date: Thu, 3 Nov 2022 17:44:51 +0000 From: Sean Christopherson To: Paolo Bonzini Cc: Marc Zyngier , Huacai Chen , Aleksandar Markovic , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , Matthew Rosato , Eric Farman , Vitaly Kuznetsov , 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 36/44] KVM: x86: Do compatibility checks when onlining CPU Message-ID: References: <20221102231911.3107438-1-seanjc@google.com> <20221102231911.3107438-37-seanjc@google.com> <23bfd709-f99a-5a74-e4b9-1381b88453f1@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <23bfd709-f99a-5a74-e4b9-1381b88453f1@redhat.com> X-Spam-Status: No, score=-17.6 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,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham 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 Thu, Nov 03, 2022, Paolo Bonzini wrote: > On 11/3/22 00:19, Sean Christopherson wrote: > > From: Chao Gao > > > > Do compatibility checks when enabling hardware to effectively add > > compatibility checks when onlining a CPU. Abort enabling, i.e. the > > online process, if the (hotplugged) CPU is incompatible with the known > > good setup. > > This paragraph is not true with this patch being before "KVM: Rename and > move CPUHP_AP_KVM_STARTING to ONLINE section". Argh, good eyes. Getting the ordering correct in this series has been quite the struggle. Assuming there are no subtle dependencies between x86 and common KVM, the ordering should be something like this: KVM: Opt out of generic hardware enabling on s390 and PPC KVM: Register syscore (suspend/resume) ops early in kvm_init() KVM: x86: Do compatibility checks when onlining CPU KVM: SVM: Check for SVM support in CPU compatibility checks KVM: VMX: Shuffle support checks and hardware enabling code around KVM: x86: Do VMX/SVM support checks directly in vendor code KVM: x86: Unify pr_fmt to use module name for all KVM modules KVM: x86: Use KBUILD_MODNAME to specify vendor module name KVM: Make hardware_enable_failed a local variable in the "enable all" path KVM: Use a per-CPU variable to track which CPUs have enabled virtualization KVM: Remove on_each_cpu(hardware_disable_nolock) in kvm_exit() KVM: Drop kvm_count_lock and instead protect kvm_usage_count with kvm_lock KVM: Disable CPU hotplug during hardware enabling KVM: Rename and move CPUHP_AP_KVM_STARTING to ONLINE section KVM: Drop kvm_arch_check_processor_compat() hook