From patchwork Thu Apr 14 17:15:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sid Kumar X-Patchwork-Id: 12813776 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F3D3C433F5 for ; Thu, 14 Apr 2022 17:17:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245464AbiDNRTg (ORCPT ); Thu, 14 Apr 2022 13:19:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345800AbiDNRTP (ORCPT ); Thu, 14 Apr 2022 13:19:15 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE0F4630B; Thu, 14 Apr 2022 10:15:54 -0700 (PDT) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 23EGmU9X008887; Thu, 14 Apr 2022 17:15:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=VLpyCX0yjxAxu6ZycAniUTGqJ77JJFiBrIjSukyXEHE=; b=AreQT5W2JoSVzuOeJ8igdbcIPxQCooqLiNuPM7Vuvvdf5WXRWTguveAuebL/xeJKNzkc MFh2p3xwUWMFv4U666ofj8vixjjjVAxRvUJv7PdiPy1tRHbpl0NVmu7dnvLCnt9+rhDf mTU1Tv+0zTRE/JYbJ9LMLdzpv0+mK2WgV94s9TQoC1ZnTxdpeXKqIdWYZ9OWVuPW+ipb hB5QvACHLLMzkRJUpO7fIR698q7Jw7wGJ2JX+pBC2hw0QtAsNPCbDjJ7BRatFc09DQyJ z0+qGQnDL2ZK1PQElzwGZ8M+WYf45T8U/wTznQcQL0crWOhQHgAvz3m9LD1T4VGBBsmZ AA== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com with ESMTP id 3fb0x2neyp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Apr 2022 17:15:43 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 23EHBPGK016054; Thu, 14 Apr 2022 17:15:42 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2102.outbound.protection.outlook.com [104.47.58.102]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com with ESMTP id 3fb0k50a2y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Apr 2022 17:15:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XO7J8IXFDuci6JrduIkyV3WuUMdgqC2p8dGHMZM7ECuyK60zZCq592LbzO0FrEsnJf4TH2kEmR+WiuwhbI18ijk14wzsTAg+W1trkaDMVxbPWRkClhd7k5CxPaf+XdloJhEe0V1k6xI7nHN23Bcv8cFH5pEFNM347Ro89Hi5zUPQCjyuabXBW3S5GCzOdZWTQlxZoBgqr2udUtROvSZD/sM8J8YtC6BKw6ZYjEaPZUoNXX1pED0yIiUHK5k62cE5J7IlQjFmM730bw6i1QpJjFBQb+Ctq6TnSiJVuh9nTaV4tYfUbiGOXjfF0UdsrxNFQB991KV953laqWlpVQk7aQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VLpyCX0yjxAxu6ZycAniUTGqJ77JJFiBrIjSukyXEHE=; b=E61tqEVqkesXmf9yyqgTnpUmXeY0uqaLPTqdePaGncUN1kXe8C9wE31cSEhRtkeZtoW0d1f2XI4G3KBo+ODiIlY8O94V6rt8GfRyDQZksmy6XwnEWMoAoUTeQhSN284URTDrcyGvDQ51mgN4HCpxuZhdi1QbKNyhEHkXk9oSSPDUKDRvC2YOaQjbLGLGn2r+8njwN+1Z/+WKM9py2v21jMfjA41Uu6RPM/XYcvDZw1k4mIqJZBSPUSVDeqSYPazBLcC0s9fid8HM3S5ZHo13zoeOrZvpetMGsStRutia27CoUnDoCg5ZtqHGwyloe+Cyj6Pd92vCjauLDDDxkULJ0w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VLpyCX0yjxAxu6ZycAniUTGqJ77JJFiBrIjSukyXEHE=; b=kxWQZVwHR+uEtj4mQVjl9GWoJqjcLkFD/PqF50JGzMCzmtlOF8N4UdBZ1jsRPmyKr1rnZCLr94VXl+lBAsZiWaJKVUtbvTTcj7HSwp4zYfwQfsjTQS3z+tWMIaETtkoZ5RdJzIGHPNqv48QdP/umBSzwVHOPzB61aTXrTdAo6yY= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by DM5PR10MB1516.namprd10.prod.outlook.com (2603:10b6:3:7::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.29; Thu, 14 Apr 2022 17:15:41 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::a8c2:7a0b:5845:1675]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::a8c2:7a0b:5845:1675%8]) with mapi id 15.20.5144.030; Thu, 14 Apr 2022 17:15:40 +0000 From: Sidhartha Kumar To: shuah@kernel.org, akpm@linux-foundation.org Cc: Sidhartha Kumar , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/4] selftest/vm: verify mmap addr in mremap_test Date: Thu, 14 Apr 2022 17:15:26 +0000 Message-Id: <20220414171529.62058-2-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20220414171529.62058-1-sidhartha.kumar@oracle.com> References: <20220414171529.62058-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SN4PR0401CA0007.namprd04.prod.outlook.com (2603:10b6:803:21::17) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ffa977c4-0653-467d-e065-08da1e3a66c5 X-MS-TrafficTypeDiagnostic: DM5PR10MB1516:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BTABynwnnmoHj90dEILMC2h+hiGvvtMbAhtEtcb7Y5JUlHpOMg6u9lpJ/luJjiD4HBB/0iwKXiOCKpYfVNzaOMeTt+/9Hywq66hZjak769UHc/CUD3G5vzATZ8sfoTyCVDaynKkZVEf5hYlWDzyrHXb6Chuk5jJ+gKq5XT+6A+6dWVrycCEfeyrHK6yGh2Jesxb7DFEahOahrDJ/6fFb7zUpSxvjZVQVuX17vOUlKiff3q89wS+PVHPHw9RBwtf7hzgrt9wHetzNMj9pl/DIETYiEoxQNh1PJaCsIYrnXwjtbD+sc7+kj7pi+8AhGJ4/IZmGem736wik3kweBIw81aplEnBwVf4oMWarZ17a6Lv0edilgvQ/lTB6Pl1EBuNNebnQV5GwuwpUYDyOsdekmWdCS126AEiIeA5Bt/7Mpih7yIKRt/xKrsr8wf3EnFnlZZ3s29OB6HMpIKPYx5lA7x9tYcLYmsCw1jPB9m5dB8vlc2mgHvusJHzgrSB8UgeOn6FN9F+mfcUQFIONcMoFzcUmNvatlO/0ReKpjSISGmLcPVP9d7qi2h5KBSqkASc81NePTE/UX+SkYomYIqxvsuDrMEZBazp0QrLWQsjByTWu/iorVJ9E3az7ADPxzBxgNJIwhG2NM3PLfpTcJEEHOs9hzAigAviEmTNSrE06zycw8fByLBDQpDoAGbDLVzM2DMYYqCh5W8/H1gTgX0bdjw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(66946007)(4326008)(8676002)(5660300002)(44832011)(36756003)(6486002)(52116002)(316002)(66556008)(508600001)(2906002)(6506007)(66476007)(6666004)(8936002)(186003)(6512007)(83380400001)(2616005)(26005)(1076003)(38350700002)(38100700002)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FYkqross/IQrDx5qp8DQp8U95mwfLiehRRvwcrBQqJGDVnoLQSe4OMMdIYmI0q8jVOprvnxnxxoOpoqsMHQKZKTw4UMz39GNzb4t2TzWiidqRdquZTva2Zmh0JCDzhyWXV1GBTIgZKm6wIfQXOGDJsdk7mwAwnL9MUGZG82oUjbI1xuQRwjH6lhTEOZyGvmLkfdp+DwlZDYVp0Iyo0sXhR1kEXL9VqdxxsTWFC1sTFxNvUjoJkJKUHKN/UlM0D5wlzNqWoZl2A22Dn+DQQj23vXUNVlLXZAxR83b263g/0zANx++0FpfQrbO9zDlFjxOs7gOWIqMQmqkUw62ZpB5Va4zhMZuTTAeqPv6UDA2mYiHe+z0g0n/zc8HEmirdrORIEjV1u8CvMSDAk58fqfTDyhwJMOUYvE3ahJD8mmK145JJPqZ2Suc7JUe/VKquAaHNTqxojhhIqdZvKEkxQGWhBlIspUEk+zag8BrWEaSbAYtrfXzlVAUC164wAvqr1pquNaEayZnSLpJ1dxeh4CyO4pOOQTpfk7Olm1S1deQ3LowBPejz97auCmeYe6vOnsUm0PJbtZXrNQQX7+KR9GPeEx+xKssTRXj8Z8TmadPvBD/3EyY5sSPNr4zQURuC2MgjOfY5Mxlu41CfRxdtU8Me9rZFGxbi7AEJwaWJExht2E/CqsSABPkdbMrEfKg5QyqgL5u3bFH8rWgoPtor5aOXkVyIuNl/Yik6KkJRlufrM5ol/mOvoxoO3rm7jMGdmTsgxYTR0NDhywQhEtitXcn8J7K6eiyq+5cTDb8K8BbX9N5bSFQNuclLYkR6rlreMkASk9VYeJ7ehcQqalJE4z0ndFeyhTkgqIyV5LRZpmJyN8qyu0AU2KQVaiC9WBD5P1OV55Gs6muWRi3orKMms3hjRiRkpV8n22JLNOaHrpwAwbp8geVudydOGpbVxSx0qw/84Xal+5w3sqZI4djEE/sjuias4meE8W0jzD+YkMre9bO4E2/n+C6/Ssq2oNOmegthUvQPjE1yPsRgPxW/FaaxywIM/cDHqidPGUCyijUzJUgosC2jRNRa78UsRWX65cKw1P+6s0UEGPonXbuxrzNgRilgtFf3CNOCMAbJMWNyOejtBAlrnEYgQn+pHHdb+kzrw6PqvwjlvaXPsMB5aRKna4LseviJ53ZEKIu+oJYacEGHSbcx8IEq2Bbu5/Z5eJbkCRB4AB5Or9GbkZiRFQrJ0/EcUl2oa4QEewysNZcddXD1z6WTrLaOkyG9QIxuSO+D2slf7f4f6sLR3yIAkIUPNrdsr3uhAJkk82/HWhGr9mwjXDkaoa48TF0cll+TkL4otNpKuy796J4f5Pxsb1reV7qDkpX4L+mxp0RBP4NFmDetaN84uCBAhMWStlP3OamjJB6BWnP0mnki0cMhrCF4fc9IaSqWTnyfh3RZiwXBaKMWRruJmK78+NJxu2Q3J5LTxYz08p7fFrbrcwQjXZ5743yxL/Ie7Fm10L44P7TBqZ2nFrScYuSv2pxMNcDvderdE2ZqcckIGf8HqNbfIAZ1HZtFaj9nviqDQ7peW+Ndbw/Lf9ZS++wGt8/s+Y1uoYB9Erlzhy97D6XfIxj2Q+y82Zhsf/AT8hE6ggPbj1dZrc7kDBLOqZta74IPjkQ9pHxmLCmjdR5aMc+qslPmjN603X2fJLaZYDIM1rCxf2ojpKxBEarwL5nzwpt1sTaJQVu78kzYD5RvM8A1A5q1Spsgyk/7mCsdlrjOoYEv24O0ik= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ffa977c4-0653-467d-e065-08da1e3a66c5 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Apr 2022 17:15:40.8620 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: IaB5YMR4zlj+AjOsfXmh4WfLEHsa2F6xF2i3HMnIQgHjXmHQW5QvzEKFbD+PFI61rg67LVgukk+vSW9dBYsP3uFE9DfMQsNCLecuiR+2Fto= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR10MB1516 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.486,18.0.858 definitions=2022-04-14_04:2022-04-14,2022-04-14 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 adultscore=0 mlxscore=0 bulkscore=0 phishscore=0 spamscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204140092 X-Proofpoint-ORIG-GUID: j4NuLrqeGoPFuI0stfdAncyLKm-ALcE6 X-Proofpoint-GUID: j4NuLrqeGoPFuI0stfdAncyLKm-ALcE6 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Avoid calling mmap with requested addresses that are less than the system's mmap_min_addr. Running the test as root returns EACCES when trying to map addresses < mmap_min_addr which is not one of the error codes for the retry condition. Add a munmap call after an alignment check as the mappings are retained after the retry and can reach vm.max_map_count. Signed-off-by: Sidhartha Kumar --- tools/testing/selftests/vm/mremap_test.c | 41 +++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/vm/mremap_test.c b/tools/testing/selftests/vm/mremap_test.c index 0624d1bd71b5..58600fee4b81 100644 --- a/tools/testing/selftests/vm/mremap_test.c +++ b/tools/testing/selftests/vm/mremap_test.c @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -64,6 +65,35 @@ enum { .expect_failure = should_fail \ } +/* Returns mmap_min_addr sysctl */ +static unsigned long long get_mmap_min_addr(void) +{ + FILE *fp; + int n_matched; + static unsigned long long addr; + + if (addr) + return addr; + + fp = fopen("/proc/sys/vm/mmap_min_addr", "r"); + if (fp == NULL) { + ksft_print_msg("Failed to open /proc/sys/vm/mmap_min_addr: %s\n", + strerror(errno)); + exit(KSFT_SKIP); + } + + n_matched = fscanf(fp, "%llu", &addr); + if (n_matched != 1) { + ksft_print_msg("Failed to read /proc/sys/vm/mmap_min_addr: %s\n", + strerror(errno)); + fclose(fp); + exit(KSFT_SKIP); + } + + fclose(fp); + return addr; +} + /* * Returns the start address of the mapping on success, else returns * NULL on failure. @@ -72,8 +102,15 @@ static void *get_source_mapping(struct config c) { unsigned long long addr = 0ULL; void *src_addr = NULL; + unsigned long long mmap_min_addr; + + mmap_min_addr = get_mmap_min_addr(); + retry: addr += c.src_alignment; + if (addr < mmap_min_addr) + goto retry; + src_addr = mmap((void *) addr, c.region_size, PROT_READ | PROT_WRITE, MAP_FIXED_NOREPLACE | MAP_ANONYMOUS | MAP_SHARED, -1, 0); @@ -91,8 +128,10 @@ static void *get_source_mapping(struct config c) * alignment in the tests. */ if (((unsigned long long) src_addr & (c.src_alignment - 1)) || - !((unsigned long long) src_addr & c.src_alignment)) + !((unsigned long long) src_addr & c.src_alignment)) { + munmap(src_addr, c.region_size); goto retry; + } if (!src_addr) goto error; From patchwork Thu Apr 14 17:15:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sid Kumar X-Patchwork-Id: 12813775 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BB70C433FE for ; Thu, 14 Apr 2022 17:17:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245437AbiDNRTf (ORCPT ); Thu, 14 Apr 2022 13:19:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345807AbiDNRTP (ORCPT ); Thu, 14 Apr 2022 13:19:15 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9D62630F; Thu, 14 Apr 2022 10:15:56 -0700 (PDT) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 23EFuT5p031505; Thu, 14 Apr 2022 17:15:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=h+3Yp+2ll8sEAkTnMwI+chofBR8PwXQtteB9632ICt4=; b=bf1nBTiZVbqs6Ez8hOCBGni0X9FqEuDbTXou+waBw2vrjmAaNTUZM89W+U0SxEVb2xQu z60oAmh2m7TdVmF7B6tjgZiLge0SqtBSxVtxT3LgYixhnOqpI4fkcz9MgGTCYexY5RNJ sL/RGzQzVGGnDCv1WOvud7DIAMRgm8wlrKX+e/aWZlS7lkVDaSgw3sQGIgUMNuA7zZIk I6qlHK0jwShNhnOpCrmS/Gz5x9jHcet7gy6Rcr1fATAb4GGYv/+Ei5ku8+/cPuXIYsBx jX1pQ7W7RYMhBY/7o6SI/PRldlI1lTrNxxbghotgIzAPHBlITAy1ScsNC8YMKyXoXHk0 JQ== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com with ESMTP id 3fb1rsdhw3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Apr 2022 17:15:45 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 23EHBmiN012522; Thu, 14 Apr 2022 17:15:45 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2175.outbound.protection.outlook.com [104.47.56.175]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com with ESMTP id 3fb0k57g29-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Apr 2022 17:15:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fqksKiqdm6G6gqYKXMIZEse/L7Gt1voxTbvlsmjbpyWMKSifJriRfkOwgkI5VQrTWW4kRWJ0c+yQbqD5iYed3qp0qbGIKaweJYnwWsxXcW/oMvhoR1DYSXpJanH4L+uGNIls+SojCQN0tOgdlSZ8rLgHlxB2K+B76JZKAivla2n4l39HBKEyAacRW409lsX+Kfd2KQY1Os3GIPHydbLhjkU5uK1/l44e03PK+7sRZI76HHAUZAlLLC/jfMfybmmrNaREx7+UOxaumchhrYrDBoy4fVilYSI2XfjwhcD7nbAdKPv+8NDg+tBi1dHt5q1+1mplWS6OkG8IviMoLWiSHQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=h+3Yp+2ll8sEAkTnMwI+chofBR8PwXQtteB9632ICt4=; b=kbly4DrR24kJbmHszHt53WS+ivbckYOUHseWxplvSfbDHstUU2IA0bDngCtj/U0d0P28hkXEy7a8nTxzVFip+8v3/R7C7fM1MLSTVVPFDde2UMe+cON6O/gRTf0BJOhjwXxxqRbfP8lJTg4uNhHK6gn3kWKfIxP9tBK9aWEAraPX0Omx+f+t8SgYQK/NHxaz02USC4NK0Lr3fEPjIY8bd4vywykP6Q8E/o7mYbd9LZ/2J8A0xpEG6Um2HYuHXArTrGb3LQSmY5x6cwhOgPP6Sinbc+EVHM2uUQCHXlM8gi4EGvWURX3cf86veB5KmCIVwFqXaZMDe+QmxE5zK1LKfA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h+3Yp+2ll8sEAkTnMwI+chofBR8PwXQtteB9632ICt4=; b=CApg6/iyoqvyYGcB0i7vBw/gdazJ/Yp0AJmlbIicoENlhACeSAeGAQhbDjel7byFxXGRm/2tBO75xjWvXgm0z/foB6Y7/E5JR1nvnU9lT/1US4FXwuDjmgmu45qBAk8fdFFvBCJztF0aJ1slqb0hmX68Seu39U1LEUuxvtGmcno= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by CY4PR1001MB2344.namprd10.prod.outlook.com (2603:10b6:910:44::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.29; Thu, 14 Apr 2022 17:15:42 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::a8c2:7a0b:5845:1675]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::a8c2:7a0b:5845:1675%8]) with mapi id 15.20.5144.030; Thu, 14 Apr 2022 17:15:42 +0000 From: Sidhartha Kumar To: shuah@kernel.org, akpm@linux-foundation.org Cc: Sidhartha Kumar , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] selftest/vm: verify remap destination address in mremap_test Date: Thu, 14 Apr 2022 17:15:27 +0000 Message-Id: <20220414171529.62058-3-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20220414171529.62058-1-sidhartha.kumar@oracle.com> References: <20220414171529.62058-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SN4PR0401CA0007.namprd04.prod.outlook.com (2603:10b6:803:21::17) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0ad12b10-ae26-46a6-0ccd-08da1e3a67d8 X-MS-TrafficTypeDiagnostic: CY4PR1001MB2344:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MCXWtGA4JFwZEbN1yIygN0GriIAA8YtFylOlEVWWJdlkuBMSY4Jh9drGoeyYjNkvvc9ceJPParsmFTu7PwPIs3bjqw8MqM9Gg1UHwmP8uUCgCsUhJnGV/y5kySGo4H1mUXlozXhveadGBM1jxqOuHr+epf7mVuHXzCReMbedZLBTH7+rqLn+P+5VUc40D6p6QaqiFTfTA78CNRWy40xiaQdwsfhcZI1j1PPwfJdAJZ1J5drOnd34YK7KjfFFbEkxSQjabUPyC0mvudYzF+tPCtxshq6OIMli68tRUQUqQp/AoR+H2dFN0PGfGACaza2kvr0mKxch+BF43ZPP/oaIQy7RAEJKCas8W3qzTzfir579udgfHzhYp4I1birxqmR1ScUr20VbkQj0cSol6PFXBI3UHpBhmZ/AGL59V1ZMc1fLvEboxdZGw2oz3Y4rtcrcT6kHBEHxSFI0uBsBSpVVztGx0HbLTA5DzYDpC3I/BiAi6q0sDIweTn1GL6hfq6wKc8vprp0o/WomIdxOFBMvERXLFLQJ4JY58tzHfQDmBQeykvJzzmdU8OVnTlKJmtv6nEdhUpfHSp8FIQwmFOYFIarqPSgz0U9gTuxPYJGGiqCAvh/XNuSZDYX0zVTIwWHdffZmyF8GOu4Ex/GGF7cp4IjKDvf9tJ+nwgYM58GXpJSg9PWGoxPVM9WErU/ra3sqQz4bvs8WmJnDfVvUZErGUg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(52116002)(4326008)(36756003)(186003)(6486002)(86362001)(508600001)(83380400001)(26005)(6666004)(1076003)(2616005)(6512007)(6506007)(66556008)(66476007)(66946007)(8676002)(44832011)(5660300002)(15650500001)(2906002)(8936002)(38350700002)(38100700002)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: aVkCTqMhWt4QkIDcNkzUISWR6DjlNgaJgXXH1ebTw1vs8fX4IoBmF3xakAFwjTJG2IsZtcmv+zLFCx55HYz577UgsxdQ2jtYlezgIutgD56Q+seJxkgNlJWkoVk96fOG4BynRW5M1mGbKnekBXbnqw8zpGcei7iMgxXgtBBu+1j5Qy0WLTmisSwXj5C9lUpQ2HFOMJvk59aXDeZ+6Z9/xZYyX5yDCGKzMhCAuyjQizXFSNX/EvViTQWb3yZ+uVzVwyFipvlb+dkf18bA3NEcC8wnMJPiF41pC6HilwpLgSr5+bButpvBjn1xae6i8iIccGE0pkYUDrPbx+wFpqbOP/h8zW0DtBZLRyF/7b5OghpET3p3AltNV8oNYRXPbKJs/3RMG0g0eTX/yWPfR34w5rfiLdfInmukE8I7Nci74u+M2Jsa4+3p8HGHI8Y0RLiurowa7t+fT+KeGea45dtaBUzp2QMk44hNSsjprtdsKmcoUuizrrudxmWQ53ss4BIdK2xUoPI5uPjPKr2oUvzwjLOK8wOWxKWFD39sEpqLmsViZzc7i2bIE0RbkaieszPwjG+06gck7Ueqhlq3Yhg2ID9G9w4Nj8y5AXF3SIJZewEdNMwDeS2Fk+24HvjMQdQTh72ZKAnuMEh4/ddS9Mz6wWz02WYw6yhSeKFm6zKrDAXWAdlc+926KNLurM4XZyCXiJEV5+OCMyvsljx93ZIcMqAaPz4NkZYH9ntAfm82liLmz/b+cEJWvNi+Fpkze0iKI+Erg7/Gn/HTwM5CoLrpgtDNjG6+lgeM9fSIkVXxaekTcksvTKAQBrdbqc5gyKYLZAw43Q3y2hZJfkaeHtu3GrG7Wkzu+XooCBxr5+aUXL4obi2T8pyy2QroezRoKfdxwKdXXbc4+B7F5WTHdyhBaOJ97uHe3LLOQhm6L+bqDzvGG727ecA8B30DsXjLn9qAoB61v3h1f8xdC7k1CmE5Upo6c/x+rUn9W48vsgIKnaf0ybYr1pPbQUw7rCIZUCqVqqTq63B7zjMxoSjR1gLm+xdMdbdW4Zs8MyZc+SuF7fp/ye8LjtWmWjdOt2KgqVGQkWgQqSvLSpHrL9WCoUmbIYHC010LbTUx0H6YzJUvkEOq599HUvooLb8ZtHTloFKChfs5h5ZKKKfVfNwvc3mP59eTn2PYOK11lFvPKaBxEXvHaJ8DZI0DAbhQ6W/JqEtZQuOt2E482nm7GVXyIj6qQlAkFtRMEoFgL0okBV0FJVApAdbQuFXgaB2VqXb4mHEutsKO4No8wEk7D1A1zyiIXAlI6Q+RR7pd7clo/PbVJlanr6qsTXAkmui4yK3OkDk4rMutoKhFFlxsqX85krMBI1pyRZAuaZP6+ycNJ2TOEzdj0Z/56trmGWc7ch7V7PSXjEcmuhydvVmwKKxJQNH/KVO9qpzyhYqBXkfOMEDxbGy7gVsOYBoDI1HrzQTuOAIKGbtbgEVlgHa67znicbUAbTvcO84lROtTw7jUAwzXFtHxoV6jJ9jjq6gElC5sz1nFlgSomwM3dYljux40d8KnXiQ9cJIAJjU7/aKv9QECd8GgcZdnowHuh2StHOALXWSLjGRu/T5yd/0HorEwFT/yVgqlPlIyrKT3yVxqshuGv9OSp1H0YP7bSoBv9MdS8EfvNuRanPpVApOXLB2dlFINRENzwymoAZn+KEGb0KgWrJns/cqxoclf5ViiFx3TuKU0PR7APTM1nKSMjS82WiG0w84v+GVpFQsXXYrtGMJGtlA= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0ad12b10-ae26-46a6-0ccd-08da1e3a67d8 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Apr 2022 17:15:42.6900 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: zJ9COhVnSdhAYplyZrzNq4m5Wr0m8bquTUF76A0Lri299pdTJ0jHtyu1PYD8T4tAmigvcTlgyHLxWVoUz3/ebRWN4GHeAmh9XbbDrVoAYqE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1001MB2344 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.486,18.0.858 definitions=2022-04-14_04:2022-04-14,2022-04-14 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 malwarescore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 mlxscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204140092 X-Proofpoint-ORIG-GUID: x5R3_Fugc65hwKds1ri1zvaYW1h0CZ_d X-Proofpoint-GUID: x5R3_Fugc65hwKds1ri1zvaYW1h0CZ_d Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Because mremap does not have a NOREPLACE flag, it can destroy existing mappings. This can cause a segfault if regions such as text are destroyed. Verify the requested mremap destination address does not overlap any existing mappings by using mmap's FIXED_NOREPLACE flag and checking for the EEXIST error code. Keep incrementing the destination address until a valid mapping is found or max address is reached. Signed-off-by: Sidhartha Kumar --- tools/testing/selftests/vm/mremap_test.c | 36 ++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tools/testing/selftests/vm/mremap_test.c b/tools/testing/selftests/vm/mremap_test.c index 58600fee4b81..98e9cff34aa7 100644 --- a/tools/testing/selftests/vm/mremap_test.c +++ b/tools/testing/selftests/vm/mremap_test.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "../kselftest.h" @@ -65,6 +66,34 @@ enum { .expect_failure = should_fail \ } +/* + * Returns 0 if the requested remap region overlaps with an + * existing mapping (e.g text, stack) else returns 1. + */ +static int remap_region_valid(void *addr, unsigned long long size) +{ + void *remap_addr = NULL; + int ret = 1; + + if ((unsigned long long) addr > ULLONG_MAX - size) { + ksft_print_msg("Can't find a valid region to remap to\n"); + exit(KSFT_SKIP); + } + + /* Use MAP_FIXED_NOREPLACE flag to ensure region is not mapped */ + remap_addr = mmap(addr, size, PROT_READ | PROT_WRITE, + MAP_FIXED_NOREPLACE | MAP_ANONYMOUS | MAP_SHARED, + -1, 0); + if (remap_addr == MAP_FAILED) { + if (errno == EEXIST) + ret = 0; + } else { + munmap(remap_addr, size); + } + + return ret; +} + /* Returns mmap_min_addr sysctl */ static unsigned long long get_mmap_min_addr(void) { @@ -180,6 +209,13 @@ static long long remap_region(struct config c, unsigned int threshold_mb, if (!((unsigned long long) addr & c.dest_alignment)) addr = (void *) ((unsigned long long) addr | c.dest_alignment); + /* Don't destroy existing mappings unless expected to overlap */ + while (!remap_region_valid(addr, c.region_size)) { + if (c.overlapping) + break; + addr += c.src_alignment; + } + clock_gettime(CLOCK_MONOTONIC, &t_start); dest_addr = mremap(src_addr, c.region_size, c.region_size, MREMAP_MAYMOVE|MREMAP_FIXED, (char *) addr); From patchwork Thu Apr 14 17:15:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sid Kumar X-Patchwork-Id: 12813777 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50B88C433FE for ; Thu, 14 Apr 2022 17:17:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245506AbiDNRTi (ORCPT ); Thu, 14 Apr 2022 13:19:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345812AbiDNRTP (ORCPT ); Thu, 14 Apr 2022 13:19:15 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 654DF6310; Thu, 14 Apr 2022 10:15:57 -0700 (PDT) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 23EGg2VI029058; Thu, 14 Apr 2022 17:15:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=zZRdcGLcIn5cE4lPD6CeWBQhju46dsEH9q8WluE8gf4=; b=cRLTtpOhPoaQQOhJr+YkL/QnwjQNnoj1GNDtE81ygt7Gz206s//3OxPW5AstN6MtLKQU 1/TKGz/aBlZZpcEOSQEs5lCqfx2wdo0XHMUFSqLpfRbjvRUCOnEAndsjMmhRX99R7pV6 G9n6TEB6PZNMae5JhCI578m/HUI89PqCXxLhydlXwtWZYSwOKAARfjspmH5aOi7pZC7S eVijP38ao/m7BV5DVDKWe+3jScxbmXsTB4JYgw75yo/NPhx+TcZGWufmUwaMtPns3VIY +jB2fwlYe8flMr3EammycZGXyuPm7rAp2d4F68MMt21qZv4QJBjL4/+f/edqV8K7jSkU lA== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com with ESMTP id 3fb1rsdhw5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Apr 2022 17:15:47 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 23EHCN2K028929; Thu, 14 Apr 2022 17:15:46 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2108.outbound.protection.outlook.com [104.47.58.108]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3fcg9kyh1n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Apr 2022 17:15:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WMHTH4bQn/i6BLYMFll0mKJQ/JLfQEZNQdQu0nicN3CDN97OJbpECDVKZpSZuX9PdQnuOs3nN2dJyV4v9QPbsjwjchhCxQ16Uv+9hiWTUx5wDLkTIWQ4P1jTRuS8q/Rewk1SewaO4G4wFPFoOCcnjBwmsn7qoOqxjcVQNFgFovXE2raXTqfioiNdNPpi7fHi/6BtYWTmtYHZI9QqOnkmroMC8/tTm7D1Ju/StU3efE5eQn1l4IAci989371Fhh0S0ykLrYd1nBYZCjRFkTVe2a7zwjp07WCSfO/MIAd4X4OIVKiIxRzM8nNosvNojCuUbWM73WMYaIT+GDFZt8tT0A== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zZRdcGLcIn5cE4lPD6CeWBQhju46dsEH9q8WluE8gf4=; b=Qt0BXLmrNVCnCh2YGD7FELCVhIGYKFue8Jvpmd3W/1dSvCU18C3ioV/SdFEn896DXh/mp8gIdNDFYvuSEgQLoVLq2RbU4t+Q6+SxozT3OB631Roi05idU9YDj8XVKDJWgrdPDSl6MiIC6Tp6YGqBcYWM2eAYHxBSa5FgBA9igfaWasA53o0j4jKQ9UGgahDFIIxqPo/dD7NspFsjpE8JLGAGwYTLYK3WpQcW3uVX7iYsCp5jT9Zri3AYEAAntUotgNW8cN0pnwvQTxHyK7zDQ5kQWV23SzTOcuMtOaTCTfbzJM8fUcCw3o9hc0KCbgTG7fNvhlQxO6EaIbVO1t3tIw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zZRdcGLcIn5cE4lPD6CeWBQhju46dsEH9q8WluE8gf4=; b=T/GFGWku+CEbrcJ0vuaGFy8PCM4TLIdP7mhcKflOBCiuHcLHpjT4l0YmdhVGAzJ0aiYLwJGirKrVCb/xadECWhDoElg1TkTLWe9fY1+Ll0EURdZ40I+rl11krHt54jcru6uhatXk4f9YUDPhs0w/U52qENmENcxHEvJSI57/Rzo= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by DM5PR10MB1516.namprd10.prod.outlook.com (2603:10b6:3:7::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.29; Thu, 14 Apr 2022 17:15:44 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::a8c2:7a0b:5845:1675]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::a8c2:7a0b:5845:1675%8]) with mapi id 15.20.5144.030; Thu, 14 Apr 2022 17:15:44 +0000 From: Sidhartha Kumar To: shuah@kernel.org, akpm@linux-foundation.org Cc: Sidhartha Kumar , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] selftest/vm: support xfail in mremap_test Date: Thu, 14 Apr 2022 17:15:28 +0000 Message-Id: <20220414171529.62058-4-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20220414171529.62058-1-sidhartha.kumar@oracle.com> References: <20220414171529.62058-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SN4PR0401CA0007.namprd04.prod.outlook.com (2603:10b6:803:21::17) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4d506e9a-bccb-4fbe-5783-08da1e3a68fe X-MS-TrafficTypeDiagnostic: DM5PR10MB1516:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6CAr/51hZtb7ydlwWAn70VT3Ewc5gkCg9/US3KWSWhU7NNBUbcchwGd10vR0kBp1puBgyowY2Oz4QXvv9oKhZa2bCL9nhRJYUJbmTZYSBUwLZytWxNgQf3Sic0kgZOv/h8KiHrVRUz9a9S5OGDon8Z9KBtLFxsOd4+Wol+byCsQbya4J+zzZ657EJ8bWOAwdtGM0jFYpiDnbQyNpbCVQqgFULGWlKACPot+gFJjbs01hUq6ASzKpxkmL0cfI+VeG0QAPO9PDJ07MAwj6OqC6fjWFe4nTiUi+du0QOIMnyiNIeylHu/5x8H9HLPjWzeGsqHmiiE02tlVwntLC+Bt1zKxi5iCZDZq40Mhegq4SV3vPLAlsHqA1CKIJae8OCDOEfJg3FGBpRxar+FlSTrUEoEfaaGiExUrWnQNuW2j0nelg3IFFMWXgBPzXYoFa+DZSn1RFjHuNnlgG1xbJQ3T8CULmnd/RH7qFvzDN46HWw6EYur3PycaHA9Xi6g6yBP65FXT0UWTFh2ylhvq5zvy9KWzFL9SLEo6FgRhipmW8ES8E3rTBwzuxX37H6fVZh6u9cqVBtGnhDXB9SpVTu+TGz0o8SjSpBw08ZnziwREkgwGTlUc5UcwBwgAISdA4c89YM2W4WbMIAahWtyrIDuI5u3wX9rscSxpBaHAaK2PU2AEuKzIwiHJRz2XLdUlwPqXNzc9FK8WdEttUxYcRip5QYQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(66946007)(4326008)(8676002)(5660300002)(44832011)(36756003)(6486002)(52116002)(316002)(66556008)(508600001)(2906002)(6506007)(4744005)(66476007)(6666004)(8936002)(186003)(6512007)(83380400001)(2616005)(26005)(1076003)(38350700002)(38100700002)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: hFs02Y+57VuRj5TE611RbqK83G7yP6liOIKuim/TOR+u0UFi1Zf8WlcP+VmqiP65quFaD10KTzgzVtFYpThenSit9jH1XkKUhuZivXqu47oZlkjYn/ipksrXYDzcY7JlTKAketjeTjsgN46/iq2UpIz1OCwiJTRmuPsNcqFD/IagzijiQ5z3YjMNePsCywyXSnJ2RmyWqsg+C0xFBK/BIuCLAp90yBTmloz4eTDqcmFBTMipDfBczAOCOL4fncBlKNf8oJT8a+vjW2K/1yHg/4GuaNFpfsVOyR+6JRp2RMBKsQm2/JhpfyZeIN8lq9oeQkQAucJqEwE3mUv3fJaXQZR0IS1/crkk8DeqY4tcdpqEqKch2b0bXGppBoQ7PRy/yZxUX52zFVkrJe82rYRR0O7JATt8lnMGkcf28fY5xjgywmzs2LvaUjfq8LJ04dQiNubBcz2AjXK54foPRD953XZs1yFRINHwXlsQhpP2W+piGAq+YtYLfeESY6OuK22iG9wwqYdo5pBdRTq1JVy822lkkTFcvZZsFbJaSfnrHMrMWjmqCZcXi6iPCmuIMkK2rFTy7LITClN4IfTIIWODwBSl5VbSyM8apihVwjxL+Md2TMjAMS548FAzzb8V5Wf/xIHy1/o2MRYTzxG2HIczrMOGkPR1ILL9c+/oksvRl9Kko3xHaGoV8xWCmHmmgvTHY+qKZoR39ukC9rWhdxRCgWWZDBHGgp/KIQv/TCe3mhgnijQZjLQdwSKbEqU3cMpxKMckK0zlfdQ2MKLiWmvrFGk3HXg2H2Wj1b07HBqhYCeaXptQoRnd5n9L310uszBknLYdzPjQYghjiYTOHiMhp8xxXvla2A40++0mgSRhMSW6zMX0o6N8kg9n/mQAY8d5zNkUrpes7o/OZrQHj2X6KprEo9euq6rHfRDA7Di1DRr8uuAHgLjp75vmJr6gNMqw1ejT15LkrVa79ZqyrrKpFz19NlT4l8F/6x1iRw0elmVW55TuSbtGBwI/h2DLVuZAe7sqR6B28Aow/N90+F2foWy5P2FFmZ2mJ9Ir+zmDCuFLSio2YJn9dSQZMHebeCpouFNrKSp6CbXNUKizt8nZdbXyYuc3ZClFDyGvyGfcyZuRIv4RtAhvwfyYntGlDWjewOBa0Myzn9r2W6W43pfmLSuNgmXmtZoO4TscYIb8RpP4bT5e7UJUPKNrrVF+tB8B8feYu5Nb1i6yNBqPVcnCqq9l96lHaBNzf1E2UJL6eEvOImGXZSMIgiEeVQmbewhDWXzmKzJbWprbJmgKAAWkqN8TpLqcGAvl8VtVtUia4eFs2YiLQUuzk/XrNp1Mf8QO6vCQ+BNZSf0Xx5zR4tCkTDY4djXFEI6gN+QZ9xVaxp+GSPwBlNdtJ3bZ24PLCcClfKiDg5S5jxTQao5CsDfhyETWMEIdJzItVOVtpOBvGbIcpESWZFrZhAPqbhzRB/6ukQILjqst5pGtSfHmDHLsiFIw7iVeI7Dq73phTiZAqwI7kz7yWAJIXTBy4IlOXNrFg9nTNcekWeNuAarcei25vSlhnwbyATijc5M6OeAcAXGERVjEOeXU7Omkq/uydEPbzRCYYY1JTnroSTmR0qZ8pbHDbmvo3EVjk7/ewwLGZjZoATq7w53YOh3h3Lu686/2UR5arLA2i0WdPU76Ajibe2N19Sgg7fc0U+aepWLlYycRjKibXgLih67Qvo/rQK1bu6gYyTvZrAtmymC29echjACew5Bs0QBOi/krzwm5R/Q= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4d506e9a-bccb-4fbe-5783-08da1e3a68fe X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Apr 2022 17:15:44.6344 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1pfKUMzC9IbbexkusaBMqulhoX+kbJIAsBC20srNWqNI0jpADFb9j16wPt0I+Vqi7W/phxTRCMixbOaTZ7uAJjaR7dVPuFO4GE5/v6r5Zjc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR10MB1516 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.486,18.0.858 definitions=2022-04-14_04:2022-04-14,2022-04-14 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxlogscore=999 spamscore=0 suspectscore=0 malwarescore=0 adultscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204140092 X-Proofpoint-ORIG-GUID: hup11fRWNqslPdzbF-7gU-jQfeWJ4DZ6 X-Proofpoint-GUID: hup11fRWNqslPdzbF-7gU-jQfeWJ4DZ6 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Use ksft_test_result_xfail for the tests which are expected to fail. Signed-off-by: Sidhartha Kumar Reviewed-by: Shuah Khan --- tools/testing/selftests/vm/mremap_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/vm/mremap_test.c b/tools/testing/selftests/vm/mremap_test.c index 98e9cff34aa7..ace9c3596ed7 100644 --- a/tools/testing/selftests/vm/mremap_test.c +++ b/tools/testing/selftests/vm/mremap_test.c @@ -269,7 +269,7 @@ static void run_mremap_test_case(struct test test_case, int *failures, if (remap_time < 0) { if (test_case.expect_failure) - ksft_test_result_pass("%s\n\tExpected mremap failure\n", + ksft_test_result_xfail("%s\n\tExpected mremap failure\n", test_case.name); else { ksft_test_result_fail("%s\n", test_case.name); From patchwork Thu Apr 14 17:15:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sid Kumar X-Patchwork-Id: 12813774 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F037AC433F5 for ; Thu, 14 Apr 2022 17:17:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245235AbiDNRTd (ORCPT ); Thu, 14 Apr 2022 13:19:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345803AbiDNRTP (ORCPT ); Thu, 14 Apr 2022 13:19:15 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F77A6305; Thu, 14 Apr 2022 10:15:54 -0700 (PDT) Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 23EGh4U7029741; Thu, 14 Apr 2022 17:15:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=ZJS2TazoVpOx6lNLJpMOjqk/mT8Hy8aLpYjiZyXj5JQ=; b=HrlyaOSdI9jPt5SGVGntYzlhAAJDZ17q9GD2/Y5ZeAaRqDAvsLRUuU+Bnom3L6vPzKNr zA8zifz6m6IxlY1UjzoxWf01RQsZVESyczhVBPkQT8sP6ysDZqTQG88bDn1X8gJ+Tm9o YXA12Rg/enliUEvPLwjUhRSYKW99zEEUJQiNkLEO68hcbgVUEOE8UVu34XwihazNPfdi kQobgVyAj8Tc/pRXQmBGAqinz1k7lYYu7cZ0D1E4/Z6yD10Ls5K+6Tl9O3/EiaAyuTCT fNVdG3d7qsAz/L1haQWlNNqSRrIDL0aadqyF/LaBXqWIIgPFDdsT0150DVPysC9spLdz Bw== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com with ESMTP id 3fb0jdd1w4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Apr 2022 17:15:49 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 23EHBUvG029678; Thu, 14 Apr 2022 17:15:48 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2100.outbound.protection.outlook.com [104.47.58.100]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3fb0k5kxpx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Apr 2022 17:15:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ws/nqQelAA0yuwtSE13jrJ+z/mUgM+HNdB5JPCjfcxS1WSVcseg69P0LCLMzgSsIZwtcbhtzLf5un6KacHSfNZSzlM1JclX3IiFAuTOFuR3FaxuNQ0l9iqFpw7teDvjcgEwC9bfx8dEvEGZPCm7xTDuFIpaF9UmQCN3QvpddMpIE7XgHXMJkjqeHeSa7Vyu45gRascz5cYRda3oaJQUeRE7VQqQZJm/UbScT5lDatfLQx3fbdaF1sqRtA9UTW2+J5zg3pHBzTJR6aUL68PDngkt3ket2DE2e9U57GJFm3jmfI5klS9iEGWmSJcxdd+bcKj37LIdgt7jEv8MFZ7UMtg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ZJS2TazoVpOx6lNLJpMOjqk/mT8Hy8aLpYjiZyXj5JQ=; b=jK5F4/6X8AukDiOtqvFjMswIJbET4fZ9/j9Ds/7ZP4WgwDXARHNmakBQzM+mAwznmCshcc+9lBMGJpP0j/WTVLEXXsDVaV/59WddB1wf4E7c4l+hFRC5U/hJ3ExMaw5qUo8QgTTtySSAFFiLdfrT83wDgGyteHsqoICGfNT9tqhPjc75voGxMkW42D4X5Oki1GDOLW/m5VkNjP+4UNnlDaELNB8NTCQcXr4i/+vmMA0FhOVrYRuDP3aY46zgdKbSJsZUyUtuRoyhfh4n6X3vOy7qb5ZTyX0+9eTjsTZFxfVTD8WQO9Ng+IX/zmWUfruRyV5p8ox9scbGb8NDyrtBZA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZJS2TazoVpOx6lNLJpMOjqk/mT8Hy8aLpYjiZyXj5JQ=; b=BLFPh+8JKt+qQ5Xw3u9GNo9PC7IiUkvZ8jzSYJK4H2X9iU/3WnUivmjpW/UFS1ZijfnUXt+Bb0jo7dZxjHJtsKa0JMY2CfUaQW6iofMN2rRcjOSflQ5jsGz8X2k6qNJlAENxjGuyF91b53mjwhorQpHIkEXsdPQ7qWgmd2iOfaQ= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by DM5PR10MB1516.namprd10.prod.outlook.com (2603:10b6:3:7::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.29; Thu, 14 Apr 2022 17:15:46 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::a8c2:7a0b:5845:1675]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::a8c2:7a0b:5845:1675%8]) with mapi id 15.20.5144.030; Thu, 14 Apr 2022 17:15:46 +0000 From: Sidhartha Kumar To: shuah@kernel.org, akpm@linux-foundation.org Cc: Sidhartha Kumar , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] selftest/vm: add skip support to mremap_test Date: Thu, 14 Apr 2022 17:15:29 +0000 Message-Id: <20220414171529.62058-5-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20220414171529.62058-1-sidhartha.kumar@oracle.com> References: <20220414171529.62058-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SN4PR0401CA0007.namprd04.prod.outlook.com (2603:10b6:803:21::17) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 84fe81bb-f08e-4c46-4e81-08da1e3a6a34 X-MS-TrafficTypeDiagnostic: DM5PR10MB1516:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sZf1qsfv/Fp22HJMHIlxnpvtBO5C0t1/4kBuxaQeT+Aw8VrGncQCXu/CbX59ztLVyxAng/k3EI9qj/39s+ti23SdLw8jtSdhkTVI+YGagK+sNutiXT3Cam2UhB0mJ9e7iq7o89F5qORr4cuhsOrzClXuKgLzmkgIs6IBGMJzuA4T5YApTBiN0E5/C/bqAGtVoNG8oETBSLAiNV6o2qLnbDoHPg54U/XPolwckZ7FE5X605DCIT7UqAS5HzBMVDadlGn7exKqkpa8kNQPRsocGd0lYT1HfrkJo2sIg2FysJpVhKP3hszw7FK15K+JsFXEgc5Q3HUU6WAdRj2ljT6Pqyz4EbXZKk+zIbWk8IjSecobwhirYn6au3k/vNW48RQp7+/MY2pamw/nD2iet/B8+vOJ9oawpivJvyXG40D57XZTDoJeZeDzOTVtJNAZk1txWQq4W/ODgzn0KEZ3/CmnUMK0Iz8YJ6nD0QvN5iCJ/irXbEuV8kwHdY3WMX7180m+THoYfaKaN+8lG2j+8rugXsQz56Cl6XRSgRYYh6CR5f0vHmZAiGrmauQhDUng0z0r/N/oTlCotEJoj0kFHWlH2prImzDtiMwIx10HfOV5/8hlapLZw3gBTExhXoqeLaK3ekzO67cMSLYJaikLLV+2b5hvndsKPp2KaitGM99pTU+9YDQBb1lvKD+t77P061Ajt1sYr7JM2WksI7BW8VzSlQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(66946007)(4326008)(8676002)(5660300002)(44832011)(36756003)(6486002)(52116002)(316002)(66556008)(508600001)(2906002)(6506007)(4744005)(66476007)(6666004)(8936002)(186003)(6512007)(83380400001)(2616005)(26005)(1076003)(38350700002)(38100700002)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: UzrP0bppnEWvlKbAyWtzHRP0L4nEjiK7EX6JgJ2YrStBLb2jm+8ia08wQonDVQtbUmJUZdc9FNhmY1NxbtjhZDjajLu7MelP76C3tAYYAB1yZi1kTkgFokcjPn6ejj9ofvnZ2Cru3yUVr4LOo+Mnjnw1ItpwvTHC/yb48mJSuBUHR2XTurtEyMrlkl/f7obztZqr1m5R5afJti99f+qIxj/qYXht8ehv+v5mxWTycejHMFN4HR5NMyJ6JwEJxbw2XvDHzs3LI+oyrlPAS/Si2P3qTl3nDpYsthtR3FwD/DzKPr0wTBY9z/Z+6SPxd13JUcqVF0ieoetOd2FeGqDLrNmSuwVjv2AyFS+f2v3VfwAebAAmYQnZzY8v/7A9PERxmBqW7IldD0itHnfTJcGRC+6NEH8EM6u1EXz2bRRkFfKqZu1NsaICpqU9MrQKdGKDORNrdHMlP5+KO+9rDHQBkufguYKvtSrc/ERMSM2w9UWk3VGTrPzOqzYG3fO4wjmWkuhu66KNxgWxraQgIFDrk8Iv5gwY3Muvh5EymvgbO2GUe4SxdpopstOKmnYaah3559OSssK1hxrugjH9TsD9UN8dpyP4PSeWUS0rbhVGQmTmj0l9woQ6flfsNmIFZM5lsKpZF1hvte8TJ5K/DUNEg1lbFI9oUaVJ1YUC1LOZmsrd2GmJodAUOkgwLlmRxGJovuy+g3t+fHPoUdtxLeCsoB1xzkZUPWPbK6zJPpAW66qQi7kWXH7AE8Ei44cao7GlXBQE3bVYWnUuWqmrhU/kkIsa5Wf3VaVZbWw6Fnd8h/tx15YDQNvoo0fvMIEqdCPudfBBzw/LTcFphxVx2DaIPjWI75urieuDo2JNSvejfSVn6nDRsBziC9znKuvUq7FN98ZfDKzqlSHaeznJSzREjDu3BMJm8YLWr3qAhmVNopgQBfy/nJpdKngnfoduLFkM6B9A09RS2lXeWcenviCfcf3b4Twv/33JuejheWcxFU/13H+SCcNE4onUYwjeGG/4TgmJirXfsbkvjjErZa8fWm//IRfwEstvyNKm+sWB+B491BS6OzFEJCYru1HHJNAhUl6lje9uGgu4SVqTYliB/3BVpqSS2xOr8+Ofy16/gGZIXwyK+PbDJo97/m+6HpdKhio3JKqHpRAb0gB8GGPS/65jolQQkXF9TVvbYGYOaO8oJjyzBPwPwqRfbSEt4crRyQrfAUqRWEJfG7kfy1LVmeF+m4sAyil413W2CAiBzRhiq2wuNhBLdiTyWRi0mvizNDbHRMZG+CX6HwqXaR5tfqYl/FBlqcU8dzfUBYGFvPRYG44E8OboMXY006b0hrYypPQNYo8Vmp8B2amGX7B4Dxb/0sP5iucosE+/6BZmP3ghhofG3MhHEJ9FHhAcU7owcTGp75eFEAhg3w1v9SaJKY6LM+n7NmeyVsbzozvzbX9CfbFZZWLXSZ/f+mcIBf7lRIvMZFU5hHITkQWQ+MdkIw+MSF/K4hBuJzmngR506EyzFLP+N6sp87rxNK5FTIf9agod3YUDvmGnieOk5P3xMQe6vdxnSm6zPZ2Z+LA3SC/HftHBqkPWa3owrmpas8TWp1jzhjBcU8Th8qfOyr1ew0SkmJtBTlCsQX9bkHZUFhrWR9/JvBHXVED2xKgia0q5fjgCuiec7ajYo0gPKbDvgwBGGLGWRkM17Lqfthz02QYp7VX+zXXR/PEqt59lEWrq0kJ2AlwwRhnBvSVi6sIIylIvTvDP3XZvNzo5eeKTxco= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 84fe81bb-f08e-4c46-4e81-08da1e3a6a34 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Apr 2022 17:15:46.6657 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RjDmtRYptHXgwiXbjf59FFahPO39V9945OGYgtOH5NoDIhIZA0Gg67VxphjuEjzCHl5dsP3HuwT0REKVk7OBOEucnCcNYNuollBMZJtM6O4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR10MB1516 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.486,18.0.858 definitions=2022-04-14_04:2022-04-14,2022-04-14 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 suspectscore=0 malwarescore=0 mlxlogscore=999 spamscore=0 adultscore=0 phishscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204140092 X-Proofpoint-ORIG-GUID: JwvzBQskxDtkGd1Aqiv_QooF-N8wZa1Q X-Proofpoint-GUID: JwvzBQskxDtkGd1Aqiv_QooF-N8wZa1Q Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Allow the mremap test to be skipped due to errors such as failing to find a valid remap region and failure to parse the mmap_min_addr sysctl. Signed-off-by: Sidhartha Kumar Reviewed-by: Shuah Khan --- tools/testing/selftests/vm/run_vmtests.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/vm/run_vmtests.sh b/tools/testing/selftests/vm/run_vmtests.sh index 88e15fbb5027..eae98f5de2cc 100755 --- a/tools/testing/selftests/vm/run_vmtests.sh +++ b/tools/testing/selftests/vm/run_vmtests.sh @@ -272,11 +272,16 @@ echo "-------------------" echo "running mremap_test" echo "-------------------" ./mremap_test -if [ $? -ne 0 ]; then +ret_val=$? + +if [ $ret_val -eq 0 ]; then + echo "[PASS]" +elif [ $ret_val -eq $ksft_skip ]; then + echo "[SKIP]" + exitcode=$ksft_skip +else echo "[FAIL]" exitcode=1 -else - echo "[PASS]" fi echo "-----------------"