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 B9997ECAAD3 for ; Thu, 1 Sep 2022 09:05:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233380AbiIAJFX (ORCPT ); Thu, 1 Sep 2022 05:05:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234458AbiIAJEY (ORCPT ); Thu, 1 Sep 2022 05:04:24 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EB5F134D58; Thu, 1 Sep 2022 02:03:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A3F37B824F7; Thu, 1 Sep 2022 09:03:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 64527C433D6; Thu, 1 Sep 2022 09:03:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662022999; bh=F8rr54ynDkiAk122+iZ4WVXked8recuKxxS5se5pHy0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=gLmONwx6Kqr0v6S0ElWGrlSZVEVr3Kz12w0vrk2/Ozicvi2zr3W/7kggFpuHzAwlW W0VtkjbZBXNad5Ae9zN9DdRBLe8VQdwG521Eew7lxEbeOdXewgpVu+yh40swwc9eGO kZ0De3giB9QNwL6aPWPtckjlfFWM8Vi/a/CxeZ84UdUyuMGnh/Cil7ckaHfVFhpLF8 GBPDBFq38LakBs3Jl1RJbJtqENKlTbIbrOrGZVKKGmvuJi/fGTXDBG1Cp24M9pHTf3 m4X2nU/aNbVnddlXP3eAFY9R5ynXreAgYXIxhK1a0w3uHC8DAMjdz+LtY7PuGae4+X i7g8x9yD787dw== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1oTg6X-007GUo-1Y; Thu, 01 Sep 2022 10:03:17 +0100 Date: Thu, 01 Sep 2022 10:03:16 +0100 Message-ID: <87y1v3v54b.wl-maz@kernel.org> From: Marc Zyngier To: Sean Christopherson Cc: "Huang, Kai" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Yamahata, Isaku" , "pbonzini@redhat.com" , "Shahar, Sagi" , "Aktas, Erdem" , "isaku.yamahata@gmail.com" , Will Deacon Subject: Re: [PATCH v8 003/103] KVM: Refactor CPU compatibility check on module initialization In-Reply-To: References: <4092a37d18f377003c6aebd9ced1280b0536c529.1659854790.git.isaku.yamahata@intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: seanjc@google.com, kai.huang@intel.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, isaku.yamahata@intel.com, pbonzini@redhat.com, sagis@google.com, erdemaktas@google.com, isaku.yamahata@gmail.com, will@kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sean, On Thu, 11 Aug 2022 18:39:53 +0100, Sean Christopherson wrote: > > +Will (for arm crud) When it comes to KVM/arm64, I'd appreciate if you could Cc me. > arm64 is also quite evil and circumvents KVM's hardware enabling > logic to some extent. kvm_arch_init() => init_subsystems() > unconditionally enables hardware, and for pKVM _leaves_ hardware > enabled. And then hyp_init_cpu_pm_notifier() disables/enables > hardware across lower power enter+exit, except if pKVM is enabled. > The icing on the cake is "disabling" hardware doesn't even do > anything (AFAICT) if the kernel is running at EL2 (which I think is > nVHE + not-pKVM?). In the cases where disabling doesn't do anything (which are the exact opposite of the cases you describe), that's because there is absolutely *nothing* to do: - If VHE, the kernel is the bloody hypervisor: disable virtualisation, kill the kernel. - if pKVM, the kernel is basically a guest, and has no business touching anything at all. So much the 'evil' behaviour. M. -- Without deviation from the norm, progress is not possible.