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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C64BEC4332F for ; Fri, 4 Nov 2022 07:19:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=AO8DBeu3sj6JLo0ql54dW0DUocWnlDfmeYZ3yI6OJpA=; b=3xVuvy9pzkdIRQ SzL1AOJxqAbQYn4mPUrwM+ZLCsI13zyWairERmpCOfQmLYDq+/aAoXK/0JnLyT1MIqxIqUvdrDqIm Xyx5Q/oS/Ktfqz9j5vhTqIHrHhB+f9lvV8tC1/fBnL+PgtYv8fshhNPFb5alkQozxe7wFWIYDF5CN YxMS5IHHDkSsPWlNwtiO1T8PRBZZ1FOpbdHBZtVS9sIzZPWg2JNsu8CoBrhlnUXocoONxt1mjVPUy aZLFUd+2iJwLOJwqSbiWevKeEPaIBToJt/oPb1EFDSjiyoGOhlif5/Lfm8oSAjg5gNdvBcx9ECDru myzXBl0356V8j1K0gB5g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqqyC-002kXK-F6; Fri, 04 Nov 2022 07:18:28 +0000 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqqy7-002kUQ-Rw; Fri, 04 Nov 2022 07:18:26 +0000 Received: by mail-pl1-x635.google.com with SMTP id b21so4108258plc.9; 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=L4y7yDjWYjP3qnW3bosm9ab8/px+hoGZXt1PTLTOQc0CvDgKCYduIujUai2d4XDhdJ n6GLPY439kwXHW4vJiSt6uwAGjmhOkHHOjrUWMIvUhujkkVSTwrnFc7mHXfSKRYVfC/n LtqCEZXBGLJQn7DrComW6GyX7SUI7OyREIDlSgqdjaBZ9TZas9GLSF2A1hm9Zoh8Gvzg i4IEnlQfTrGxJE++CgrLy3g5+HK8HbiYi3OyGpoPbb2x+gw6s9wV58bvgadFVkIHLzu4 2DoYbPJkPt1nH6Shql2gYT3yf7OzhYpLoC/k9be3qiKA8pRSm++BSeHsnMRmfEhm7KKl QmUg== X-Gm-Message-State: ACrzQf1w6qSPKhqrs1d74eqALRPIjVemDT9kVYtDnies1cvmtdPUBp/+ OisAICM8nNHdWoRvj60HhoQ= X-Google-Smtp-Source: AMsMyM44DihVYXeoqfThPObIIFl16q8Fgq5Ol1s8X3KRnlnJD5T+n/qjAhXcJhbg7QI1HMtgLqbViQ== 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-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221104_001823_920468_E7D9E456 X-CRM114-Status: GOOD ( 18.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel