From patchwork Tue Jan 10 07:42:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yi Sun X-Patchwork-Id: 9506631 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 331BC60710 for ; Tue, 10 Jan 2017 07:45:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 274F228156 for ; Tue, 10 Jan 2017 07:45:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C4E428485; Tue, 10 Jan 2017 07:45:38 +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 C84FD283F6 for ; Tue, 10 Jan 2017 07:45:37 +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 1cQr5c-0003s1-7s; Tue, 10 Jan 2017 07:43:28 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQr5b-0003qZ-5Z for xen-devel@lists.xenproject.org; Tue, 10 Jan 2017 07:43:27 +0000 Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id 4C/B6-02804-E9094785; Tue, 10 Jan 2017 07:43:26 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrLLMWRWlGSWpSXmKPExsVywNykWHfuhJI Ig223DS2+b5nM5MDocfjDFZYAxijWzLyk/IoE1oy2x2tYCxYIVFy/ENfAeIKni5GTQ0igUmLL 124mEFtCgFfiyLIZrBC2v0TLv362LkYuoJoGRom3R3+xgCTYBNQlHn/tAWsQEVCSuLdqMhNIE bPAfkaJ+cePM3cxcnAIC1hJbNyVAFLDIqAqsfj9SbChvALuEhM/XmGGWCAncfLYZLA4p4CHRM vVdYwQB7lLNL+9zziBkXcBI8MqRo3i1KKy1CJdI0u9pKLM9IyS3MTMHF1DA2O93NTi4sT01Jz EpGK95PzcTYzAYKhnYGDcwdi01+8QoyQHk5Iob4puSYQQX1J+SmVGYnFGfFFpTmrxIUYZDg4l Cd6qfqCcYFFqempFWmYOMCxh0hIcPEoivNtB0rzFBYm5xZnpEKlTjIpS4ryBIAkBkERGaR5cG ywWLjHKSgnzMjIwMAjxFKQW5WaWoMq/YhTnYFQS5m0GmcKTmVcCN/0V0GImoMWRdsUgi0sSEV JSDYwmV089nyVrvGSr6CzGZ5ds8y4LdkrUd8U98gqRUQ/be3f7YU+m98Hbrmq+lVhpH+vBMrl yeZHWWvlPi2bXrfywUkfZwjxMR+hgtYmREOfSbQ80pA2bAg1ZUr5uNwwXVWi4o/grZoJrz1TH R4eOX9ivpCR4Qj139znnvlsfXyqwN6kVfljewqrEUpyRaKjFXFScCABdQDLWgAIAAA== X-Env-Sender: yi.y.sun@linux.intel.com X-Msg-Ref: server-11.tower-31.messagelabs.com!1484034191!48884458!5 X-Originating-IP: [192.55.52.115] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 7533 invoked from network); 10 Jan 2017 07:43:25 -0000 Received: from mga14.intel.com (HELO mga14.intel.com) (192.55.52.115) by server-11.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 10 Jan 2017 07:43:25 -0000 Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP; 09 Jan 2017 23:43:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,343,1477983600"; d="scan'208";a="211583015" Received: from vmmmba-s2600wft.bj.intel.com ([10.240.193.63]) by fmsmga004.fm.intel.com with ESMTP; 09 Jan 2017 23:43:23 -0800 From: Yi Sun To: xen-devel@lists.xenproject.org Date: Tue, 10 Jan 2017 15:42:23 +0800 Message-Id: <1484034155-4521-5-git-send-email-yi.y.sun@linux.intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1484034155-4521-1-git-send-email-yi.y.sun@linux.intel.com> References: <1484034155-4521-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] [RFC 04/16] x86: implement data structure of MBA. 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 main data structures of MBA. Like CAT features, MBA HW info has cos_max which means the max cos registers number, and thrtl_max which means the max throttle value (delay value). It also have a flag to represent if the throttle value is linear or not. One COS register of MBA stores a throttle value for one or more domains. That means the transaction time between L2 cache and next level memory will be delayed. Signed-off-by: Yi Sun --- xen/arch/x86/psr.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c index 2c69cc0..58d3555 100644 --- a/xen/arch/x86/psr.c +++ b/xen/arch/x86/psr.c @@ -27,17 +27,23 @@ * - CDP Code and Data Prioritization * - COS/CLOS Class of Service. Also mean COS registers. * - COS_MAX Max number of COS for the feature (minus 1) + * - MBA Memory Bandwidth Allocation * - MSRs Machine Specific Registers * - PSR Intel Platform Shared Resource + * - THRTL_MAX Max throttle value (delay value) of MBA */ #define PSR_CMT (1<<0) #define PSR_CAT (1<<1) #define PSR_CDP (1<<2) +#define PSR_MBA (1<<3) #define CAT_CBM_LEN_MASK 0x1f #define CAT_COS_MAX_MASK 0xffff +/* Linear bit. */ +#define MBA_LINEAR (1<<2) + /* * Per SDM 17.17.3.3 'Cache Allocation Technology: Cache Mask Configuration', * the MSRs range from 0C90H through 0D0FH (inclusive), enables support for @@ -79,6 +85,14 @@ enum psr_feat_type { PSR_SOCKET_L3_CAT = 0, PSR_SOCKET_L3_CDP, PSR_SOCKET_L2_CAT, + PSR_SOCKET_MBA = 16, +}; + +/* MBA HW info data structure. */ +struct psr_mba_hw_info { + unsigned int thrtl_max; + unsigned int cos_max; + unsigned int linear; }; /* CAT/CDP HW info data structure. */ @@ -93,6 +107,7 @@ struct feat_hw_info { struct psr_cat_hw_info l3_cat_info; struct psr_cat_hw_info l3_cdp_info; struct psr_cat_hw_info l2_cat_info; + struct psr_mba_hw_info mba_info; }; };