lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5e86524413ec2cfeb1096f49851bf18837c7e50b.camel@intel.com>
Date: Sun, 7 Apr 2024 08:13:28 +0000
From: "Zhang, Rui" <rui.zhang@...el.com>
To: "linux@...ck-us.net" <linux@...ck-us.net>,
	"ricardo.neri-calderon@...ux.intel.com"
	<ricardo.neri-calderon@...ux.intel.com>, "Wysocki, Rafael J"
	<rafael.j.wysocki@...el.com>, "jdelvare@...e.com" <jdelvare@...e.com>
CC: "srinivas.pandruvada@...ux.intel.com"
	<srinivas.pandruvada@...ux.intel.com>, "lukasz.luba@....com"
	<lukasz.luba@....com>, "linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
	"linux-hwmon@...r.kernel.org" <linux-hwmon@...r.kernel.org>,
	"daniel.lezcano@...aro.org" <daniel.lezcano@...aro.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, "Neri,
 Ricardo" <ricardo.neri@...el.com>
Subject: Re: [PATCH 1/3] thermal: intel: intel_tcc: Add model checks for
 temperature registers

> +
> +#define TCC_FAM6_MODEL_TEMP_MASKS

Future non FAM6 processors can still use this macro, right?
So I'd prefer to remove FAM6_MODEL in the macro name.

[...]
> 
> +
> +/**
> + * get_tcc_offset_mask() - Returns the model-specific bitmask for
> TCC offset
> + *
> + * Get the model-specific bitmask to extract TCC_OFFSET from the
> MSR_TEMPERATURE_
> + * TARGET register. If the mask is 0, it means the processor does
> not support TCC offset.
> + *
> + * Return: The model-specific bitmask for TCC offset.
> + */
> +u32 get_tcc_offset_mask(void)
> +{
> +       return intel_tcc_temp_masks.tcc_offset;
> +}
> +EXPORT_SYMBOL_NS(get_tcc_offset_mask, INTEL_TCC);

the name is not consistent with the other intel_tcc APIs.

how about intel_tcc_get_offset_mask()?

[...]

> diff --git a/include/linux/intel_tcc.h b/include/linux/intel_tcc.h
> index 8ff8eabb4a98..e281cf06aeab 100644
> --- a/include/linux/intel_tcc.h
> +++ b/include/linux/intel_tcc.h
> @@ -14,5 +14,13 @@ int intel_tcc_get_tjmax(int cpu);
>  int intel_tcc_get_offset(int cpu);
>  int intel_tcc_set_offset(int cpu, int offset);
>  int intel_tcc_get_temp(int cpu, int *temp, bool pkg);
> +#ifdef CONFIG_INTEL_TCC
> +u32 get_tcc_offset_mask(void);
> +u32 intel_tcc_get_temp_mask(bool pkg);
> +#else
> +static inline u32 get_tcc_offset_mask(void) { return 0; }
> +/* Use the architectural bitmask of the temperature readout. No
> model checks. */
> +static inline u32 intel_tcc_get_temp_mask(bool pkg) { return 0x7f; }
> +#endif

for intel_tcc_get_temp_mask()
   1. with CONFIG_INTEL_TCC
      a) for a platform in the model list, return the hardcoded value
      b) for a platform not in the model list, return 0xff
   2. without CONFIG_INTEL_TCC, return 0x7f

This is a bit confusing. IMO, at least we should leave a comment about
this difference.

thanks,
rui

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ