From patchwork Thu Aug 12 22:46:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Babu Moger X-Patchwork-Id: 12434379 Return-Path: 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=-10.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS 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 E5F33C4338F for ; Thu, 12 Aug 2021 22:46:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C30656104F for ; Thu, 12 Aug 2021 22:46:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238410AbhHLWrY (ORCPT ); Thu, 12 Aug 2021 18:47:24 -0400 Received: from mail-co1nam11on2065.outbound.protection.outlook.com ([40.107.220.65]:4320 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S235927AbhHLWrY (ORCPT ); Thu, 12 Aug 2021 18:47:24 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KmpieRXmpfdsSE9S0i7iA1AbmhoUc6vB6wQOfEC+oM4KOe5urXnrFUcWI/H2AybEiO7hVGlVgyXxRVeLKGZnk3fxLJHwfotBLRQOeb0tqNXel7pAtocxi/+F0u3udel+iAYYgzyfu+rV3lTdg73hSrBs7V2hs75hwyVgCb+cbxdvFYhl3BURAmsDNmrUyM8cBKHfRlUTDL+lQS9kdos994iZMzh+WehfRHWkeR6Vw+sBTisRaOtCCiUGf64nKSNs7buGupt9/m+k3SZHLJlRNle/vPAG2qoBpViSYTx3fHCcANXST4CLGEOg3qJwKh0XFL/S3BST9hy53iYBdxW9uQ== 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=w4idl6fxm0VQzCJ1n0Os5i1kGDwV61Ya4nCSgc0KbzM=; b=enkXhLw3/TC7OvHO3uI2Q3TbnwJIVfFzXLMo8aS0NJN2/GcnvtcsSHx6UJ+quaWev1U3jTE8XRRPs9DfA4eEWwPjt4jFyauf8DWy35B7l+MkdKSOuplU4+BZ+tAPaI86tSVvI5MzfruE+vHOTuJsnRmfDvNcN7IfTBLSAnOpj0PXN+bZlrDqRpLQ5PkCVNNFhdRPsloRkCK2GeB5L0L679jAjLy2usQKiMQYBME+49P6Hr0bEkm4KsYYXFIhygNSk0BX8GpDoDYEmMlh8AMro5LNsPpA2EI0juYToSx4l8SxvD40Mlo3EkQLUzGMDSSEAZ/hc38ACgplaDMPsjMJvw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=w4idl6fxm0VQzCJ1n0Os5i1kGDwV61Ya4nCSgc0KbzM=; b=AEjW4bB8nxTCPhihZmkEn1H2UTsKDYkO0+vLXFjh38uiQItomJS7Yrv8FrcgQZlDVEmSYQjVeeD1lrRwvae4UEkZ1o75cD6Bp2X3bwstTz4k7BW/QKTj+gFWfkm1WP6SNuLKjXqNsQ3NuQTKOWQPeMJq+thz5PYxFdrlxKxd5/8= Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=amd.com; Received: from MW3PR12MB4553.namprd12.prod.outlook.com (2603:10b6:303:2c::19) by MW3PR12MB4555.namprd12.prod.outlook.com (2603:10b6:303:59::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16; Thu, 12 Aug 2021 22:46:56 +0000 Received: from MW3PR12MB4553.namprd12.prod.outlook.com ([fe80::3987:37e5:4db7:944e]) by MW3PR12MB4553.namprd12.prod.outlook.com ([fe80::3987:37e5:4db7:944e%6]) with mapi id 15.20.4394.026; Thu, 12 Aug 2021 22:46:56 +0000 Subject: [kvm-unit-tests PATCH v2 0/2] Couple of SVM unit test fixes From: Babu Moger To: pbonzini@redhat.com Cc: seanjc@google.com, thuth@redhat.com, drjones@redhat.com, kvm@vger.kernel.org, babu.moger@amd.com Date: Thu, 12 Aug 2021 17:46:53 -0500 Message-ID: <162880829114.21995.10386671727462287172.stgit@bmoger-ubuntu> User-Agent: StGit/0.17.1-dirty X-ClientProxiedBy: SN6PR04CA0101.namprd04.prod.outlook.com (2603:10b6:805:f2::42) To MW3PR12MB4553.namprd12.prod.outlook.com (2603:10b6:303:2c::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [127.0.1.1] (165.204.77.1) by SN6PR04CA0101.namprd04.prod.outlook.com (2603:10b6:805:f2::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Thu, 12 Aug 2021 22:46:55 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5bdb6e92-fe5c-41fd-8b07-08d95de315ef X-MS-TrafficTypeDiagnostic: MW3PR12MB4555: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: D/nEQrMzzLkltj1WRtYjUjRJdfsUb532lqlRhg7zM8UTPwVbSz2+0cpbYKEOHaKI3kTC3n4v7jIOGOz3koeFgyix11korW2ip7MG8FHSAuy6JXvg/1Tw8DyVvHg6r6LIZy3IXulf0KBzz3E2xgRHJp57sVnd1DzhrldyF/nxoCAE0nllrywzmNLcqQjbxi+0uRba4nRbzcg44u4T+2a0CwJkwIwUx9AhCdyYnSxcfxALxyA8rTJaZD01oW6ZRG0GiuMch+7HJIYaXbWn2aSmKkCDGSprWolCCTDrCSIL/03mVzVoI2o4fy0t3Q3XCyF3myWjm3bH8q6Wa4q/EH5bHnDf8JzdxkwpMPuM9hXv+ugTHRhXv7BOAi1C7B5j20qh3gJjzL101NpLRV/tD0J6H3Vl/SsapyoRE6SZBs20KZ7GUNSbOS2zZv+yTn1xawG2AsS78S12973vYs5PBWr9io2Z0MbGHzy5fF1shEN/qb5K3DNw5hydW4heQbIlv9tcWH17q/GOZlB6f/2rhOVXQNR3JcIfXokCiZgCk5qTIR04u5q0pHsIspKxCZkX+2A+yW04B6N+DQ49KwiKeaPE9kX5Tecnd17Xdwyz8S87Osdt9ku3QDDIHZ/aXreu5wqa/g3PJ2JSog6hqRBEkSdZI/H1G+WPqATguA84g1c7JsTkjGEK1wuTVfI8l4xsIUpOwpNYeMnoOYpyAqm6MTnmXc7MudeZRxCebaWKOCBq8JbjVUku5HlBqAKcauXfvbt0tBVk2msf8L5w/LZ/hMOyHDMoaupPrE5wmyaDq/21K0w= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW3PR12MB4553.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(7916004)(376002)(396003)(136003)(39860400002)(346002)(366004)(83380400001)(4744005)(9686003)(8936002)(86362001)(103116003)(66476007)(6486002)(66556008)(38100700002)(956004)(38350700002)(33716001)(16576012)(66946007)(316002)(8676002)(26005)(6916009)(966005)(2906002)(5660300002)(478600001)(4326008)(52116002)(44832011)(186003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?qrpsh4wevDJ/r9NuMr4ATfmvfeJx?= =?utf-8?q?RlSPy6Z3wcSiO3QtMIoRCQfcLBL3NpbO+I1qCnFJO6ttwMOsFp3+Va4ptZzNv8xbl?= =?utf-8?q?bIXCFiv13t+bcoFZpAga+ZtZAotjL5eIhlkpdRHym7YadGbX0YmHr1BAy9wNdoYY2?= =?utf-8?q?8fS1mWsCbw1rB2ko2fZGF9V6KuBmZ/T01w8Q1droz6Klbzed/HuhBEEgLMpvViY4m?= =?utf-8?q?eS5JfG0EaixRqMYF2LeAps0dhlUE/Dgy+7p4m/TtlLWwew5klqJZp5+a4ynZX3bhq?= =?utf-8?q?e1vLyQZGeun/3CnO1e67e5NbafddtXjVqbqkuDaaVXq0LHAIRXeQ+hdvaeUEQ717G?= =?utf-8?q?7ovCmez+eGF/b5DsBNF6SmAl1fALAr/UFpVKMgULLcQYscpG7RJOpCN5YyzSvLQMU?= =?utf-8?q?VI/NdRFKtbH6Esqx4ghACRduZj8HWNXeD/EFFs7UnHd+uX1E/jFUJEcArVk75aQWP?= =?utf-8?q?i0l10RhrNp3PhY55HLIUE7LJHsgAmI2fh+0jGOID2fKnEZO3Hn81Nw9nyeRg36YSK?= =?utf-8?q?5uthsMQvQy+LqMbnJWV0tcGn3uxndcLXFf39VRUXK+O8/y0MKORCgTIUuG1bcllq5?= =?utf-8?q?ZUY+fRrwau0sfqQ+W/aJvhV9fEIkjWYrnhnja2Shhy6hL3B0TmAK6kA6PpNmwDwbs?= =?utf-8?q?Rcbc+sRpBZE3VNu1Vc6KTNaOYXc02UOjjFOqaCtnGWvyynyIPhne5lkrwtXqfR8cs?= =?utf-8?q?kgTHoQvB9OpwygpudvdYUTsa3/0rwVRuqGMnaCZNS5wGGvORMUlYK8JnubpN1ET8n?= =?utf-8?q?Y8D54NGotP67rA6XCEdKrHNRqALdKQIYXCvMnf9Q76ukGiLBrRFe2Rs5pv8eCU25Y?= =?utf-8?q?o+UHFiEWkLt+Uzk9cNGpMQjy1dMCIBvvVRZPD6AfVV9nEKMU9ibaX4S2/RW+2NYn0?= =?utf-8?q?KiRk3lXYrc4XIe4UcSZf6um5kijl2fNnbnzPLJV4Q9qSEXymV3NlEu9YMMty92l4x?= =?utf-8?q?2Os2CBGlWzvJKpv7WjZ6Mw8Ag+Oz8x1H8yA1eRtFfY3zeyT5S+q1Q2bMmAgRzTK9S?= =?utf-8?q?ekoGgxbP1XkvskrTuAOg2rh3D8/LklceCXE1yfAZSpffYkSsnZudVkeFGmxXiMAKx?= =?utf-8?q?XzpYzSjCVzvDCPmIFFSsnfWkw9YaRxPlsDy3EHpgUYheL4j3GZXBLFbsY5U2R1+ab?= =?utf-8?q?UaDP4OBTmTxbAPwZZjc0oxbU5kN3sTOiDi/oU3z9uK/gexSb74LJ3A6lzLzip7x0J?= =?utf-8?q?sqySwq9c5dZ5LsA7bFwMgwzg2BIT3eGYn+r4wNgOJlWEngu0ufdvVaJhxp/6lg8e5?= =?utf-8?q?GQZtP6663AEa6j9q?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5bdb6e92-fe5c-41fd-8b07-08d95de315ef X-MS-Exchange-CrossTenant-AuthSource: MW3PR12MB4553.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2021 22:46:55.8108 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: XlbT9JaNEDbGiLDuJooMIEonA676Kk8l9bxSU+52Bjf+t9YBgsJAzPNskWcIiFqi X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4555 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org This series fixes couple of unittest failures for SVM. 1.The test ./x86/access is failing with timeout. 2.The test ./x86/svm failure with infinite loop. --- v2: 1. Modified the check in ac_test_legal to limit the number of test combinations based on comments from Paolo Bonzini and Sean Christopherson. 2. Changed the rdrand function's retry method. Kept the retry outside the function. Tom Lendacky commented that RDRAND instruction can sometimes loop forever without setting the carry flag. v1: https://lore.kernel.org/kvm/162826604263.32391.7580736822527851972.stgit@bmoger-ubuntu/ Babu Moger (2): x86: access: Fix timeout failure by limiting number of tests nSVM: Fix NPT reserved bits test hang lib/x86/processor.h | 11 +++++++++++ x86/access.c | 11 +++++++---- x86/svm_tests.c | 28 ++++++++++++++++++++++++---- 3 files changed, 42 insertions(+), 8 deletions(-) --