From patchwork Tue Feb 23 08:25:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: He Zhe X-Patchwork-Id: 12100031 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71E33C433DB for ; Tue, 23 Feb 2021 08:27:51 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0B8FE64E05 for ; Tue, 23 Feb 2021 08:27:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0B8FE64E05 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe :List-Id:MIME-Version:Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=3Al1TGzCZmfotMU/5b8zjUBYLn4oXA8EO0brH/a4LOY=; b=BsGmWTC81ht+wZHyq9NH1aHUEX rihD7hnL5IjzE7xrH4s7ZaJKAXs19QToQEZr96X6HrAmJZ1gIQGcJp9F0PSJs5u7RqS2wiaoPtQ+N 1Zu5xIDaegxetuiRS7fP0SxiCDScuL+wmu9BqtSrWr+GKXiypybLSlYWxuV5Bvws8ldOeg0MyRKY2 0vuVYtX+ivIng7KfZzehLhVN2uq2fu/uQNKEiNcnjcbZQ1gVK2FuCFh48fmT3joLfaYiWU6j2RMFS kuKo/oCLijrLsvY/l3fs3b8NoypiFKWzcq5OBR97CHsCvKRNhCLgz6qNzVK8Tb1DO1dkUoFtO3R6K Ojg4cnhA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lET1F-0007hl-Jk; Tue, 23 Feb 2021 08:26:09 +0000 Received: from mail-dm6nam11on2077.outbound.protection.outlook.com ([40.107.223.77] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lET19-0007gi-Kz for linux-arm-kernel@lists.infradead.org; Tue, 23 Feb 2021 08:26:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NQIC1fHRSuq+QJmwuywpgGy3i+eMF/3Rs1xNrtpDxeg5CyKSydKDr88CoPHwDDQz3geOT3I7quHvjNZFS+xIebV8y0sB+RhTor9ySfwVPPfLQ10MgdAX74Kn7XhPlT7Z8OI2I8LwYI+Hoi5zE8TyVybD7VpZH7TZKP3zj5okG/Q2/469S2joBvX1ue25qASb4mgC+s+EqidqJtO4Fdfp/rIGOX99198KL9gVD/z1l9tqKI3xnbRiFE0irRfwHpjR8icF+SqVZrbMuiRmZ7nofz//gR7LskYIKvPfcPOvUBj3R/mPKuNBpZ8e8OSy+ablJAL6f+DijlJV8bEB3GlRVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uG0ykDZ8H6mxiQTiG4V1tyssG0q/P/1IinwL5ZcF+EM=; b=AZgSBTndLoHqaZ3LCid0gByUKGZQ0OdK1kq9EWiN+HAxgEjaH9ncp75FMhqXhuIHiLAQFk9g9x+Ou09gOuyVBvCtkQuHNBNQTtuTeLvyydGhJdTiviJFZ93ALD0J///03NamymaULCFcO1Pv3BP/ygCDlh8oJPn4A7CgrQQV+U+LTVUUx9Ka08ByvnyD3v7+cdKtHztZWytFiGQ4A4r6EimLGNvOdCMUDp0dsuBiepnorovJjA+h39pe1QTarCp4AWR16OJGD+dtHZMlUXgQFrFN2fcQczw88ppQ4RyH6aHlVDFbAHNz+mIEV4KeoSaIfQ/Qnc2us9X6w5IaT55+mA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriversystems.onmicrosoft.com; s=selector2-windriversystems-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uG0ykDZ8H6mxiQTiG4V1tyssG0q/P/1IinwL5ZcF+EM=; b=ZcrM56dvsR3NkYVno9ENvZTfD5F+IzCBOQ7Gfsms3TpZJzFUjmGs/FrTJdcHbom1b3QzIHJ11agGjd5s7ah8KrZMKq7PmRa+7+rNuVDfNigVbiQGjRjDeLpSTBXznogCiVa0HmjOinxKAFrvVC5SSJNRIXeegcExWVhRytM220o= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=windriver.com; Received: from MWHPR1101MB2351.namprd11.prod.outlook.com (2603:10b6:300:74::18) by MWHPR11MB1679.namprd11.prod.outlook.com (2603:10b6:301:f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.27; Tue, 23 Feb 2021 08:25:58 +0000 Received: from MWHPR1101MB2351.namprd11.prod.outlook.com ([fe80::ad02:3dcf:d3e5:b27d]) by MWHPR1101MB2351.namprd11.prod.outlook.com ([fe80::ad02:3dcf:d3e5:b27d%10]) with mapi id 15.20.3868.033; Tue, 23 Feb 2021 08:25:58 +0000 From: He Zhe To: catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] arm64: uprobe: Return EOPNOTSUPP for AARCH32 instruction probing Date: Tue, 23 Feb 2021 16:25:34 +0800 Message-Id: <20210223082535.48730-1-zhe.he@windriver.com> X-Mailer: git-send-email 2.17.1 X-Originating-IP: [60.247.85.82] X-ClientProxiedBy: HKAPR03CA0003.apcprd03.prod.outlook.com (2603:1096:203:c8::8) To MWHPR1101MB2351.namprd11.prod.outlook.com (2603:10b6:300:74::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pek-lpg-core2.corp.ad.wrs.com (60.247.85.82) by HKAPR03CA0003.apcprd03.prod.outlook.com (2603:1096:203:c8::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.8 via Frontend Transport; Tue, 23 Feb 2021 08:25:55 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6fa3b015-c74d-458a-524d-08d8d7d4a51c X-MS-TrafficTypeDiagnostic: MWHPR11MB1679: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dpw9Is1cS6DLRpATMwesCwgWwMpZ/hjf+pw5J0gPDA3MUJjO2zZN2VZFdtQlHTbiYy3Lk1ia4UDSzuyrczPrcgsK7epGOnKlGBLR8B0RmbLOT91DC4T4rqeHe2/WqgujajK9k1qlcsn3qtLLxH1dmB6M5b0DlGPizbl+PSctItfRDlFKFnnoJ2cwTJdBf0IroUClawOswekv63ixYFtrI36U9iI88rhfDGrdxBsLMZuARhcufaU+PG1dbkYdjIRCQa88O484/j0ml2PZJQI2UFaIxQFJP1RXZEzOUSbCep1Z+Qv07aRItki+i+NxjCsWuURdRjztqhnko27r8uhgDhlu5oRATfcFMxxNyWcQao1n1Ra0TEb+ZIF8zRoIv0WwAFwYUCAv3cbpBjDxmvyVC5+u/kxgchUD+Qs/D0B0KLH3VwbnGdI2NzB11X5gDG/mQ6yK2M387FZuqjcXm17p9H/Ve1C6BrPWec/SE2vRhzFET/+29m5rfGtlYq7CKRE6+Rq6BOpvg6GP/r8v78PbMw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR1101MB2351.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(376002)(366004)(39850400004)(346002)(136003)(186003)(26005)(1076003)(8936002)(6512007)(6506007)(66946007)(16526019)(478600001)(6666004)(36756003)(5660300002)(8676002)(2616005)(83380400001)(52116002)(66556008)(2906002)(86362001)(956004)(66476007)(316002)(6486002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 2TMwiCPOljYoHHAufbLPxy/zcOd70kz4EyCw15hakLteVpA6brExhPkjdxQPATy5hU14bXxJwTAImGByWV3s1lWj8ZIlVI4y6buLj4fdxkTaodVHuAlNw2GGLelSmXUz/xcEFWU3S/IIgZhm2P8Hmce+UA9z+bwR+HqRbQs90VB8qsrqB6spK+7XLHZjXb6idiu9bU2CzW7kvOiLL5A2ml3l3VeNlmd3vXOI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tgDGdUojLwrjdLdwVe5H8JncArEQvK0xOnMta8hAapfO/ZkO7Pb1E X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6fa3b015-c74d-458a-524d-08d8d7d4a51c X-MS-Exchange-CrossTenant-AuthSource: MWHPR1101MB2351.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2021 08:25:58.0388 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: //7UqtIbyK4/9Q47CTY0GSEyV5g+PFBJHhrpPJRpCyvqIYp7framXuGTzyZHRo+YFrNzIedEw82QloHsBMWl7w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1679 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210223_032603_828306_B0DC6589 X-CRM114-Status: GOOD ( 10.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 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 As stated in linux/errno.h, ENOTSUPP should never be seen by user programs. When we set up uprobe with 32-bit perf and arm64 kernel, we would see the following vague error without useful hint. The sys_perf_event_open() syscall returned with 524 (INTERNAL ERROR: strerror_r(524, [buf], 128)=22) Use EOPNOTSUPP instead to indicate such cases. Signed-off-by: He Zhe --- arch/arm64/kernel/probes/uprobes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kernel/probes/uprobes.c b/arch/arm64/kernel/probes/uprobes.c index a412d8edbcd2..2c247634552b 100644 --- a/arch/arm64/kernel/probes/uprobes.c +++ b/arch/arm64/kernel/probes/uprobes.c @@ -38,7 +38,7 @@ int arch_uprobe_analyze_insn(struct arch_uprobe *auprobe, struct mm_struct *mm, /* TODO: Currently we do not support AARCH32 instruction probing */ if (mm->context.flags & MMCF_AARCH32) - return -ENOTSUPP; + return -EOPNOTSUPP; else if (!IS_ALIGNED(addr, AARCH64_INSN_SIZE)) return -EINVAL;