From patchwork Tue Aug 1 08:48:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yi Sun X-Patchwork-Id: 9873883 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 870A360365 for ; Tue, 1 Aug 2017 09:06:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F6C02582C for ; Tue, 1 Aug 2017 09:06:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 847E928670; Tue, 1 Aug 2017 09:06:50 +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 2A63F2582C for ; Tue, 1 Aug 2017 09:06:50 +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 1dcT6u-0005eM-Cv; Tue, 01 Aug 2017 09:05:04 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dcT6t-0005cH-2c for xen-devel@lists.xenproject.org; Tue, 01 Aug 2017 09:05:03 +0000 Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id 8D/D9-01994-E3440895; Tue, 01 Aug 2017 09:05:02 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrJLMWRWlGSWpSXmKPExsXS1tYhomvj0hB pMGWSqsX3LZOZHBg9Dn+4whLAGMWamZeUX5HAmjHrVwNjwXv+io9L9BsYW3m6GLk4hASmMUpc XbGYqYuRk0NCgFfiyLIZrBC2v8TjN9+ZIIoaGCXOffvGDJJgE1CXePy1B6xBREBJ4t6qyWBFz ALzmSRen38AViQs4Cixe+9NNhCbRUBV4v6Lo2A2r4CHxOUdrYwQG+QkTh6bDLaNEyi+4+YNoF 4OoG3uEjtnJk5g5F3AyLCKUb04tagstUjXVC+pKDM9oyQ3MTNH19DAVC83tbg4MT01JzGpWC8 5P3cTIzAYGIBgB+OXfudDjJIcTEqivIo99ZFCfEn5KZUZicUZ8UWlOanFhxhlODiUJHglnBsi hQSLUtNTK9Iyc4BhCZOW4OBREuG94ASU5i0uSMwtzkyHSJ1i1OV4NeH/NyYhlrz8vFQpcd6LI EUCIEUZpXlwI2AxcolRVkqYlxHoKCGegtSi3MwSVPlXjOIcjErCvLIgl/Bk5pXAbXoFdAQT0B GSpbUgR5QkIqSkGhiTWANnGy9N3TFJ47O6ecm7Ax2XLh0x+6/YK3b27cmeqTzuvPHcf15UJJx TfHGBd65ESHCoQ0L7Po7OZxeL2KoEt6o995w5mT+NWSzF5IXg4qM/0/fJ/2+6uJXnjM3rON4X TQF5J74/m2nQ9539y7VeG/57hxZc2WJiudzH6oDYin3fj0fusXmrxFKckWioxVxUnAgAziJ1R YwCAAA= X-Env-Sender: yi.y.sun@linux.intel.com X-Msg-Ref: server-16.tower-206.messagelabs.com!1501578248!89431283!19 X-Originating-IP: [134.134.136.20] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjAgPT4gMzU1MzU4\n X-StarScan-Received: X-StarScan-Version: 9.4.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 55493 invoked from network); 1 Aug 2017 09:04:59 -0000 Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20) by server-16.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 1 Aug 2017 09:04:59 -0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Aug 2017 02:04:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,305,1498546800"; d="scan'208";a="118061683" Received: from vmmmba-s2600wft.bj.intel.com ([10.240.193.80]) by orsmga002.jf.intel.com with ESMTP; 01 Aug 2017 02:04:54 -0700 From: Yi Sun To: xen-devel@lists.xenproject.org Date: Tue, 1 Aug 2017 16:48:49 +0800 Message-Id: <1501577334-7431-19-git-send-email-yi.y.sun@linux.intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1501577334-7431-1-git-send-email-yi.y.sun@linux.intel.com> References: <1501577334-7431-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 v15 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 --- v14: - rebase domctl.c on latest codes: bool_t is replace by bool. 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 4224408..b4847b6 100644 --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -1483,6 +1483,13 @@ long arch_do_domctl( copyback = true; 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 = true; + break; + default: ret = -EOPNOTSUPP; break; diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h index ff39762..61d44cd 100644 --- a/xen/include/public/domctl.h +++ b/xen/include/public/domctl.h @@ -1142,6 +1142,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 */