From patchwork Thu Aug 12 22:47:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Babu Moger X-Patchwork-Id: 12434381 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=-15.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,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 E448EC432BE for ; Thu, 12 Aug 2021 22:47:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BF1AD610A4 for ; Thu, 12 Aug 2021 22:47:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238420AbhHLWrc (ORCPT ); Thu, 12 Aug 2021 18:47:32 -0400 Received: from mail-co1nam11on2053.outbound.protection.outlook.com ([40.107.220.53]:38880 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S238412AbhHLWra (ORCPT ); Thu, 12 Aug 2021 18:47:30 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Uq3auKGplhYmyaIp3FkSrepx11DrtAdqZW29G132xAYN5aeaOdaHZ0aYMrpfWcVR/rdLvsg0D5Jbl541k8PoKR7YuYIQS/WU3zxV22R7xUGj/T2EsWWal9Vh/qf4h6XlF1fvSwn4m4KSPrqVoLKm1ptp95XmWhFyd+cV6Q6N9ydIiTvm3l1/3ODBLSZwN48+qZRlL7IP2sg2z/qKeLPgKhWY0BYaMsTzCMXw9V4WKKL04Jdr/xC72bZDoV2dMLDsv/fIZUKWMgPEeJE438nQoPIPFUsGO2vdpePUmlFQJEjgYA/QX2v2XXzDfKzbfpsenQ4YEI6jDEcFci2D/ji2dA== 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=TT91SQCKo33BAXE2AFLA0tEtdJ5LjsgIFhy4otfZVpM=; b=nsaMAFxIVSOld05rEE7lt0CGY85tT1gOLx6sTRZ82vwG9TJkY/sY3wjwz9ow1z1Ahabj+zfzZnJqFwmXAjWqY4K2dpVc2MCcTAnBxkaSOFiMVM1+L8Ft2sCfJn0Z1wEfmlGZ2N01qKo64V1NYICq6l+IGOdKGmUU9/i2ZGyIwnlbykOlTmwYuYL5PFqKyZw3kO4V4S9kaCRGA7QlR2NKH//k1HKSkXusJA2sSND+r/N1Fla1fSghopWQt3zlUIjlBFG25fwTmVbkiRnLPs93wtUHAHrRSTZEaTNtPrFPjT6aO+fuaieJY8sNnnvp0T7LprpA/WALkOJ6b21nOguMrg== 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=TT91SQCKo33BAXE2AFLA0tEtdJ5LjsgIFhy4otfZVpM=; b=P+52dTL2Exp1PZ8xCFGnKPv8+fTcqT6t+p5BKV+FBEdN/T9mGWi7Bg5OF/x1sppRoPMjySbS0NnXhz95b4f+RREpAUsS93fUlKaE0R98qjlNWvcCAd+2eoUSBhpqspad6nrpP84XI4V3L0q1x7g4+WvTIwYM/AgirMVVMf9SUo0= 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:47:03 +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:47:03 +0000 Subject: [kvm-unit-tests PATCH v2 1/2] x86: access: Fix timeout failure by limiting number of tests 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:47:01 -0500 Message-ID: <162880842111.21995.9414122849581561486.stgit@bmoger-ubuntu> In-Reply-To: <162880829114.21995.10386671727462287172.stgit@bmoger-ubuntu> References: <162880829114.21995.10386671727462287172.stgit@bmoger-ubuntu> User-Agent: StGit/0.17.1-dirty X-ClientProxiedBy: SN7P220CA0017.NAMP220.PROD.OUTLOOK.COM (2603:10b6:806:123::22) 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 SN7P220CA0017.NAMP220.PROD.OUTLOOK.COM (2603:10b6:806:123::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.17 via Frontend Transport; Thu, 12 Aug 2021 22:47:02 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ce030ca8-d55c-4c13-12e0-08d95de31a71 X-MS-TrafficTypeDiagnostic: MW3PR12MB4555: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PxWGygamGWXSDe8M5MSopluINWu/gU43eliCq1J8KnP4HjpRv83Z+u3UF596wLqHoQvxDw3Lr1iW9U6t5GbEqoyXRaWlY+bAS0qhDKytTb/yGYcam2YP+/2vS9lk7YoNOGvMRYrybQW99GdPqIX7mrBlx3nlXZPOLq8ccB0nbXrcwClY6Kh6fGnIGHJkYpu0a8HZTQ0awIz+UGinttALFmtrC1nV9BEhOsdH1suvJ+TFHJUVFkt+HeLPeqCYBObPP+nPKGOgQ7I4r3k1kT0aiKHKNafqxgW90Y8zJrutzFygGhoSCQi+37FI5Ayj/3hq3/KtZrqLhLtriZn7Ivhsd3VROjRpbQo5N+gIvySmabudjAONef5A4DQJPKr6JuhzhJ8T2kszGoLic9yYMcGWW5IHO72As446TTJCVnuSMthz+dwkhhbSIlxz5GPvIA6XXwi+wXr1ONIUScmEBMtCrKXV+ahBcD0x5sDo+wbDtswq7iEPgZLbxL3uJEeCyukvTPBiEFRqLNTGetkknNsoWFNr8Y4P8NkENuU3xJuqC6kn+sOrc2U+P6jBJzE3LB+RDUwHC2AzDFFo5ANHIix7Zd2/w3gf8oDp/2MUhVkznWL48S4V0pUQ1NXxJUXoCmChlQrqSEk8y2Oiekpiq/F7nIVj8pp607SrWpHiKUX04NoJjnKshXPUE3H7JhE0lAvzRv5UV6GftlcdGcbW6IpghQ== 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)(9686003)(8936002)(86362001)(103116003)(66476007)(6486002)(66556008)(38100700002)(956004)(38350700002)(33716001)(16576012)(66946007)(316002)(8676002)(26005)(6916009)(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?tdZryHVhSylC3rjuju3n8t4JQE3c?= =?utf-8?q?7nVhRma0/h7UkpPpA2dzZSrBj3ItuL+g31207uOdCtMIW18ClZt1hPObVpqfqhpsA?= =?utf-8?q?xKdq849AEw+YApIwBI26qtEFzfOcLGHWvNeCmh+n6y08c+Fc/GfBc/6z39i4sJNVV?= =?utf-8?q?JpcrjavavH4/zEA6NZG4aWIj6igZ0m25Gdxri3P9pLcF2Xp/DIFtXQSR5+7abZF2r?= =?utf-8?q?71jX11/O+1PZohw79TNeNGVSSsJ+mNy52fISolzfAgALqQdZVzL3w+UGHEB6x+O60?= =?utf-8?q?K4BoIzZ2qYtzr4VVFJH4nsxWi+p9MKNlPxRSRhbF26k/sv0II996OhXXRpM0sxkBT?= =?utf-8?q?ztM095nCXunPt4coyswGPtPiZJZR5Qj6NcxUIYJgFJNw3dYubLn3HGODehxpMYOlp?= =?utf-8?q?V8/WNCoqmzC/AeCZrukMeM3gxNor31WCgYrDcmSA7v3nAOTCRC1b0ieLy5+jO+egY?= =?utf-8?q?SYSCHUIZjItQup17HRDLJ2dOes+i1T1MDok3xk7JzpSRQe6G2HPVMa+nGJADwlqo2?= =?utf-8?q?l0iAKIsSqa1X2ZnMkKN1rSXuOsLC+EIZ0zRtSk5ZrBAn28Oni2uyEFG2IT3PSHiqV?= =?utf-8?q?cI51cawj8ylwrBLbSWn8W68tXe93FikP3xeOhRLEX+MsN42SQ/CU3PsCQGHksDrFe?= =?utf-8?q?GWAi6HrFqenejYD9LYOdlWIt51j+S4W85MH78udN9sZEcOB7vXHpgYLAvt68lJx2W?= =?utf-8?q?xDp1DEZY99CYj8eAOqoS9bO9zvv1bMLUU30HMlXiCbHC1W5f4dx8bnq17N2suGKLM?= =?utf-8?q?rG1hfTtRFA81qKb/C2clzAGSHH8KOtGFHMJ6mv5JIAx/3EUsOaOnpXjL8mN0p5+ph?= =?utf-8?q?JpOMCN4EV1EYfjYoGNtbjdt9P74bSm/+mVJXpX9Wzc8/soBqI5d8Hg0K0gSBTXb5T?= =?utf-8?q?8iU6pN44AIyaDyUN5TDIAaAz6EHoy78HmXLYkdfIfPcL5Kw0Kf2ybGapCFTaHMusG?= =?utf-8?q?28CRr9UNVc+6EiKRSl44PrCi8v0ButXMZPtWTgdnGEqYxwRjIOob+c/6NkgHlHzan?= =?utf-8?q?Hrcb/GBLgWtXgifu0SAxhwoAbEFa8G3tCfsD3KiR72IQ2v2A0e7dS3PhVlL2jYYHv?= =?utf-8?q?edJjQFdMBtvCr4WD9DqEo5VykR0xy4RHcnSagZmkwFy6mG1yGh0AakzoclkKWH+qS?= =?utf-8?q?hq5i7NBerdwtBIadvB8iHVAKOGYEguwzzijRvpA665Ocx5qb6cWhPaUKM3MQHviZH?= =?utf-8?q?MgzB/P0J0mXKI+Vvctzo1DvlHwp8ZRmWgqP4Na8nm+STbcgAoqieTYjFQZivFGvX6?= =?utf-8?q?8N3mE/lhf6Bhzitg?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: ce030ca8-d55c-4c13-12e0-08d95de31a71 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:47:03.3139 (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: SZ39sA6Lrf+IVdh3+PyQTPtW101HQOwHtIgefBfob18+qlRRroibTSawrNobcbm+ X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4555 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Babu Moger The test ./x86/access fails with a timeout. This is due to the number test combination. The test cases increase exponentially as the features get enabled. The new machine adds the feature AC_CPU_CR4_PKE. The default timeout is 180 seconds. Seen this problem both on AMD and Intel machines. Test fails with following messages. #./tests/access qemu-system-x86_64: terminating on signal 15 from pid 20050 (timeout) FAIL access (timeout; duration=180) This test can take about 7 minutes without timeout. time ./tests/access 58982405 tests, 0 failures PASS access real 7m10.063s user 7m9.063s sys 0m0.309s Fix the problem by adding a new check to limit to the number of tests. The new a check limits the combinations with more than one reserved bits. With this limit, the runtime goes down from 7 minutes to approximately 2 minutes. Signed-off-by: Babu Moger --- x86/access.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/x86/access.c b/x86/access.c index 47807cc..c71f39d 100644 --- a/x86/access.c +++ b/x86/access.c @@ -315,11 +315,14 @@ static _Bool ac_test_legal(ac_test_t *at) return false; /* - * Shorten the test by avoiding testing too many reserved bit combinations + * Shorten the test by avoiding testing too many reserved bit combinations. + * Skip testing multiple reserved bits to shorten the test. Reserved bit + * page faults are terminal and multiple reserved bits do not affect the + * error code; the odds of a KVM bug are super low, and the odds of actually + * being able to detect a bug are even lower. */ - if ((F(AC_PDE_BIT51) + F(AC_PDE_BIT36) + F(AC_PDE_BIT13)) > 1) - return false; - if ((F(AC_PTE_BIT51) + F(AC_PTE_BIT36)) > 1) + if ((F(AC_PDE_BIT51) + F(AC_PDE_BIT36) + F(AC_PDE_BIT13) + + F(AC_PTE_BIT51) + F(AC_PTE_BIT36)) > 1) return false; return true;