Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp302730imm; Tue, 24 Jul 2018 19:45:54 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe+d40mH3vqAQFBFFwVHWHb3+1QU6njSxE/zQrIzM0eQVSN2k6+kZ7DBTrQ6vcp44436h8K X-Received: by 2002:a65:5a8a:: with SMTP id c10-v6mr17978449pgt.389.1532486754194; Tue, 24 Jul 2018 19:45:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532486754; cv=none; d=google.com; s=arc-20160816; b=darobScATNxL0HG3A6uWLd+chXSyQ8bJgLJm+DMFUZIQvxLVfaw563ulhXZrIpi3Yx tgX3eo4rT16qWh9ahQd9DlWlszlvnbEpjpYQMkQgf8Sr/c/dX9GE5SOuZPUsL65zo4LD sbZus9Ot0UU+ym6z1nXOPc9MVTxTBNMrltS2GP6Eq6owtImKtKyJpXnrdrhPZ3YSsJAy DJIKci0HyAyTeKtuq4BlfkFEH3EPlkB5RyABSrOJrDVgTL82CZSXnlST+Yq9pH5PS1Fu ag4LmBx45VsGYj1K7BJ6zohzlwaznCGGz9B3wWQyi4PvgTfM/XszOMHRqiVNbHpdJmnl YySw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from:arc-authentication-results; bh=Geu630lDDl+OTMI7c+KyMRpj+noXwx78JaeLMq+FEy4=; b=t7xhJ41StmMOFyt169DO8tFwo03upyP2+0qFWNFNCUSFmMvyWvobwcDRRvosDnsq77 eCjwm8ZOMRv/GW/pIb5PVpPtyl1H+toyeMuBK7x8kjdiMrtcPPtbMbPNfjozJfaHhAwN PtoZFI8dmcRetD34SBi29uKfw/F7NiotwAfL+oeDVyOrcTn9nTdYjPHP4Z5Vmran3R6D SmzeULKoQhTZRPE8PGFnl0JRtdvJASmQToitQXf5y3yHeVWlWAhnFAnpC1ZwoaHo+Gjo GdCwgdUx4DM6gAiJDwVd//zBhkvfQviYH+LCNxv65Sqdoqq1T/ciYm8XL5regDo938pe Esmw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e17-v6si12960454pgm.671.2018.07.24.19.45.39; Tue, 24 Jul 2018 19:45:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388568AbeGYDx7 (ORCPT + 99 others); Tue, 24 Jul 2018 23:53:59 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:49018 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727646AbeGYDx7 (ORCPT ); Tue, 24 Jul 2018 23:53:59 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w6P2hXui047861 for ; Tue, 24 Jul 2018 22:44:30 -0400 Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.153]) by mx0b-001b2d01.pphosted.com with ESMTP id 2kedmnc5wn-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 24 Jul 2018 22:44:28 -0400 Received: from localhost by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 24 Jul 2018 20:44:27 -0600 Received: from b03cxnp08028.gho.boulder.ibm.com (9.17.130.20) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 24 Jul 2018 20:44:25 -0600 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w6P2iOfO8782230 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 24 Jul 2018 19:44:24 -0700 Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 86BEF7805F; Tue, 24 Jul 2018 20:44:24 -0600 (MDT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8CA0C7805E; Tue, 24 Jul 2018 20:44:22 -0600 (MDT) Received: from morokweng.localdomain.com (unknown [9.85.159.138]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP; Tue, 24 Jul 2018 20:44:22 -0600 (MDT) From: Thiago Jung Bauermann To: linux-kselftest@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Shuah Khan , Andrea Arcangeli , Mike Rapoport , Prakash Sangappa , Thiago Jung Bauermann Subject: [PATCH 3/3] userfaultfd: selftest: Report XFAIL if shmem doesn't support zeropage Date: Tue, 24 Jul 2018 23:42:09 -0300 X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180725024209.32586-1-bauerman@linux.ibm.com> References: <20180725024209.32586-1-bauerman@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18072502-0012-0000-0000-00001690D8E5 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009424; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01065718; UDB=6.00547467; IPR=6.00843576; MB=3.00022308; MTD=3.00000008; XFM=3.00000015; UTC=2018-07-25 02:44:27 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18072502-0013-0000-0000-000053CAC391 Message-Id: <20180725024209.32586-4-bauerman@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-24_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807250027 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If userfaultfd runs on a system that doesn't support UFFDIO_ZEROPAGE for shared memory, it currently ends with error code 1 which indicates test failure: # ./userfaultfd shmem 10 10 nr_pages: 160, nr_pages_per_cpu: 80 bounces: 9, mode: rnd poll, unexpected missing ioctl for anon memory # echo $? 1 This is a real failure, but expected so signal that to the test harness: # ./userfaultfd shmem 10 10 nr_pages: 160, nr_pages_per_cpu: 80 bounces: 9, mode: rnd poll, UFFDIO_ZEROPAGE unsupported in shmem VMAs # echo $? 2 Signed-off-by: Thiago Jung Bauermann --- tools/testing/selftests/vm/userfaultfd.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c index bc9ec38fbc34..686fe96f617f 100644 --- a/tools/testing/selftests/vm/userfaultfd.c +++ b/tools/testing/selftests/vm/userfaultfd.c @@ -1115,6 +1115,14 @@ static int userfaultfd_stress(void) expected_ioctls = uffd_test_ops->expected_ioctls; if ((uffdio_register.ioctls & expected_ioctls) != expected_ioctls) { + if (test_type == TEST_SHMEM && + (uffdio_register.ioctls & expected_ioctls) == + UFFD_API_RANGE_IOCTLS_BASIC) { + fprintf(stderr, + "UFFDIO_ZEROPAGE unsupported in shmem VMAs\n"); + return KSFT_XFAIL; + } + fprintf(stderr, "unexpected missing ioctl for anon memory\n"); return 1;