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 8B4BCC4332F for ; Thu, 3 Nov 2022 17:59:11 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4N3BMx6FnWz3cKb for ; Fri, 4 Nov 2022 04:59:09 +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=VcsLNIKX; 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=VcsLNIKX; 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=pbonzini@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=VcsLNIKX; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=VcsLNIKX; 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 4N3BLr4DK7z2yMj for ; Fri, 4 Nov 2022 04:58:10 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667498288; 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=VcsLNIKXCPbANvk47dCxIiw+T8y96kdw1P5S45DSbzh0n5Xmj9ZEaWPALNzURBDX0Ui0rJ lqaGBq6cZP0Dk6DicQP8W6sgQWejpSgdkH1WkQDRJbOwPFqkthq4bFNCubhFQRnD76Xxet UlQFMjB7q9l5f07VRoICx5aQM7djyxA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667498288; 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=VcsLNIKXCPbANvk47dCxIiw+T8y96kdw1P5S45DSbzh0n5Xmj9ZEaWPALNzURBDX0Ui0rJ lqaGBq6cZP0Dk6DicQP8W6sgQWejpSgdkH1WkQDRJbOwPFqkthq4bFNCubhFQRnD76Xxet UlQFMjB7q9l5f07VRoICx5aQM7djyxA= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-435-sEe_XFdUOjCmDC52pM2pIw-1; Thu, 03 Nov 2022 13:58:01 -0400 X-MC-Unique: sEe_XFdUOjCmDC52pM2pIw-1 Received: by mail-ed1-f70.google.com with SMTP id q13-20020a056402518d00b00462b0599644so1923508edd.20 for ; Thu, 03 Nov 2022 10:58:01 -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=Bf6c3T5wWnbdAq0fqGmTMy2NY5IY78bYehudR9ZRd51wZBaJLG1VchuYKAH96a/nz/ aaoO4NnvQM7iEySMIbtSX+GnlOPipfFxMArtVv+OlTHW4DijR+7P5UfJiBpVXieXKY23 LunVV8ntJayrV+FRjpQZ6wwmEYF76pK2NCyJTViS5MLBkpUPRYl6UKLNL81ISUqvMm4R qFkDHJgXwtYFsmVpadxL2ouwyI5Zial4MG+xNjOl3vYUAKIMx/VUlvMC4iczx6qOXynK /WGh5Xv615Ni7RmP5hnFNKet8kpY3gWg2b9vw6/pnK+TXeTThHsRGy7E+A30M5FyDYr4 jiqQ== X-Gm-Message-State: ACrzQf3DooeBgM3Mb58PqX/o3FjWZyq6OzN1jOF0sUYJYQSJWiqgeFWj Fq9kGn1vgdUxNC1DJkQmDCUBBMCk9Mxrwcg01N62zzk7Eo5XiaOn58N+/Grsl5+ziTqN+vYeQd0 BKgDR+c0JxjbsGI14ZmW71m6v9A== X-Received: by 2002:a17:907:a087:b0:7ad:a2ec:1afa with SMTP id hu7-20020a170907a08700b007ada2ec1afamr30061870ejc.151.1667498280036; Thu, 03 Nov 2022 10:58:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6QZmNq5hCph1jlllZl0PdTQdpFjKynjhfU4TqqXsTy2ri356CZrCrEtJkVH+I+gMfL+O9fNA== 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 To: Sean Christopherson 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: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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: Matthew Rosato , David Hildenbrand , Yuan Yao , Paul Walmsley , linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Claudio Imbrenda , kvmarm@lists.cs.columbia.edu, linux-s390@vger.kernel.org, Janosch Frank , Marc Zyngier , Huacai Chen , Aleksandar Markovic , James Morse , Christian Borntraeger , Chao Gao , Eric Farman , Albert Ou , Suzuki K Poulose , kvm@vger.kernel.org, Atish Patra , 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 , Palmer Dabbelt , kvm-riscv@lists.infradead.org, Anup Patel , Vitaly Kuznetsov , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 >