From patchwork Tue Oct 25 03:41:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yi Sun X-Patchwork-Id: 9393907 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 6420B60762 for ; Tue, 25 Oct 2016 02:37:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5854E29282 for ; Tue, 25 Oct 2016 02:37:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A1D92927D; Tue, 25 Oct 2016 02:37:01 +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 E14132927D for ; Tue, 25 Oct 2016 02:37:00 +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 1byrZC-0004ga-TT; Tue, 25 Oct 2016 02:34:18 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1byrZC-0004fC-3m for xen-devel@lists.xenproject.org; Tue, 25 Oct 2016 02:34:18 +0000 Received: from [193.109.254.147] by server-11.bemta-6.messagelabs.com id CB/2C-08498-9A4CE085; Tue, 25 Oct 2016 02:34:17 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrHLMWRWlGSWpSXmKPExsVywNykWHfFEb4 Ig/fb1Cy+b5nM5MDocfjDFZYAxijWzLyk/IoE1oyGt39ZClbwVix79pe1gfEhZxcjJ4eQQIXE wxen2UFsCQFeiSPLZrB2MXIA2QES05aLdTFyAZU0MErMONbHBlLDJqAu8fhrDxOILSKgJHFv1 WQmkCJmgf2MEr9ePmYBSQgL2Et8+rADzGYRUJWYfvc5WAOvgIdE16mzzBDL5CROHpvMCmJzAs Xv7D3ODnGQu0RfQxPjBEbeBYwMqxg1ilOLylKLdA3N9ZKKMtMzSnITM3N0DQ3M9HJTi4sT01N zEpOK9ZLzczcxAsOBAQh2MN7eGHCIUZKDSUmUd+YmvgghvqT8lMqMxOKM+KLSnNTiQ4wyHBxK ErzrDwPlBItS01Mr0jJzgIEJk5bg4FES4X0CkuYtLkjMLc5Mh0idYlSUEuddBJIQAElklObBt cGi4RKjrJQwLyPQIUI8BalFuZklqPKvGMU5GJWEeV+ATOHJzCuBm/4KaDET0GLBeB6QxSWJCC mpBkaB6FsbolZHXuLeVWtRrbL8c1Fv/GJl7ryABEMejrbs/VoT+vr8ymJXr9gww5Jvq855L22 zslLlqraTHx6le+61u/575qTvDXN3HSz83c18OHjrfhu/9An3lXlON05csy/13Mr3T/ffCq28 lp3TMiv42aW3AZHdkv158zK7lWcYGK1fn3Zgm7wSS3FGoqEWc1FxIgCUaMg4gQIAAA== X-Env-Sender: yi.y.sun@linux.intel.com X-Msg-Ref: server-14.tower-27.messagelabs.com!1477362814!54875270!14 X-Originating-IP: [192.55.52.115] X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50 X-StarScan-Received: X-StarScan-Version: 9.0.13; banners=-,-,- X-VirusChecked: Checked Received: (qmail 64978 invoked from network); 25 Oct 2016 02:34:16 -0000 Received: from mga14.intel.com (HELO mga14.intel.com) (192.55.52.115) by server-14.tower-27.messagelabs.com with DHE-RSA-CAMELLIA256-SHA encrypted SMTP; 25 Oct 2016 02:34:16 -0000 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 24 Oct 2016 19:34:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.31,544,1473145200"; d="scan'208"; a="1049570245" Received: from vmmmba-s2600wft.bj.intel.com ([10.240.193.60]) by orsmga001.jf.intel.com with ESMTP; 24 Oct 2016 19:34:14 -0700 From: Yi Sun To: xen-devel@lists.xenproject.org Date: Tue, 25 Oct 2016 11:41:01 +0800 Message-Id: <1477366863-5246-14-git-send-email-yi.y.sun@linux.intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1477366863-5246-1-git-send-email-yi.y.sun@linux.intel.com> References: <1477366863-5246-1-git-send-email-yi.y.sun@linux.intel.com> Cc: wei.liu2@citrix.com, he.chen@linux.intel.com, andrew.cooper3@citrix.com, ian.jackson@eu.citrix.com, Yi Sun , jbeulich@suse.com, chao.p.peng@linux.intel.com Subject: [Xen-devel] [PATCH v3 13/15] x86: Add L2 CAT interfaces in domctl. 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 This patch adds L2 CAT interfaces to get/set CBM in domctl. Signed-off-by: He Chen Signed-off-by: Yi Sun --- xen/arch/x86/domctl.c | 13 +++++++++++++ xen/include/public/domctl.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c index 8e5502a..81f05d7 100644 --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -1424,6 +1424,19 @@ long arch_do_domctl( copyback = 1; break; + case XEN_DOMCTL_PSR_CAT_OP_SET_L2_CBM: + ret = psr_set_val(d, domctl->u.psr_cat_op.target, + domctl->u.psr_cat_op.data, + PSR_CBM_TYPE_L2); + break; + + case XEN_DOMCTL_PSR_CAT_OP_GET_L2_CBM: + ret = psr_get_val(d, domctl->u.psr_cat_op.target, + &domctl->u.psr_cat_op.data, + PSR_CBM_TYPE_L2); + copyback = 1; + break; + default: ret = -EOPNOTSUPP; break; diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h index 177319d..17c4ab4 100644 --- a/xen/include/public/domctl.h +++ b/xen/include/public/domctl.h @@ -1137,6 +1137,8 @@ struct xen_domctl_psr_cat_op { #define XEN_DOMCTL_PSR_CAT_OP_SET_L3_DATA 3 #define XEN_DOMCTL_PSR_CAT_OP_GET_L3_CODE 4 #define XEN_DOMCTL_PSR_CAT_OP_GET_L3_DATA 5 +#define XEN_DOMCTL_PSR_CAT_OP_SET_L2_CBM 6 +#define XEN_DOMCTL_PSR_CAT_OP_GET_L2_CBM 7 uint32_t cmd; /* IN: XEN_DOMCTL_PSR_CAT_OP_* */ uint32_t target; /* IN */ uint64_t data; /* IN/OUT */