From patchwork Sat Sep 23 09:48:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yi Sun X-Patchwork-Id: 9967429 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 31CCF602D8 for ; Sat, 23 Sep 2017 10:10:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20EE628F6A for ; Sat, 23 Sep 2017 10:10:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 158FB29895; Sat, 23 Sep 2017 10:10:33 +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.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED 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 915A428F6A for ; Sat, 23 Sep 2017 10:10:32 +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 1dvhMI-0004e1-OT; Sat, 23 Sep 2017 10:08:26 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvhMH-0004cs-QZ for xen-devel@lists.xenproject.org; Sat, 23 Sep 2017 10:08:25 +0000 Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id B2/FD-02229-99236C95; Sat, 23 Sep 2017 10:08:25 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrAIsWRWlGSWpSXmKPExsXS1tYhrzvD6Fi kQddERYvvWyYzOTB6HP5whSWAMYo1My8pvyKBNWPZtYiCR7wVB1a9YWxgvMHVxcjJISRQIXHo +WF2EFtCgFfiyLIZrBC2v8TfGffYuhi5gGoaGCUWtnWAFbEJqEs8/trDBGKLCChJ3Fs1mQmki FngN6PEqS2HwBLCAi4SbZOvM4PYLAKqEus3zAGbyivgLnHt1EQWiA1yEiePTQaLcwp4SDTfOM ECcZG7xN+bT5kh6gUlTs58AhTnAFqgLrF+nhBImFlAXqJ562zmCYwCs5BUzUKomoWkagEj8yp GjeLUorLUIl0jU72kosz0jJLcxMwcXUMDY73c1OLixPTUnMSkYr3k/NxNjMDQrGdgYNzB2HrC 7xCjJAeTkihvjdaxSCG+pPyUyozE4oz4otKc1OJDjDIcHEoSvHcMgHKCRanpqRVpmTnAKIFJS 3DwKInwpoOkeYsLEnOLM9MhUqcYdTk6bt79wyTEkpeflyolzrvXEKhIAKQoozQPbgQsYi8xyk oJ8zIyMDAI8RSkFuVmlqDKv2IU52BUEuYtA1nFk5lXArfpFdARTEBHlK8+AnJESSJCSqqBMb8 q6ILR//k5W6oPlKnpHDnS/lf3UcUpFk3mhr2a+TW23O/fnWip/PW25/3Wh9+fuSscPFb2tK1z TdrW5y3h4XMOq0/VeRH328v6tL3grb0Felvalk/ef/fLuiOFl2dyGS698Pasrl0L56IbOR+Ns 3lm9N64dTFz4Y7mqd2bd+6vmOxV6i167ooSS3FGoqEWc1FxIgANc/jH0wIAAA== X-Env-Sender: yi.y.sun@linux.intel.com X-Msg-Ref: server-5.tower-31.messagelabs.com!1506161302!112929073!1 X-Originating-IP: [134.134.136.31] 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 28336 invoked from network); 23 Sep 2017 10:08:24 -0000 Received: from mga06.intel.com (HELO mga06.intel.com) (134.134.136.31) by server-5.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 23 Sep 2017 10:08:24 -0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP; 23 Sep 2017 03:08:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,429,1500966000"; d="scan'208";a="138601216" Received: from vmmmba-s2600wft.bj.intel.com ([10.240.193.75]) by orsmga002.jf.intel.com with ESMTP; 23 Sep 2017 03:08:19 -0700 From: Yi Sun To: xen-devel@lists.xenproject.org Date: Sat, 23 Sep 2017 17:48:15 +0800 Message-Id: <1506160104-5890-7-git-send-email-yi.y.sun@linux.intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1506160104-5890-1-git-send-email-yi.y.sun@linux.intel.com> References: <1506160104-5890-1-git-send-email-yi.y.sun@linux.intel.com> MIME-Version: 1.0 Cc: Wei Liu , Yi Sun , Andrew Cooper , Jan Beulich , Chao Peng , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [Xen-devel] [PATCH v4 06/15] x86: implement get value interface for MBA 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: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP This patch implements get value domctl interface for MBA. Signed-off-by: Yi Sun Reviewed-by: Roger Pau Monné Acked-by: Jan Beulich --- CC: Jan Beulich CC: Andrew Cooper CC: Wei Liu CC: Roger Pau Monné CC: Chao Peng v4: - remove 'ALLOC_' from macro names. (suggested by Roger Pau Monné) v3: - change 'PSR_VAL_TYPE_MBA' to 'PSR_TYPE_MBA_THRTL'. (suggested by Roger Pau Monné) --- xen/arch/x86/domctl.c | 7 +++++++ xen/include/public/domctl.h | 1 + 2 files changed, 8 insertions(+) diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c index 18cae88..22650d7 100644 --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -1496,6 +1496,13 @@ long arch_do_domctl( copyback = true; break; + case XEN_DOMCTL_PSR_GET_MBA_THRTL: + ret = psr_get_val(d, domctl->u.psr_alloc.target, + &val32, PSR_TYPE_MBA_THRTL); + domctl->u.psr_alloc.data = val32; + copyback = true; + break; + default: ret = -EOPNOTSUPP; break; diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h index 0c6f6ae..ec6d2de 100644 --- a/xen/include/public/domctl.h +++ b/xen/include/public/domctl.h @@ -1156,6 +1156,7 @@ struct xen_domctl_psr_alloc { #define XEN_DOMCTL_PSR_GET_L3_DATA 5 #define XEN_DOMCTL_PSR_SET_L2_CBM 6 #define XEN_DOMCTL_PSR_GET_L2_CBM 7 +#define XEN_DOMCTL_PSR_GET_MBA_THRTL 9 uint32_t cmd; /* IN: XEN_DOMCTL_PSR_* */ uint32_t target; /* IN */ uint64_t data; /* IN/OUT */