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

Re: [PATCH v2 03/13] cpufreq: Export intel_feature_detect


  • To: Jason Andryuk <jandryuk@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 15 Aug 2022 16:34:45 +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=EgMuU5/YNSyPZxwYiJMHVBD1qLPEOFOaXITD7jC1Fng=; b=Zik0cZFP5QQl3qVZkhaqd2sbfGnTkT8X3KFv6V8AdDa83oAgXJAsbi3voJ/ngFNK33KAnaxB+pX18qSy3Ah+Oa+S89LFqn6+GyW8ix0A2O8P3P+YqseBstHvf9Rl/M4ivcrw8n3Z8KwgF4FN0aZnCpEHYNtTHqPD0U786pGHq5voZu5RUpcrrvQSMrZW3KtC6pfBDaojbyeCtRx7TCwVZ5CKOsUIu6P7tflV5ej/AbF2SKe9UQlPx3AeiN4/kVbSlm/9nQCq4TfzF99wzAmu8xTPgyphNGjRauLyaZW1EwFstXmBf/v0sFYizPaYtMgnfT/m2+jpEvfGwdCytDNlOg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e7Zu3etebJrV8jd1fw+iWoYna/zPjpAgP6ag4NQCqmtLtiGNcg7E6qZF3EArJjf5MM33A7Pc+kqqklROdZtLiMG5wYNe7c7dNQslJPI5EDlRgH82w9jcfwjamlUH1gmoLJdS1hhnVZtvA6bPR1dj0k2XNsMk6ho4caT5FjX5DxJipl309pyjNLbBr2ZqJII2Oc8DwSVWQaWQ8HOnp44IL/8xJDZ4PfrgHswkwCYz8rwBqoRqrytwwxg5cKiv2/begHmTPrSaNVaLnnKdSm5U3l/SCRFNJbmOWKy/fAI//DUEMGAb+QF7jV/sJT6AOkYed4E7m/1rY/gd+eaUWiU38Q==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 15 Aug 2022 14:34:56 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 10.08.2022 21:29, Jason Andryuk wrote:
> Export feature_detect as intel_feature_detect so it can be re-used by
> HWP.
> 
> Signed-off-by: Jason Andryuk <jandryuk@xxxxxxxxx>
> ---
> v2
> export intel_feature_detect with typed pointer
> Move intel_feature_detect to acpi/cpufreq/cpufreq.h since the
> declaration now contains struct cpufreq_policy *.

I don't mind the new placement, but I don't follow the reasoning.

> --- a/xen/arch/x86/acpi/cpufreq/cpufreq.c
> +++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c
> @@ -340,9 +340,8 @@ static unsigned int cf_check get_cur_freq_on_cpu(unsigned 
> int cpu)
>      return extract_freq(get_cur_val(cpumask_of(cpu)), data);
>  }
>  
> -static void cf_check feature_detect(void *info)
> +void intel_feature_detect(struct cpufreq_policy *policy)
>  {
> -    struct cpufreq_policy *policy = info;
>      unsigned int eax;
>  
>      eax = cpuid_eax(6);
> @@ -354,6 +353,11 @@ static void cf_check feature_detect(void *info)
>      }
>  }
>  
> +static void cf_check feature_detect(void *info)

This function is invoked indirectly via on_selected_cpus() (hence
the cf_check attribute) - I wonder how you get away without that for
HWP. Or else why we need this as a wrapper here when then you'd have
another similar wrapper elsewhere.

> +{
> +    intel_feature_detect((struct cpufreq_policy *)info);

Why the cast?

Jan



 


Rackspace

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