From patchwork Tue Jan 25 15:09:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 12723956 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 949FCC433F5 for ; Tue, 25 Jan 2022 15:27:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LWSCqi3Gx9IPa7jW/bGaXIYN3qF2zDVEkdfAI9oLA8Y=; b=HVl/ixvDW7jK21 7xApwNTGDQnSH8kSSYElNWglkrOtjgbIhvg4A1EjqgyEND6RpUt+HMWc+oaREcf0OwZpNDj+MRals EPdxIjQapSsvN1DdDmMHSvgnGNhpL6UMgC0FgtleRQtV+gTISRyiLyKx3RQfDnJ1xAniRggKXzg8o vcRU88HHFfdku9FiesdN0jq/wrFRya3dRFcRoe0CavUjdhEgMp6K5+MMDs7bp0ve85WtYB5Qi0qXm zbt//EwnbzkwjCduiAu+VUrzn+WTu9ByTTw/kFxkiS6Zda5H1GdU1TStRDNG8OXmLbYbIbMDvsKLD yKEcJUIUm2duf8xTWllg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCNgx-008N2N-2c; Tue, 25 Jan 2022 15:25:08 +0000 Received: from mail-am6eur05on2078.outbound.protection.outlook.com ([40.107.22.78] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCNST-008IMi-8M for linux-arm-kernel@lists.infradead.org; Tue, 25 Jan 2022 15:10:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hWHYlHYciBAhEyWxsh4TWgWkE1jyB2F2YvqdYCZ7fGQ=; b=BjMR7xrpDMC+UG7/WI7IMDU+wTr5/kLsmLraiq54SdEwJDToTyBaMc/GboOx8RobDjF1+d78fNEYW+HG1NQKsfR0mpx+tEGcicBHeoipJvUkmdk7aSOLlvjkAyVf8ykQQDC8SDYxkGkvtw7Hnq6TilykMjv58I1Gn1Rz+CEJoaE= Received: from AM6PR0502CA0068.eurprd05.prod.outlook.com (2603:10a6:20b:56::45) by AM6PR08MB4325.eurprd08.prod.outlook.com (2603:10a6:20b:71::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.8; Tue, 25 Jan 2022 15:10:02 +0000 Received: from AM5EUR03FT043.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:56:cafe::dc) by AM6PR0502CA0068.outlook.office365.com (2603:10a6:20b:56::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.17 via Frontend Transport; Tue, 25 Jan 2022 15:10:02 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT043.mail.protection.outlook.com (10.152.17.43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.7 via Frontend Transport; Tue, 25 Jan 2022 15:10:02 +0000 Received: ("Tessian outbound 1f399c739551:v113"); Tue, 25 Jan 2022 15:10:02 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 3a491c9e006a103e X-CR-MTA-TID: 64aa7808 Received: from 365f9e2f412e.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 8BE48E25-346C-42A8-B462-4F5E97E5FD09.1; Tue, 25 Jan 2022 15:09:55 +0000 Received: from EUR03-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 365f9e2f412e.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 25 Jan 2022 15:09:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZocjOAoC3usI4PiZA+ymO4xjE/Ir2378QYxmAefsBFN0av/fk2yW6JaCGQiW1vpgWELrxCCtIL281P2HD3Vt4fgs0g3OLEf2Di7LItPB6Fz3nVVgbSQOs8DXK0+d12dV4ulRyA4NQqRFIOi8aP/1Autca/lKVVeZDCSPffUiZooyCsFcXkjRvj+63uYjcsBjPwtS4Z0JdolVJpiA+VGLqN0ZEGPcEIzCefCs3MTdvvZt141xtTAA89r7KgTqM3HqfVO3yFLIpcTF/wpDBcTdCA3/JQ8co2wOIdV7GKPxhwCndKBhdoa1pqzTDhz32vTBKDDpSWD6ydWhaGm/dRNWkg== 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=hWHYlHYciBAhEyWxsh4TWgWkE1jyB2F2YvqdYCZ7fGQ=; b=V9Mpqtk7DlGJGUprrCRpqbjq83P1RSKUjy6exxABusnSWWsbFw7LCa/zSrdvhgqoXmcoK4nqtvVwET7K5hHrbilJ/OoQTWIbxH0QMEgzfS1zHyrpmnSaex05KRncukvXa0imhgswueTe9iN87x86ZzA8jmnyeTPXvYPKLZog8mG1r8nckD9TyW5e/ciDZ/8geSp/BnpYG/mULACYrFgaVrqxkValGipe6NOIw+g4bE8wy0mzUiFSi3tqfJ1D3SlRv6yCPzXN3esGn/8ETbdV97XLYVcN5rdjrToHe3tzSZG57hFu5a4DtvlaFNVuYkLBB6BaYFSTiLyp6j1L7XKmzw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.infradead.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hWHYlHYciBAhEyWxsh4TWgWkE1jyB2F2YvqdYCZ7fGQ=; b=BjMR7xrpDMC+UG7/WI7IMDU+wTr5/kLsmLraiq54SdEwJDToTyBaMc/GboOx8RobDjF1+d78fNEYW+HG1NQKsfR0mpx+tEGcicBHeoipJvUkmdk7aSOLlvjkAyVf8ykQQDC8SDYxkGkvtw7Hnq6TilykMjv58I1Gn1Rz+CEJoaE= Received: from DB3PR06CA0024.eurprd06.prod.outlook.com (2603:10a6:8:1::37) by PA4PR08MB7483.eurprd08.prod.outlook.com (2603:10a6:102:2a7::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.7; Tue, 25 Jan 2022 15:09:53 +0000 Received: from DB5EUR03FT040.eop-EUR03.prod.protection.outlook.com (2603:10a6:8:1:cafe::5) by DB3PR06CA0024.outlook.office365.com (2603:10a6:8:1::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.15 via Frontend Transport; Tue, 25 Jan 2022 15:09:53 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT040.mail.protection.outlook.com (10.152.20.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4909.7 via Frontend Transport; Tue, 25 Jan 2022 15:09:53 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Tue, 25 Jan 2022 15:09:27 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.20 via Frontend Transport; Tue, 25 Jan 2022 15:09:27 +0000 From: Joey Gouly To: CC: , , , , Subject: [PATCH v1 7/7] kselftest/arm64: mte: add more test types Date: Tue, 25 Jan 2022 15:09:20 +0000 Message-ID: <20220125150920.23955-8-joey.gouly@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220125150920.23955-1-joey.gouly@arm.com> References: <20220125150920.23955-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: a1434101-2d5b-438c-dd8b-08d9e014c2e0 X-MS-TrafficTypeDiagnostic: PA4PR08MB7483:EE_|AM5EUR03FT043:EE_|AM6PR08MB4325:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:4125;OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: TZRQ/RZgYIw0d9YvmpJnInB1jgqNwhdemZ3aaarHbx2yeS+x5mfBCGmOuWxq++qDj/a5HqatCVtYMRZq1Jut/NFqNHXSh1ft2QLNzw0sW3JsySs9UUVKszlxm2liF7uRc8R4aXlrpWIorH9pMv2P+cdteL9FinLM11sbgBWAcNADrOnAYcCL/RILvZ4mFFKl3nn9BfDJ0FeLaEV/52t0xM4MzPqSGsv4BDBXxgKYpcVhDK2sv1shpWlS4o3nZRDrohlX+zIzGdqKgbfuJ7uANABpX3u8EzgxFjPZdCJfq+JHgY/D4+ifbFaNKC268SNIMSeK/PoCDlW9THecDo4tQfdIPJEs+EoqsMm/i1Z3KY/8eLJVrpaUd5lQbWxbhSdp22G9/Lafi65SMjp3HlZa5xXwq5rZ0CLczmolhkH0+3+YN0uVBBju3wKuDx+50xZLmTi9zcUU5hlkiL4jbtCq4ZM3vZH6S6XfhVd2537xIMXXUChT+rszruucrv/D7KnsJeqm73dJXyK0b4/XL7BqH5woqXaMg/XSp/mHzAIWk3RiRzX/mxg7gast8xSAD3efyJTX56nv3eXVM6+/pUgvt1Td4vfNE2hHCyVpgLZxD3pgXoPRxJnVse90LPd/NttAwa2++fNIS3Hy66iky9fQcUyw4QJP+MsNkSZEeQzLMoRS050FEk9M5FVsL91m+zujfo0a4gNiPn2pEIq5wBk0x8zDTBc7UyTSBz58ugpxxcK0WaC1c0VII9HGF41hySG/VfhVSkYAoPO9oRjjfVG1dr5snWQpgHgymTWpCL3D7SM= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(40470700004)(26005)(186003)(7696005)(6916009)(2616005)(8936002)(4326008)(36860700001)(54906003)(316002)(36756003)(44832011)(508600001)(5660300002)(40460700003)(82310400004)(86362001)(336012)(70206006)(6666004)(2906002)(70586007)(1076003)(8676002)(81166007)(47076005)(83380400001)(356005)(426003)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB7483 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT043.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 71fb05cd-e6f8-4cc2-e101-08d9e014bdb4 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 75wfddseYqTHxqYRWM9hUrvYcRgprDPptIxx6o8vzp6N20s9ZIt/P6T2tgVRhSdbSxUN8gvFMqYn4lPriqCRP7B8YmfP51tt44lSICCS4tdktSX75VAOSI5q82wvOwJF1BqijqdAOvqGCbxmu/YiN/SSO55J+BjJ2TftLMnj5VELzR8duEebcK3fcMzJ/IeeHEzZnodgshgWliKRrkLnxnGfDkvzR656QN7J1j46c98AAIp0TBTXTPI2YFd6yv9v92ZBn0GivbbSMS/81Zqq5hWq/iH+S9zFHKBLdicItDNqGUGI7y5cRiviTK4AMqBbBU5EnG+Rplzp8jvQBg38I6BjqadJHC7FWtckSer//0KmKRDnYI1nsY6oUVW0Dp0iqcCfDtjpPfZQUOjBbPbU+2M7HnHNb05qJMH8BBZVVPDPQOyrS0lR1D5q+5wSOHF2zb/iibdjFVeZAo2haQVCgBrzygBNLjFbAwYVtww+kZ6zayPAMicLsFLDPBJ0JnT5CukWdxosD6rCDHDud/5fIxAT03++eY9mvMHGG5pj5D+VsKnor1/hkGY+ZzYU0vHMEuIxLtXJeLQ6j4YYNen/A9uyPAhOiChX30MJ3bxqNacfiAAUkCeCnNP1y3KTqsDGKhdIFvUA/qAQd05VfIqdJpjzVyjjHMafSG5rwSKxBqmgVig6o0i3Xw0i1nRknx8jfEWW9e5HU9jDsBn2h/TTR4cxC0IAbfNlm7NZgbAkcFCbnYqXOyPna950edlSfIwR X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(4636009)(46966006)(40470700004)(36840700001)(7696005)(40460700003)(316002)(6666004)(2616005)(26005)(70206006)(426003)(82310400004)(54906003)(70586007)(107886003)(6916009)(47076005)(5660300002)(44832011)(86362001)(83380400001)(4326008)(336012)(8936002)(1076003)(186003)(36860700001)(508600001)(36756003)(8676002)(2906002)(81166007); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2022 15:10:02.2651 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a1434101-2d5b-438c-dd8b-08d9e014c2e0 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT043.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4325 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220125_071009_356726_AAE3C73D X-CRM114-Status: GOOD ( 12.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add test support for write, readv, and writev. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon --- .../selftests/arm64/mte/check_user_mem.c | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/arm64/mte/check_user_mem.c b/tools/testing/selftests/arm64/mte/check_user_mem.c index d104feab4e86..df4c8d8c9c17 100644 --- a/tools/testing/selftests/arm64/mte/check_user_mem.c +++ b/tools/testing/selftests/arm64/mte/check_user_mem.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include "kselftest.h" @@ -21,6 +22,9 @@ static size_t page_sz; enum test_type { READ_TEST, + WRITE_TEST, + READV_TEST, + WRITEV_TEST, LAST_TEST, }; @@ -85,6 +89,23 @@ static int check_usermem_access_fault_helper(int mem_type, int mode, int mapping case READ_TEST: syscall_len = read(fd, ptr + ptroff, size); break; + case WRITE_TEST: + syscall_len = write(fd, ptr + ptroff, size); + break; + case READV_TEST: { + struct iovec iov[1]; + iov[0].iov_base = ptr + ptroff; + iov[0].iov_len = size; + syscall_len = readv(fd, iov, 1); + break; + } + case WRITEV_TEST: { + struct iovec iov[1]; + iov[0].iov_base = ptr + ptroff; + iov[0].iov_len = size; + syscall_len = writev(fd, iov, 1); + break; + } case LAST_TEST: goto usermem_acc_err; } @@ -140,7 +161,7 @@ int main(int argc, char *argv[]) mte_register_signal(SIGSEGV, mte_default_handler); /* Set test plan */ - ksft_set_plan(9); + ksft_set_plan(36); for (t = 0; t < LAST_TEST; t++) { evaluate_test(check_usermem_access_fault(USE_MMAP, MTE_SYNC_ERR, MAP_PRIVATE, page_sz, t),