From patchwork Wed Jun 14 01:12:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yi Sun X-Patchwork-Id: 9785121 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 73D9060384 for ; Wed, 14 Jun 2017 01:27:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 668A826E75 for ; Wed, 14 Jun 2017 01:27:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B6F028472; Wed, 14 Jun 2017 01:27:49 +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 105F326E75 for ; Wed, 14 Jun 2017 01:27:49 +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 1dKx4V-0007zL-2M; Wed, 14 Jun 2017 01:26:11 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dKx4U-0007yT-L6 for xen-devel@lists.xenproject.org; Wed, 14 Jun 2017 01:26:10 +0000 Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id 52/DD-02022-1B090495; Wed, 14 Jun 2017 01:26:09 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrALMWRWlGSWpSXmKPExsVywNykWHf9BId Igx9XFSy+b5nM5MDocfjDFZYAxijWzLyk/IoE1oxVTb9YC5bxVzT+OM/SwHiau4uRi0NIYBqj xKtbe5i6GDk5JAR4JY4sm8EKYftJXOnsYIYoamCUeNqyiBkkwSagLvH4aw9Yg4iAksS9VZOZQ IqYBXYySaw7/R2sSFjAUeLZxJdsIDaLgKrEz/tHwGxeAU+Jqc92skNskJM4eWwy2DZOoHj362 dgQ4UEPCR+XpnKNIGRdwEjwypGjeLUorLUIl0jQ72kosz0jJLcxMwcXUMDU73c1OLixPTUnMS kYr3k/NxNjMCQqGdgYNzBeHey3yFGSQ4mJVHeJXYOkUJ8SfkplRmJxRnxRaU5qcWHGGU4OJQk eN/0AeUEi1LTUyvSMnOAwQmTluDgURLhrW0DSvMWFyTmFmemQ6ROMSpKifOeAukTAElklObBt cEi4hKjrJQwLyMDA4MQT0FqUW5mCar8K0ZxDkYlYd7j/UBTeDLzSuCmvwJazAS0+PoVG5DFJY kIKakGxnUamyWX7S44GLn9sSu70nZH3gxGXt/Nx4LNzS0Vqg3M590++dVi3cEzc+xPz1gieua xuZTM2oX9rhmsWxOkGg7MMJZd/PRKYeqOOYUhXc6fTt22/ZVx7fbel86GzJ1NRTfui9v57rpi M+9ugUAw03uRAva9szbyljYZub1vWmt0SGW/uuOUJUosxRmJhlrMRcWJAKFJsZqDAgAA X-Env-Sender: yi.y.sun@linux.intel.com X-Msg-Ref: server-16.tower-206.messagelabs.com!1497403511!87398197!19 X-Originating-IP: [192.55.52.115] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 52140 invoked from network); 14 Jun 2017 01:26:07 -0000 Received: from mga14.intel.com (HELO mga14.intel.com) (192.55.52.115) by server-16.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 14 Jun 2017 01:26:07 -0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jun 2017 18:26:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,340,1493708400"; d="scan'208";a="99174027" Received: from vmmmba-s2600wft.bj.intel.com ([10.240.193.64]) by orsmga002.jf.intel.com with ESMTP; 13 Jun 2017 18:26:03 -0700 From: Yi Sun To: xen-devel@lists.xenproject.org Date: Wed, 14 Jun 2017 09:12:51 +0800 Message-Id: <1497402776-22348-19-git-send-email-yi.y.sun@linux.intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497402776-22348-1-git-send-email-yi.y.sun@linux.intel.com> References: <1497402776-22348-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 v12 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 */