From patchwork Fri Oct 13 08:40:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yi Sun X-Patchwork-Id: 10003803 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 CCEEC60216 for ; Fri, 13 Oct 2017 09:04:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C226E29009 for ; Fri, 13 Oct 2017 09:04:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B6DE32900D; Fri, 13 Oct 2017 09:04:13 +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 3879F29009 for ; Fri, 13 Oct 2017 09:04:13 +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 1e2vr7-0001q6-Q2; Fri, 13 Oct 2017 09:02:09 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2vr7-0001pF-5h for xen-devel@lists.xenproject.org; Fri, 13 Oct 2017 09:02:09 +0000 Received: from [193.109.254.147] by server-8.bemta-6.messagelabs.com id 4F/26-13910-01180E95; Fri, 13 Oct 2017 09:02:08 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrAIsWRWlGSWpSXmKPExsVywNwkVleg8UG kwa/H7Bbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8buHVuZClr4Kn7Nrm9gXM/dxcjFISQwjVFi 9vmlLF2MnBwSArwSR5bNYIWwAyS6u+6B2UICDYwSl38FgdhsAuoSj7/2MIHYIgJKEvdWTWYCG cQs8JtRYueDfWwgCWEBF4l1ZxqYQWwWAVWJx0fvgcV5BTwkDhxaArVMTuLksclgCzgFPCW6mj YyQyzzkNj8ZTJUvaDEyZlPgOo5gBaoS6yfJwQSZhaQl2jeOpt5AqPALCRVsxCqZiGpWsDIvIp Rozi1qCy1SNfYWC+pKDM9oyQ3MTNH19DATC83tbg4MT01JzGpWC85P3cTIzA0GYBgB+PO9YGH GCU5mJREedUiH0QK8SXlp1RmJBZnxBeV5qQWH2KU4eBQkuD1aQDKCRalpqdWpGXmAKMEJi3Bw aMkwqsJkuYtLkjMLc5Mh0idYtTl6Lh59w+TEEtefl6qlDivBUiRAEhRRmke3AhYxF5ilJUS5m UEOkqIpyC1KDezBFX+FaM4B6OSMO+feqApPJl5JXCbXgEdwQR0xLsIsCNKEhFSUg2MFmptfmd F8/Xlky7EZF7VXfso/vbjhP2Tmx9sXento/6v6V327JSkoFSFX+xx88y2lvUYPfBbHDtjzWqD AmMDT9bsP9y3V6rsiWH0svxpU/QqO0xvo5rapSezuQL9yve5mD74OrFks7CmYKLa5PM6YivOn t+ySIKrZX7sfv3nmXFiD16J3dynxFKckWioxVxUnAgAgMTXiNMCAAA= X-Env-Sender: yi.y.sun@linux.intel.com X-Msg-Ref: server-6.tower-27.messagelabs.com!1507885322!111673941!4 X-Originating-IP: [192.55.52.93] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjkzID0+IDMyNDY2NQ==\n X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 9483 invoked from network); 13 Oct 2017 09:02:07 -0000 Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93) by server-6.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 13 Oct 2017 09:02:07 -0000 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Oct 2017 02:02:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.43,370,1503385200"; d="scan'208"; a="1024784888" Received: from vmmmba-s2600wft.bj.intel.com ([10.240.193.75]) by orsmga003.jf.intel.com with ESMTP; 13 Oct 2017 02:02:05 -0700 From: Yi Sun To: xen-devel@lists.xenproject.org Date: Fri, 13 Oct 2017 16:40:59 +0800 Message-Id: <1507884068-18757-8-git-send-email-yi.y.sun@linux.intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1507884068-18757-1-git-send-email-yi.y.sun@linux.intel.com> References: <1507884068-18757-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 v7 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: Jan Beulich CC: Wei Liu CC: Roger Pau Monné 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 ae06627..ffb038c 100644 --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -1491,6 +1491,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; + #undef domctl_psr_get_val default: diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h index c099334..e8f4c4c 100644 --- a/xen/include/public/domctl.h +++ b/xen/include/public/domctl.h @@ -1069,6 +1069,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 */