From patchwork Sat Sep 30 01:39:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yi Sun X-Patchwork-Id: 9979023 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 A7B9F60311 for ; Sat, 30 Sep 2017 02:01:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 95FE1298AA for ; Sat, 30 Sep 2017 02:01:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8AE20298C5; Sat, 30 Sep 2017 02:01:43 +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 38FE1298AA for ; Sat, 30 Sep 2017 02:01:43 +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 1dy73s-0004UE-Eg; Sat, 30 Sep 2017 01:59:24 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dy73q-0004R3-JT for xen-devel@lists.xenproject.org; Sat, 30 Sep 2017 01:59:22 +0000 Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id B3/23-02048-97AFEC95; Sat, 30 Sep 2017 01:59:21 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrLIsWRWlGSWpSXmKPExsXS1taRolv561y kwaQr3Bbft0xmcmD0OPzhCksAYxRrZl5SfkUCa0bLJJ+C07wVrzeaNTA+4+pi5OQQEqiQ+LC3 nRnElhDglTiybAYrhB0gMW/fFvYuRi6gmgZGia+bJoEl2ATUJR5/7WECsUUElCTurZrMBFLEL DCbUeLWopWMXYwcHMICLhJ/JluD1LAIqEo0dSwFq+cVcJd49OM8O8QCOYmTxyaDzeQU8JC41t PEBnGQu8SVlrWMEPWCEidnPmEBGckMtHf9PCGQMLOAvETz1tnMExgFZiGpmoVQNQtJ1QJG5lW M6sWpRWWpRbrGeklFmekZJbmJmTm6hgbGermpxcWJ6ak5iUnFesn5uZsYgUHJAAQ7GJu/OB1i lORgUhLl3f3zXKQQX1J+SmVGYnFGfFFpTmrxIUYZDg4lCd4IkJxgUWp6akVaZg4wPmDSEhw8S iK8tiBp3uKCxNzizHSI1ClGXY6Om3f/MAmx5OXnpUqJ8xaAFAmAFGWU5sGNgMXqJUZZKWFeRq CjhHgKUotyM0tQ5V8xinMwKgnzuoNM4cnMK4Hb9AroCCagIyZPPANyREkiQkqqgdHweuLZ3EP K27JXaeXkpat6b2T+XRf9nmPzfY8nLy2Y95qq5nasehXL43hofnt1P9Pk3uCClg0LXE4Xqi+f 8CJFoeiASvCDXX76JV+vV89ZdIf1d+KrqQFBrterxDn2ubBvCyxceTBmw+2P7cHRggsffji6v dzCcubDf0cVgg+FzWS5Wm3qv1qJpTgj0VCLuag4EQDYprf50AIAAA== X-Env-Sender: yi.y.sun@linux.intel.com X-Msg-Ref: server-9.tower-31.messagelabs.com!1506736754!61764479!3 X-Originating-IP: [134.134.136.100] 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 30283 invoked from network); 30 Sep 2017 01:59:20 -0000 Received: from mga07.intel.com (HELO mga07.intel.com) (134.134.136.100) by server-9.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 30 Sep 2017 01:59:20 -0000 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP; 29 Sep 2017 18:59:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.42,455,1500966000"; d="scan'208"; a="1020039044" Received: from vmmmba-s2600wft.bj.intel.com ([10.240.193.75]) by orsmga003.jf.intel.com with ESMTP; 29 Sep 2017 18:59:18 -0700 From: Yi Sun To: xen-devel@lists.xenproject.org Date: Sat, 30 Sep 2017 09:39:17 +0800 Message-Id: <1506735566-5706-8-git-send-email-yi.y.sun@linux.intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1506735566-5706-1-git-send-email-yi.y.sun@linux.intel.com> References: <1506735566-5706-1-git-send-email-yi.y.sun@linux.intel.com> MIME-Version: 1.0 Cc: Andrew Cooper , Yi Sun , Wei Liu , Chao Peng Subject: [Xen-devel] [PATCH v5 07/16] 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: Andrew Cooper CC: Wei Liu CC: Chao Peng v5: - use newly defined macro to get MBA thrtl. (suggested by Roger Pau Monné) 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 | 4 ++++ xen/include/public/domctl.h | 1 + 2 files changed, 5 insertions(+) diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c index cc09f7d..5fb443f 100644 --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -1492,6 +1492,10 @@ long arch_do_domctl( ret = domctl_psr_get_val(d, domctl, PSR_TYPE_L2_CBM, copyback); break; + case XEN_DOMCTL_PSR_GET_MBA_THRTL: + ret = domctl_psr_get_val(d, domctl, PSR_TYPE_MBA_THRTL, copyback); + break; + default: ret = -EOPNOTSUPP; break; diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h index 6ed3c53..1231d37 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 */