Message ID | 20210413140140.73690-11-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 A8DC9C433B4 for <xen-devel@archiver.kernel.org>; Tue, 13 Apr 2021 14:03:09 +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 5BD9B61206 for <xen-devel@archiver.kernel.org>; Tue, 13 Apr 2021 14:03:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5BD9B61206 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.109794.209613 (Exim 4.92) (envelope-from <xen-devel-bounces@lists.xenproject.org>) id 1lWJd3-0005av-MC; Tue, 13 Apr 2021 14:02:57 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 109794.209613; Tue, 13 Apr 2021 14:02:57 +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 1lWJd3-0005am-IC; Tue, 13 Apr 2021 14:02:57 +0000 Received: by outflank-mailman (input) for mailman id 109794; Tue, 13 Apr 2021 14:02:55 +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 1lWJd1-0005VP-Lw for xen-devel@lists.xenproject.org; Tue, 13 Apr 2021 14:02:55 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id e7aa8d1c-a197-4003-8b03-da7179619109; Tue, 13 Apr 2021 14:02:54 +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: e7aa8d1c-a197-4003-8b03-da7179619109 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1618322574; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=WrgzclkoEzTDmdIEIC5OF4WYt487TOXaBKzV0255Ehc=; b=cW1DwgZ2EH4UaWnCeb5YmY0ma/ucANYMiazLQj9leA1o7wQJIhnxp340 XFLudQOYx9/IbZ54jg6GJfv2jlSY53wCsbM8DiaTnPghqRGYDPirdGeja tfWETNdq3p62MkCZSnzNg6uMt7QIRBkXxCiEHxMoSUAnvyYHUo+BdHUAZ w=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com IronPort-SDR: 9xL1XWWUHkQE602k0AFIqXPVi8BFPmApmrtre0or53xCSVo4VK9l4NvIEvvUpAmP94oQ1q5YVd 3pAyPRn22vQf8wQh15DiL8tST94jxiW0X9pUxfnFqtinaWyVkhXgarB1FlMOji7lVqp5wHXGyl 5dfDtbOmoSPsdxvcUxf+SMt4r9y9g5S5bHSQ+3QHL1mcPSJWaRXQMPmF0/d6P1H0n8t71yV+1s jO7vxeKYFD6Pjm1+Heb2SOdB/a9IwzYcZiamajbIz2lh/XcXI3KCUzOYOmWhA5lHsoFZhndlwF Oo8= X-SBRS: 5.2 X-MesageID: 41476507 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-HdrOrdr: A9a23:nS7wcq4XsyIXVmxItQPXwU2EI+orLtY04lQ7vn1ZYSd+NuSFis Gjm+ka3xfoiDAXHEotg8yEJbPoexzh3LZPy800Ma25VAfr/FGpIoZr8Jf4z1TbdxHW3tV2kZ 1te60WMrDNJHBnkMf35xS5Gd48wN+BtJuln/va0m0Fd2BXQotLhj0JbjqzOEtwWQVAGN4FD5 Ka/MVKvH6Nfn4QY8S9CBA+LpT+jvfMk4/rZgNDOg4/5GC1/E6VwZPZMzzd5BcRVDtT3awvmF KqryXV7riu2svLrCP0+HTU6/1t6bnc4/tFQPeBk80Ebgjr4zzYH7hJf52nkHQLrPq06FAs+e O80ysIG8ho8XveciWUjHLWqnDd+Q0j4XPj1lOU6EGLyaeSJENYerh8rLlUfRfD500rsMsU6t Mw40uju4dKFhSFpSzh5rHzJmBXv3Cpqnkvm/N7tQ05baIibtZq3Oki1XIQOpIBECXm0ZsgAe ljAerNjcwmD2+yXjT3uHJiz8erWWl2NhCaQlIassjQ6DROmmtlpnFoiPA3rzMlztYQWpNE7+ PLPuBBk6x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KYAr+TV8Zi4 1DfVERacoGqgBKtvxJ7gGCDortokwklFNC5ypAjVCF4Pn+3Fvm X-IronPort-AV: E=Sophos;i="5.82,219,1613451600"; d="scan'208";a="41476507" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LhusGuN/wA9Tg9JPTTttwO4yzdLd7ohDdhBwi6H2xR0DtA2q6lspK3C7RgcAfN95f3PM35XUBaHdYb2swDfzcButSV61nJQwjNKnSSDztIWaNpGOBnMv70KQeSqyl0Af0eX4E6149+V8TDC0CZ16t/QSj4csESHaSQ820g18qnVzm08Vga0Oro7hSI3r6yQlPSLJ37ADB3c/saCTwr5WTjecA7kZVaqYB8bnXZzwagAJ1AZT4OqOEAnmFCh/egOH48hXGe5ACH3ICKTbSGtavUNjVnEnpxzjIY/FHE2XUwHJhdMRe8jFlQO5wcEgldfAI76TqJSla6Ms3Q5tN1ZB6w== 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=QdjL53sxfL72OocLfvFBEO6t+rw9rfdKFRBd12scbro=; b=RzoL7xPis1aErWqhZMWfzxp0MhJGbRSVrXuX86GizC9zdFuKK5PrD4FW7oHCXQau+C6uQuOVvZH4brCz+uEb7+YKP8Pot+gOnl37hIRIja77ahoKD2fgjjZM0kD6nsTq7AespkDZxs7/b8O+fPwHhnfV3XztLiBomGtKguOsFJ3Iw6+vQDzEHqKHQVqKW1EtVGPp8mXg9QyXHoGBoJdzRu9xOgsLpXkudQQ+MwBrM1nF2hUH6BViTX3AwhV4r5kMxuOHY++sfnZ4zz3StiIDY7vS46ovsITJ4x7sfjqRd3CvgkkZWuMqklwGp76vOlFM8mz8XHDGy9pZ6ofWtlIdPQ== 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=QdjL53sxfL72OocLfvFBEO6t+rw9rfdKFRBd12scbro=; b=d5ZVAc8StDCLtYrb/sD8RTJpFjsT+PxBY/sqXVPPRX5ZE68VmABGglQRVQnqX4n9gW7BXO8tMDYRw0kF0YuGZpXLTcG6TLViEjy0mNyQXqD7HFNpEEP8U6fis/xsvqXFOeTuSHvtWBx/NBFZ7L13nK662I1Spt/g8ZQuzkug1BA= 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>, Jan Beulich <jbeulich@suse.com>, Wei Liu <wl@xen.org>, Ian Jackson <iwj@xenproject.org> Subject: [PATCH v2 10/21] tests/cpu-policy: add sorted MSR test Date: Tue, 13 Apr 2021 16:01:28 +0200 Message-ID: <20210413140140.73690-11-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: MR2P264CA0114.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:33::30) 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: 5d3d20d3-3ccb-41f1-7c39-08d8fe84d3f1 X-MS-TrafficTypeDiagnostic: DM5PR03MB2553: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: <DM5PR03MB2553617630EAD18D164BC9FE8F4F9@DM5PR03MB2553.namprd03.prod.outlook.com> X-MS-Oob-TLC-OOBClassifiers: OLM:2276; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 48VIJXz3jh4b7mENzd/m/UVziWlbcSQy302XrYpX4/Nn51JaBAokO5ic5orHVyC/xAggYHIQJN/ufOaZJjPGe6kP/R1+vdmMtNLYwiNSmRwjR//0t0N3gVOs2asPfnazkKyNhFpsW7GhmtsR8nsHA2vcNNQ2tlMFeBgktQMyhAR04wTbbEpPp+YiSnk/DmWhLy2RLRjgU+1+A1tGqx5zAs8KtktPsMS0WOMmjmv9t5pHSGUZnYCcefj7sNnOFiL7OMWE40M0OwXqaYfqlRmMFQSQI9HUmZLGXpXg3lD6p0z8oFKhGLQzc1z8qeY0Rxl+ZQG0WWhgRWUtV1os0CaKk/YCSH+Hv1ISqrvUfs3pQ6tXrjRw4zkEeSETnzcxT4kf8RtbwyHKn3TSQwNjY4t4naPVVt6bX5M+AcA8CXJ2jOcyxK8wPXnkxs3eP9RxG5781ycloM1tzE0Fa6gfq8UKeGVJBinftOSMN3HCDXfka4IIGAJKN5rzVVTyGPOc3hKc7O3mMInGLiz0CJ2IWfSKexeEv5DVfnajMkniHIBOSe8X9WuQennAzCArsa5Ar+/w5MLBmKOrM7tQGayJSDWTFA== 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)(366004)(376002)(136003)(396003)(346002)(39850400004)(8936002)(6496006)(186003)(38100700002)(2906002)(66476007)(86362001)(956004)(2616005)(8676002)(478600001)(66556008)(66946007)(6666004)(6486002)(16526019)(316002)(6916009)(36756003)(54906003)(1076003)(5660300002)(4326008)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?q?1GEFkMZmXtjmboY1W9a0DL+6BKgbLv?= =?utf-8?q?ROAdwZcNZK+iK7p9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9gr6ZjCSgniLKnQO3303MZS4HyBFAQvWQQ3zL5LWN+Hhc9kNEUi?= =?utf-8?q?mShNIfCDUZUJhjqc0VIRHwCeb2tzWY3hTgAGWAxtyGEMGzM7rLaLJIEYwZyyCZwPm?= =?utf-8?q?sY/O9KTpYlWEjLsxXSTG4l9RzECHPhwaA0W9v6WhyWzfnz8p5YvRpdmljRQ51xztq?= =?utf-8?q?1XS9M9y8JQwHFx4IyGOaOOFWGPVBaoJy7dTAo9eC9YSHiWKS3/HVtdH9Zr/u13/6d?= =?utf-8?q?g6C4/uZc9vXWGWIpu6JdV73ExkO8h7BMfnd46x2dlhz3aIFFezrNoc4HE6DfLZz2k?= =?utf-8?q?I5BIULOpAC1olUG5D1dbpYpy0JUJNkYgfnBQSW+rs6wBiBMLYwp7ActEBa2GZQadL?= =?utf-8?q?oH01iOmX+e4ELx?= X-MS-Exchange-CrossTenant-Network-Message-Id: 5d3d20d3-3ccb-41f1-7c39-08d8fe84d3f1 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:51.9863 (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: EmfiLvtKDedysUSzzvY4Jc2J7Ns8idIQXjQhlnoWFgXkGRrh2y1DJFMS0Qv2yCBzZ2gYqJYwgLmCYXqMvwYEfg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR03MB2553 X-OriginatorOrg: citrix.com |
Series |
libs/guest: new CPUID/MSR interface
|
expand
|
diff --git a/tools/tests/cpu-policy/test-cpu-policy.c b/tools/tests/cpu-policy/test-cpu-policy.c index 0fa209f1ea7..ed450a09970 100644 --- a/tools/tests/cpu-policy/test-cpu-policy.c +++ b/tools/tests/cpu-policy/test-cpu-policy.c @@ -86,6 +86,16 @@ static bool leaves_are_sorted(const xen_cpuid_leaf_t *leaves, unsigned int nr) return true; } +static bool msrs_are_sorted(const xen_msr_entry_t *entries, unsigned int nr) +{ + for ( unsigned int i = 1; i < nr; ++i ) + /* MSR index went backwards => not sorted. */ + if ( entries[i - 1].idx > entries[i].idx ) + return false; + + return true; +} + static void test_cpuid_current(void) { struct cpuid_policy p; @@ -270,6 +280,13 @@ static void test_msr_serialise_success(void) goto test_done; } + if ( !msrs_are_sorted(msrs, nr) ) + { + fail(" Test %s, MSR entries not sorted\n", + t->name); + goto test_done; + } + test_done: free(msrs); }
Further changes will rely on MSR entries being sorted, so add a test to assert it. Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> --- Changes since v1: - New in this version. --- tools/tests/cpu-policy/test-cpu-policy.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)