summaryrefslogtreecommitdiff
path: root/xen/arch/x86/acpi/cpufreq/cpufreq.c
AgeCommit message (Collapse)Author
2020-03-31x86: compress lines for immediate returnSimran Singhal
Compress two lines into a single line if immediate return statement is found. It also remove variables retval, freq, effective, vector, ovf and now as they are no longer needed. Signed-off-by: Simran Singhal <singhalsimran0@gmail.com> Reviewed-by: Wei Liu <wl@xen.org> Acked-by: Jan Beulich <jbeulich@suse.com>
2020-02-03xen: split parameter related definitions in own header fileJuergen Gross
Move the parameter related definitions from init.h into a new header file param.h. This will avoid include hell when new dependencies are added to parameter definitions. Signed-off-by: Juergen Gross <jgross@suse.com> Acked-by: Julien Grall <julien@xen.org> Acked-by: Dario Faggioli <dfaggioli@suse.com> Acked-by: Paul Durrant <pdurrant@amazon.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Acked-by: Jan Beulich <jbeulich@suse.com>
2019-08-07xen/percpu: Drop unused asm/percpu.h includesAndrew Cooper
These files either don't use any PER_CPU() infrastructure at all, or use DEFINE_PER_CPU_*(). This is declared in xen/percpu.h, not asm/percpu.h, which means that xen/percpu.h is included via a different path. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Julien Grall <julien.grall@arm.com> Reviewed-by: Roger Pau Monné <roger.pau@citrix.com> Acked-by: Jan Beulich <jbeulich@suse.com>
2019-06-12x86/acpi: Add Hygon Dhyana supportPu Wen
Add Hygon Dhyana support to the acpi cpufreq and cpuidle subsystems by using the code path of AMD. Signed-off-by: Pu Wen <puwen@hygon.cn> Acked-by: Jan Beulich <jbeulich@suse.com>
2019-04-05x86/cpu: Renumber X86_VENDOR_* to form a bitmapAndrew Cooper
CPUs from different vendors sometimes share characteristics. All users of X86_VENDOR_* are now direct equal/not-equal comparisons. By expressing the X86_VENDOR_* constants in a bitmap fashon, we can more concicely and efficiently test whether a vendor is one of a group. Update all parts of the code which can already benefit from this improvement. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Reviewed-by: Jan Beulich <jbeulich@suse.com>
2018-11-09cpufreq: convert to a single post-init driver (hooks) instanceJan Beulich
This reduces the post-init memory footprint, eliminates a pointless level of indirection at the use sites, and allows for subsequent alternatives call patching. Take the opportunity and also add a name to the PowerNow! instance. Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Wei Liu <wei.liu2@citrix.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2017-07-04x86/acpi: use plain boolWei Liu
Signed-off-by: Wei Liu <wei.liu2@citrix.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2016-03-18x86: rename features to be closer to the vendor definitionsAndrew Cooper
These features are soon to be exposed in the Xen public API. Rename them to better match the vendor definitions. No functional change. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Reviewed-by: Jan Beulich <jbeulich@suse.com>
2015-10-05x86: APERF/MPERF feature detectWei Wang
Add support to detect the APERF/MPERF feature. Also, remove the identical code in cpufreq.c and powernow.c. Signed-off-by: Wei Wang <wei.w.wang@intel.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> Cosmetics. Signed-off-by: Jan Beulich <jbeulich@suse.com>
2015-07-29Replace FSF street address with canonical URLIan Campbell
As recommended in http://www.gnu.org/licenses/gpl-howto.en.html. This is the result of: $ git grep -El Mass\|Temple\|Franklin | xargs ./fsf.pl Where fsf.pl is: #!/usr/bin/perl -w -pi.bak -0777 my $repl = 'If not, see <http://www.gnu.org/licenses/>.'; my $br = qr/(?:\s*\n\s*(?:[\*\#]|\/\/|\.\\" )?\s*|\s+)/; my $inwt = qr/[Ii]f${br}not,${br}write${br}(?:to${br})?the${br}Free${br}Software${br}Foundation,(?:${br}Inc\.,)?/; my $mass = qr/675${br}Mass${br}Ave,?${br}Cambridge,?${br}MA${br}02139,?${br}USA,?\.?/; my $franklin = qr/51${br}Franklin${br}St(?:reet)?(?:,${br}| - )Fifth${br}Floor,?${br}Boston,?${br}MA,?${br}02110-1301,?${br}USA,?\.?/; my $temple = qr/59${br}Temple${br}Place(?:,${br}| - )Suite${br}330,?${br}Boston,?${br}MA,?${br}021110?-1307,?${br}USA,?\.?/; s|$inwt$br$mass|$repl|m; s|$inwt$br$franklin|$repl|m; s|$inwt$br$temple|$repl|m; The only remaining mentions of these addresses are in COPYING files which I haven't touched. Some of the changed files are imports from elsewhere, however filtering them out is tricky, I think it is tolerable to have these files be modified here and then perhaps reverted on the next sync, since it's only 1-2 lines and obvious what is going on. Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2014-08-06x86/ACPI: command line option adjustmentsJan Beulich
Improving their documentation, and converting one option to boolean since it has only boolean meaning. Signed-off-by: Jan Beulich <jbeulich@suse.com>
2012-09-12xen: Remove x86_32 build target.Keir Fraser
Signed-off-by: Keir Fraser <keir@xen.org>
2012-01-13remove inclusion of asm/config.hJan Beulich
This was always bogus (xen/config.h should have been used instead) and is superfluous now that xen/config.h gets included through the compiler command line. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
2011-11-08eliminate first_cpu() etcJan Beulich
This includes the conversion from for_each_cpu_mask() to for_each-cpu(). Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2011-11-07cpufreq: allocate CPU masks dynamicallyJan Beulich
struct cpufreq_policy, including a cpumask_t member, gets copied in cpufreq_limit_change(), cpufreq_add_cpu(), set_cpufreq_gov(), and set_cpufreq_para(). Make the member a cpumask_var_t, thus reducing the amount of data needing copying (particularly with large NR_CPUS). Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
2011-10-21eliminate cpumask accessors referencing NR_CPUSJan Beulich
... in favor of using the new, nr_cpumask_bits-based ones. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
2011-10-21introduce and use nr_cpu_ids and nr_cpumask_bitsJan Beulich
The former is the runtime equivalent of NR_CPUS (and users of NR_CPUS, where necessary, get adjusted accordingly), while the latter is for the sole use of determining the allocation size when dynamically allocating CPU masks (done later in this series). Adjust accessors to use either of the two to bound their bitmap operations - which one gets used depends on whether accessing the bits in the gap between nr_cpu_ids and nr_cpumask_bits is benign but more efficient. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
2011-10-04use xzalloc in x86 codeJan Beulich
This includes the removal of a redundant memset() from microcode_amd.c. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
2011-06-16Use same data array for INTEL and AMD cpufreq handlingJuergen Gross
The AMD and INTEL specific parts of cpufreq handling used different per-cpu data structures with nearly identical semantics. Fold the two structures into one by adding a generic architecture data item. Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
2011-05-31x86: cpufreq init cleanupLiu, Jinsong
c/s 20325 change AMD cpufreq init logic. Before that, AMD cpu start cpufreq init logic only when all cpus ready. c/s 20325 change it to per cpu add, however, leave code un-elegant. This patch do a little cleanup work. Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
2010-07-12x86 cpufreq: Fix debug=y build.Keir Fraser
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-07-12x86/cpufreq: pass pointers to cpu masks where possibleKeir Fraser
This includes replacing the bogus definition of cpumask_test_cpu() (introduced by c/s 20073) with a Linux compatible one and replacing the bad uses with cpu_isset(). Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-07-09cpufreq: eliminate unnecessary NR_CPUS-sized arraysKeir Fraser
Replace them with per-CPU data. Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-07-08x86/cpufreq: check array index before useKeir Fraser
... rather than after. Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-06-25x86 cpufreq: Fixes after msr cleanup patchKeir Fraser
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-06-25x86 cpufreq: use rdmsrl/wrmsrlKeir Fraser
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2010-05-13x86: Fix a few on_{selected,each}_cpus callers who should wait for completion.Keir Fraser
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-05-07x86/cpufreq: fix turbo mode detectionKeir Fraser
{acpi,powernow}_cpufreq_cpu_init() generally don't run on the CPU the policy they deal with is related to, hence using cpuid() directly works only as long as all CPUs in the system are identical (which admittedly is commonly the case). Further add a per-policy flag indicating the availability of APERF/MPERF MSRs, so that globally setting the .getavg accessor won't be a problem on heterogeneous configurations. Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-04-09Add support for AMD MPERF/APERFKeir Fraser
Starting with Family 0x10, model 10 processors, some AMD processors will have support for the APERF/MPERF MSRs. This patch adds the checks necessary to support those MSRs. It also makes the get_measured_perf function defined inside cpufreq.c driver independent. max_freq is taken from the policy definition instead of being a private argument in struct acpi_cpufreq_data. The struct member is entirely removed from the function since it is no longer used. Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com>
2010-04-09Refactor Xen Support for Intel Turbo BoostKeir Fraser
Refactor the existing code that supports the Intel Turbo feature to move all the driver specific bits in the cpufreq driver. Create a tri-state interface for the Turbo feature that can distinguish amongst enabled Turbo, disabled Turbo, and processors that don't support Turbo at all. Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com>
2010-03-18cpufreq: make non-verbose by defaultKeir Fraser
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-10-16x86: Update powernow.c to latest cpufreq codeKeir Fraser
The general cpufreq infrastructure has been improved over the last year. Update the AMD PowerNow! driver powernow.c to take advantage of those improvements. Specifically, addresses Novell bugzilla # 530035. Signed-of-by: Mark Langsdorf <mark.langsdorf@amd.com>
2009-05-27Remove unused 'retry' parameter from on_selected_cpus() etc.Keir Fraser
Remove the unused "retry" parameter of on_selected_cpus(), on_each_cpu(), smp_call_function(), and smp_call_function_single(). Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-05-27Pass cpumasks by reference always.Keir Fraser
Rather than passing cpumasks by value in all cases (which is problematic for large NR_CPUS configurations), pass them 'by reference' (i.e. through a pointer to a const cpumask). On x86 this changes send_IPI_mask() to always only send IPIs to remote CPUs (meaning any caller needing to handle the current CPU as well has to do so on its own). Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-04-14Fix cpufreq HW-ALL coordination handleKeir Fraser
Currently cpufreq HW-ALL coordination is handled same way as SW-ALL. However, SW-ALL will bring more IPIs which is bad for cpuidle. This patch implement HW-ALL coordination handled in different way from SW-ALL, for the sake of performance and reduce IPIs. We also suspend/resume HW-ALL dbs timer for idle. Signed-off-by: Yu, Ke <ke.yu@intel.com> Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com> Signed-off-by: Tian, Kevin <kevin.tian@intel.com>
2009-03-20cpufreq: Update cpufreq aperf and mperf read, so that it can be usedKeir Fraser
by both ondemand gov and user program Current __get_measured_perf read aperf and mperf MSR and then clear them for the sake of ondemand governor. This solution block user program to get aperf and mperf on their purpose. In this patch, it no longer clear aperf and mperf MSR, so that it can be used by both ondemand gov and user program. Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
2009-02-11x86: cpufreq get_cur_val adjustmentKeir Fraser
c/s 19149 update cpufreq get_cur_val logic to avoid cross processor call. However, to avoid null drv_data pointer, we adjust some logic in this patch to keep advantage of c/s 19149 and at same time to avoid null drv_data pointer. Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
2009-02-03x86: misc adjustments to acpi-cpufreqKeir Fraser
Avoid the call to check_freq() by default, since that function may spin up to 1ms on certain systems without indicating any kind of severe failure. This matches similar behavior in Linux. Avoid doing a cross processor call in get_cur_val() if the current CPU has its bit set in the mask passed in. Also use the local variable 'cpu' consistently, allowing to remove another local variable. Signed-off-by: Jan Beulich <jbeulich@novell.com>
2008-12-29cpufreq: xen is default cpufreq, userspace is default governor (override on ↵Keir Fraser
cmdline) Set userspace governor as default, which stays same effect as when cpufreq in xen is not enabled. As a result, enable cpufreq in xen by default to avoid reboot to activate cpufreq. Now it's always on but w/o performance impact if user doesn't attempt to change governor. Add governor option at cmdline, add some warning info for debug. Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
2008-12-11x86, cpufreq: Change cpufreq_driver->get so that it can get otherKeir Fraser
cpu's real physical freq. Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
2008-12-11cpufreq: Short path avoiding IPI in critical fast path.Keir Fraser
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-12-10Add user PM control interfaceKeir Fraser
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
2008-12-05x86/cpufreq: reduce verbosityKeir Fraser
These messages don't exist in powernow's equivalent code, and are pretty useless anyway, hence just cluttering the logs. Signed-off-by: Jan Beulich <jbeulich@novell.com>
2008-11-03Cpufreq: Enhance hypervisor px sanity checkKeir Fraser
This patch enhances hypervisor px sanity check in 2 level: Firstly, move per-cpu-level px sanity check from each cpufreq driver to common point (@ hypercall path). Secondly, add per-domain-level px sanity check to common point (@ cpufreq_add_cpu). Signed-off-by: Jinsong Liu <jinsong.liu@intel.com>
2008-10-27Cpufreq statistic update for SW_ANY coordinationKeir Fraser
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
2008-09-26x86 and ia64: move cpufreq notify code to commone placeKeir Fraser
This patch move the cpufreq notify code from x86 specfic place to common place, since it can be used by both x86 and ia64 cpufreq driver. Signed-off-by: Liu Jinsong <jinsong.liu@intel.com> Signed-off-by: Yu Ke <ke.yu@intel.com>
2008-09-26X86 and IA64: Update cpufreq statistic logic for supporting both x86Keir Fraser
and ia64 Signed-off-by: Yu, Ke <ke.yu@intel.com> Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
2008-09-26X86 and IA64: Rebase cpufreq logic for supporting both x86 and ia64Keir Fraser
arch Rebase cpufreq logic for supporting both x86 and ia64 arch: 1. move cpufreq arch-independent logic into common dir (xen/drivers/acpi and xen/drivers/cpufreq dir); 2. leave cpufreq x86-dependent logic at xen/arch/x86/acpi/cpufreq dir; Signed-off-by: Yu, Ke <ke.yu@intel.com> Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
2008-09-22x86/cpufreq: don't use static array for large per-CPU data structuresKeir Fraser
... as this is rather wasteful when Xen is configured to support many CPUs but is running on systems having only a few. Signed-off-by: Jan Beulich <jbeulich@novell.com>
2008-09-12x86: Clean up cpufreq core logicKeir Fraser
Clean up cpufreq core logic, which now can cope with cpu online/offline event, and also dynamic platform limitation event (_PPC). Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>