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 5AC27C433FE for ; Thu, 3 Nov 2022 22:34:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231294AbiKCWeR (ORCPT ); Thu, 3 Nov 2022 18:34:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229863AbiKCWeP (ORCPT ); Thu, 3 Nov 2022 18:34:15 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3DE21FCE7 for ; Thu, 3 Nov 2022 15:34:14 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id gw22so2988328pjb.3 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=AARr5GjhuivhMRBSUNyrivNRl3w8h1qAJ2UF5tOLndRBwPnRQJa4g16BETbCrB5d0f zmio7YGxXkDY6OXYajp1y/gaFCjzBHXkuN5vTHDlSvb1l2ccdiMRCEht+SROS5eyvmz3 4+6cAPX9mJgmF3RfhXaHwn64JqkY8yMmKf8ASrpS5ODjw+G+GAhQbdGapAfrVvhG8ppk rB/FNEdjEzW7u2apN80o4XU0XsVsZnEHU4t8/zIlHZWAxYhH21oPFsDs1mCaPvGNyt+k 96u1J6S/2f/e/LYbdB6PeDirswEf3JPoTXOwQokep3hzMpFLNZEEabda+aRXLzUG7dU1 ExSw== X-Gm-Message-State: ACrzQf0VcCiSbUHHk/k4+Tp4etv0bbGg++Nod2K/oitgwYufAJadG2t9 Yo/HIhtfuvD+M9ErXVPugHIhTA== X-Google-Smtp-Source: AMsMyM4x/1h/4H3vdmKr9CnvGb6Osipgsi8YDrhqpMcYmjYNzerzqYc2UHi5AhKhfTxXN1DVaborYg== 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> Precedence: bulk List-ID: X-Mailing-List: linux-mips@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.