From patchwork Thu Nov 9 17:09:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksandr Tyshchenko X-Patchwork-Id: 10051387 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8304B60381 for ; Thu, 9 Nov 2017 17:13:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 69D882B04E for ; Thu, 9 Nov 2017 17:13:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5EA1A2B053; Thu, 9 Nov 2017 17:13:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A546C2B052 for ; Thu, 9 Nov 2017 17:13:36 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eCqLc-0003x6-1u; Thu, 09 Nov 2017 17:10:36 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eCqLb-0003vs-2Z for xen-devel@lists.xenproject.org; Thu, 09 Nov 2017 17:10:35 +0000 Received: from [193.109.254.147] by server-7.bemta-6.messagelabs.com id 1E/BB-25852-A0C840A5; Thu, 09 Nov 2017 17:10:34 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrCIsWRWlGSWpSXmKPExsVyMfS6oy5nD0u Uwd4+TYvvWyYzOTB6HP5whSWAMYo1My8pvyKBNaN5dytzwTzDinudL1gaGNu1uhg5OYQEZjBK fF+m0cXIxcEi8JJF4tL+aywgCQmBflaJrXO8IewsiT2HfjJB2GkSN15Nh7IrJHqe9jNDDFKSe L1zMxPIICGB2UwSPyc3gyXYBAwk9r97wg5iiwAV3Vs1GayIGaTo/p6PYAlhgUiJJ7M3soHYLA KqEk+nHQXbwCvgLHF53gyoi+Qkbp7rBBvKKeAi8ebjdTaIzc4SF18fZ5vAKLiAkWEVo0ZxalF ZapGuobleUlFmekZJbmJmjq6hgZlebmpxcWJ6ak5iUrFecn7uJkZgyDEAwQ7G2xsDDjFKcjAp ifJKWbJECfEl5adUZiQWZ8QXleakFh9ilOHgUJLg5ekGygkWpaanVqRl5gCDHyYtwcGjJMK7s QsozVtckJhbnJkOkTrF6Mpx4c6lP0wcxzZdBpIH9twCks9mvm5g5ph2tbWJWYglLz8vVUqc1w pktgBIc0ZpHtxoWOReYpSVEuZlBDpWiKcgtSg3swRV/hWjOAejkjDvdpATeDLzSuAueAV0HBP QcdHsYMeVJCKkpBoYWebvePr34pyaSVmH/qydlSK6181gwmU9HZtJfb/uKG372ras1G0qh9j9 h7NO7T7+4eSUrqDNO843/zDiUVz27Mn/Vf2OfAkCG++v45DoOJZw+/piqXPfDzU5uvFaCCiur L06kyuzW/aVOYfrj5DgBVw3Jud9nBTkqs1ZuP/cDG+ONfEMgrne65RYijMSDbWYi4oTAZFZLb DXAgAA X-Env-Sender: olekstysh@gmail.com X-Msg-Ref: server-4.tower-27.messagelabs.com!1510247433!115005344!1 X-Originating-IP: [209.85.215.65] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 13263 invoked from network); 9 Nov 2017 17:10:33 -0000 Received: from mail-lf0-f65.google.com (HELO mail-lf0-f65.google.com) (209.85.215.65) by server-4.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 9 Nov 2017 17:10:33 -0000 Received: by mail-lf0-f65.google.com with SMTP id f125so7974333lff.4 for ; Thu, 09 Nov 2017 09:10:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0Dti0uMOrJy7nuvGztsLEk/fEAppAz8iTSEIVSs/DxQ=; b=l6UKWeHneW0/xyl0gKJyRXARdNR1j3tLdS8UfAfvQJjNhRiePgIwS9lz2jJ6rmWo1n OVrAO6i2+yyGRWeGQs3zl01omx+sgeoPHLHOQ1FHzrGEuQ/lGk2ac/AYOz8MKMrbKhKz 39zBKnaXRYmgjgjXuqcujAJ4wA6Myu7cPKuXZ6HX6FugbY6nNtnHOw3fHU803gV58+b7 18RHmD5HFgKDQDpz0FfuP8daF5YSRoahvkDdygjmVP97meUyJ6GhhigkO/BXo+/Io78R PXTu2NSh72nh6quJ+5HIPAZFK/WIp3QWnuC41Uc1syQECJtjiM8xu+Ehk/DAo1nhw96j B9Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=0Dti0uMOrJy7nuvGztsLEk/fEAppAz8iTSEIVSs/DxQ=; b=ZXd9ec7qGp464vfga6Bi7WWvJpXbbQbfTVWEYwvPmssShM0EvJlmVvGYYY1YeoxBR3 CpclW7YShP+cgPzXwwO+WBpXlqHlUr12BTtO0H85RafQO0nHF+gdOVYhETO0atyYFpLs 7wCikMQqkRgmBOC8FBOzsWSdTvI6JVTOYGBkY3je7c166xPiVAVDMJ+nuqXBixVtlWrR F/L4rk7yq1QynndoVoZCPQp2MLGzdmwjs1r13Zwbu9jxS4FZzmGXxCycwGDQxuYO2f4r /K/s1tOwUZGtPgamPfkMAWIytRJxZnwFKv3f9oYhLPtLLJLWGrbH02hqLCG6xCZiSYJP 6CWQ== X-Gm-Message-State: AJaThX4rCvsW0OLCLl3HaOUKpHoyDQXUCns7G33rW7Dai9p7W5HQTl7V s+oX4EB9S3DfuKUQr8xK7JBgFg== X-Google-Smtp-Source: AGs4zMY92niqbzqrXRCRJ0bY2LOAIdwnSmsx4lIfT5quLPGBMTh45KDZ1G6NHhPaBWOy/G7D8O+VkA== X-Received: by 10.46.29.203 with SMTP id w72mr473073lje.171.1510247432737; Thu, 09 Nov 2017 09:10:32 -0800 (PST) Received: from otyshchenko.kyiv.epam.com (ll-53.209.223.85.sovam.net.ua. [85.223.209.53]) by smtp.gmail.com with ESMTPSA id x90sm1394299ljb.86.2017.11.09.09.10.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Nov 2017 09:10:32 -0800 (PST) From: Oleksandr Tyshchenko To: xen-devel@lists.xenproject.org Date: Thu, 9 Nov 2017 19:09:52 +0200 Message-Id: <1510247421-24094-3-git-send-email-olekstysh@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510247421-24094-1-git-send-email-olekstysh@gmail.com> References: <1510247421-24094-1-git-send-email-olekstysh@gmail.com> Cc: Stefano Stabellini , Andrew Cooper , Oleksandr Dmytryshyn , Julien Grall , Oleksandr Tyshchenko , Jan Beulich Subject: [Xen-devel] [RFC PATCH 02/31] pm: move processor_perf.h file to the xen/include/xen location X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Oleksandr Dmytryshyn Cpufreq driver should be more generalizable (not ACPI-specific). Thus this file should be placed to more convenient location. This is a rebased version of the original patch: https://lists.xen.org/archives/html/xen-devel/2014-11/msg00934.html Signed-off-by: Oleksandr Dmytryshyn Signed-off-by: Oleksandr Tyshchenko CC: Jan Beulich CC: Andrew Cooper CC: Stefano Stabellini CC: Julien Grall --- MAINTAINERS | 2 +- xen/arch/x86/platform_hypercall.c | 2 +- xen/include/acpi/cpufreq/processor_perf.h | 63 ------------------------------- xen/include/xen/cpufreq.h | 2 +- xen/include/xen/processor_perf.h | 63 +++++++++++++++++++++++++++++++ 5 files changed, 66 insertions(+), 66 deletions(-) delete mode 100644 xen/include/acpi/cpufreq/processor_perf.h create mode 100644 xen/include/xen/processor_perf.h diff --git a/MAINTAINERS b/MAINTAINERS index 524e067..9794a81 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -294,8 +294,8 @@ F: xen/arch/x86/acpi/ X: xen/arch/x86/acpi/boot.c X: xen/arch/x86/acpi/lib.c F: xen/drivers/cpufreq/ -F: xen/include/acpi/cpufreq/ F: xen/include/xen/cpufreq.h +F: xen/include/xen/processor_perf.h PUBLIC I/O INTERFACES AND PV DRIVERS DESIGNS M: Konrad Rzeszutek Wilk diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c index ebc2f39..17c8304 100644 --- a/xen/arch/x86/platform_hypercall.c +++ b/xen/arch/x86/platform_hypercall.c @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/xen/include/acpi/cpufreq/processor_perf.h b/xen/include/acpi/cpufreq/processor_perf.h deleted file mode 100644 index d8a1ba6..0000000 --- a/xen/include/acpi/cpufreq/processor_perf.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef __XEN_PROCESSOR_PM_H__ -#define __XEN_PROCESSOR_PM_H__ - -#include -#include -#include - -#define XEN_PX_INIT 0x80000000 - -int powernow_cpufreq_init(void); -unsigned int powernow_register_driver(void); -unsigned int get_measured_perf(unsigned int cpu, unsigned int flag); -void cpufreq_residency_update(unsigned int, uint8_t); -void cpufreq_statistic_update(unsigned int, uint8_t, uint8_t); -int cpufreq_statistic_init(unsigned int); -void cpufreq_statistic_exit(unsigned int); -void cpufreq_statistic_reset(unsigned int); - -int cpufreq_limit_change(unsigned int); - -int cpufreq_add_cpu(unsigned int); -int cpufreq_del_cpu(unsigned int); - -struct processor_performance { - uint32_t state; - uint32_t platform_limit; - struct xen_pct_register control_register; - struct xen_pct_register status_register; - uint32_t state_count; - struct xen_processor_px *states; - struct xen_psd_package domain_info; - uint32_t shared_type; - - uint32_t init; -}; - -struct processor_pminfo { - uint32_t acpi_id; - uint32_t id; - struct processor_performance perf; -}; - -extern struct processor_pminfo *processor_pminfo[NR_CPUS]; - -struct px_stat { - uint8_t total; /* total Px states */ - uint8_t usable; /* usable Px states */ - uint8_t last; /* last Px state */ - uint8_t cur; /* current Px state */ - uint64_t *trans_pt; /* Px transition table */ - pm_px_val_t *pt; -}; - -struct pm_px { - struct px_stat u; - uint64_t prev_state_wall; - uint64_t prev_idle_wall; -}; - -DECLARE_PER_CPU(struct pm_px *, cpufreq_statistic_data); - -int cpufreq_cpu_init(unsigned int cpuid); -#endif /* __XEN_PROCESSOR_PM_H__ */ diff --git a/xen/include/xen/cpufreq.h b/xen/include/xen/cpufreq.h index ed38a6c..30c70c9 100644 --- a/xen/include/xen/cpufreq.h +++ b/xen/include/xen/cpufreq.h @@ -21,7 +21,7 @@ #include #include -#include +#include DECLARE_PER_CPU(spinlock_t, cpufreq_statistic_lock); diff --git a/xen/include/xen/processor_perf.h b/xen/include/xen/processor_perf.h new file mode 100644 index 0000000..d8a1ba6 --- /dev/null +++ b/xen/include/xen/processor_perf.h @@ -0,0 +1,63 @@ +#ifndef __XEN_PROCESSOR_PM_H__ +#define __XEN_PROCESSOR_PM_H__ + +#include +#include +#include + +#define XEN_PX_INIT 0x80000000 + +int powernow_cpufreq_init(void); +unsigned int powernow_register_driver(void); +unsigned int get_measured_perf(unsigned int cpu, unsigned int flag); +void cpufreq_residency_update(unsigned int, uint8_t); +void cpufreq_statistic_update(unsigned int, uint8_t, uint8_t); +int cpufreq_statistic_init(unsigned int); +void cpufreq_statistic_exit(unsigned int); +void cpufreq_statistic_reset(unsigned int); + +int cpufreq_limit_change(unsigned int); + +int cpufreq_add_cpu(unsigned int); +int cpufreq_del_cpu(unsigned int); + +struct processor_performance { + uint32_t state; + uint32_t platform_limit; + struct xen_pct_register control_register; + struct xen_pct_register status_register; + uint32_t state_count; + struct xen_processor_px *states; + struct xen_psd_package domain_info; + uint32_t shared_type; + + uint32_t init; +}; + +struct processor_pminfo { + uint32_t acpi_id; + uint32_t id; + struct processor_performance perf; +}; + +extern struct processor_pminfo *processor_pminfo[NR_CPUS]; + +struct px_stat { + uint8_t total; /* total Px states */ + uint8_t usable; /* usable Px states */ + uint8_t last; /* last Px state */ + uint8_t cur; /* current Px state */ + uint64_t *trans_pt; /* Px transition table */ + pm_px_val_t *pt; +}; + +struct pm_px { + struct px_stat u; + uint64_t prev_state_wall; + uint64_t prev_idle_wall; +}; + +DECLARE_PER_CPU(struct pm_px *, cpufreq_statistic_data); + +int cpufreq_cpu_init(unsigned int cpuid); +#endif /* __XEN_PROCESSOR_PM_H__ */