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: <9df6459a7b00ae59b12070a4b1a311c4a29f2321.camel@intel.com>
Date:   Fri, 20 Aug 2021 11:35:25 +0800
From:   Zhang Rui <rui.zhang@...el.com>
To:     Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
        daniel.lezcano@...aro.org, rjw@...ysocki.net,
        viresh.kumar@...aro.org, lenb@...nel.org
Cc:     linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] thermal: intel: Allow processing of HWP interrupt

On Thu, 2021-08-19 at 19:40 -0700, Srinivas Pandruvada wrote:
> Add a weak function to process HWP (Hardware P-states) notifications
> and
> move updating HWP_STATUS MSR to this function.
> 
> This allows HWP interrupts to be processed by the intel_pstate driver
> in
> HWP mode by overriding the implementation.
> 
> Signed-off-by: Srinivas Pandruvada <
> srinivas.pandruvada@...ux.intel.com>

Acked-by: Zhang Rui <rui.zhang@...el.com>

thanks,
rui
> ---
>  drivers/thermal/intel/therm_throt.c       | 7 ++++++-
>  drivers/thermal/intel/thermal_interrupt.h | 3 +++
>  2 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/thermal/intel/therm_throt.c
> b/drivers/thermal/intel/therm_throt.c
> index 99abdc03c44c..dab7e8fb1059 100644
> --- a/drivers/thermal/intel/therm_throt.c
> +++ b/drivers/thermal/intel/therm_throt.c
> @@ -569,13 +569,18 @@ static void notify_thresholds(__u64 msr_val)
>  		platform_thermal_notify(msr_val);
>  }
>  
> +void __weak notify_hwp_interrupt(void)
> +{
> +	wrmsrl_safe(MSR_HWP_STATUS, 0);
> +}
> +
>  /* Thermal transition interrupt handler */
>  void intel_thermal_interrupt(void)
>  {
>  	__u64 msr_val;
>  
>  	if (static_cpu_has(X86_FEATURE_HWP))
> -		wrmsrl_safe(MSR_HWP_STATUS, 0);
> +		notify_hwp_interrupt();
>  
>  	rdmsrl(MSR_IA32_THERM_STATUS, msr_val);
>  
> diff --git a/drivers/thermal/intel/thermal_interrupt.h
> b/drivers/thermal/intel/thermal_interrupt.h
> index 53f427bb58dc..01e7bed2ffc7 100644
> --- a/drivers/thermal/intel/thermal_interrupt.h
> +++ b/drivers/thermal/intel/thermal_interrupt.h
> @@ -12,4 +12,7 @@ extern int (*platform_thermal_notify)(__u64
> msr_val);
>   * callback has rate control */
>  extern bool (*platform_thermal_package_rate_control)(void);
>  
> +/* Handle HWP interrupt */
> +extern void notify_hwp_interrupt(void);
> +
>  #endif /* _INTEL_THERMAL_INTERRUPT_H */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ