From nobody Mon Nov 25 05:37:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1715456590; cv=none; d=zohomail.com; s=zohoarc; b=GN5PLLbAKdWG3ueJxcP8ewxApQbj0692IUod0FUDMriHiutuBgyZ49lQnz1pi16RdFC3vuhOdwxbg6PxZHkCA+Oj1rXtzvl1ojhzS7Eh4SeRh4x1574NPV00K0iEdrSU/hMCKxp5jsenFfNlCo7/4E6ohk7EqqqhfJhdy0r099E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715456590; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=oqZtZryQor/ppvAR+iR/fgku6YlEtXdshM2WNruV4V4=; b=nt80xVUfl09+kazT0X72T5nBN8EPyYy5sh6lEGnIoTm9UVYAg/ha8DzwKwD9U0BpIDarkJpoS+nOIFiMaEJI4JJcGl45GaJU3fUms6v9VRA8idPWB1NmUiSrD08Bv8d5MvmPYFxhVQXXNiKP7TpzrK32qVi2r/csFbcJPB0fyjc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1715456590760134.13680972176462; Sat, 11 May 2024 12:43:10 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.720430.1123491 (Exim 4.92) (envelope-from ) id 1s5scF-0002ME-5d; Sat, 11 May 2024 19:42:43 +0000 Received: by outflank-mailman (output) from mailman id 720430.1123491; Sat, 11 May 2024 19:42:43 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s5scF-0002M7-2D; Sat, 11 May 2024 19:42:43 +0000 Received: by outflank-mailman (input) for mailman id 720430; Sat, 11 May 2024 19:42:41 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s5scD-0002M1-7Z for xen-devel@lists.xenproject.org; Sat, 11 May 2024 19:42:41 +0000 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [2a00:1450:4864:20::631]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id a02c1680-0fce-11ef-909d-e314d9c70b13; Sat, 11 May 2024 21:42:39 +0200 (CEST) Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-a5a4bc9578cso145039066b.2 for ; Sat, 11 May 2024 12:42:39 -0700 (PDT) Received: from andrewcoop.citrite.net (default-46-102-197-194.interdsl.co.uk. [46.102.197.194]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5733c34fed1sm3751139a12.96.2024.05.11.12.42.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 May 2024 12:42:38 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: a02c1680-0fce-11ef-909d-e314d9c70b13 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1715456559; x=1716061359; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=oqZtZryQor/ppvAR+iR/fgku6YlEtXdshM2WNruV4V4=; b=XMhne4QkVm/0Y3MqcyGvhGbDfR9Gk/UwRfhwNbBwtTaGPNmvkSvFV5VmbACad8Imh0 1DjRYUqPgDd4F67hPkQwlZBHtjDSmvY9EPMevaY9puHKC/uILNaugSskUWcfRb8BDnBv 3lzga4bge2+ejXLc0fOjmgaYeje25upOfmsX0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715456559; x=1716061359; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=oqZtZryQor/ppvAR+iR/fgku6YlEtXdshM2WNruV4V4=; b=OjuLNBg0Lu0IJEsS62r13hR4pACtpuVYcxRQr/Ht+na8iRhC1sJme6jZ0Q3FuglZSP pF8nBr7cUhr9DyakrICrV3aZZwTznYtZ3dhm8asq3gWt5jRVjC1SBQgQM8gsuRvs2T+5 kxU/0gc5MeyT6zh3reVnYCAU7lFWszVfUT2lyxid3oWVhlL8rmG55Sf0UEFrNeBnXIyr Q3MnLhABzTcXAVdVQiWcz1ycSWs8nNCxPSiSb4CYTN69TqPyLFFtcW72+clhoGzhg3Bj TjVcCph/g/UVXP5xyyqIXEKQxOLEp9oNuodxv3ade+zTohjIH1Ef1Y0xoy9FyU/8VSwu eKyw== X-Gm-Message-State: AOJu0YzG0P5deCgf3kFWqTXCmClbBEax8OW5BX8jYvImkvA+Dpee+t6O R+t+UYfPLNw8is7HK/knu1aFT95iIOeiq1CG2RstYDK5UvWwUaSOMRiAr4kE0fDmFjPou2QH8U1 K X-Google-Smtp-Source: AGHT+IHvW56HBIUibeOV4rBI6uPxDVDXUpS2j7ihhlwFhZHdcW6XWB5QCaydJX8oFiqgVuGb8rcdrw== X-Received: by 2002:a50:d4c8:0:b0:572:719f:b430 with SMTP id 4fb4d7f45d1cf-5734d6f0080mr5347809a12.32.1715456558918; Sat, 11 May 2024 12:42:38 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Stefano Stabellini , Nicola Vetrini , "consulting @ bugseng . com" Subject: [PATCH] x86/cpufreq: Rename cpuid variable/parameters to cpu Date: Sat, 11 May 2024 20:42:37 +0100 Message-Id: <20240511194237.2596271-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1715456591161100001 Various functions have a parameter or local variable called cpuid, but this triggers a MISRA R5.3 violation because we also have a function called cpui= d() which wraps the real CPUID instruction. In all these cases, it's a Xen cpu index, which is far more commonly named just cpu in our code. While adjusting these, fix a couple of other issues: * cpufreq_cpu_init() is on the end of a hypercall (with in-memory paramete= rs, even), making EFAULT the wrong error to use. Use EOPNOTSUPP instead. * check_est_cpu() is wrong to tie EIST to just Intel, and nowhere else usi= ng EIST makes this restriction. Just check the feature itself, which is mo= re succinctly done after being folded into its single caller. * In powernow_cpufreq_update(), replace an opencoded cpu_online(). Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 CC: Stefano Stabellini CC: Nicola Vetrini CC: consulting@bugseng.com cpu needs to stay signed for now in set_px_pminfo(), because of get_cpu_id(= ). This can be cleaned up by making better use of BAD_APICID, but that's a much more involved change. --- xen/arch/x86/acpi/cpu_idle.c | 14 ++++---- xen/arch/x86/acpi/cpufreq/cpufreq.c | 24 +++---------- xen/arch/x86/acpi/cpufreq/hwp.c | 6 ++-- xen/arch/x86/acpi/cpufreq/powernow.c | 6 ++-- xen/drivers/cpufreq/cpufreq.c | 18 +++++----- xen/drivers/cpufreq/utility.c | 43 +++++++++++------------ xen/include/acpi/cpufreq/cpufreq.h | 6 ++-- xen/include/acpi/cpufreq/processor_perf.h | 8 ++--- xen/include/xen/pmstat.h | 6 ++-- 9 files changed, 57 insertions(+), 74 deletions(-) diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c index cfce4cc0408f..c8db1aa9913a 100644 --- a/xen/arch/x86/acpi/cpu_idle.c +++ b/xen/arch/x86/acpi/cpu_idle.c @@ -1498,14 +1498,14 @@ static void amd_cpuidle_init(struct acpi_processor_= power *power) vendor_override =3D -1; } =20 -uint32_t pmstat_get_cx_nr(uint32_t cpuid) +uint32_t pmstat_get_cx_nr(unsigned int cpu) { - return processor_powers[cpuid] ? processor_powers[cpuid]->count : 0; + return processor_powers[cpu] ? processor_powers[cpu]->count : 0; } =20 -int pmstat_get_cx_stat(uint32_t cpuid, struct pm_cx_stat *stat) +int pmstat_get_cx_stat(unsigned int cpu, struct pm_cx_stat *stat) { - struct acpi_processor_power *power =3D processor_powers[cpuid]; + struct acpi_processor_power *power =3D processor_powers[cpu]; uint64_t idle_usage =3D 0, idle_res =3D 0; uint64_t last_state_update_tick, current_stime, current_tick; uint64_t usage[ACPI_PROCESSOR_MAX_POWER] =3D { 0 }; @@ -1522,7 +1522,7 @@ int pmstat_get_cx_stat(uint32_t cpuid, struct pm_cx_s= tat *stat) return 0; } =20 - stat->idle_time =3D get_cpu_idle_time(cpuid); + stat->idle_time =3D get_cpu_idle_time(cpu); nr =3D min(stat->nr, power->count); =20 /* mimic the stat when detail info hasn't been registered by dom0 */ @@ -1572,7 +1572,7 @@ int pmstat_get_cx_stat(uint32_t cpuid, struct pm_cx_s= tat *stat) idle_res +=3D res[i]; } =20 - get_hw_residencies(cpuid, &hw_res); + get_hw_residencies(cpu, &hw_res); =20 #define PUT_xC(what, n) do { \ if ( stat->nr_##what >=3D n && \ @@ -1613,7 +1613,7 @@ int pmstat_get_cx_stat(uint32_t cpuid, struct pm_cx_s= tat *stat) return 0; } =20 -int pmstat_reset_cx_stat(uint32_t cpuid) +int pmstat_reset_cx_stat(unsigned int cpu) { return 0; } diff --git a/xen/arch/x86/acpi/cpufreq/cpufreq.c b/xen/arch/x86/acpi/cpufre= q/cpufreq.c index 2b6ef99678ae..a341f2f02063 100644 --- a/xen/arch/x86/acpi/cpufreq/cpufreq.c +++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c @@ -55,17 +55,6 @@ struct acpi_cpufreq_data *cpufreq_drv_data[NR_CPUS]; static bool __read_mostly acpi_pstate_strict; boolean_param("acpi_pstate_strict", acpi_pstate_strict); =20 -static int check_est_cpu(unsigned int cpuid) -{ - struct cpuinfo_x86 *cpu =3D &cpu_data[cpuid]; - - if (cpu->x86_vendor !=3D X86_VENDOR_INTEL || - !cpu_has(cpu, X86_FEATURE_EIST)) - return 0; - - return 1; -} - static unsigned extract_io(u32 value, struct acpi_cpufreq_data *data) { struct processor_performance *perf; @@ -530,7 +519,7 @@ static int cf_check acpi_cpufreq_cpu_init(struct cpufre= q_policy *policy) if (cpufreq_verbose) printk("xen_pminfo: @acpi_cpufreq_cpu_init," "HARDWARE addr space\n"); - if (!check_est_cpu(cpu)) { + if (!cpu_has(c, X86_FEATURE_EIST)) { result =3D -ENODEV; goto err_unreg; } @@ -690,15 +679,12 @@ static int __init cf_check cpufreq_driver_late_init(v= oid) } __initcall(cpufreq_driver_late_init); =20 -int cpufreq_cpu_init(unsigned int cpuid) +int cpufreq_cpu_init(unsigned int cpu) { - int ret; - /* Currently we only handle Intel, AMD and Hygon processor */ if ( boot_cpu_data.x86_vendor & (X86_VENDOR_INTEL | X86_VENDOR_AMD | X86_VENDOR_HYGON) ) - ret =3D cpufreq_add_cpu(cpuid); - else - ret =3D -EFAULT; - return ret; + return cpufreq_add_cpu(cpu); + + return -EOPNOTSUPP; } diff --git a/xen/arch/x86/acpi/cpufreq/hwp.c b/xen/arch/x86/acpi/cpufreq/hw= p.c index e61212803e71..59b57a4cef86 100644 --- a/xen/arch/x86/acpi/cpufreq/hwp.c +++ b/xen/arch/x86/acpi/cpufreq/hwp.c @@ -506,11 +506,11 @@ static void cf_check hwp_set_misc_turbo(void *info) } } =20 -static int cf_check hwp_cpufreq_update(int cpuid, struct cpufreq_policy *p= olicy) +static int cf_check hwp_cpufreq_update(unsigned int cpu, struct cpufreq_po= licy *policy) { - on_selected_cpus(cpumask_of(cpuid), hwp_set_misc_turbo, policy, 1); + on_selected_cpus(cpumask_of(cpu), hwp_set_misc_turbo, policy, 1); =20 - return per_cpu(hwp_drv_data, cpuid)->ret; + return per_cpu(hwp_drv_data, cpu)->ret; } =20 static const struct cpufreq_driver __initconst_cf_clobber diff --git a/xen/arch/x86/acpi/cpufreq/powernow.c b/xen/arch/x86/acpi/cpufr= eq/powernow.c index 8a27ee82a5b0..69364e185562 100644 --- a/xen/arch/x86/acpi/cpufreq/powernow.c +++ b/xen/arch/x86/acpi/cpufreq/powernow.c @@ -68,12 +68,12 @@ static void cf_check update_cpb(void *data) } =20 static int cf_check powernow_cpufreq_update( - int cpuid, struct cpufreq_policy *policy) + unsigned int cpu, struct cpufreq_policy *policy) { - if (!cpumask_test_cpu(cpuid, &cpu_online_map)) + if ( !cpu_online(cpu) ) return -EINVAL; =20 - on_selected_cpus(cpumask_of(cpuid), update_cpb, policy, 1); + on_selected_cpus(cpumask_of(cpu), update_cpb, policy, 1); =20 return 0; } diff --git a/xen/drivers/cpufreq/cpufreq.c b/xen/drivers/cpufreq/cpufreq.c index 36c800f4fa39..a74593b70577 100644 --- a/xen/drivers/cpufreq/cpufreq.c +++ b/xen/drivers/cpufreq/cpufreq.c @@ -459,21 +459,21 @@ static void print_PPC(unsigned int platform_limit) =20 int set_px_pminfo(uint32_t acpi_id, struct xen_processor_performance *perf) { - int ret=3D0, cpuid; + int ret=3D0, cpu; struct processor_pminfo *pmpt; struct processor_performance *pxpt; =20 - cpuid =3D get_cpu_id(acpi_id); - if ( cpuid < 0 || !perf ) + cpu =3D get_cpu_id(acpi_id); + if ( cpu < 0 || !perf ) { ret =3D -EINVAL; goto out; } if ( cpufreq_verbose ) - printk("Set CPU acpi_id(%d) cpuid(%d) Px State info:\n", + printk("Set CPU acpi_id(%d) cpu(%d) Px State info:\n", acpi_id, cpuid); =20 - pmpt =3D processor_pminfo[cpuid]; + pmpt =3D processor_pminfo[cpu]; if ( !pmpt ) { pmpt =3D xzalloc(struct processor_pminfo); @@ -482,11 +482,11 @@ int set_px_pminfo(uint32_t acpi_id, struct xen_proces= sor_performance *perf) ret =3D -ENOMEM; goto out; } - processor_pminfo[cpuid] =3D pmpt; + processor_pminfo[cpu] =3D pmpt; } pxpt =3D &pmpt->perf; pmpt->acpi_id =3D acpi_id; - pmpt->id =3D cpuid; + pmpt->id =3D cpu; =20 if ( perf->flags & XEN_PX_PCT ) { @@ -564,7 +564,7 @@ int set_px_pminfo(uint32_t acpi_id, struct xen_processo= r_performance *perf) =20 if ( pxpt->init =3D=3D XEN_PX_INIT ) { - ret =3D cpufreq_limit_change(cpuid); + ret =3D cpufreq_limit_change(cpu); goto out; } } @@ -573,7 +573,7 @@ int set_px_pminfo(uint32_t acpi_id, struct xen_processo= r_performance *perf) { pxpt->init =3D XEN_PX_INIT; =20 - ret =3D cpufreq_cpu_init(cpuid); + ret =3D cpufreq_cpu_init(cpu); goto out; } =20 diff --git a/xen/drivers/cpufreq/utility.c b/xen/drivers/cpufreq/utility.c index dbf8985969b2..6d2413b32a55 100644 --- a/xen/drivers/cpufreq/utility.c +++ b/xen/drivers/cpufreq/utility.c @@ -86,13 +86,12 @@ void cpufreq_statistic_update(unsigned int cpu, uint8_t= from, uint8_t to) spin_unlock(cpufreq_statistic_lock); } =20 -int cpufreq_statistic_init(unsigned int cpuid) +int cpufreq_statistic_init(unsigned int cpu) { uint32_t i, count; struct pm_px *pxpt; - const struct processor_pminfo *pmpt =3D processor_pminfo[cpuid]; - spinlock_t *cpufreq_statistic_lock =3D=20 - &per_cpu(cpufreq_statistic_lock, cpuid); + const struct processor_pminfo *pmpt =3D processor_pminfo[cpu]; + spinlock_t *cpufreq_statistic_lock =3D &per_cpu(cpufreq_statistic_lock= , cpu); =20 spin_lock_init(cpufreq_statistic_lock); =20 @@ -101,7 +100,7 @@ int cpufreq_statistic_init(unsigned int cpuid) =20 spin_lock(cpufreq_statistic_lock); =20 - pxpt =3D per_cpu(cpufreq_statistic_data, cpuid); + pxpt =3D per_cpu(cpufreq_statistic_data, cpu); if ( pxpt ) { spin_unlock(cpufreq_statistic_lock); return 0; @@ -114,7 +113,7 @@ int cpufreq_statistic_init(unsigned int cpuid) spin_unlock(cpufreq_statistic_lock); return -ENOMEM; } - per_cpu(cpufreq_statistic_data, cpuid) =3D pxpt; + per_cpu(cpufreq_statistic_data, cpu) =3D pxpt; =20 pxpt->u.trans_pt =3D xzalloc_array(uint64_t, count * count); if (!pxpt->u.trans_pt) { @@ -138,22 +137,21 @@ int cpufreq_statistic_init(unsigned int cpuid) pxpt->u.pt[i].freq =3D pmpt->perf.states[i].core_frequency; =20 pxpt->prev_state_wall =3D NOW(); - pxpt->prev_idle_wall =3D get_cpu_idle_time(cpuid); + pxpt->prev_idle_wall =3D get_cpu_idle_time(cpu); =20 spin_unlock(cpufreq_statistic_lock); =20 return 0; } =20 -void cpufreq_statistic_exit(unsigned int cpuid) +void cpufreq_statistic_exit(unsigned int cpu) { struct pm_px *pxpt; - spinlock_t *cpufreq_statistic_lock =3D=20 - &per_cpu(cpufreq_statistic_lock, cpuid); + spinlock_t *cpufreq_statistic_lock =3D &per_cpu(cpufreq_statistic_lock= , cpu); =20 spin_lock(cpufreq_statistic_lock); =20 - pxpt =3D per_cpu(cpufreq_statistic_data, cpuid); + pxpt =3D per_cpu(cpufreq_statistic_data, cpu); if (!pxpt) { spin_unlock(cpufreq_statistic_lock); return; @@ -162,22 +160,21 @@ void cpufreq_statistic_exit(unsigned int cpuid) xfree(pxpt->u.trans_pt); xfree(pxpt->u.pt); xfree(pxpt); - per_cpu(cpufreq_statistic_data, cpuid) =3D NULL; + per_cpu(cpufreq_statistic_data, cpu) =3D NULL; =20 spin_unlock(cpufreq_statistic_lock); } =20 -void cpufreq_statistic_reset(unsigned int cpuid) +void cpufreq_statistic_reset(unsigned int cpu) { uint32_t i, j, count; struct pm_px *pxpt; - const struct processor_pminfo *pmpt =3D processor_pminfo[cpuid]; - spinlock_t *cpufreq_statistic_lock =3D=20 - &per_cpu(cpufreq_statistic_lock, cpuid); + const struct processor_pminfo *pmpt =3D processor_pminfo[cpu]; + spinlock_t *cpufreq_statistic_lock =3D &per_cpu(cpufreq_statistic_lock= , cpu); =20 spin_lock(cpufreq_statistic_lock); =20 - pxpt =3D per_cpu(cpufreq_statistic_data, cpuid); + pxpt =3D per_cpu(cpufreq_statistic_data, cpu); if ( !pmpt || !pxpt || !pxpt->u.pt || !pxpt->u.trans_pt ) { spin_unlock(cpufreq_statistic_lock); return; @@ -194,7 +191,7 @@ void cpufreq_statistic_reset(unsigned int cpuid) } =20 pxpt->prev_state_wall =3D NOW(); - pxpt->prev_idle_wall =3D get_cpu_idle_time(cpuid); + pxpt->prev_idle_wall =3D get_cpu_idle_time(cpu); =20 spin_unlock(cpufreq_statistic_lock); } @@ -389,7 +386,7 @@ int cpufreq_driver_getavg(unsigned int cpu, unsigned in= t flag) return policy->cur; } =20 -int cpufreq_update_turbo(int cpuid, int new_state) +int cpufreq_update_turbo(unsigned int cpu, int new_state) { struct cpufreq_policy *policy; int curr_state; @@ -399,7 +396,7 @@ int cpufreq_update_turbo(int cpuid, int new_state) new_state !=3D CPUFREQ_TURBO_DISABLED) return -EINVAL; =20 - policy =3D per_cpu(cpufreq_cpu_policy, cpuid); + policy =3D per_cpu(cpufreq_cpu_policy, cpu); if (!policy) return -EACCES; =20 @@ -413,7 +410,7 @@ int cpufreq_update_turbo(int cpuid, int new_state) policy->turbo =3D new_state; if (cpufreq_driver.update) { - ret =3D alternative_call(cpufreq_driver.update, cpuid, policy); + ret =3D alternative_call(cpufreq_driver.update, cpu, policy); if (ret) policy->turbo =3D curr_state; } @@ -422,11 +419,11 @@ int cpufreq_update_turbo(int cpuid, int new_state) } =20 =20 -int cpufreq_get_turbo_status(int cpuid) +int cpufreq_get_turbo_status(unsigned int cpu) { struct cpufreq_policy *policy; =20 - policy =3D per_cpu(cpufreq_cpu_policy, cpuid); + policy =3D per_cpu(cpufreq_cpu_policy, cpu); return policy && policy->turbo =3D=3D CPUFREQ_TURBO_ENABLED; } =20 diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/= cpufreq.h index b4685a908599..443427153bb6 100644 --- a/xen/include/acpi/cpufreq/cpufreq.h +++ b/xen/include/acpi/cpufreq/cpufreq.h @@ -145,8 +145,8 @@ extern int cpufreq_driver_getavg(unsigned int cpu, unsi= gned int flag); #define CPUFREQ_TURBO_UNSUPPORTED 0 #define CPUFREQ_TURBO_ENABLED 1 =20 -extern int cpufreq_update_turbo(int cpuid, int new_state); -extern int cpufreq_get_turbo_status(int cpuid); +int cpufreq_update_turbo(unsigned int cpu, int new_state); +int cpufreq_get_turbo_status(unsigned int cpu); =20 static inline int __cpufreq_governor(struct cpufreq_policy *policy, unsigned int event) @@ -167,7 +167,7 @@ struct cpufreq_driver { int (*init)(struct cpufreq_policy *policy); int (*verify)(struct cpufreq_policy *policy); int (*setpolicy)(struct cpufreq_policy *policy); - int (*update)(int cpuid, struct cpufreq_policy *policy); + int (*update)(unsigned int cpu, struct cpufreq_policy *policy); int (*target)(struct cpufreq_policy *policy, unsigned int target_freq, unsigned int relation); diff --git a/xen/include/acpi/cpufreq/processor_perf.h b/xen/include/acpi/c= pufreq/processor_perf.h index 7cd240061947..5f48aceadb21 100644 --- a/xen/include/acpi/cpufreq/processor_perf.h +++ b/xen/include/acpi/cpufreq/processor_perf.h @@ -12,9 +12,9 @@ unsigned int powernow_register_driver(void); unsigned int get_measured_perf(unsigned int cpu, unsigned int flag); void cpufreq_residency_update(unsigned int cpu, uint8_t state); void cpufreq_statistic_update(unsigned int cpu, uint8_t from, uint8_t to); -int cpufreq_statistic_init(unsigned int cpuid); -void cpufreq_statistic_exit(unsigned int cpuid); -void cpufreq_statistic_reset(unsigned int cpuid); +int cpufreq_statistic_init(unsigned int cpu); +void cpufreq_statistic_exit(unsigned int cpu); +void cpufreq_statistic_reset(unsigned int cpu); =20 int cpufreq_limit_change(unsigned int cpu); =20 @@ -59,5 +59,5 @@ struct pm_px { =20 DECLARE_PER_CPU(struct pm_px *, cpufreq_statistic_data); =20 -int cpufreq_cpu_init(unsigned int cpuid); +int cpufreq_cpu_init(unsigned int cpu); #endif /* __XEN_PROCESSOR_PM_H__ */ diff --git a/xen/include/xen/pmstat.h b/xen/include/xen/pmstat.h index 43b826ad4d37..e6ab1423a9be 100644 --- a/xen/include/xen/pmstat.h +++ b/xen/include/xen/pmstat.h @@ -7,9 +7,9 @@ =20 int set_px_pminfo(uint32_t acpi_id, struct xen_processor_performance *perf= ); long set_cx_pminfo(uint32_t acpi_id, struct xen_processor_power *power); -uint32_t pmstat_get_cx_nr(uint32_t cpuid); -int pmstat_get_cx_stat(uint32_t cpuid, struct pm_cx_stat *stat); -int pmstat_reset_cx_stat(uint32_t cpuid); +uint32_t pmstat_get_cx_nr(unsigned int cpu); +int pmstat_get_cx_stat(unsigned int cpu, struct pm_cx_stat *stat); +int pmstat_reset_cx_stat(unsigned int cpu); =20 int do_get_pm_info(struct xen_sysctl_get_pmstat *op); int do_pm_op(struct xen_sysctl_pm_op *op); --=20 2.30.2