From patchwork Mon Oct 16 03:04:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yi Sun X-Patchwork-Id: 10007609 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 68048601E7 for ; Mon, 16 Oct 2017 03:28:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5CE4527165 for ; Mon, 16 Oct 2017 03:28:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5138C26E78; Mon, 16 Oct 2017 03:28:28 +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 8D3E627D0C for ; Mon, 16 Oct 2017 03:28:26 +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 1e3w28-0002Ui-SY; Mon, 16 Oct 2017 03:25:40 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3w27-0002Tr-It for xen-devel@lists.xenproject.org; Mon, 16 Oct 2017 03:25:39 +0000 Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id 4D/70-07262-2B624E95; Mon, 16 Oct 2017 03:25:38 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrHIsWRWlGSWpSXmKPExsXS1tYhr7tR7Um kQdtkAYvvWyYzOTB6HP5whSWAMYo1My8pvyKBNWP2uxnsBS18FR/PfmBqYFzP3cXIySEkUCHx fPYlNhBbQoBX4siyGawQto9E67HVzBA1DYwSe2d4gdhsAuoSj7/2MIHYIgJKEvdWTQayuTiYB X4zSux8sA9skLCAi8TeeQ/AilgEVCXOfTvC0sXIwcEr4C6x5oIUxHw5iZPHJoPt4hTwkJh5dx MbSIkQUMnFK+ogYV4BQYmTM5+AdTIDrV0/TwgkzCwgL9G8dTbzBEaBWUiqZiFUzUJStYCReRW jRnFqUVlqka6RiV5SUWZ6RkluYmaOrqGBsV5uanFxYnpqTmJSsV5yfu4mRmBY1jMwMO5gfHXc 7xCjJAeTkijvudaHkUJ8SfkplRmJxRnxRaU5qcWHGGU4OJQkeLerPokUEixKTU+tSMvMAUYIT FqCg0dJhDcSJM1bXJCYW5yZDpE6xajL0XHz7h8mIZa8/LxUKXHeKyBFAiBFGaV5cCNg0XqJUV ZKmJeRgYFBiKcgtSg3swRV/hWjOAejkjDvLZApPJl5JXCbXgEdwQR0xLuIByBHlCQipKQaGIU c7T9Uis3VTm21W9cy2V3m7u8LnJ4XlU4ELuvM9d6pW13/T8f834k9vo8lfgYcb6/bci1A0lZR XUB+9vp7O2b5RJcuE2Sc/C2su32KujTLqVkpQlb/9c79TDul2d9gpL3gGG/RDcYUf69rqRfSr JaVX1kyaxr7napmbsu2faKNpY9O6gqYK7EUZyQaajEXFScCAPcMfwfRAgAA X-Env-Sender: yi.y.sun@linux.intel.com X-Msg-Ref: server-9.tower-31.messagelabs.com!1508124315!54894109!8 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.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 35934 invoked from network); 16 Oct 2017 03:25:36 -0000 Received: from mga06.intel.com (HELO mga06.intel.com) (134.134.136.31) by server-9.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 16 Oct 2017 03:25:36 -0000 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP; 15 Oct 2017 20:25:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,371,1503385200"; d="scan'208";a="533645" Received: from vmmmba-s2600wft.bj.intel.com ([10.240.193.75]) by orsmga001.jf.intel.com with ESMTP; 15 Oct 2017 20:25:33 -0700 From: Yi Sun To: xen-devel@lists.xenproject.org Date: Mon, 16 Oct 2017 11:04:12 +0800 Message-Id: <1508123061-6600-8-git-send-email-yi.y.sun@linux.intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508123061-6600-1-git-send-email-yi.y.sun@linux.intel.com> References: <1508123061-6600-1-git-send-email-yi.y.sun@linux.intel.com> MIME-Version: 1.0 Cc: Wei Liu , Yi Sun , Andrew Cooper , Jan Beulich , Chao Peng , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [Xen-devel] [PATCH v8 07/16] x86: implement get value interface for 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: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP This patch implements get value domctl interface for MBA. Signed-off-by: Yi Sun Reviewed-by: Roger Pau Monné Acked-by: Jan Beulich --- CC: Andrew Cooper CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monné CC: Chao Peng v5: - use newly defined macro to get MBA thrtl. (suggested by Roger Pau Monné) v4: - remove 'ALLOC_' from macro names. (suggested by Roger Pau Monné) v3: - change 'PSR_VAL_TYPE_MBA' to 'PSR_TYPE_MBA_THRTL'. (suggested by Roger Pau Monné) --- xen/arch/x86/domctl.c | 4 ++++ xen/include/public/domctl.h | 1 + 2 files changed, 5 insertions(+) diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c index bc025ce..b726eae 100644 --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -1491,6 +1491,10 @@ long arch_do_domctl( ret = domctl_psr_get_val(d, domctl, PSR_TYPE_L2_CBM, copyback); break; + case XEN_DOMCTL_PSR_GET_MBA_THRTL: + ret = domctl_psr_get_val(d, domctl, PSR_TYPE_MBA_THRTL, copyback); + break; + #undef domctl_psr_get_val default: diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h index 4a66be1..002a26f 100644 --- a/xen/include/public/domctl.h +++ b/xen/include/public/domctl.h @@ -1070,6 +1070,7 @@ struct xen_domctl_psr_alloc { #define XEN_DOMCTL_PSR_GET_L3_DATA 5 #define XEN_DOMCTL_PSR_SET_L2_CBM 6 #define XEN_DOMCTL_PSR_GET_L2_CBM 7 +#define XEN_DOMCTL_PSR_GET_MBA_THRTL 9 uint32_t cmd; /* IN: XEN_DOMCTL_PSR_* */ uint32_t target; /* IN */ uint64_t data; /* IN/OUT */