From patchwork Wed Apr 20 21:57:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 12820845 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18681C433F5 for ; Wed, 20 Apr 2022 21:57:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 72B206B0073; Wed, 20 Apr 2022 17:57:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6DC466B0074; Wed, 20 Apr 2022 17:57:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4E0396B0075; Wed, 20 Apr 2022 17:57:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id 3F5D86B0073 for ; Wed, 20 Apr 2022 17:57:53 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id B49F212290E for ; Wed, 20 Apr 2022 21:57:52 +0000 (UTC) X-FDA: 79378620384.15.8194BDB Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf16.hostedemail.com (Postfix) with ESMTP id DC66E180025 for ; Wed, 20 Apr 2022 21:57:50 +0000 (UTC) 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 23KInIsI009531; Wed, 20 Apr 2022 21:57:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=tLsqQ6KwnxR8ySvJVD4/a33QtGvbjfVSrXNfY9lKlgw=; b=mEN8TsdljbtTz+bp3nabxvSadaZVCdsIJoGBfLlhu9wi1VgysZ4+pYHfDMFry8tnwAc6 QGb6DJ12lhSvT35qb1W92SZP8eZV2jIevkRTkyQdWxJ2o1rtfVeeqm3mph9Qf3RgM626 YZKDq6rtH0b0R1IlFLZE5EcC2msLaZ3kVlFOwQSQLQfV7GQf/NXViGugbE9CJPp1ZLKg m2AP0CYdx/jc6uReY6rD8KP9ihTugZcYo6nc0SRUJz2FhvCwuhKY8L3nrxNpnSdT7xda QmSttnaLt+N2V4d0f6ji/Ceqgwa91suCeSyrW0ir48pNzE/6RJ8DJvsWWkOxnZYDDXgC Yg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com with ESMTP id 3ffmk2te8b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Apr 2022 21:57:47 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 23KLuBj3015959; Wed, 20 Apr 2022 21:57:46 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2171.outbound.protection.outlook.com [104.47.58.171]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3ffm8823md-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Apr 2022 21:57:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jep9vFtZiMKbWXQNwFYqorqNruvFSZC2AP8aSA19t3hNxjbFyosg2YTgNMDLT5TsarzqDKZcmqGdkZ9BzcI9rYxs64ntltg4rPIC8h3WHtMdKq06OvTwR0smcqm1e55Mkn8mXDq2zckhe22vrD/LgWfmf1OACcDVKf1/Esu6OOr4dl4phpDBpKWG0c8UrbrMYWnf5LhqOk1Oe3FblScvPnyeiZC4sU2dVMU7m7fyZz7mIiXV5P6vtsXdGhtiu95b50JFND8Tc3VStQP171oh3NvJpqbpcgMqMoiSI8E/zE0HQP+/vEz1IFFOn7ffVxAouZfkoaN0tM189EqT5NJQSA== 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=tLsqQ6KwnxR8ySvJVD4/a33QtGvbjfVSrXNfY9lKlgw=; b=apzfJGnZezbaWvX1C5ORvpWk6/DvhmKY/XNCoTKARSgfbiLLyiAjT7XSKwVCGSjkCskxvId7vPJXszW++WiC/HGVPDZtLhi1Bm1HrGIqPv4Tdp16L0FdV7g9HI1Q0Q1T3pH3cHbldU6Tc/a3h0WnnnA53oMhI4VPJtROwjUfsKLSdtjhy5HjmEdT/hvmZTHo14mZiipjFzSQp4mACv6tOq+czDo5KuxgkJ36bJJMuTh55uXIySHEDn2l/h19nVIQr+0OlBPaoDt84iP2wnBYUqp7P3WaJiaRa9pXDK8v4zol4B20CxY4Bt2Rg/FhwdYXe2+LNdWLLqPZvSOgnQX8Tg== 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=tLsqQ6KwnxR8ySvJVD4/a33QtGvbjfVSrXNfY9lKlgw=; b=g1xUbNfSLSMgnmXLk1FZ3vG5AKGgLqzcoK7krsq6IX9VyAWL77kxPBRaIv2cAngciwa395S2ZMgspNL/gw1e/fwKoWfyHY8JtJH6L/AScY5jn7oEdn6jjuT2w/ryOSgYa1WBzSWugJ5oiPM2CoDhotYxa+0EfNwwopsfqTH15PA= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by BN0PR10MB5350.namprd10.prod.outlook.com (2603:10b6:408:124::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.14; Wed, 20 Apr 2022 21:57: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.5164.026; Wed, 20 Apr 2022 21:57: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 v2 1/4] selftest/vm: verify mmap addr in mremap_test Date: Wed, 20 Apr 2022 21:57:18 +0000 Message-Id: <20220420215721.4868-1-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.24.1 X-ClientProxiedBy: SN6PR05CA0012.namprd05.prod.outlook.com (2603:10b6:805:de::25) 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: 98e7221b-23c6-4e97-9d14-08da2318cc66 X-MS-TrafficTypeDiagnostic: BN0PR10MB5350: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: jCMo77CcVWNShFSGGsQ5wGEuaowivXtL1eW0eC2hrG1sYOBmJcDwSai/GK7kJF6X+7tmvFr+uuOcypFP5i5aMegxtiWjaYgNzyVUR3EGISrxr+IKkuRT7rU3hflrso1/g98kKMIgfCBII7XOROcd/U2myv2ZhGlO2FI8zYssLVkob/P4PXWsDYU2BgnQ2uawC6kNP1H8m5lB/q4Y4i6DY4beym8JGVBrJnLvk3InW2Bwx7qDGTZfY/viQnlcPIdQfvGluq+79hxAjj37LbhGxiVJqHeoEpmHL+L98zdIySkIvnCuq9wUYqrIKNwZqXDrugDW0DqOXwccVOalEvaRZRne3sULpEZTaYVlxg34BmF/2/qTju3qeEZHGz5dEAginTQuYWh1mCdCWKPHJIBAaLHfX6h44rgKQj7y/+lEyIr6g9oDpXlGPc3oLDxWpyDXHdDuJX57bKy7FWH7WVpDpWraLWTzDTvEegVPmakdgHv1YuVvpTkOZO5fQL5LIIHJs/Bz5sAT6UN6HjdR27G9wt9un7w7XJAa4qGnEdlvY/+q3ErWcTOsngQJUfXsV5f0+wNncStZGkAEcLsmyvhn6C+PYIUVz26uZ4398gzF3gQmMcIsyTzXtvTBIu2KlfRYODhE+flIYkQ80c2Fnp3Z2hJVLIMMyyDYb8V2AGIa8zF8+JxPLZyFgD0d/vojvEj56eJyCxO1yrTpSA8IWdk7qQ== 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)(6486002)(38350700002)(38100700002)(8936002)(508600001)(86362001)(316002)(4326008)(186003)(83380400001)(66556008)(36756003)(52116002)(44832011)(26005)(66946007)(2906002)(6506007)(6512007)(1076003)(5660300002)(15650500001)(66476007)(6666004)(2616005)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vSVXKu9Spc0A7XT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3wk1EjphuzGGWrk6vdtyMI9g32lczqv5pw0l4fxPAHaLkW1vYtF8vD49EBvoupO931x0lRJox9dlZxxDhaUCEawvN6wod3tyoLaR0jOxoJ9xqkB/Jjgpp/Onu3U2ebUVLuJOQWEtK3Z2dg6bY8plhzwvcgl17KOdfBh4hqfATJGbZWhGIkwWLASXVTMvS/+w8Eih6dGj46bBBj491gMptwfLxpYOCkdjPOokCqSQfPET3zOG+sb/0cRnu/ie2vq3e+kSmmNepIWLMc3Ns+afeXefeyzMxkW2nqCUus3zkRwHP3qghIyJjG7snrDNCJYzgsgt/HnOAAmGZssKWt5rdvyakiU45YueI2CN/WtlYkaAH14lsIwQ/bXhujWcqG08p3hnvfb9z5BvNIj6TnRNpS/WckbWPBdFkX01wPwLh1Z2Tu9G7YN7DiwhefmvjHNT67ryvbrhOiky0bzZiETCrUhuOzyEkTkplROg1JN5YJWtjVvj3z31xfE2ssNOk49CqkcCWHJ91Nz5ETABT+OgeaqWsBRmLdIuB+mglTf+dCu/7s8N3HBW3b/RLyLcj8J0YUPgsj3MPPUXbhDwwRhv2VdFwAbuzj/b8nAh7xpE52KmaaJ7/eClpRAKqkr6Mt00mVj7sWdsb4bWaggR7TY= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 98e7221b-23c6-4e97-9d14-08da2318cc66 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Apr 2022 21:57:44.3060 (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: 1aqZ3aPDEFniKxz8+UiR3r+46C9viMSryrJ4WYDHM/UkltO67aAFgetyrxPwy7mbejPKwV2BeRtgLxr2VXYZTtXiLHjRvr2CNnP8ageKixc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR10MB5350 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.486,18.0.858 definitions=2022-04-20_05:2022-04-20,2022-04-20 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 adultscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 spamscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204200128 X-Proofpoint-GUID: aqTgcwaqHSVa7QiZLJPtxpr_Zqqg1JvD X-Proofpoint-ORIG-GUID: aqTgcwaqHSVa7QiZLJPtxpr_Zqqg1JvD X-Rspam-User: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: DC66E180025 X-Stat-Signature: 1s17c36pqude7h7he6ordfctd58ctzmh Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2021-07-09 header.b=mEN8Tsdl; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=g1xUbNfS; spf=none (imf16.hostedemail.com: domain of sidhartha.kumar@oracle.com has no SPF policy when checking 205.220.177.32) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=none) header.from=oracle.com X-HE-Tag: 1650491870-508326 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Avoid calling mmap with requested addresses that are less than the system's mmap_min_addr. When run as root, mmap returns EACCES when trying to map addresses < mmap_min_addr. This is not one of the error codes for the condition to retry the mmap in the test. Rather than arbitrarily retrying on EACCES, don't attempt an mmap until addr > vm.mmap_min_addr. Add a munmap call after an alignment check as the mappings are retained after the retry and can reach the vm.max_map_count sysctl. Signed-off-by: Sidhartha Kumar Reviewed-by: Shuah Khan --- v2: -change comment for description of get_mmap_min_addr() -fix commit message formatting 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..2b3b4f15185f 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 tunable from procfs */ +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 Wed Apr 20 21:57:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 12820846 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA39EC433EF for ; Wed, 20 Apr 2022 21:57:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3F6B26B0074; Wed, 20 Apr 2022 17:57:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3A7576B0075; Wed, 20 Apr 2022 17:57:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 15EF76B0078; Wed, 20 Apr 2022 17:57:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.27]) by kanga.kvack.org (Postfix) with ESMTP id 084DA6B0074 for ; Wed, 20 Apr 2022 17:57:55 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id CA6EA2673E for ; Wed, 20 Apr 2022 21:57:54 +0000 (UTC) X-FDA: 79378620468.27.8811B70 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf19.hostedemail.com (Postfix) with ESMTP id 492191A0018 for ; Wed, 20 Apr 2022 21:57:52 +0000 (UTC) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 23KLbMha019753; Wed, 20 Apr 2022 21:57:50 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=WycdjKiNqmEMh+xFeVDykSO/BvYKbAnJWJ33/MmaFIU=; b=yuzvpLz5NhWqYPL4Vu7HgPK9aBrQ8YtAIHB8QqHHn1rv3tNHJPtt9HyGPmwp1wVNWQJg xL1xRb8MJCccXav/JeojNYbCaNrRQYn4VWA8x8ADRpzh24S7JQBBIbMlK459V02T52bM Eokh7Moc72CWipeWji2YRzTqSPA+GCL0c1CeaNh5qK7GEmnvpWdduw8mem61XbsROo3m J4dEZOZKK3T9LIQ6NArRwF8ZxIvTRQv4L6H4+n6Fo2cclVH6qfkx2Ou6fbr05s7E4axA W+VOsEfD3XMNolIpVEL4HWgPPVQbc9VhSB9ZCtDy82tMaCHJd7xo4Z9ALgVJJv24a/vB QA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com with ESMTP id 3ffmd1agv3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Apr 2022 21:57:50 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 23KLuGQa016193; Wed, 20 Apr 2022 21:57:49 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2175.outbound.protection.outlook.com [104.47.58.175]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3ffm8823p6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Apr 2022 21:57:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fupFxWnyxsBFXJlkJgeN0DAnq7SM32ZK45D41w1x0+TaN2J1OImNY5UYP3I+sxySb7i4+UTbszDjVPyHPs0z1Q8IUyS3NN8qSaT1L6MjGgcN6xFVV1YcHts4DBXRrVgTAx3QtCTe1NnQU7G/vnuPUhLT9S9E9etscMWF84Nxx2pugZeWfxcgyQsYnQy/LJB6pHCFC7tM9jO3iP4CfFkKzI72DX2LQIvMemtzH85M5sJ0pgPH2Sh7tJkULLfJhAUnG9lprlnTUz2TQbXQ5o3t7tyWriGj9eGf52aM80JfvuojkE4SmKlEkEATRCj6JRuUn2HDpiKccvFJU2PmLb5zug== 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=WycdjKiNqmEMh+xFeVDykSO/BvYKbAnJWJ33/MmaFIU=; b=hY0dVnnE/WpW4k1BgX7YwpkvMm3XbwanMV8D3l8oaHh7KZSMaccoLrMkUU2VU9E3mcElzH48JbNM06PgZkN8uXqxq6s4T380c51Q15s1szXlHMtYWcOoTZ41fmz3Whd6tW1FHMhahBZWccHlru2CDKcTqpHTVON+/ao6Oe1D3n0CUdvJ3y5I1RiawBvypN3cOpQ2BMpexgAuQwsOqVLrzhBz2W7cF3DqXUX6RIIFF0V7ufLG5Mx6T/E8Bu6itWXLIpK8SG2xl62ozH+8fLarsENpMPsDP4TMjJnOO1NvmFaKH6i81fomHY+iGJv0opOrmwBcOlKN+Y0jlJ1pbF1wRw== 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=WycdjKiNqmEMh+xFeVDykSO/BvYKbAnJWJ33/MmaFIU=; b=tFB7fI6vx9LNrhek+c8ydGVbfkmgf/Jj6i29kDq/nrIkulYRTY91WziuPHqee+hObphaxEtNaHqbztlvnODYFsSGnEuy0FqwcEMWrfzkfckjVJSehhEZ5/c8HbOw1sS7RL5oFaXsXVo7qO1D15xoEc8zpiv6u7hBL8wxVQf6Wn0= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by BN0PR10MB5350.namprd10.prod.outlook.com (2603:10b6:408:124::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.14; Wed, 20 Apr 2022 21:57:47 +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.5164.026; Wed, 20 Apr 2022 21:57:47 +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 v2 2/4] selftest/vm: verify remap destination address in mremap_test Date: Wed, 20 Apr 2022 21:57:19 +0000 Message-Id: <20220420215721.4868-2-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20220420215721.4868-1-sidhartha.kumar@oracle.com> References: <20220420215721.4868-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SN6PR05CA0012.namprd05.prod.outlook.com (2603:10b6:805:de::25) 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: 492aa591-bf3b-4cb4-e758-08da2318ce4a X-MS-TrafficTypeDiagnostic: BN0PR10MB5350: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: iVA4rj2eoQQ2QXlb4i+5rUDOuWbFr0FY7RoGAQM2eDlCNoAp2d9W5XB7z8+qV4UU+5EyKt8VXKSGkpv2CGZey2NYHHlMS687hhsHSN222zzI98Q+8YaCfZBGs/gAs8IMS0RvZ602PJFGziLrQNexzRrhnCt4y4+OVvd1nh+ptQE3bW96roTdcwEzlB3SjeWZkmOluRucGZtnFWQIDB21fm28eVCXoQczrX/LtqzLm75g/XNBeK1Su7q9tu4TSVphAHnNuZmPOf1gTN159DXpJgnzzCbnvKFVKtU/x0RqdPM/er505VkqlR7o5kfIbPu1RSvMAre27W8U89ip6ii3qGeyFG3i/kvrdYkPheYjYhyT7xjZFMg+9peQU6SYmbBfbuike/UOkPKATV6+BciVxFaUnfXMUlq0X65kuvQb1rc689EBD3iE2Q5qxasQzo/nAQoOGLq8Qraeay5hYu8RCv3oD04+TIuRgn9WUTbtNqQyBThEVTlmQuMTCDXQJEDTh6EnnvEvq3iwZuqAPvP3e1WWYQRe7yrovuCT6ed3B2ezf+J3XWIyt44Uf1yB96V5FkwaekWSJUi1s3DzOyoHl2wkT7dhWeu62iY47gHObfv0XMrkFJwg/J8orfcsVb3VAOQJt/OpIN1rJxrIDLufaGBhISsySURIxrJ3CXnw9COFWL7Yfk/8QS/VlDtH95b0jPzYJ9nilRspt1pXfz8bUw== 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)(6486002)(38350700002)(38100700002)(8936002)(508600001)(86362001)(316002)(4326008)(186003)(83380400001)(66556008)(36756003)(52116002)(44832011)(26005)(66946007)(2906002)(6506007)(6512007)(1076003)(5660300002)(15650500001)(66476007)(6666004)(2616005)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: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azBx87PQEGFazIfcLLmuP/t7fv4a8xFDPpNy47FEKV8IURQVGpXHmbvJ0RII+bMbvCxb0z32mxiDWzUg9gAXs+dt3RKRmX3MqWmkydJF0HLyZ+p+rEELd7TUI28dWWW3BaYn1/mzmA5Wj+b4wZTwrmsHZa4P5BuKBefvMqN2WuJixOYBrGEXIGEUHQmgJa8PzASVXP7I6jHuUd5lNGEISZNaCmarGjtbi5ZRLnFFG4vOnRRLS0D+7yEDH2lX53TE4FcJIJT049LvjXZlkq8LZPMcSRfCx3CrMCHllDpFDMe7vq9WcBfkWpF59orO9T7uV7qeGDneKGrdqlfbgay4DpTxnjMpl99xKDEKAjKS9uYQ5HsWUIddBd2tg/7GcFpyrUrONnBzsbHp4Sj55kb7WfZkTnEcf1hUHrkaLBXr8pS4Qi3nnSvxfNFN/PUlmpYnwzoP7Dl+NEkh7n3WtjkyL6ocnQ27lQ9GZr4wvCFh1wo8QGfLA1OaQaDA9DrWmeDXFxLH5/7b7N8KkTTarutk/TySBYeickHA2GnXj2JxW3SWTldwgW6Xo2hgN2xijQ4opCXIoziWQAMKGHzHfZfe8yNOeyIV8FnefDzkJTDzGnd7gCUoNjAd71Kza3sHtxZ/L2qOgKJ8FtnbLsGE+qXLoH3HnlvntChMmxwWZBYQ4= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 492aa591-bf3b-4cb4-e758-08da2318ce4a X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Apr 2022 21:57:47.4955 (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: w6OcFB5CCfNsJNOtJHbcbhqmkGg4nG/DadvBchxNST+s/5qp/cbzt8i3wsFZriL9cm4f2S1mg2e4EoP0tsNtnoHQU6FyUQEZs5DHiE78NQ4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR10MB5350 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.486,18.0.858 definitions=2022-04-20_05:2022-04-20,2022-04-20 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 adultscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 spamscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204200128 X-Proofpoint-ORIG-GUID: pN0kphForBB1PCry6DTyRKtsSvcvSOqH X-Proofpoint-GUID: pN0kphForBB1PCry6DTyRKtsSvcvSOqH Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2021-07-09 header.b=yuzvpLz5; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=tFB7fI6v; dmarc=pass (policy=none) header.from=oracle.com; spf=none (imf19.hostedemail.com: domain of sidhartha.kumar@oracle.com has no SPF policy when checking 205.220.165.32) smtp.mailfrom=sidhartha.kumar@oracle.com X-Rspam-User: X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 492191A0018 X-Stat-Signature: drs9jqg97rks3mweibq7ggbs5rjc1aen X-HE-Tag: 1650491872-748168 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Because mremap does not have a MAP_FIXED_NOREPLACE flag, it can destroy existing mappings. This causes a segfault when regions such as text are remapped and the permissions are changed. Verify the requested mremap destination address does not overlap any existing mappings by using mmap's MAP_FIXED_NOREPLACE flag. Keep incrementing the destination address until a valid mapping is found or fail the current test once the max address is reached. Signed-off-by: Sidhartha Kumar Reviewed-by: Shuah Khan --- v2: -rename remap_region_valid() to is_remap_region_valid(). -change return value of is_remap_region_valid() to bool. -take out overflow check from is_remap_region_valid() to inside caller. -fail just the current test on overflow rather than existing the program -fix alignment of mmap calls -change "can't" to "couldn't" in error message -increment mremap destination address by dest_alignment rather than src_alignment tools/testing/selftests/vm/mremap_test.c | 42 ++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/vm/mremap_test.c b/tools/testing/selftests/vm/mremap_test.c index 2b3b4f15185f..e3ce33a9954e 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,30 @@ enum { .expect_failure = should_fail \ } +/* + * Returns false if the requested remap region overlaps with an + * existing mapping (e.g text, stack) else returns true. + */ +static bool is_remap_region_valid(void *addr, unsigned long long size) +{ + void *remap_addr = NULL; + bool ret = true; + + /* 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 = false; + } else { + munmap(remap_addr, size); + } + + return ret; +} + /* Returns mmap_min_addr sysctl tunable from procfs */ static unsigned long long get_mmap_min_addr(void) { @@ -112,8 +137,8 @@ static void *get_source_mapping(struct config c) goto retry; src_addr = mmap((void *) addr, c.region_size, PROT_READ | PROT_WRITE, - MAP_FIXED_NOREPLACE | MAP_ANONYMOUS | MAP_SHARED, - -1, 0); + MAP_FIXED_NOREPLACE | MAP_ANONYMOUS | MAP_SHARED, + -1, 0); if (src_addr == MAP_FAILED) { if (errno == EPERM || errno == EEXIST) goto retry; @@ -180,9 +205,20 @@ 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 (!is_remap_region_valid(addr, c.region_size) && !c.overlapping) { + /* Check for unsigned overflow */ + if (addr + c.dest_alignment < addr) { + ksft_print_msg("Couldn't find a valid region to remap to\n"); + ret = -1; + goto out; + } + addr += c.dest_alignment; + } + clock_gettime(CLOCK_MONOTONIC, &t_start); dest_addr = mremap(src_addr, c.region_size, c.region_size, - MREMAP_MAYMOVE|MREMAP_FIXED, (char *) addr); + MREMAP_MAYMOVE|MREMAP_FIXED, (char *) addr); clock_gettime(CLOCK_MONOTONIC, &t_end); if (dest_addr == MAP_FAILED) { From patchwork Wed Apr 20 21:57:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 12820847 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4604EC433F5 for ; Wed, 20 Apr 2022 21:57:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CFA226B0075; Wed, 20 Apr 2022 17:57:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C83306B0078; Wed, 20 Apr 2022 17:57:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A85E36B007B; Wed, 20 Apr 2022 17:57:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id 9A6496B0075 for ; Wed, 20 Apr 2022 17:57:57 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 7B81E25E77 for ; Wed, 20 Apr 2022 21:57:57 +0000 (UTC) X-FDA: 79378620594.02.989768D Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf28.hostedemail.com (Postfix) with ESMTP id DC57BC001A for ; Wed, 20 Apr 2022 21:57:54 +0000 (UTC) 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 23KJBjVW019298; Wed, 20 Apr 2022 21:57:53 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=AOGzhEy8TC1CJCi3CB19nDcaVPsQOvWqY5h0L/a6TbA=; b=tw7KS82+76Hf9whgr4XnfYK7L0YY5n/qRSh8bDxrVZN05ddYI2PmJVGJnX9/aDe4prJr TEN7iQ6BwCGzUMRrlrsSMXvbgQh3yh0tnhSwCshyUP12frSP4VHqQKNMESn6/24fsXkF R0OzskVsZ8ntZGS/B/qKK1MCHvLu5v7MQ7uhPW9+6rbHvEYyTixo5N2pWUkdPFOxWP5h hRUQxXfX/4AOcyCMFbtAgnzeTaUE4g3e95ha4NOfUsXG1oM9fWqBMM2bQAznxvmaAVHw MA4c/hkIh0UjXkwPRxZsS/NuyA4t1xLLdjjxl+ZKfKWrwZKwUZFpjwmm1jX8fL1hjj/T MA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com with ESMTP id 3ffm7ct737-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Apr 2022 21:57:53 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 23KLuGQb016193; Wed, 20 Apr 2022 21:57:52 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2175.outbound.protection.outlook.com [104.47.58.175]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3ffm8823qs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Apr 2022 21:57:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hMDLev8r4XHug0A+c1irykKgOCsCmJPJXFBvT9O1v7mBjkGxfVh/6sIZ9GL44gWDxoZ5IFNTKia7DcdqVYDa1L0adwKx8AkCAHE5MNoK8e1rhi7W20gxBZ7hWrUoL6JWVlJ0K40aum6u/M2L11AkXSijbvmbmw42CPGgNhszvW25fiAzvunE40z4JBhLa8bH0cWoAfspLLHQvKgOIsQjzXXlbqhOfYIm6riUNE6nXIOwyBnAxeaez0K2I/WmfuCLBNR2X70rNfYn96x9XjRSlSZX7sEGqi1v+lwXjmbTkO7Nvnp6kFGvYyBCNmNkDx0UL2t3ekI81RWX2YeTZBnaww== 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=AOGzhEy8TC1CJCi3CB19nDcaVPsQOvWqY5h0L/a6TbA=; b=Y+jvPma5RRvz33B454LcEwShd6szpoj+nnCZxO14vjaqLfu5gufXixUSq20OhIt85f9ItjQP0XqyDYLI2uI16RkmIQXEkICqWmtq8loAd5nrDsjD+X5nooxm9Wt/bKHkLkFZkjcyourJJ1ovnVb1437nZWP1jeD0tZ2/dgptApTsLvXl8RiZI3XSO5xbt4MB9oaPEvXZu89oZeeIvcKCm5nwfIw8902t0KABIV52lBd1jHSPg3qnxKBw3mdqdpxW1CsKM2LI18Lhf9NY5GtOblQTO+MUo4ARzDVSS3wtE0AZkOLWJBqylcwJVojUwrWRtoGrp7rVsy+t6Dy0dPHA7g== 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=AOGzhEy8TC1CJCi3CB19nDcaVPsQOvWqY5h0L/a6TbA=; b=Em0g2q3Lxw5mx1LlaxB+EuV4/Xpnehm4ojwUq9Iz+HtqatOPL43qKrKqgTwARK8/noLN3SV+q5k1TskKL2vmqdD0wqpGqZyn/EzMWbrIUiB9hu5gp3XEx89R7K6phGPQm7TrYatvVTeUTVFv9QfscoQUjEjif1oATx/lIXB3aOY= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by BN0PR10MB5350.namprd10.prod.outlook.com (2603:10b6:408:124::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.14; Wed, 20 Apr 2022 21:57:50 +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.5164.026; Wed, 20 Apr 2022 21:57:50 +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, Shuah Khan Subject: [PATCH v2 3/4] selftest/vm: support xfail in mremap_test Date: Wed, 20 Apr 2022 21:57:20 +0000 Message-Id: <20220420215721.4868-3-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20220420215721.4868-1-sidhartha.kumar@oracle.com> References: <20220420215721.4868-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SN6PR05CA0012.namprd05.prod.outlook.com (2603:10b6:805:de::25) 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: d84d2533-2d5c-4a48-aa12-08da2318cfe2 X-MS-TrafficTypeDiagnostic: BN0PR10MB5350: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: LW15ORnnS1RBqe92O03bI4IxMJOfzoleuSLMYVvrLAS++Ey/DAEcqL1MMIMZ2QrDPVKSfHnJFJLAkznfLLGwFUOgyRWbqUE92fxX9s+sZ3MeaU6BxdmD5ItujGZkOSVF8fAW7pMcQcNrsJT3hZdZu0AXmQJzhAGddq5jSpA7lwAvPHWQZ5vLqh+N9senZjogyBJnIfNEVqzvXuftUJJaZBLCskzX0UpQDs4l4Ymu9RVI7S7B/QgtTTGPNiKdKXoeq2vGSs+ef+3X2hTz2Q3D0W0tVqCiYp1FfdKdw5WLawuK7lTbtmG5NlB5YOuBGGa4blFHpJtHNIDQvnUyhaeQZMDNcujBn8hph89V60IWFVIaXWcv2I9KaurWJ4ABYfCH/OPhyGEDKG1ZCKw52NGNZqNchiCezrPmYVyXeHC8pi+WN/O5oDT2ATV66UVp7+N6Oj71KOjgILIZbaIaEna2ePbcPZ79rFAhsBkevAOW0O50We9NjbPXUYZZIpwKEcWP0CoX6xr8pmVNLBT1iuEOeAqX/Hq6iY88ddIVBQk4TUhlg1s47DjwvqMM0lqp84lgbSd5Ax2HZKJHgPCMkvx3+5eLKi96sI26Q7jsy9xBpRlvPt5LAW4HYatWkXOsTvXuzYx2NkLNDC8CqFLMwSqcYV1dbGelbusTVpZGVfcIRIgX/gz1DG3WV9I4jASMnMxDwe5+x/dRd9PX5es3RfNesA== 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)(6486002)(38350700002)(38100700002)(8936002)(508600001)(86362001)(54906003)(316002)(4326008)(186003)(83380400001)(66556008)(36756003)(52116002)(44832011)(26005)(4744005)(66946007)(2906002)(6506007)(6512007)(1076003)(5660300002)(66476007)(6666004)(2616005)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sTNW9FJv7BDWKAS3rquBSHz63oD97Sxom/MDkWt1sDqgA4HASlokB7ixEDAXPiX82uBuHEOTGnzujPMGTveDdi69JBkLfuAOSHx6mI72uZhwq3U+jmmH1bAmlQBUtzBSFWcWRZp6MiY4bvf++qBTTG0YQXqOSI07O+xSWQ3xRyZd2LLDRSQOSyDWQDyYlZhTuCGXkMbynhWNd2T9LilD+KNBD0z0OWMvtJs0aG1oOmZKKK7n7bDZPzO2vLLCJkw1vaPR5dINMjcsOM/1KkXvl7V1PoMsvQqi/ZkzDOM4m0vfRGstiGH+98FOLwAQk/mYOikcqZFPVoidnGt22di8fC8eEgvy2tqgQNN2S79gQ02pRcMsKp6iQX9nkwLn7J3MCM0Kq+sE9qa/rCtexxpzITEdfJq3vwSyqC7TDjLvxOBX1dD9EizJ74ijzzlsUpGb9bLoclloyYP0GJycZ5/aGHB/TT73Zg/8Q0NM2luxE2o0ibzurEtfJto1eKkRN3Y28hdL9SvfYFTj4lRSAAen0MnXx4lIZYhJL6L7XrUbHe3vJssNdeTcYiHXZybcCjI/qWHf01W2ET20UKAdXltD/Z5CRwkfUXNV7dTVOrv9b6L0dBQwDBZvRy868KNrpIG94yie2Oa2e2n8VEJZ33C+5NfrjL2FZkGnfUJ56/gGpqbLGUxTKEp0mn+aBsNj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riginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d84d2533-2d5c-4a48-aa12-08da2318cfe2 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Apr 2022 21:57:50.1724 (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: bpVdrwk8SQk2YJ0OlKvg/lhorPb7zYrMxPEWFAcVe4JoKGqr3et/pk3XU/cLCDrcQQJTTdG25apJ3UziEMDQNh++xVmuTBki3DuAsvka4qM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR10MB5350 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.486,18.0.858 definitions=2022-04-20_05:2022-04-20,2022-04-20 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 adultscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 spamscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204200128 X-Proofpoint-GUID: MO7mMbxHZ1K1x1tl9y7sSWOeBYU0W422 X-Proofpoint-ORIG-GUID: MO7mMbxHZ1K1x1tl9y7sSWOeBYU0W422 Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2021-07-09 header.b=tw7KS82+; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Em0g2q3L; spf=none (imf28.hostedemail.com: domain of sidhartha.kumar@oracle.com has no SPF policy when checking 205.220.177.32) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=none) header.from=oracle.com X-Stat-Signature: cbkfbynxsyz7usqdai4ub6irgitwyytz X-Rspamd-Queue-Id: DC57BC001A X-Rspamd-Server: rspam04 X-Rspam-User: X-HE-Tag: 1650491874-465268 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000019, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Use ksft_test_result_xfail for the tests which are expected to fail. Signed-off-by: Sidhartha Kumar Reviewed-by: Shuah Khan --- v2: -add Reviewed-by tag -fix commit message formatting 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 e3ce33a9954e..237b7ccfa333 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 Wed Apr 20 21:57:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 12820848 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84573C433F5 for ; Wed, 20 Apr 2022 21:58:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D709C6B0078; Wed, 20 Apr 2022 17:58:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D1C9D6B007B; Wed, 20 Apr 2022 17:58:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B6FB26B007D; Wed, 20 Apr 2022 17:58:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.28]) by kanga.kvack.org (Postfix) with ESMTP id A8F0C6B0078 for ; Wed, 20 Apr 2022 17:58:02 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 804792F2F for ; Wed, 20 Apr 2022 21:58:02 +0000 (UTC) X-FDA: 79378620804.26.1CB2314 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf16.hostedemail.com (Postfix) with ESMTP id 9FC64180022 for ; Wed, 20 Apr 2022 21:58:00 +0000 (UTC) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 23KIcDF7019815; Wed, 20 Apr 2022 21:57:55 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=nTtXlw1vb0XLA6Hgk+3TmkEWN64YMp9QB868rDaE8DY=; b=PPqAVY5VUZvIKGQ12bGYOdedCtDuh++pVRqDWoJoCu3+3njTiZF+ZEvOsLIpkgFmCuI6 iP38Lx8laNazws+7S/voOjl8yFDOwuLqn5aOg79Sn8sApZo0WTx48KWR3x4EFc3DnjT1 TEC/EuVJnt51tVG51bElh9t8cStaKmkiIWEsxn2dgrtuSb2qwjs4vb5M57mx13bhib03 KG1gvG8G5yiNJkzsdqPHa4VJJtL6IRDScqfyKz5j4fa0SfIdKY4XMLUVrpd5ljuJwyrp JRNFFza/oZgusk4AQTIO+MWGTyMmtKdTbx0cdCt7npM4gjSbUqQP4fmk53/q4icT9S/C mg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com with ESMTP id 3ffmd1agv7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Apr 2022 21:57:55 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 23KLuGQd016193; Wed, 20 Apr 2022 21:57:54 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2170.outbound.protection.outlook.com [104.47.58.170]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3ffm8823s1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Apr 2022 21:57:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PCHD5QORfAVvHADDQqFmJxxzq9xbu2wxRwAYVU543LqfPlo/ilWmKqxssjDXPwlJGI3O1mqBXQgkDdEbFV1YmwS629U4ZEM9w4DB35rl/ACV4B9qXsUB5Jhi0D4HhNzD2Uuqaaz62hYJgeO4mdw8LmzawGUPrBVSAmP/+wjpx3/iF3WVyJ+16RO+8jlXYUde6eJgh+pPjv0cz1ReCbpa5i8iVwmrV4nkTOXjcM2vpQC+Rit2kcCdELN2FREwPJ/JQgPbwlc7pZy9o4hOjD+lJbXpbCFUgwTAfiudUn6faRYCy6sI74+yMB6FgxySoZhPZXbUR4WtRzeVFvT2MhoFGg== 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=nTtXlw1vb0XLA6Hgk+3TmkEWN64YMp9QB868rDaE8DY=; b=C/e/Z4fE8zFV72dcoOATolgPUaEbgjfArnC1ulhtT0NZjn++QD9EhJGOYvfADmYyaih7DJ4gz5Wo7PCNeHbvmG7tYpeLHHcmow9nah7MKfNxVMac6Oocs9rB8gyuaT8D6Mml3enQ7xS55y2Zw35nBZU8Qwmf5BaMiAuUfeWnP68jmFxdnGrL4pRVhzrgx8KKyQaw0omz4hrieI5Qlna8aeVrPetLLa0PaPIHP8vll/UW6C+0ArIYCvg/FQugG/t7Oessf6SQfBikDZEDgUK9eaUl3kJmOrpnqPRHSRov90sfgjFtCxd8Neu1qYE3BRweO4vHthsj+xXfkVX5LQHK3w== 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=nTtXlw1vb0XLA6Hgk+3TmkEWN64YMp9QB868rDaE8DY=; b=if5aATh/YfPGMekdeC8/NAqKbpfC25dhS3wdx0exvQKQzqIpO4CIjuabZeEHlgrhnbmZAvMTOaGZDML1ThHUqILXohXe/zcCEF+pyt+vALSkRs+C9XQ5j4s6s+y+Nv68pzamjqsjT9VcYmJVNzfoyk24N/Nwh9g+M8PqwW0+Q6k= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by BN0PR10MB5350.namprd10.prod.outlook.com (2603:10b6:408:124::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.14; Wed, 20 Apr 2022 21:57:52 +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.5164.026; Wed, 20 Apr 2022 21:57:52 +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, Shuah Khan Subject: [PATCH v2 4/4] selftest/vm: add skip support to mremap_test Date: Wed, 20 Apr 2022 21:57:21 +0000 Message-Id: <20220420215721.4868-4-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20220420215721.4868-1-sidhartha.kumar@oracle.com> References: <20220420215721.4868-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SN6PR05CA0012.namprd05.prod.outlook.com (2603:10b6:805:de::25) 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: 2e2e307d-c6cb-4339-8f12-08da2318d115 X-MS-TrafficTypeDiagnostic: BN0PR10MB5350: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: ANp8XAn5ecKy7+TqJ/LqYDYgT71kgwvWfi+1QHHsDN8/g5hrPs6j7C0t6MNZF8rozUjJMpbBm6SFCpI5F2XVLQWwqIO3e6aNhoCzis5axCNoMfFU6VRSV96zzt6L0mwWxgIbjAjnSLUPfT4u5KWRwfUNqiG4ERngHHSGIBat2CfhoYz1nnyJJl8O41qDkaAde242HZBa7vYUDJLU1nx2QJNwOJ8J+ugjmjVb7FVXJMyBXqYPuteCGK+/wz0FGU7Eyt9CWlX2hU7q9FKweyIsKeYgV9RkxiupwvOICzhEE0DT/hyQrDJP//duWqsAju2Bj2/jIK4QlCOunh+NJJvXlLob4bPBGCGStvXnmUggjOiBKyy5stVN0qXI98BndDuarMraEWV79pGXnUY/v23h/5pYwaNIYc0XWMT7PUu8XBsdrHJbB6ys4Kl5vdj+QaqdMbS2EGObePCFEtAywbaVBJK757PaRgyQAhDxn/xETrVpTnr/VBC09vY8Zjyt3GYSbfTRUCc9is8TCQ7cuTbMfaRc714SpcGkyRIEUCwC2Kz/lNF2QJkvojAWFNh+SQb549TRQjtGoBm4gIMN95W2oTQjLToUaaHU55nBvD57fztzU7mtkm9qlKdFls/npHICK6udukfWBkvuhnE38k6YNY2YLD/HyHpqObh37+9MlBHhIXBUpbWFP1sh+JMQRyrIjwPCupI05fr9RDvnvjgGPw== 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)(6486002)(38350700002)(38100700002)(8936002)(508600001)(86362001)(54906003)(316002)(4326008)(186003)(83380400001)(66556008)(36756003)(52116002)(44832011)(26005)(4744005)(66946007)(2906002)(6506007)(6512007)(1076003)(5660300002)(66476007)(6666004)(2616005)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SIKgbCCVyDdS7/7/mMMta1/yOvLDFeugHjuPnd86Uqq1Iv3x6LnjFzdl/V2Byj7KUa6oMZTB6jvV7qUu1nVTz4qqhIkxx1tQO9zwWeFWy4wYrGeqSiUzd4dsUvccpuDT0NyEqNOa6UPNgpoBW2MYbeE6u+cS1RLmkAB7F2cHYZT9Qec0iIrAhdNirDE0vSGh2cY9QgGP9pWkoqW43QL4/YPPtU4IROzJllqIIExdRnncvTO1YED9zmMqosZ2Y5Y1x5QiqBML/uIXJq66z7a1+/h2w8zcvbxTnk7rZMIcS7F2ZFCu2o69oQOJIwujMCBY/uZ6KrpIypscSXiTM0JX4GpaqCF1G3SPJ8XvrI05fdJ/kNSM0AI1lYiggzaqcMWh7ulz0oxhrOuEHZmmT13ILX5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gSW2/5ICNRZbVcfdVFUutmmKbC+1swXz/Ysi2TULC4Dxw7skX20vXvP8whF4fAqBARURyGm1/zjwktlijMyV5Tzml+01rl3y69BhyT5zHMtwMBhOAAUZPybZnlS3k3eHqR3IVC9kMapcdiUIN9676kDzIPkYWtKRlIzaTSQqqckdH7ELM/AiatHxKt/reN6hSTCQsg7IaRt+d0yVx2c1ERrzcZi5Ww1+WbE4MY4Pg7/+wPdn+LbE1DtSg9nqVYgniOSyUl3HlwrQihfxyhn8iEBA4VYE= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2e2e307d-c6cb-4339-8f12-08da2318d115 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Apr 2022 21:57:52.2271 (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: xgCe/xU1BKHhOWutle1Ll9JUpRS+op1EbQk3PWEmCKQJ4GmTpwnZ4LOqPFGW5fa9Lqopv/LMXKnivuOupixdTtndnfm7Tn7QfRumlUduILM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR10MB5350 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.486,18.0.858 definitions=2022-04-20_05:2022-04-20,2022-04-20 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 adultscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 spamscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204200128 X-Proofpoint-ORIG-GUID: kwcsFTtVapGFW7a7H1rVTbFTe_eAkZrY X-Proofpoint-GUID: kwcsFTtVapGFW7a7H1rVTbFTe_eAkZrY X-Stat-Signature: e76qjtcitytbeztn4ozss59zhbp4izcx X-Rspam-User: Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2021-07-09 header.b=PPqAVY5V; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="if5aATh/"; dmarc=pass (policy=none) header.from=oracle.com; spf=none (imf16.hostedemail.com: domain of sidhartha.kumar@oracle.com has no SPF policy when checking 205.220.165.32) smtp.mailfrom=sidhartha.kumar@oracle.com X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 9FC64180022 X-HE-Tag: 1650491880-33608 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Allow the mremap test to be skipped due to errors such as failing to parse the mmap_min_addr sysctl. Signed-off-by: Sidhartha Kumar Reviewed-by: Shuah Khan --- v2: -add Reviewed-by tag -fix commit message formatting 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 "-----------------"