From patchwork Thu Jul 6 01:53:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yi Sun X-Patchwork-Id: 9827427 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 E256C602BD for ; Thu, 6 Jul 2017 02:08:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D1639285C7 for ; Thu, 6 Jul 2017 02:08:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C4D23285C9; Thu, 6 Jul 2017 02:08:58 +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 5BC1F285C7 for ; Thu, 6 Jul 2017 02:08:58 +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 1dSwCX-0001Bt-H3; Thu, 06 Jul 2017 02:07:29 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dSwCW-0000zm-8H for xen-devel@lists.xenproject.org; Thu, 06 Jul 2017 02:07:28 +0000 Received: from [193.109.254.147] by server-10.bemta-6.messagelabs.com id CF/74-03582-06B9D595; Thu, 06 Jul 2017 02:07:28 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrFLMWRWlGSWpSXmKPExsXS1tYhrxs/Ozb SYMIvJYvvWyYzOTB6HP5whSWAMYo1My8pvyKBNePu00aWgkX8FUt2XWVtYDzB3cXIySEkUCnx ZdsbZhBbQoBX4siyGawQdoDE5107gWwuoJoGRoltDWvZQRJsAuoSj7/2MIHYIgJKEvdWTWYCK WIWmM8k8fr8A7BJwgKOEu92bwRrYBFQlTiyfg5LFyMHB6+Ap8T0tf4QC+QkTh6bDLaMEyh85G ozO8RBHhIb218zTWDkXcDIsIpRozi1qCy1SNfQUi+pKDM9oyQ3MTNH19DATC83tbg4MT01JzG pWC85P3cTIzAcGIBgB+OPZQGHGCU5mJREef/ox0YK8SXlp1RmJBZnxBeV5qQWH2KU4eBQkuDV mQWUEyxKTU+tSMvMAQYmTFqCg0dJhHe1MFCat7ggMbc4Mx0idYpRl+PVhP/fmIRY8vLzUqXEe e1BZgiAFGWU5sGNgEXJJUZZKWFeRqCjhHgKUotyM0tQ5V8xinMwKgnzBoNM4cnMK4Hb9AroCC agIxQbY0COKElESEk1MDrEZ//KnR8zrZ7T80PI0vOHzk49Ma/EYMJRRT2tYqEfvlNSGF3kH8z /ZPKIy+r+D8dZO2rCxC2PXwgV7HvOzv2j6EAhG1u94C7X+9Xe6w88dbTK1RObXSjKU2XQUH5f YEUrY8lr8+L+06V3XQyz2KZOzSrJepsUsWjfa/9nMyOX5Gfq/UxepsRSnJFoqMVcVJwIAGztO OKNAgAA X-Env-Sender: yi.y.sun@linux.intel.com X-Msg-Ref: server-3.tower-27.messagelabs.com!1499306837!105490986!5 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.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 34859 invoked from network); 6 Jul 2017 02:07:27 -0000 Received: from mga06.intel.com (HELO mga06.intel.com) (134.134.136.31) by server-3.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 6 Jul 2017 02:07:27 -0000 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP; 05 Jul 2017 19:07:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.40,314,1496127600"; d="scan'208"; a="1191048176" Received: from vmmmba-s2600wft.bj.intel.com ([10.240.193.80]) by fmsmga002.fm.intel.com with ESMTP; 05 Jul 2017 19:07:24 -0700 From: Yi Sun To: xen-devel@lists.xenproject.org Date: Thu, 6 Jul 2017 09:53:11 +0800 Message-Id: <1499305996-19029-19-git-send-email-yi.y.sun@linux.intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1499305996-19029-1-git-send-email-yi.y.sun@linux.intel.com> References: <1499305996-19029-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, 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 v13 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 cea643c..d637bca 100644 --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -1460,6 +1460,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 f7cbc0a..61a9450 100644 --- a/xen/include/public/domctl.h +++ b/xen/include/public/domctl.h @@ -1134,6 +1134,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 */