Received: by 2002:a05:6358:16cd:b0:dc:6189:e246 with SMTP id r13csp346286rwl; Fri, 4 Nov 2022 00:44:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5+3GknWok5s1LCWNcln2J9okHwqbPowELDOg683aEUZrHVPiQFOUOdDF0l521jvlPzhqRX X-Received: by 2002:a17:902:d48d:b0:186:cf83:4be3 with SMTP id c13-20020a170902d48d00b00186cf834be3mr33885162plg.22.1667547845955; Fri, 04 Nov 2022 00:44:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667547845; cv=none; d=google.com; s=arc-20160816; b=hgy7LccNynHLBv7DbGV+/i2lb1XzojYJPb3Tfm6bY/jcev2TGRvS/0yKi1i0Cpu25n PAE8ozIA6IKVilsGjnLeMV3bktG/QAnNqac5bKtKAb1KMJ3/3BM3xzOT2OKsCA/qSCqa wacL42uhy2GGlURyoYl6VBr4zSMmX0PEUE0G4o/mHe3ShFv1QiOyiTFs/nEeNtSq4iK6 25q93wrzxVXOOOTRxlsLWC5gefge8cpop+BztJW9zKC3yjVZV23malisKc7A3hD3cu2W /vZBBPtt31/66nUa0XMiNVrURbcnw+4ZVEUARjh/40ePEeuuemom/FY3xMG70/bNcevz 0Ojw== 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=eA0yZupCmJu+lIFxWoscgsZofsCuVm6nQ+r3Bs4PfgM=; b=nbUH3cdNrLmPIC0D+EPADyWkSBZkEuAcm9XSmJMbzXcJT1hxnud/falXim7hl7zpSR yPBV+lApK463xKH+0uOrCC/useqYesFrG8FMWxhVyQdYkBDnRu6xUm4lCu/10t+hpIED 4zu6d73fZQ1oiqssztuun9QdKwf5UFqzribW8TqGyYwG+MSimH6hsePavQs9b/96/Yvx 05c/LkQE9ccF7Mh19orx6hUhXKmB+2ZMHU7bOVDI3eNykU6NJs2ED550+ZOp3cKdLiyS ukCOCPm2wtd1a5cCGAHfh/nk/vsCkb8Xf9l8wcy9tz126AdHTte3cRWhuAY60Mu57fw3 0K/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="pMTxZL/o"; 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 pg7-20020a17090b1e0700b0020ae29877besi2889382pjb.20.2022.11.04.00.43.54; Fri, 04 Nov 2022 00:44:05 -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="pMTxZL/o"; 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 S231387AbiKDHS0 (ORCPT + 96 others); Fri, 4 Nov 2022 03:18:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231374AbiKDHSW (ORCPT ); Fri, 4 Nov 2022 03:18:22 -0400 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77153F33; Fri, 4 Nov 2022 00:18:21 -0700 (PDT) Received: by mail-pj1-x102d.google.com with SMTP id gw22so3785311pjb.3; Fri, 04 Nov 2022 00:18:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=eA0yZupCmJu+lIFxWoscgsZofsCuVm6nQ+r3Bs4PfgM=; b=pMTxZL/oe6jfdbdYCNUp+Xb6WGMwDJ0tqzYjFuCFVTbU1K6LCmp38IhtqgFEtGH1Fw eLi3S+bCzf2+/rSdLI9BvXSs2AxVFQGLdZ/VpkCMRosDZICPg8K0E7aAi3VCg4WFPYDw BfmWNQys/m/eitnUWQLYZ4i97xNTJmOpokS1/YmW7+tK6sMrbeSwt/lUvRFiVPBmwrU/ ivWuBjfa1WZ8S1UNebL0AtpJKNK0IoOPWmP7NKKqfcpMaASq0oFieIk/rtzcNf6p/IAa QK7q17GoUs4Yjdkmho6a4WFZ4muIgt4Uy+uR4Vu4p0vmgfomnVLk+4/4y9tD9W4Njnx3 1t6w== 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 :message-id:reply-to; bh=eA0yZupCmJu+lIFxWoscgsZofsCuVm6nQ+r3Bs4PfgM=; b=0fXgmSAgQp3CEAU9JiRx5zUifmpjqg5xcoqY+d31uqQBauQXzIHBGlCSxPzgQjtrAh jb41sMOEK05HWxSSxRYyuYZQ9FxCdzk+RrRVnYP1N4WHzgdK1Y5C3BLjn1GPN1IqJKZQ cp/UZ1mcjnPgUsfvLBimLK2qtegErm8JvVZj6mMtSCAA8guLxeGmNn/MEjB7yOFOcNqe ooyOYjWZl6kQQQtvpkv1QAYMYBWyWIf9hQfZYrBvtTRagDaUvPISAV4Lm25m2LQqwmFh LswyG1Da0PBarJZQVtDXOY2dMFdoHPi+o/IXBUu7jC+ein4L2nSmVGePd8EvTfopfRgC actw== X-Gm-Message-State: ACrzQf3yumu0n+1uwUG1MV+UYSFLLjBHSmSjULtzYv4e+3/xprovEVnI GhpRl6AYGZIn5hUuEBcREWw= X-Received: by 2002:a17:902:d592:b0:17a:582:4eb with SMTP id k18-20020a170902d59200b0017a058204ebmr34136415plh.40.1667546300864; Fri, 04 Nov 2022 00:18:20 -0700 (PDT) Received: from localhost ([192.55.54.55]) by smtp.gmail.com with ESMTPSA id y9-20020a17090322c900b00186f0f59c85sm1854838plg.235.2022.11.04.00.18.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Nov 2022 00:18:20 -0700 (PDT) Date: Fri, 4 Nov 2022 00:18:19 -0700 From: Isaku Yamahata To: Sean Christopherson Cc: Isaku Yamahata , Paolo Bonzini , 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 Subject: Re: [PATCH 36/44] KVM: x86: Do compatibility checks when onlining CPU Message-ID: <20221104071819.GD1063309@ls.amr.corp.intel.com> References: <20221102231911.3107438-1-seanjc@google.com> <20221102231911.3107438-37-seanjc@google.com> <20221103210402.GB1063309@ls.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline 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 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 Thu, Nov 03, 2022 at 10:34:10PM +0000, Sean Christopherson wrote: > On Thu, Nov 03, 2022, Isaku Yamahata wrote: > > On Wed, Nov 02, 2022 at 11:19:03PM +0000, > > Sean Christopherson wrote: > > > diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h > > > index f223c845ed6e..c99222b71fcc 100644 > > > --- a/arch/x86/include/asm/kvm_host.h > > > +++ b/arch/x86/include/asm/kvm_host.h > > > @@ -1666,7 +1666,7 @@ struct kvm_x86_nested_ops { > > > }; > > > > > > struct kvm_x86_init_ops { > > > - int (*check_processor_compatibility)(void); > > > + int (*check_processor_compatibility)(int cpu); > > > > Is this cpu argument used only for error message to include cpu number > > with avoiding repeating raw_smp_processor_id() in pr_err()? > > Yep. > > > The actual check is done on the current executing cpu. > > > > If cpu != raw_smp_processor_id(), cpu is wrong. Although the function is called > > in non-preemptive context, it's a bit confusing. So voting to remove it and > > to use. > > What if I rename the param is this_cpu? I 100% agree the argument is confusing > as-is, but forcing all the helpers to manually grab the cpu is quite annoying. Makes sense. Let's settle it with this_cpu. -- Isaku Yamahata