Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp1965257rwi; Thu, 3 Nov 2022 11:01:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7wOxLj1NLvpqPWXSVvmetDOdU7qc9MjpIIgDShT023u6wXa7qsVJtGxLGm4ofCBvE0VtnR X-Received: by 2002:a17:90a:b00a:b0:213:623:2c12 with SMTP id x10-20020a17090ab00a00b0021306232c12mr50024534pjq.153.1667498510141; Thu, 03 Nov 2022 11:01:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667498510; cv=none; d=google.com; s=arc-20160816; b=wNaiw5Ewfq5P01SOdEPcqrfJ5IAyQng7cqS9Hajd2/+Z69YXRskja6Q6iK1UIZmNFC zAWTrHnx363esxDGIo1os2zlZ6KQxSnUAhsGSjIt8wRDXoD8D9HxYrxPXzR6MHR6gxdO dYk3MIYOLY4V+Cd+/8FUojsYdGM29ZsTrG1bMw3Yfg7vikoBKisiXMrtK89zFmLB43lB VcIGLK/bnRam3VIoAyucn+hTbzrI+PG5SZ5y9Lzws2qMvZGszSWwjEU/0sYFEnvEIul+ hSkxbNXbRH8aD26xMUQ9cXO0sAtr6oZD7SUTgbjmPjzGcSpNdvux5AWfg1dGDnleNOMP h/hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=yqxXm7t2WOic9y4ISYxOwK8KmYTr1cBIHzcg/Vydbzs=; b=m5uHBL+Ww4e+J3oPEd2p5WWdfn3ZtMnz5sbJIl9PRkm9tS/a6X3RUugiWasshvDVlv T9EykrSdiS8sKcfQwaXzhBs0vNxQPg8B2ZWx1P5rOOs7flyGPh0y+fXF1wdh+JvymRG/ ki9gYxXaHEp+72x6T3dxgR+QzMNQj5ZZAKgQaJlFo8HRYjeJdsCMbIWAd1UeEyTxJmqk wObtLgs0L5RCXAKYulVxXULFPdtZn0BZtOkV3vQHgkkDUZkz3ARpRhMX6e7kF8u0Q1d+ S8BHZJfZM+NPuS+p2l88EpTJDB856k7/jDizw5jIokCycDhEwMwti7ER23id2pXqVgzS rAeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jWZhqk8O; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z12-20020a056a00240c00b0056d480f7b92si1917660pfh.378.2022.11.03.11.01.24; Thu, 03 Nov 2022 11:01:50 -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=@redhat.com header.s=mimecast20190719 header.b=jWZhqk8O; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231781AbiKCR7N (ORCPT + 98 others); Thu, 3 Nov 2022 13:59:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231703AbiKCR7G (ORCPT ); Thu, 3 Nov 2022 13:59:06 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAAAB1C438 for ; Thu, 3 Nov 2022 10:58:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667498283; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yqxXm7t2WOic9y4ISYxOwK8KmYTr1cBIHzcg/Vydbzs=; b=jWZhqk8Op8xpXKAf/bD9sAMgGMuTwu77yjU+nJdXulwU4p/Bfp6uw+TcRz7WB71gAZvASb xezkYofgI8ZsVM5gbZ0j+wpUAv+gawAp797zb9ETmY4AU7jgzuPzDBRg4Sk4Qjyj/2W2Hp cNkIKN7w1FI5U5aIlp+PMpdAlVEifUw= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-494-BQGZ6zoPNgKT6r1Z6gAfrg-1; Thu, 03 Nov 2022 13:58:01 -0400 X-MC-Unique: BQGZ6zoPNgKT6r1Z6gAfrg-1 Received: by mail-ej1-f69.google.com with SMTP id qk31-20020a1709077f9f00b00791a3e02c80so1751570ejc.21 for ; Thu, 03 Nov 2022 10:58:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yqxXm7t2WOic9y4ISYxOwK8KmYTr1cBIHzcg/Vydbzs=; b=hRnR0FCYkBILWhiFJCbAuEO/Mx+eUSxeq6m1NaPmJ8ojxSAhNYoslX2fsyvweoeWy/ JJMmHYuRt8hMXZJom0vXVcizp9mj9sdEQjwpv5Z8vv7d/NAYLNwwiE7cEBlnekVAIuPo 2ZNW75lyL80rZqIkrFdxUB+1g6qKQRfEDjzzT8VeDd97TNcdGANiKegFm9VHpHjWPzhv UkEAztft1KjQtMwPiq41D89D5HaVdylp6nrqISut0BJfGFyLLX/FZ+t8ek+T4qimH6+F A9q8HG1umsa8DAYL1oYKkf5K9H+B+f4CZT9M2rEyLrHKTCpEWh7xawCtMM0rC6C/NILk D/mQ== X-Gm-Message-State: ACrzQf0r5fFOAI4MYTsGAyrObqlKnr1v/wXYzMGQMbZX/q2hOGUHc2vk PB/HPVB8Qv7v40t1QXwx34Es+Hq37kAwPEVOzijG9Zn9WytGZ6KhEg9yUieTDvLB4bsFp/Di5X5 RXST691zxh521EE7nXjvcPI9g X-Received: by 2002:a17:907:a087:b0:7ad:a2ec:1afa with SMTP id hu7-20020a170907a08700b007ada2ec1afamr30061862ejc.151.1667498280032; Thu, 03 Nov 2022 10:58:00 -0700 (PDT) X-Received: by 2002:a17:907:a087:b0:7ad:a2ec:1afa with SMTP id hu7-20020a170907a08700b007ada2ec1afamr30061831ejc.151.1667498279805; Thu, 03 Nov 2022 10:57:59 -0700 (PDT) Received: from ?IPV6:2001:b07:6468:f312:1c09:f536:3de6:228c? ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.googlemail.com with ESMTPSA id l3-20020a170907914300b0078d76ee7543sm734215ejs.222.2022.11.03.10.57.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Nov 2022 10:57:58 -0700 (PDT) Message-ID: <1fd2e729-6e46-b0bf-d89e-f5d1b4dbde77@redhat.com> Date: Thu, 3 Nov 2022 18:57:55 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH 36/44] KVM: x86: Do compatibility checks when onlining CPU Content-Language: en-US To: Sean Christopherson 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 References: <20221102231911.3107438-1-seanjc@google.com> <20221102231911.3107438-37-seanjc@google.com> <23bfd709-f99a-5a74-e4b9-1381b88453f1@redhat.com> From: Paolo Bonzini In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 11/3/22 18:44, Sean Christopherson wrote: >>> 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: It's not a problem to keep the ordering in this v1, just fix the commit message like "Do compatibility checks when enabling hardware to effectively add compatibility checks on CPU hotplug. For now KVM is using a STARTING hook, which makes it impossible to abort the hotplug if the new CPU is incompatible with the known good setup; switching to an ONLINE hook will fix this." Paolo > 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 >