Message ID | 20210413140140.73690-6-roger.pau@citrix.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show
Return-Path: <SRS0=+ia2=JK=lists.xenproject.org=xen-devel-bounces@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66408C433ED for <xen-devel@archiver.kernel.org>; Tue, 13 Apr 2021 14:02:38 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 183E261206 for <xen-devel@archiver.kernel.org>; Tue, 13 Apr 2021 14:02:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 183E261206 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.109772.209553 (Exim 4.92) (envelope-from <xen-devel-bounces@lists.xenproject.org>) id 1lWJcb-00058B-SL; Tue, 13 Apr 2021 14:02:29 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 109772.209553; Tue, 13 Apr 2021 14:02:29 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from <xen-devel-bounces@lists.xenproject.org>) id 1lWJcb-000583-Oq; Tue, 13 Apr 2021 14:02:29 +0000 Received: by outflank-mailman (input) for mailman id 109772; Tue, 13 Apr 2021 14:02:28 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from <SRS0=51M0=JK=citrix.com=roger.pau@srs-us1.protection.inumbo.net>) id 1lWJca-00055v-O3 for xen-devel@lists.xenproject.org; Tue, 13 Apr 2021 14:02:28 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 97c9e2fa-9949-4b1d-a14a-e3b47dc21392; Tue, 13 Apr 2021 14:02:27 +0000 (UTC) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion <xen-devel.lists.xenproject.org> List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>, <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xenproject.org> List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help> List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe> Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org> X-Inumbo-ID: 97c9e2fa-9949-4b1d-a14a-e3b47dc21392 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1618322547; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=WGVjcZJbLqz1e0K2Qv90XwMs+SAdnWmxpckssWf3UQY=; b=KnJRdZif6IhAZ05E7o7r9vSRM7Qixa/ypY4+thfB7LirB1Jl5SXtXbGj HSpXIwioa1o2RhkhMAIsdU2DS427G32aM70LdboyBaVsOVvyUC6LC2kTo +WQql1KVUhYdo0YHuAM98zzoiBe1KFJi6LwtyKb94/vRudp8igQWHqi2G 0=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com IronPort-SDR: ny6wdbq1xxQnWPkZASog2YB8UKm3gHC6diJ52Ox5jdlkFtqBJ2O3/UIRIeELIKR3D6TqNGFlaW Uqp9Xb5S8xLrEIA6X1kfGoWDAFaltWtpW+5ojlm4auHn20dfQGqAc6F2ZGni5+FalMqZLA4MF5 ePsuaVW2V+N1I+skYuIrMmId1UwYaDjQ6qf8+kJTmokH0YO8nYBP5Zk6pd83QLY9U+mDQgLjUh WcP3K+SC/fi+mHAjdpyn2nxrzjC8OxWZwAK7iwddoF0suc2Y5s3dRJlQVQtI0ASUojQTfHM8FC n+w= X-SBRS: 5.2 X-MesageID: 41613815 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-HdrOrdr: A9a23:25MGkK1424yXglONOf1kOwqjBTd3eYIsi2QD101hICF9Wvez0+ izgfUW0gL1gj4NWHcm3euNIrWEXGm0z/FIyKErF/OHUBP9sGWlaLtj44zr3iH6F0TFmtJ1/Z xLN5JzANiYNzVHpO7n/Qi1FMshytGb8KauwdzT1WtpUBsCUcBdxi1SYzzrdnFebg9AGJY/Cd 6g/cJBvTWtYjA6ac68C3kDUYH41qH2vbjhZgMLAANi1RmWgVqTmcPHOjW7/jNbaTNAxr8+7X PI+jaW2oyPu+y2oyWssVP7wI9RnLLau7l+LeyKzvMYMzD9zjuvDb4RIIGqmBAQjKWR5E0xkN /Kyi1QT/hbz3/KZGm6rV/M9mDboU8TwkTvw1OZnnfvyPaRLFlRa7sj9PBkWyDU5EY6sNZ33L gj5RPii7NtAQ7dhyO43tDUVnhR5zuJiEA/mu0ehWE3a/p4VJZtq+UkjSZoOaZFNif75Ic7Kf JpHcHR6d1HGGnqEUzxjy1BxsehUW80GQrDak8eutaN2zwTp3xhyVAErfZv0ksoxdYYcd1p9u 7EOqNn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5 ZEe0wWZtlCjTdnrLRf6FnMdoXH5mQ/k1Vf5jl7kEXKwYbO2haDIX17 X-IronPort-AV: E=Sophos;i="5.82,219,1613451600"; d="scan'208";a="41613815" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S0UH35FCVfoJidA/NbGvIfQ3vUqiiuwkHizfhN7kk1PCBbY0ak1uc1hLgMNyCJQu1DcjqoSkOiVG929DUEtMzbyRKqR/npSRt5G2heuKv1vja9DpwDrRoKLP1cCM9uOK57O2fPhd1rGH7APqXW6uXREv/Chn1mF6EP2wGgJmZ4o90YfV4A9BRUjfxeVtxejr8aP4iS239Pa4Oe3HtZe09CvsIl3QdmPwXERqGItmSQboqPbFa85C4H+y76FGHRs6rG9UJujTJcqRbjrbTf+TeR1VpquUN5lZvRSIVPyHkxhT28XPkve2SBKONb6UFbX2APJHtrMQvVzzLyAPlTKR4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7iRy9GuGFLyRtl5I3ssxtVqxdTgRXM3rmBhXql49R5s=; b=MoMjLFeu0eSqLBEE5jsaJGwqw91VgXzhDyNKaJCkxDk/dzuuoIxd2v2QsB+stqx+XE36pk9vYnBAIHm2PB7f2zfLWwemRZnTuv/J67xWMAyHOmLMGwwM3vJc+Ud0b71hjleeZzC2IiN3qTiwbuepmHARZ2RLp/0hrEKiseTLJFrh/JV2NnFrcG9+bYJDyXQ5MORivKUbs7vyD4NwsgU8P36kNp2NCQg4K1U5KL3Hr2ndm3M+0SjSpYfko/wt9qSWQpgt4SZKf0ftH5Iuj5/oiiGzlK2IjO8V/UWBOxDLSBDE/rBlxn5MzrWlVzcjGL8EChGyETiIOro/cy6CTcCMFw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7iRy9GuGFLyRtl5I3ssxtVqxdTgRXM3rmBhXql49R5s=; b=TdtqAeIsDqDormoIW/dyYdtKqYId6j57wKMHCf4NxDyE2qIAJD3SWWP6CMUmEt/AuBNL/wCwpPhiSIHHfOi9nhJkw77tpNWAgyom23YV+3fG/2RxFI1BrI9DjYxLCPNYfqxRMpBeMeO2IFSAqsir3A8XsKIsFpsHS/PUbJOzfac= From: Roger Pau Monne <roger.pau@citrix.com> To: <xen-devel@lists.xenproject.org> CC: Andrew Cooper <andrew.cooper3@citrix.com>, Roger Pau Monne <roger.pau@citrix.com>, Ian Jackson <iwj@xenproject.org>, Wei Liu <wl@xen.org>, Jan Beulich <jbeulich@suse.com> Subject: [PATCH v2 05/21] libs/guest: introduce helper to fetch a domain cpu policy Date: Tue, 13 Apr 2021 16:01:23 +0200 Message-ID: <20210413140140.73690-6-roger.pau@citrix.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210413140140.73690-1-roger.pau@citrix.com> References: <20210413140140.73690-1-roger.pau@citrix.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: MR2P264CA0022.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:1::34) To DS7PR03MB5608.namprd03.prod.outlook.com (2603:10b6:5:2c9::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2b192e6b-f1bf-4f4a-8614-08d8fe84c39b X-MS-TrafficTypeDiagnostic: DS7PR03MB5542: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: <DS7PR03MB5542C875554BAFF458C4DE428F4F9@DS7PR03MB5542.namprd03.prod.outlook.com> X-MS-Oob-TLC-OOBClassifiers: OLM:612; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SwGd5gfYa7rwXBI15R6ZI7yv2qgTgGP5EgzHyQKonLf0/2PSmXFKh13n+JrjHhrjR+LwOE8mSlVR3DfdEGe7yj1nw9GXGD0M+odwFa0sKvJu0XTf4fc3u6dl7lKYhj+kiY/MFMBewLv9bquhk3gOwZBOvkELzSV2nJILiLh7IIYhDyMGKpF44P1WvCX7AO/VwnORwpfEoX9ET93GWiy5iTshH3tvoutdCwckoEc4ZlgX3GFHoPK2to8XBtm+d52/JcxC0s0u/wghy8A1bAm+g4JsZIYfrX4u9ggyNAoxow9a0FzDo+BVFvOt+8MG1YJpcMJQQW3tghomPWmvrM3myonIQiCNytuzCS9nNOFuQiNyYXieqQMQIajD5xPojLwOpEsVmb8dxXG5Aj9Oq41nddF11Ue0+TTYcaKmE0wZ0DggyGOnldx02hDfT4qKP0OW7fXe0Hj1WmjFluldwREtEMWJwPh22fXkLEmRl25Gec1NXMexXLeTvp0uoMtki0uVn3+JXYiXAQqmSeSNRb1RFtgnAMGjZh/MG+CsJM8zBCFnY+DpbgO9F8gSPBe1hZv7JV0EHRCE4n6GkNSgZZXfFRB4b+KX4MOfKAEFEB8DL4U= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR03MB5608.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(396003)(366004)(39850400004)(346002)(376002)(2906002)(6916009)(6486002)(36756003)(66946007)(54906003)(1076003)(5660300002)(66476007)(316002)(66556008)(8936002)(478600001)(186003)(2616005)(16526019)(86362001)(6496006)(26005)(38100700002)(8676002)(956004)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?q?OvCIHjCo2jVm2mC8lGWYY+xNf4O7ux?= =?utf-8?q?XYy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JJzyXyJ5THTFTNzHVP8jIL7Br/esdqx9M5wRuX30YQqTibUP?= =?utf-8?q?7rjjy/MhmuV0HulQtImIKK5wmsLOJO71gGAJYswcRgLyscwsGAa4uFpQSsDYmPhzL?= =?utf-8?q?anSmUbLZCb5pLhVmGCxwcZtNmWesecgmXJCd29hjsHLLVE4gBed8RVaOT/kYfgA2n?= =?utf-8?q?/fWuILKEXtQJ8sFDcJGazNVjJvRxLHCUDFF2ndEOtTdzj2+ub3J5CBgzl2dYyPaMW?= =?utf-8?q?+G3I3Y4ihpC8tLLmXCmE3ar7ooqTpFzsCVaiQn8yvnldYhf9gFXXCflWrSG+azlQ7?= =?utf-8?q?c1AkJTtDK25Jqjz7EKO8hDa22KZ+SutnTFrFicQJT7HdEA7WY9haC7uC5Y7j5ms9m?= =?utf-8?q?LSWWUVLR+O3Iuq?= X-MS-Exchange-CrossTenant-Network-Message-Id: 2b192e6b-f1bf-4f4a-8614-08d8fe84c39b X-MS-Exchange-CrossTenant-AuthSource: DS7PR03MB5608.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2021 14:02:24.5948 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: aBztJWLHqpR0WkZC30vqVhX+ZwEm99zFiE9cQZnhjmnxrLjEFXVDICUyOYhbmssHyuI/WFc63KNucr4pAp9O1g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR03MB5542 X-OriginatorOrg: citrix.com |
Series |
libs/guest: new CPUID/MSR interface
|
expand
|
diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h index 187df5c5d2d..34d979d11da 100644 --- a/tools/include/xenctrl.h +++ b/tools/include/xenctrl.h @@ -2599,6 +2599,8 @@ void xc_cpu_policy_destroy(xc_cpu_policy_t policy); /* Retrieve a system policy, or get/set a domains policy. */ int xc_cpu_policy_get_system(xc_interface *xch, unsigned int policy_idx, xc_cpu_policy_t policy); +int xc_cpu_policy_get_domain(xc_interface *xch, uint32_t domid, + xc_cpu_policy_t policy); int xc_get_cpu_levelling_caps(xc_interface *xch, uint32_t *caps); int xc_get_cpu_featureset(xc_interface *xch, uint32_t index, diff --git a/tools/libs/guest/xg_cpuid_x86.c b/tools/libs/guest/xg_cpuid_x86.c index 78fbc7db9d3..1394e503f3d 100644 --- a/tools/libs/guest/xg_cpuid_x86.c +++ b/tools/libs/guest/xg_cpuid_x86.c @@ -732,3 +732,28 @@ int xc_cpu_policy_get_system(xc_interface *xch, unsigned int policy_idx, return rc; } + +int xc_cpu_policy_get_domain(xc_interface *xch, uint32_t domid, + xc_cpu_policy_t policy) +{ + unsigned int nr_leaves = ARRAY_SIZE(policy->leaves); + unsigned int nr_entries = ARRAY_SIZE(policy->entries); + int rc; + + rc = xc_get_domain_cpu_policy(xch, domid, &nr_leaves, policy->leaves, + &nr_entries, policy->entries); + if ( rc ) + { + PERROR("Failed to obtain domain %u policy", domid); + return rc; + } + + rc = deserialize_policy(xch, policy, nr_leaves, nr_entries); + if ( rc ) + { + errno = -rc; + rc = -1; + } + + return rc; +}