From patchwork Wed May 3 08:44:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yi Sun X-Patchwork-Id: 9708997 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 2682C6021C for ; Wed, 3 May 2017 08:56:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 09BEF28602 for ; Wed, 3 May 2017 08:56:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F292928606; Wed, 3 May 2017 08:55:59 +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 A0DDB28602 for ; Wed, 3 May 2017 08:55:59 +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 1d5q3K-00016g-Nk; Wed, 03 May 2017 08:54:30 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5q3K-00015H-37 for xen-devel@lists.xenproject.org; Wed, 03 May 2017 08:54:30 +0000 Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id 67/D6-02022-5CA99095; Wed, 03 May 2017 08:54:29 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrPLMWRWlGSWpSXmKPExsXS1tYhoXtkFme kwZw5uhbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8bLzyfYC77yVVyfco2xgXE+dxcjF4eQwHRG iQtvV7J0MXJySAjwShxZNoMVwvaX+NF8lgWiqIFRYu3/TiaQBJuAusTjrz1gtoiAksS9VZOZQ IqYBXYySaw7/Z0ZJCEs4Cix8OkDMJtFQFViw+zbYDavgKfEq/U7obbJSZw8NhlsGydQ/PmXje wgtpCAh8ShZ++ZJjDyLmBkWMWoXpxaVJZapGusl1SUmZ5RkpuYmaNraGCql5taXJyYnpqTmFS sl5yfu4kRGBAMQLCDce8/p0OMkhxMSqK86q/YI4X4kvJTKjMSizPii0pzUosPMcpwcChJ8D6c yRkpJFiUmp5akZaZAwxNmLQEB4+SCG8XSJq3uCAxtzgzHSJ1ilFRSpx3OkhCACSRUZoH1waLh 0uMslLCvIxAhwjxFKQW5WaWoMq/YhTnYFQS5k0GmcKTmVcCN/0V0GImoMXNshwgi0sSEVJSDY xWFmE7n95nOGkcxneyxoMp6Xao1errdUbsM5Q1f/F5foyaJv9QU9iH24Pt4LUmvuU/7Vvd7j+ 9fY3BfAFXcdNF1tKOgyuelrzq1g4v3KX84kPX91vmVxfyGq4zf/c7ak6E/XNdg3TBfovVu+Yq r/0a/yBzSYd+0blz21znLrQPuySn83FDh74SS3FGoqEWc1FxIgAoAMwxggIAAA== X-Env-Sender: yi.y.sun@linux.intel.com X-Msg-Ref: server-2.tower-206.messagelabs.com!1493801620!75519330!19 X-Originating-IP: [134.134.136.24] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzkwOTcx\n X-StarScan-Received: X-StarScan-Version: 9.4.12; banners=-,-,- X-VirusChecked: Checked Received: (qmail 15327 invoked from network); 3 May 2017 08:54:28 -0000 Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24) by server-2.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 3 May 2017 08:54:28 -0000 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 May 2017 01:54:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,283,1491289200"; d="scan'208";a="852347687" Received: from vmmmba-s2600wft.bj.intel.com ([10.240.193.39]) by FMSMGA003.fm.intel.com with ESMTP; 03 May 2017 01:54:25 -0700 From: Yi Sun To: xen-devel@lists.xenproject.org Date: Wed, 3 May 2017 16:44:18 +0800 Message-Id: <1493801063-38513-19-git-send-email-yi.y.sun@linux.intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1493801063-38513-1-git-send-email-yi.y.sun@linux.intel.com> References: <1493801063-38513-1-git-send-email-yi.y.sun@linux.intel.com> Cc: kevin.tian@intel.com, wei.liu2@citrix.com, andrew.cooper3@citrix.com, dario.faggioli@citrix.com, he.chen@linux.intel.com, ian.jackson@eu.citrix.com, Yi Sun , mengxu@cis.upenn.edu, jbeulich@suse.com, chao.p.peng@linux.intel.com, roger.pau@citrix.com Subject: [Xen-devel] [PATCH v11 18/23] x86: L2 CAT: implement get value flow. 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 implements L2 CAT get value interface in domctl. Signed-off-by: Yi Sun Reviewed-by: Jan Beulich --- v11: - remove "get_val' assignment because it has been replaced by generic codes. (suggested by Jan Beulich) v10: - remove cast in domctl. (suggested by Jan Beulich) v9: - reuse 'cat_get_val' for L2 CAT to reduce redundant codes (suggested by Roger Pau) - changes about 'uint64_t' to 'uint32_t'. (suggested by Jan Beulich) v5: - remove type check in callback function. (suggested by Jan Beulich) v4: - create this patch because of codes architecture change. (suggested by Jan Beulich) --- 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 124a1c6..2970118 100644 --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -1449,6 +1449,13 @@ long arch_do_domctl( copyback = 1; break; + case XEN_DOMCTL_PSR_CAT_OP_GET_L2_CBM: + ret = psr_get_val(d, domctl->u.psr_cat_op.target, + &val32, PSR_CBM_TYPE_L2); + domctl->u.psr_cat_op.data = val32; + copyback = 1; + break; + default: ret = -EOPNOTSUPP; break; diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h index 9e3ce21..16c08c0 100644 --- a/xen/include/public/domctl.h +++ b/xen/include/public/domctl.h @@ -1132,6 +1132,7 @@ 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_GET_L2_CBM 7 uint32_t cmd; /* IN: XEN_DOMCTL_PSR_CAT_OP_* */ uint32_t target; /* IN */ uint64_t data; /* IN/OUT */