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

Re: [PATCH v2 6/6] x86/cpufreq: use host CPU policy in HWP driver


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Mon, 24 Nov 2025 09:35:44 -0500
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=JTPwPA51pdpKbZ9WeYPyvala1S8NXW2Pnvok26N6YHg=; b=Q5arzE5mr1bOySIk1+0lXCkJno0TNykqatGsYOp98Dt5S4GinZdDZj9RnlfQUzWOkhypBdx2viTKAW1fRs4wflO5/fehn3hDg+CnJ8f/s2xlNckArMsGokDxYtT+tlFHAmuRGSxF1jo0KZ9pHF5PM9p/n0xYtkHVYEaWddSslmSm6EbSfNHInfMIRtb+HyqlXcXWtCpxsO34KgjYBgEFyJOeGV+E6nv8fVKSqWO0durwIp7oP0sebMs0vB6Fd08sKAf7dmZ8aEzQgBLGUtXdN18D2sjjlMw6IKEYwGXF7B9rSmeUzibMjH84NJZ8yzt35jN2nVFVcxXN5Z5eIv5QTA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=A9KhbzyP6XwenB6qJ+x0NtBLAX4NCOaW/ESVE17CBgiX1Yq3RddNquSsjUt7P3WEcsNxqBjarPX6G+zhgz0fTuxdPiKIUDcS2bqGLyZLz4FPbIFsb1z0R54kYImNm2AQWdhmM/XM/bH6v+jVO3wCxBd1BiYIeO7qXYGpFZwiojk3hBPdKhPdfgQcTwoV+oIBz/jgpo2rw/DSsFdID9SYnCh9sspOEG0hyKAQneNLBW8FmbwcdemM/0g9BGIYQhxXjrGcYR865g46B171JOzkAc+hE+uAc1lEPVVHkmw4Zuh2TfQ4T5R5fNjh8nphWcFXrJ4JN5qQSgCa+77jyoQiGg==
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Mon, 24 Nov 2025 14:36:01 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2025-11-24 07:25, Jan Beulich wrote:
There's no need to invoke CPUID yet another time. This way two of the
static booleans can also go away.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
v2: Introduce cpu_has_*.

--- a/xen/arch/x86/acpi/cpufreq/hwp.c
+++ b/xen/arch/x86/acpi/cpufreq/hwp.c

@@ -226,7 +214,8 @@ static int cf_check hwp_cpufreq_verify(s
  {
      struct hwp_drv_data *data = per_cpu(hwp_drv_data, policy->cpu);
- if ( !feature_hwp_activity_window && data->activity_window )
+    if ( !cpu_has_hwp_activity_window &&
+         data->activity_window )

This ...
      {
          hwp_verbose("HWP activity window not supported\n");

@@ -537,7 +526,8 @@ int get_hwp_para(unsigned int cpu,
          return -ENODATA;
cppc_para->features =
-        (feature_hwp_activity_window ? XEN_SYSCTL_CPPC_FEAT_ACT_WINDOW : 0);
+        (cpu_has_hwp_activity_window
+         ? XEN_SYSCTL_CPPC_FEAT_ACT_WINDOW : 0);

...and this can still be on one line.

Preferably with that fixed:

Reviewed-by: Jason Andryuk <jason.andryuk@xxxxxxx>

Thanks,
Jason

      cppc_para->lowest           = data->hw.lowest;
      cppc_para->lowest_nonlinear = data->hw.most_efficient;
      cppc_para->nominal          = data->hw.guaranteed;



 


Rackspace

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