Received: by 2002:a05:6a10:5594:0:0:0:0 with SMTP id ee20csp544364pxb; Mon, 25 Apr 2022 16:07:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNMGbwk1JkIT8vcRoeuoMtqABk0jm3KL3ohWhLFY6RHjlXZDvVLu3/h63Y5b0BIUlFXM/c X-Received: by 2002:a17:906:c10d:b0:6ef:9503:3372 with SMTP id do13-20020a170906c10d00b006ef95033372mr18635270ejc.408.1650928023382; Mon, 25 Apr 2022 16:07:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650928023; cv=none; d=google.com; s=arc-20160816; b=mvXdjoX4D998eZ6n8OAyTk7QaDHRBXKP67saj30dXRQ10qjvmuTUXUVxLdisq8dZNQ BNsfCxCeq2BGZ0jGbcCyHdajiFKN3eUAVsqsuxaI9/3N4GJHFgxzbAcXEd1JKZFEjRR2 vQiUWFp7RXsw7M0PHFFKXyxgFzN/0vmTDjH4chMuSpS9gRtxX+KKNIRGVisnLaQnAxrP 769pf/NLsXPgxS/ECSfcHZ6hVWdkhb7Ui5jLHpimVjeOJ/+/Kwfon3QvPG4izw6zjQch Gusm+7PrhZWAlNdBCBwNCKvZeJazniqgMe8/UUqgoh2KdqqZHEE65vOLElkcY5TQPBeT 4Jpg== 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; bh=N+T1uFPvpk+TduyCL4G0Lj8jCl9tpg3TC+NZTTHptlQ=; b=tMvUHrzfP4m8HIbPfIQKcLdMHjB4xVzCgjbVfrYdZiD81hD4QC2AShJHJtCvoGOPgc PqvoTWNGwvNQpjnZbcY5jULEOw1aFUXCn6nqeIeZo7GZSd58x8b72HsrYWthwIpytAKe XiorUf78I2kgnpzqv+IHTe+IzK+J3chMDXkAT9dg+ImwgDhTCRttVh3k3ZvVRUsQjBk5 ahdWRZ3U9NWZtl9Zro/41JIefn/LLYeJ4iXdNG9jyVgcs1+EFhr8W0GdKX+Id8BZkeg7 LLiwvwlHgzb4iecYdwk2lIfYBLSHTfWQB5lPqMravW/QY4SXXBGf4la6bLuCsKdxtM6m f6gg== ARC-Authentication-Results: i=1; mx.google.com; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z3-20020a170906668300b006df76385e9asi14068762ejo.826.2022.04.25.16.06.37; Mon, 25 Apr 2022 16:07:03 -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; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237600AbiDYPue (ORCPT + 99 others); Mon, 25 Apr 2022 11:50:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242987AbiDYPu3 (ORCPT ); Mon, 25 Apr 2022 11:50:29 -0400 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CD30114811; Mon, 25 Apr 2022 08:47:24 -0700 (PDT) Received: by mail-wr1-f53.google.com with SMTP id k2so1050719wrd.5; Mon, 25 Apr 2022 08:47:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=N+T1uFPvpk+TduyCL4G0Lj8jCl9tpg3TC+NZTTHptlQ=; b=gnbi5e6bs1AJIPkNhhik3bDbXSFhmlu6YiFF11e8OSaT1EqP/juZY83oc63tHeY7yi P6VnPJFYtYJjp1y35PZsDROgyDb5n3WFi5yAtViWXJt1mOKuAHF1FSGk5zicdOxK1G2r 8FeqOPcqK0wPMLZ7vjkAgtU2BYAajx6Xcog8cW5P4Bde1EibDEEhp2EwZ+oG312de2Ci kZmGEsRx9jt2gGZbk7UPJkeEYf8LEJjNuJyFLc5c8cBmK1F09zcVkiyYn4o6FYVEyTJT YdJtz/H/lxYzrKIQTMBvJ9VQgq/W5Xx7WazW2URTAcUBG52YtIRju5b53PnPuDBwPsfS 6TVg== X-Gm-Message-State: AOAM530glSJd0pN1x7GF2hydDnSyY8gRa+gl64+J+qTD7JiIr5RH1RvS /tLMnozbAFWdkxSPfulVTfQ= X-Received: by 2002:adf:d1c7:0:b0:20a:963a:1c9f with SMTP id b7-20020adfd1c7000000b0020a963a1c9fmr15001365wrd.221.1650901642851; Mon, 25 Apr 2022 08:47:22 -0700 (PDT) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id y9-20020a05600015c900b0020adb0e106asm4217430wry.93.2022.04.25.08.47.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Apr 2022 08:47:22 -0700 (PDT) Date: Mon, 25 Apr 2022 15:47:21 +0000 From: Wei Liu To: Vitaly Kuznetsov , Michael Kelley Cc: kvm@vger.kernel.org, Paolo Bonzini , Sean Christopherson , Wanpeng Li , Jim Mattson , Michael Kelley , Siddharth Chandrasekaran , linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, Wei Liu Subject: Re: [PATCH v3 07/34] x86/hyperv: Introduce HV_MAX_SPARSE_VCPU_BANKS/HV_VCPUS_PER_SPARSE_BANK constants Message-ID: <20220425154721.xunncuuuzs55nwc7@liuwe-devbox-debian-v2> References: <20220414132013.1588929-1-vkuznets@redhat.com> <20220414132013.1588929-8-vkuznets@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220414132013.1588929-8-vkuznets@redhat.com> X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no 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, Apr 14, 2022 at 03:19:46PM +0200, Vitaly Kuznetsov wrote: > It may not come clear from where the magical '64' value used in > __cpumask_to_vpset() come from. Moreover, '64' means both the maximum > sparse bank number as well as the number of vCPUs per bank. Add defines > to make things clear. These defines are also going to be used by KVM. > > No functional change. > > Signed-off-by: Vitaly Kuznetsov > --- > include/asm-generic/hyperv-tlfs.h | 5 +++++ > include/asm-generic/mshyperv.h | 11 ++++++----- > 2 files changed, 11 insertions(+), 5 deletions(-) > > diff --git a/include/asm-generic/hyperv-tlfs.h b/include/asm-generic/hyperv-tlfs.h > index fdce7a4cfc6f..020ca9bdbb79 100644 > --- a/include/asm-generic/hyperv-tlfs.h > +++ b/include/asm-generic/hyperv-tlfs.h > @@ -399,6 +399,11 @@ struct hv_vpset { > u64 bank_contents[]; > } __packed; > > +/* The maximum number of sparse vCPU banks which can be encoded by 'struct hv_vpset' */ > +#define HV_MAX_SPARSE_VCPU_BANKS (64) > +/* The number of vCPUs in one sparse bank */ > +#define HV_VCPUS_PER_SPARSE_BANK (64) I think replacing the magic number with a macro is a good thing. Where do you get these names? Did you make them up yourself? I'm trying to dig into internal code to find the most appropriate names, but I couldn't find any so far. Michael, do you have insight here? Thanks, Wei.