Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1968037pxb; Thu, 11 Feb 2021 00:18:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJxbHqqcRZ4KHeggM3WD0QtQ69zxI+IhS5M5zjPbAlcwD4ZqLDdKEEo7mroNDMVCB2nrb0ES X-Received: by 2002:aa7:d901:: with SMTP id a1mr7109501edr.120.1613031503888; Thu, 11 Feb 2021 00:18:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613031503; cv=none; d=google.com; s=arc-20160816; b=U2fdkvzxkRL/ZiXs5Neq187e5CmKYLCTaetXP6yidwWwqnbDLvkkzO4tNSYTWIQ/7c 3j1Z3bCohUnWHgBOs2HWE8lbYkyQCs1ObH9w8+IkeFvgIQTOH3Pa2HYyBroAdb6mqSXI HWKoEhXwRQ9PuoPJ0HGMP6hMNkOrdUjOjp0GJO0jXU7FPHKR0zcj9ly5oi4yU+5JSSEr zOsze8Rd5X747y379z+Sg1EWIiS3WSb7VN4WVXEaTRmoJojhWHhU0zrY3HXZ13rgUIH+ bL6l3olmzRNViE469s7AdBiFN0Kda79yl5RzudyLAQtOHclMLlq6XVAQc/0adghnutzG RiwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=05JsT8G3dDNpvGDtdnxJN4ly066HKxrSQevN3wrQbqA=; b=iqzChoMVAFjpOhwVohEn1gs7CTc2kSo/jVQdE1QlD2xkaNYfL0k5usTsIs+Yxab/h1 obVKeYd8/8OlyqZKjib2dpxRBZ7v+Q7sq/0amoxPCZX8CyIW632KJZdzM58X096VtfD4 /BL+KySGPcHOAPaalrIFrkJzdYj+O6Kp9Sr79jAtXqKr6df2WmeGu/YTtVoB0M+rm0yd NlS229MsLHT/UFLkIcvZiZGL++aVW/oDYZ2B3qFUSO680dwtgBjymkWZ4i2khDHJ3qgu Xp4cR5P5wVXBQQMEasuh8vwvFkYalN4ssNAhqsUFNRC1wU8OCN73FWSIFiRmEjPR2X// 4krw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NIa8kKfK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y15si3253151ejl.188.2021.02.11.00.18.00; Thu, 11 Feb 2021 00:18:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NIa8kKfK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229701AbhBKIP4 (ORCPT + 99 others); Thu, 11 Feb 2021 03:15:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:34070 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229623AbhBKIPw (ORCPT ); Thu, 11 Feb 2021 03:15:52 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 03F5D64DE3 for ; Thu, 11 Feb 2021 08:15:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1613031312; bh=r/jjDkP/cNaixfQFqqhPOP8kZqq6pBJzVaqgRc1huUM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=NIa8kKfK1zurap6Cj4bNg5OT+f4K1O0d7w2XaZhYrl/ykskJIXSUbkYhbjyFkl/4U 2+WXHR4AnVS4FZVHasPuNX7LswrAtilFLzRW6onTCOnwUMMhfgDoQkZ5tX+wWxgZyy U8a8DTLH9QxCrEEll9oEPqlKNkX5UVxD+ih2q478LCfltEvtYRJrHn0vA/Mk3bLp0z gcYpRA9wFTNlgAtHlXK6eMPY6CcJIT2RWEpePzaxzBojLjEl/NxYTR8VYfcj7pFajM Pi7qSNfEDJh6j6oVCrSf297BIfm7XxDaDp+s7I2IV8vHDMzYDLwqdt+HJM20givpyw 7camNrEu1aECw== Received: by mail-ot1-f51.google.com with SMTP id c16so4445683otp.0 for ; Thu, 11 Feb 2021 00:15:11 -0800 (PST) X-Gm-Message-State: AOAM530Zwi4S/XYCMNiS6ARM2uHYaO8gowiX1jxYKiaVutdJcf8+hVkO JYwslSZbHkgQ8pEmJBylPMqDyb40ycEBD4B12sY= X-Received: by 2002:a05:6830:11:: with SMTP id c17mr4884725otp.77.1613031311336; Thu, 11 Feb 2021 00:15:11 -0800 (PST) MIME-Version: 1.0 References: <20210211025149.3544593-1-ndesaulniers@google.com> <20210211025149.3544593-2-ndesaulniers@google.com> In-Reply-To: <20210211025149.3544593-2-ndesaulniers@google.com> From: Ard Biesheuvel Date: Thu, 11 Feb 2021 09:15:00 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 1/2] ARM: kprobes: fix UNPREDICTABLE warnings To: Nick Desaulniers Cc: Russell King , Arnd Bergmann , clang-built-linux , Linux ARM , Linux Kernel Mailing List , Nathan Chancellor , Peter Smith , Renato Golin , David Spickett , "kernelci . org bot" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 11 Feb 2021 at 03:52, Nick Desaulniers wrote: > > GNU as warns twice for this file: > Warning: using r15 results in unpredictable behaviour > > via the Arm ARM: > K1.1.1 Overview of the constraints on Armv7 UNPREDICTABLE behaviors > > The term UNPREDICTABLE describes a number of cases where the > architecture has a feature that software must not use. > > Link: https://github.com/ClangBuiltLinux/linux/issues/1271 > Link: https://reviews.llvm.org/D95586 > Reported-by: kernelci.org bot > Suggested-by: Peter Smith > Suggested-by: Renato Golin > Suggested-by: David Spickett > Signed-off-by: Nick Desaulniers Acked-by: Ard Biesheuvel But can we add a bit more context to the commit log, please? It is not obvious to the casual reader why it is OK to emit UNPREDICTABLE opcodes, i.e., that these are selftests that aim to ensure that kprobe never attempts to replace the opcodes in question with a probe, but that they are not actually executed, or expected to occur in real code. > --- > arch/arm/probes/kprobes/test-arm.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/probes/kprobes/test-arm.c b/arch/arm/probes/kprobes/test-arm.c > index 977369f1aa48..2543106a203e 100644 > --- a/arch/arm/probes/kprobes/test-arm.c > +++ b/arch/arm/probes/kprobes/test-arm.c > @@ -166,10 +166,10 @@ void kprobe_arm_test_cases(void) > > /* Data-processing with PC as a target and status registers updated */ > TEST_UNSUPPORTED("movs pc, r1") > - TEST_UNSUPPORTED("movs pc, r1, lsl r2") > + TEST_UNSUPPORTED(__inst_arm(0xe1b0f211) " @movs pc, r1, lsl r2") > TEST_UNSUPPORTED("movs pc, #0x10000") > TEST_UNSUPPORTED("adds pc, lr, r1") > - TEST_UNSUPPORTED("adds pc, lr, r1, lsl r2") > + TEST_UNSUPPORTED(__inst_arm(0xe09ef211) " @adds pc, lr, r1, lsl r2") > TEST_UNSUPPORTED("adds pc, lr, #4") > > /* Data-processing with SP as target */ > -- > 2.30.0.478.g8a0d178c01-goog >