Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp2333664rwi; Thu, 3 Nov 2022 15:59:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM73ZUkVPjyv+90hvftXLvueER07JKGsUuxWMXFtihy8AXc1d1CDjJkxyvkNSeH/Y8C/zhad X-Received: by 2002:a17:906:5daa:b0:78d:fa76:f837 with SMTP id n10-20020a1709065daa00b0078dfa76f837mr31110337ejv.239.1667516371260; Thu, 03 Nov 2022 15:59:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667516371; cv=none; d=google.com; s=arc-20160816; b=Q9TfqUEMML/noI2oI/hc2fBc4WaYXYznnL9PEdBZBoF79PwPryRYDT+tHxRnKCsyyO tEmGQcJeyslOdK9j8s4ZRAS6g2Rck3FqgRJa5R3OWZ9ZIzaX7rabz2Wqfyv2/i45oUFZ nnLY1nAMTixyRi5mKgYDY4OmgnZ9B4SP5EDKm67ygRaCrE2pZg5PfgUpZyB0NYNipydz ZU4xj+FyP9nANIPaLEeVFji0Jy/c80DrGZWXuGf9V/GC658TG+7u4m+JOfDqwWbKCeOU /pBDPO1zqWH5CORlmU+HVOwGQqgO+2JTSPHJbY2B5KPj2DR6yHJIVQuDWe1vXwhobAm+ a31g== 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=ldFAJy69ux+7z8nNCEANq8kYxugZwXEN2GoxlipQK+E=; b=nAwZAjBsrjGXqDXYEZNWQPOsD+kUodUhN9rzlMTiDH2cfpTDECDq4KsjmPADtZ8vzt PdoPYQUcqjSaw9AuQIyX5oBBam6rFQHJJT9iCK79DyWWI73QtzwbHhfw9Un9dnhrzX9W CJFD/IHfbqQXg33LOJkqjnJwShe30OjpzNEIh23i/qyTRPAmriaNbu4RZyLAb2U4Bx12 N6GPWKuDabSBVVeYVznlY3lcQhKOn9Nuoalc2uGKSNHmOjtKG9eQ7V1+MjPnenGyH9jL eNi9gBeYgyYWglIXGR+SgTcg5eXHiyQXH8XLijgfMQA8VCUe6Kl/WVL+RP7lLzId4S/0 vJGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=mkCIQ7bn; 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 d8-20020a50ea88000000b00461bff75d84si2497908edo.463.2022.11.03.15.59.07; Thu, 03 Nov 2022 15:59:31 -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=mkCIQ7bn; 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 S231390AbiKCWeT (ORCPT + 97 others); Thu, 3 Nov 2022 18:34:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231238AbiKCWeP (ORCPT ); Thu, 3 Nov 2022 18:34:15 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E834620BE7 for ; Thu, 3 Nov 2022 15:34:14 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id j12so3278481plj.5 for ; Thu, 03 Nov 2022 15:34:14 -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:message-id:reply-to; bh=ldFAJy69ux+7z8nNCEANq8kYxugZwXEN2GoxlipQK+E=; b=mkCIQ7bnuqf5rnZcP6hp5JREtMJ78/S1f1OWtkJaTeRse5OVZRNDMID1AYpz+jBJzg eTpW9c3Fpt1GJSjywJBWRecDimPLsqOLfN7Nt46XLz4VoW6wiMtnGP3QRSBmWb2Jy2Ue XIrU3j6Zv6WjRE+wBsl7MInjLBoh0ETGKk290BPhyym2xqAHPTTSp2piVfBSnA5Xqpa6 3LkVfTkbpSA7y+3xQukW44oEvhoV3ll0HshYQg8WmMixLpenp+usLAkNlELtK9JmVVTO f4CyPp1jxX+2aW0ZdvzjRbMLb0KbcueA1rrAX1kSu3aGK0UrE4ad6SuEvUCcApyckgBR ztmg== 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=ldFAJy69ux+7z8nNCEANq8kYxugZwXEN2GoxlipQK+E=; b=kBVkpcwIhtfNYzM5x2TP5EUtHol9sPS3JTUuhuuIMSJsZEUZngwTjfUJpwSPJxCPSF /ItoZSBTyQ948ObPPNbHRGgovntuzcgJVIE846Ucz+b2EF4LKJV4TgWxcM4hq9duChbV KUsDOfcxvWRRC3P6ZKK8Y9IyCF9NCSKhplqq8zi9qLCwov8xGqTmy3B9Cz5pMqUma9ro 9diJFdGGZEOaiFz3LhD6HlRTB3rbaIOcmd8nsNKSLemYeDTMfLVX+ZM+DD+KPjNIioW/ QD7O5gePJ35RjTy4pCq4B+K+i5iB7aFO91Fn2jogPR68sPWDBXK/0l2eMnjdXB2uYvyw /NFQ== X-Gm-Message-State: ACrzQf1Z6xOiy3008zLeieVuFacxy31BtilIFCDTI43fvHTsyZcxN14q FUfH7UbIfPTDCSNZKQ9iuRQbrw== X-Received: by 2002:a17:90a:6045:b0:212:fe9a:5792 with SMTP id h5-20020a17090a604500b00212fe9a5792mr49415367pjm.178.1667514854306; Thu, 03 Nov 2022 15:34:14 -0700 (PDT) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id u10-20020a170902e80a00b00186ad73e2d5sm1151929plg.208.2022.11.03.15.34.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 15:34:13 -0700 (PDT) Date: Thu, 3 Nov 2022 22:34:10 +0000 From: Sean Christopherson To: Isaku Yamahata Cc: 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: 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=us-ascii Content-Disposition: inline In-Reply-To: <20221103210402.GB1063309@ls.amr.corp.intel.com> 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,FSL_HELO_FAKE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,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, 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.