[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86/vpmu: Simplify is_pmc_quirk


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 21 Jun 2023 10:16:59 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=UIzyyTURzen0PkVEXGjSLwPKXMg3Z2ai+0daJky0H2k=; b=Y7QBY7FDo626nKCwSh3AexM1WfEqwyOAXRLNxG5mn9RmrIN1d3EstRSIPKyHmnXBIulr2HHEl4HkTsFpGYTAH79Uis9BTs5xNnhoLKTRv5ezicAlCY72ZkMcgBJfbr7R20wGGGe3tdzjj2wpPeyiw9zfjwM98weEn4FrkBPAPw+3LPygtEZioguRuwOQKFauTkCVDpv+JILqjpzVQZ6OJGTVSovLYtGLm5rBPtKwaukL1hlNWsQ+DYV6grEjSqZ5rWk1P1xXQgoJxXL4tdz5zKBc628lxxtzbJXP+d7Q02OzzSE6uSR9oczS8EsMnnPVY6gOrOdU1pPdinbVm5cOtA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ciy/qG3g2HBLdfu3J2tZqhN7b/+V4Ju6+C+DULrJ+ZOPLwxpFHYTNQ67HFmiKyNyRU7GEK9MxQx1GHoc3sw2lmfzfY50RLs+DH1ObXkATqDoSNfQ5dPUcI01TRAkwUbvm46Sn4kHShyUWWSpA81ocrfoiPbKtwL4timnJwWF1I9P69YZXpNWVBg5ReSX3eGAIPqMUH4XKxEoKCm09iEh/C8DI+RFMHRWcpU6l4JqxHFNTiBikPOXlJe+LIJEqjJHKuBq35csneF+2MgTMTpEpCKYy+SHepVW8+4PsH53Dk0CZFBONpbzO2LWJAGSStwc5GsLLqzSMIZsWNrbc++giQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 21 Jun 2023 08:17:51 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 20.06.2023 19:45, Andrew Cooper wrote:
> This should be static, and there's no need for a separate (non-init, even)
> function to perform a simple equality test.  Drop the is_ prefix which is
> gramatically questionable, and make it __ro_after_init.
> 
> Leave a TODO, because the behaviour is definitely wrong to be applied to ~all
> modern Intel CPUs, and has been raised on xen-devel previously without
> conclusion.
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
with one request:

> @@ -967,7 +960,8 @@ const struct arch_vpmu_ops *__init core2_vpmu_init(void)
>                sizeof(uint64_t) * fixed_pmc_cnt +
>                sizeof(struct xen_pmu_cntr_pair) * arch_pmc_cnt;
>  
> -    check_pmc_quirk();
> +    /* TODO: This is surely wrong. */
> +    pmc_quirk = current_cpu_data.x86 == 6;

In the description you say "~all modern Intel CPUs", which suggests it might
be correct for old enough ones. Would you mind weakening the comment to
"This surely isn't universally correct" or some such?

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.