Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp785566rwe; Thu, 1 Sep 2022 07:36:44 -0700 (PDT) X-Google-Smtp-Source: AA6agR7NWemKBJ+PVODwZhXzQpDZMiU91ctBlSS/Fa6dbrecSHTejON9pWAQh9uSlzubCU8zS0cs X-Received: by 2002:a05:6a00:1594:b0:537:b6ab:2dd5 with SMTP id u20-20020a056a00159400b00537b6ab2dd5mr31356248pfk.51.1662043004364; Thu, 01 Sep 2022 07:36:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662043004; cv=none; d=google.com; s=arc-20160816; b=lH4SDkEKF+sTnrnTIh1p6qdPoIxBS+jSfU+L3g3oXI7BvODAIjfOh20TGi0d16oMpg vV/w8JJIj0gIqt3EGrj78CYFDFckOnCZRwa73XuJVRFHCyOa00yi1VOYc+CndkehHjsQ 9OOIzz5FKj/ZUJp6QB84oefqO52/+tpr1hnD2Zo6ZJ1PnYjAxRgPcJARujBvIZlDmbt7 vAuE/sXTQYPlVPCeSVBX7q8CiSolno7sA8M7RZ08cxJnYHUMXiIoLU9eU6csNkjgzUEi SSYEyg5LcxAVIp5O9X0HIL+rON623QmRy/32fDaX+cE/OlJ8KR+Lz/HTCrVD6GsfPCt2 jcnw== 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=8OIlXCHvB4xFMaL/mDUpyfIfwwt9XTn35CLPOt6No9g=; b=arapPPnCRoWW4/qmbGDFLsbZqdPumoao94WProAFRBJKb0tHmVDr/4+zusMYNWeFXC t1/cwyKDiUC3rM4lRO1avKVSKMT3mddmTCn3Vl4O7mASfeUQKgOduNyrMyA+tq5tWdZA kI9OxizGFgIwQWgydtmxAQiuv2vzn5CWI+4iKcXNrSJeSu9PvtzzBvUHUpXqaFZqXaGa LjchbPb7LJ2jepmAhH/6z+32052ZaJU0TzIrRHFb4NHuMn6F85+XAP/R+8I1xDvM+gJT 1FI8vuSOAlCtUEGh2rBujHlEGudcIdw7MiDVSQwUB+GrIVkRyvCpk6lLdoaOlZJm2Ad0 jWEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Mirx+GpK; 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 y8-20020a170902b48800b0016efb38cf39si15189310plr.141.2022.09.01.07.36.22; Thu, 01 Sep 2022 07:36:44 -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=Mirx+GpK; 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 S234466AbiIAOIx (ORCPT + 99 others); Thu, 1 Sep 2022 10:08:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233513AbiIAOIt (ORCPT ); Thu, 1 Sep 2022 10:08:49 -0400 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10CB4263 for ; Thu, 1 Sep 2022 07:08:48 -0700 (PDT) Received: by mail-pg1-x531.google.com with SMTP id r22so16490995pgm.5 for ; Thu, 01 Sep 2022 07:08:48 -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; bh=8OIlXCHvB4xFMaL/mDUpyfIfwwt9XTn35CLPOt6No9g=; b=Mirx+GpK5brNlklKegbj57qMFDT0WS3jhLqeAJ6CABTHIjyltYjsE4LVhiihcZqAlz grOTlXQxy0O9y9Ix8MfWUzBetsq6EuEvUFFzErJuwGMRgNVeObjJMDZC7V21h1I4nyhX wnZGkOmJwLHCgMxZEDaHqwSzn5T55ext3J2VSdcxB/aSdVZqvk/b0htPdLzXbmjQhkVZ XQj37YCqwppEojKZJ12H8q9gWUwOFHjBaYzzZRmRLMo2AEUaUkfhG4YhNzBjFcF40XPW grSsTh8Ith4w/+OQSIIQ5K/ioY4cIEm8rwBS61GA/mBrFHTjNuAD/qKkkQ5wpdPhTtyl d31Q== 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; bh=8OIlXCHvB4xFMaL/mDUpyfIfwwt9XTn35CLPOt6No9g=; b=pO2bbS0EGfUzYPI7fsdq18zWkNiv5OOwVLuZ1/Ygaiabsyt+sAb4+vi95p3cfyOpUQ m19Mn6iZqvw9oiFsk9QADzEO9IVAeUSwxkmj+2IMW114Ju12t4PEY1Ucv++Sh9bO+7+6 AneHcW6EMyZCqk1lo0NUnIlnkpEVWlBjHRZKFogXnG1WnyOguF3j4AJL178PbGIBl52w slRU+HSvGXHQp9Mw/wdTT8+90zZ3uQ+4KRfJOa6lyJGEi2qS7zczNYyRnKPxyNqo61Tl PjwnIORwuMJUtZQbWw9eOdPhhUr7cU6vYFJcgQF4b1XoT8MaKeBHOXHkD0YNCb6v8X+X 4XrQ== X-Gm-Message-State: ACgBeo0ycG3C85ghIse43lev+rho5qP+uEFS/bdNv0uuOX2Qivs6p6bU pSK1ej5+uodo6AJ52WwA7wGL1A== X-Received: by 2002:a63:d16:0:b0:41d:fe52:1d2f with SMTP id c22-20020a630d16000000b0041dfe521d2fmr26882977pgl.416.1662041327419; Thu, 01 Sep 2022 07:08:47 -0700 (PDT) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id 80-20020a621453000000b00535c4b7f1eesm13346694pfu.87.2022.09.01.07.08.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Sep 2022 07:08:46 -0700 (PDT) Date: Thu, 1 Sep 2022 14:08:43 +0000 From: Sean Christopherson To: Marc Zyngier 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 Message-ID: References: <4092a37d18f377003c6aebd9ced1280b0536c529.1659854790.git.isaku.yamahata@intel.com> <87y1v3v54b.wl-maz@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87y1v3v54b.wl-maz@kernel.org> 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,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=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 Thu, Sep 01, 2022, Marc Zyngier wrote: > 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. Sorry, will do. > > 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: Yes, I know. > - 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. The colorful language is tongue-in-cheek. I get the impression that you feel I am attacking ARM. That is very much not what I intended. If anything, I'm attacking x86 for forcing its quirks on everyone else. What am trying to point out here is that ARM and other architectures are not well-served by KVM's current hardware enabling/disabling infrastructure. I am not saying that ARM is broken and needs to be fixed, I am saying that KVM is broken and needs to be fixed, and that ARM is a victim of KVM's x86-centric origins.