From patchwork Thu Nov 9 17:09:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksandr Tyshchenko X-Patchwork-Id: 10051373 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 31BFE60381 for ; Thu, 9 Nov 2017 17:13:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1936F2B03A for ; Thu, 9 Nov 2017 17:13:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0DFA72B04E; Thu, 9 Nov 2017 17:13:27 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, 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 32C0F2B03A for ; Thu, 9 Nov 2017 17:13:26 +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 1eCqLg-00040f-Vi; Thu, 09 Nov 2017 17:10:40 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eCqLf-0003yY-45 for xen-devel@lists.xenproject.org; Thu, 09 Nov 2017 17:10:39 +0000 Received: from [85.158.143.35] by server-11.bemta-6.messagelabs.com id 5E/0E-20813-E0C840A5; Thu, 09 Nov 2017 17:10:38 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrCIsWRWlGSWpSXmKPExsVyMfS6sy5vD0u UQXuvucX3LZOZHBg9Dn+4whLAGMWamZeUX5HAmvF77SyWgsfiFe8nTWdsYGwS6WLk4hASmMEo 0fbwHTuIwyLwkkXi3pz3jCCOhEA/q8Tym2eBHA4gJ0vi2huHLkZOIDNN4uaxP8wQ4XKJhhfVI GEhASWJ1zs3M0EMnc0ksXj7UyaQBJuAgcT+d0/YQWwRoKJ7qyaDFTGDFN3f8xEsISzgLbGw5z AbiM0ioCqxZHE3K4jNK+AscWnLPEaIxXISN891MoPYnAIuEm8+XmeD2OwscfH1cbYJjIILGBl WMWoUpxaVpRbpGpnqJRVlpmeU5CZm5ugaGpjp5aYWFyemp+YkJhXrJefnbmIEhhwDEOxgXLUg 8BCjJAeTkiivlCVLlBBfUn5KZUZicUZ8UWlOavEhRhkODiUJ3rtdQDnBotT01Iq0zBxg8MOkJ Th4lER434GkeYsLEnOLM9MhUqcYXTku3Ln0h4nj2KbLQPLAnltA8tnM1w3MHNOutjYxC7Hk5e elSonzWnUDNQuANGeU5sGNhkXuJUZZKWFeRqBjhXgKUotyM0tQ5V8xinMwKgnzbgc5gSczrwT ugldAxzEBHRfNDnZcSSJCSqqBkX/KzJeMUWwKHa8P/eCyFktWWXNhxpb+INVT0xoXXpLYuKLE LVXbk8n+zfJ225+dN84e2DtBdeZtvgQtwfjTvbt42ZIO8i356Ni0TZdvcUrVQd+u5rJgT7OWv FyPeV6/LKT8mX7bbZNjrbSa8Gt1iPzpAzN/i89NslQN7hEKe8zxVrG488ZGJZbijERDLeai4k QAftSErtcCAAA= X-Env-Sender: olekstysh@gmail.com X-Msg-Ref: server-7.tower-21.messagelabs.com!1510247437!81338345!1 X-Originating-IP: [209.85.215.67] 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 64255 invoked from network); 9 Nov 2017 17:10:37 -0000 Received: from mail-lf0-f67.google.com (HELO mail-lf0-f67.google.com) (209.85.215.67) by server-7.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 9 Nov 2017 17:10:37 -0000 Received: by mail-lf0-f67.google.com with SMTP id l23so8033621lfk.10 for ; Thu, 09 Nov 2017 09:10:37 -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=y/fxIY0AQRv/txCvjzhCdeWSMoRH4IzSygJPiwSq/ME=; b=jE/NLoLrDt4eiRkGDxPPOxczD0Y2wb3r9R2+xocQwwrIagUeLtCEbyvvLk1dq0CYla 5SNMWvRp0GwaYxR0EehGc5Hom+ITuznJJpXdZgPtv2SwFbDNVzJeALlqIY/aJOPEB7r8 t54VkWerIAEM8prtpXK/rrON9sOk4BNC8TZVD1BUSuxR+02u1B0/JVxRZQAymesnmxYQ C6Tm8YpFw/f1q2A/NiGxNGnSP09vwqqUuQudjykdG8izqRhNLOUAejHzEf24YhkvOE1U wBBKFGYQXuXxRb2C7LdkV23E7lmh5UAr2K7V12uSy10ma5Vc+5s0zH+/IamvFyaCI4Hj BhyQ== 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=y/fxIY0AQRv/txCvjzhCdeWSMoRH4IzSygJPiwSq/ME=; b=gN3fWIhg3ReiYhB/CqZDm2PYdEaATV2oq4IbZ9QAnfVHv2nngqYCSdrYBGquqedNcy u33jenlNNM6p8FDvkLOufG9SIpWu58O1gXKE4WNcJTjSJigULfyCbLYzhwDRuf8hQ1Br MuaWmdaISfOeKvTz4iw2mNf8a/vCGxG34d2GvgvGWvq5HUyolQhNGfgu9RKz4nkBGs8H 03sH1Fp24zXklUgLLals4X3Z8+tRDlTB0jwYbxhKxBDde90mKe8WR1u/Dq0ncNw23bQU JRzYwesNvl5KXAj1YRVV0KvuXMkZFHr7drz1NnUOwzJONp18qu16WxcaGsSVHO6lPWxb J5Pg== X-Gm-Message-State: AJaThX7EbmE3lYJU/kahN3jWabBAV0jVbYucbZTfrZs/hHkQaYJkFCVH MEk6Ze5e42hhJnWwTpw/8/g07A== X-Google-Smtp-Source: AGs4zMYZfGuCEFbR12Y7vavH/H+QYQdkTtij4WrF09G6mFQKUJB0+wpo99dc2PlXb/dkHKOR/jxNIg== X-Received: by 10.25.143.78 with SMTP id r75mr470693lfd.85.1510247436972; Thu, 09 Nov 2017 09:10:36 -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.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Nov 2017 09:10:36 -0800 (PST) From: Oleksandr Tyshchenko To: xen-devel@lists.xenproject.org Date: Thu, 9 Nov 2017 19:09:55 +0200 Message-Id: <1510247421-24094-6-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 05/31] pmstat: make pmstat functions more generalizable 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 ACPI-specific parts are moved under appropriate ifdefs. Now pmstat functions can be used in ARM platform. This is a rebased version of the original patch: https://lists.xen.org/archives/html/xen-devel/2014-11/msg00941.html Signed-off-by: Oleksandr Dmytryshyn Signed-off-by: Oleksandr Tyshchenko CC: Jan Beulich CC: Andrew Cooper CC: Stefano Stabellini CC: Julien Grall --- xen/drivers/pm/stat.c | 8 +++++++- xen/include/xen/pmstat.h | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/xen/drivers/pm/stat.c b/xen/drivers/pm/stat.c index 133e64d..986ba41 100644 --- a/xen/drivers/pm/stat.c +++ b/xen/drivers/pm/stat.c @@ -35,7 +35,6 @@ #include #include #include -#include #include #include @@ -132,6 +131,8 @@ int do_get_pm_info(struct xen_sysctl_get_pmstat *op) break; } +/* For now those operations can be used only when ACPI is enabled */ +#ifdef CONFIG_ACPI case PMSTAT_get_max_cx: { op->u.getcx.nr = pmstat_get_cx_nr(op->cpuid); @@ -150,6 +151,7 @@ int do_get_pm_info(struct xen_sysctl_get_pmstat *op) ret = pmstat_reset_cx_stat(op->cpuid); break; } +#endif /* CONFIG_ACPI */ default: printk("not defined sub-hypercall @ do_get_pm_info\n"); @@ -465,6 +467,7 @@ int do_pm_op(struct xen_sysctl_pm_op *op) break; } +#ifdef CONFIG_ACPI case XEN_SYSCTL_pm_op_get_max_cstate: { op->u.get_max_cstate = acpi_get_cstate_limit(); @@ -476,6 +479,7 @@ int do_pm_op(struct xen_sysctl_pm_op *op) acpi_set_cstate_limit(op->u.set_max_cstate); break; } +#endif /* CONFIG_ACPI */ #ifdef CONFIG_HAS_CPU_TURBO case XEN_SYSCTL_pm_op_enable_turbo: @@ -500,6 +504,7 @@ int do_pm_op(struct xen_sysctl_pm_op *op) return ret; } +#ifdef CONFIG_ACPI int acpi_set_pdc_bits(u32 acpi_id, XEN_GUEST_HANDLE_PARAM(uint32) pdc) { u32 bits[3]; @@ -530,3 +535,4 @@ int acpi_set_pdc_bits(u32 acpi_id, XEN_GUEST_HANDLE_PARAM(uint32) pdc) return ret; } +#endif /* CONFIG_ACPI */ diff --git a/xen/include/xen/pmstat.h b/xen/include/xen/pmstat.h index 266bc16..a870c8a 100644 --- a/xen/include/xen/pmstat.h +++ b/xen/include/xen/pmstat.h @@ -6,10 +6,12 @@ #include /* for struct pm_cx_stat */ int set_px_pminfo(uint32_t cpu, struct xen_processor_performance *perf); +#ifdef CONFIG_ACPI long set_cx_pminfo(uint32_t cpu, 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); +#endif int do_get_pm_info(struct xen_sysctl_get_pmstat *op); int do_pm_op(struct xen_sysctl_pm_op *op);