Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp2681705rwn; Fri, 9 Sep 2022 18:57:51 -0700 (PDT) X-Google-Smtp-Source: AA6agR6ilDpzmASk4GQrD0ZQNiqaEkn1bnB4/jOikGUOqJPyk49KBJOWrzz/OgEoOGwGNvouh8zu X-Received: by 2002:a17:902:6549:b0:178:12e9:8d7b with SMTP id d9-20020a170902654900b0017812e98d7bmr3215973pln.14.1662775070972; Fri, 09 Sep 2022 18:57:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662775070; cv=none; d=google.com; s=arc-20160816; b=Bqp0F/8vlTJ676+xlwBJ63poczSndM7ryOp10zxybNbozMHG4ZGC/koP7cs94kAfsi ZHc8H4c45DhT6kN0K3ZfIfVYyWKSbutRINSPtf9RtkSNFCWQdI5QsAKVCq1soC3gf6RT gar5mEfLy8NS4MZg+DDlg4B7yAgmsb7B1FasJ+K+vV4IwjOprUlyYFuyer49Ok3lqMY4 m1i6s2tAIV+9ZaIFpSbKfCxPjYMGkw4FDSErUPjRQrk0j3calD3OXzU1lwNR/xcQRRql J7tIKe0Eq8TiVSUD+q84NA/onQSc0LvYuXysHcs7urJeEkuJf4r7KjITtsrVl5sUxa6n ERkQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=+HyY6MoZcN0FsKJ3qyqHucj5l+tGou55KVTzAQ3Bdi8=; b=Z9bi4B853SpNQkszmjZB5QZjd7T8N+ZBGkWwVc36X8F4DCb6yHM21Q+mBcQj6JZDQA 97EaSL6RrwIHg3rhm1A4JI1cFQSTblX0DIvJDAvtZ/AG1e1zoqMKg4tTlG+bQUgBH4+T isv22TYWW/sIi3/WUOvs1bSbh+OLsCkaToCJpslzqI2qiP55PhpzO3glUUztZ4XECfDQ YTVNI/eNU/UFHCXHXJ2ECWp1gSFAKiyWCYn3xGeuUgl3qsSRawSJ1yFfwmTG7zEQ4fpD +IPZ+L8JirG7H/jNedAmZfHwvMRjvukOf3n9mS7OEz/bzbuvG7LIKl153QlX+VZpaPaZ 1eJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=oYfb1vg+; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a9-20020a17090a8c0900b002007b4cf899si1889484pjo.49.2022.09.09.18.57.34; Fri, 09 Sep 2022 18:57: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=@gmail.com header.s=20210112 header.b=oYfb1vg+; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229748AbiIJBjn (ORCPT + 99 others); Fri, 9 Sep 2022 21:39:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229599AbiIJBjj (ORCPT ); Fri, 9 Sep 2022 21:39:39 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CCD5FD36; Fri, 9 Sep 2022 18:39:38 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id x1so3341295plv.5; Fri, 09 Sep 2022 18:39:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date; bh=+HyY6MoZcN0FsKJ3qyqHucj5l+tGou55KVTzAQ3Bdi8=; b=oYfb1vg+Kct23PhbzI75hD7wq0paEq8bOjhP7a39L3EHazFeRyHJdcOXIAqxCEsMvA 8PxFjgViFtOxjlQcHRC3NW7z3rO81TfLCVEbRJk/Kr55PCDZcjoPZkzC4OdpfkbXb7nj cQgkdRqQYPWte2dIA8jQUFYWrm/jHWOyrE4kJQexSc0WO2hlU8+11LwohMJNbWhY3Cur Vw6KdvjKfOwJPiUYfWJ5p+pOOdQc+zs23J0sodSQCKivoJ4+I0NSxBam9yHej9t/kbVh V6AYVCQrdoQUC15Tr58FdCocNJHPkNQf30U6Xxr0b9A1YVvdATGDJ7DaTrbvIVdZxQV6 /1iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date; bh=+HyY6MoZcN0FsKJ3qyqHucj5l+tGou55KVTzAQ3Bdi8=; b=TOgJFjQ9iRZ4bMnsJQQ8IQNkjLnOCTVfAvyjIuzlAsf5YRpONMKdh4U9cuAQiOmvXu KFuPQvK9U1Wa5MKU1y1klMwmd2tPLhJw1dKzLLsOV2pbCdKb/m35HxjkBLMWHlwTjGe/ aEA7BivTXFlpncTKwMh+Dkj2DGiqmvwHgSI9NVsIxxvC/KZ5pDxtNUolNo2/+vw4OY7t XU/oV4dE/6pZCA4Qw6iVxmK3FUVBRVMpX+peGO38ozD6GRhx6i0QQYCUUFwfA2aw/MIV xEi3eO3B085v6dljJh5pKqWPVtbpGNrGJnGlU4QfzVbaBxKUIFmIZR6q/19R8JiQBHF0 h2Rg== X-Gm-Message-State: ACgBeo2X/JiaxHCE83WV7xF0L75cfc18A2x5BCxpRFqgBYR3qVHx9hDZ HT4dgfHszxEG75P6+Rq2EkCd8VCjalNl3g== X-Received: by 2002:a17:90a:1f49:b0:202:7a55:558f with SMTP id y9-20020a17090a1f4900b002027a55558fmr8501511pjy.108.1662773977401; Fri, 09 Sep 2022 18:39:37 -0700 (PDT) Received: from localhost ([192.55.55.56]) by smtp.gmail.com with ESMTPSA id n10-20020a65488a000000b0041a6638b357sm1149185pgs.72.2022.09.09.18.39.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Sep 2022 18:39:36 -0700 (PDT) Date: Fri, 9 Sep 2022 18:39:35 -0700 From: Isaku Yamahata To: Christophe Leroy Cc: "isaku.yamahata@intel.com" , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , Paolo Bonzini , Sean Christopherson , Marc Zyngier , Will Deacon , Yuan Yao , Huang Ying , Daniel Lezcano , Fabiano Rosas , "linuxppc-dev@lists.ozlabs.org" , John Garry , Shaokun Zhang , Kai Huang , Atish Patra , Huacai Chen , Qi Liu , "isaku.yamahata@gmail.com" , Chao Gao Subject: Re: [PATCH v4 23/26] RFC: KVM: powerpc: Move processor compatibility check to hardware setup Message-ID: <20220910013935.GA699006@ls.amr.corp.intel.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Fri, Sep 09, 2022 at 05:55:14AM +0000, Christophe Leroy wrote: > > > Le 09/09/2022 à 01:25, isaku.yamahata@intel.com a écrit : > > [Vous ne recevez pas souvent de courriers de isaku.yamahata@intel.com. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ] > > > > From: Isaku Yamahata > > > > Move processor compatibility check from kvm_arch_processor_compat() into > > kvm_arch_hardware_setup(). The check does model name comparison with a > > global variable, cur_cpu_spec. There is no point to check it at run time > > on all processors. > > > > Suggested-by: Sean Christopherson > > Signed-off-by: Isaku Yamahata > > Cc: linuxppc-dev@lists.ozlabs.org > > Cc: Fabiano Rosas > > --- > > arch/powerpc/kvm/powerpc.c | 13 +++++++++++-- > > 1 file changed, 11 insertions(+), 2 deletions(-) > > > > diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c > > index 7b56d6ccfdfb..7e3a6659f107 100644 > > --- a/arch/powerpc/kvm/powerpc.c > > +++ b/arch/powerpc/kvm/powerpc.c > > @@ -444,12 +444,21 @@ int kvm_arch_hardware_enable(void) > > > > int kvm_arch_hardware_setup(void *opaque) > > { > > - return 0; > > + /* > > + * kvmppc_core_check_processor_compat() checks the global variable. > > + * No point to check on all processors or at runtime. > > + * arch/powerpc/kvm/book3s.c: return 0 > > + * arch/powerpc/kvm/e500.c: strcmp(cur_cpu_spec->cpu_name, "e500v2") > > + * arch/powerpc/kvm/e500mc.c: strcmp(cur_cpu_spec->cpu_name, "e500mc") > > + * strcmp(cur_cpu_spec->cpu_name, "e5500") > > + * strcmp(cur_cpu_spec->cpu_name, "e6500") > > + */ > > This explanation shouldn't be in the code. The content of other file may > change in the future, the files may be renamed or deleted, new files may > be added. And there is no added value with that comment. > > That detailed explanation should go in the commit message. Ok, will move the comment into the commit message. -- Isaku Yamahata