Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2393605pxb; Thu, 11 Feb 2021 11:09:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJwTh3JNuE0Tw98sdwHXHU9DF3PRLpEx/UkcYbor2yUf2Fpb1PWjY5JOBbhKJRXnCMpk5G9C X-Received: by 2002:a17:906:b055:: with SMTP id bj21mr10011471ejb.355.1613070574705; Thu, 11 Feb 2021 11:09:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613070574; cv=none; d=google.com; s=arc-20160816; b=BHsHJNNlOW6dzUmewN4H3RSvCS9qXIh1RoK4Se+Hvwj29PHmFodI+IpLXtMdcRNtGH PPMqZBZSNATUYUcFYm91fWIhY/O+e8nFUGGE2BVLb+7Lu4Sq8OVmMzZIx4QmIyBNPpRL GRaFUxPHvHWZj5oqMKyDoXpHqvFrHKO6cgqvURyJOgrGj8Rc150u+0Y3/X3G/qLcGmkw Mm07dNTZEfyWcbiDr8rhn4GfIGIy4Gt5wufmZPYlcjZEWR9CuvxIOOgXrTz2VzSGIjiX FmHYK6PJRwFl1oMN9gSKk28eB/+Fc6l9nkWx66t0llPfOAG4HBt7x2SZFDZvKwwa3kbE t8XA== 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=NDFyBCzQ/w2scwnDR1KimaJyc5DX1XbezjKjDgGDDbI=; b=vTA2CzR0ilQjjIKvYNk2RyIzO8xK/AsHhs2hVUVwQd5s61xZjiqtwfngf7fQpy2md+ QTNFGBt9mi+zmgmTzKapm7bCwl1hdVpGORSlGQUqZaYbWPINlu0LLP64hR6Z+c0WMyOc 1vUM7GxipkCRaVhpQS34QEs9pIqzBbfTpo+8+nOf1VnDFMoc5LYVRv8nWJO6OY8xuYbF 3N8CQfdWinz9Gx2Nc7P+0lPaze05UQs61fFmCeE87rWJJ3HQXEHJN7c6c7ZRMJvftyjJ Xt9fuau7oC/OuoFrZoEy20qLJUQTZPQgKTj0YhS1BdA+NXgLxp9i8WaDk0A0/YnjoJA0 7R/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=lhYmgLGa; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v26si4200798ejc.336.2021.02.11.11.09.10; Thu, 11 Feb 2021 11:09:34 -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=@google.com header.s=20161025 header.b=lhYmgLGa; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229886AbhBKTGq (ORCPT + 99 others); Thu, 11 Feb 2021 14:06:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230269AbhBKTGL (ORCPT ); Thu, 11 Feb 2021 14:06:11 -0500 Received: from mail-oo1-xc2b.google.com (mail-oo1-xc2b.google.com [IPv6:2607:f8b0:4864:20::c2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C2B3C061574 for ; Thu, 11 Feb 2021 11:05:30 -0800 (PST) Received: by mail-oo1-xc2b.google.com with SMTP id x10so1536456oor.3 for ; Thu, 11 Feb 2021 11:05:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NDFyBCzQ/w2scwnDR1KimaJyc5DX1XbezjKjDgGDDbI=; b=lhYmgLGac7wmXlVRa/6bLo+0VEueioiEtkv/vVz6DcqJItDRHXzciz9m65j/LLRHT0 3WmgvFZgXU3j2FRW9+LZOXG9uqAFkxn2Hna1snamNLuTwNvlGcZW5DmclfUf873Nuzoi NyWHTQIgCKToMlzv16dA1kUbxBf5EpWup+ecfK2Kl9SmVdCSQrQVTrqt52at/CYZj1TQ 5CN2uPlg3ZMc2AWNtMnPonR6fWyMCt1f9zWHpbHVZENY1ZCzgopsAlBr92uffD+DNLqk x2Ll/jfLQOlflp0ABYekv41e3SbosuBoxPSe1qLFIlAfsFKgJ5zjs1er5NfdeJ70gNE4 gk3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NDFyBCzQ/w2scwnDR1KimaJyc5DX1XbezjKjDgGDDbI=; b=UiEABLEjQCe8Nw+Ps/PL5CMuRBudK9F+qVQKDb0HK9VW8y9tDYgOnfyzMFuXEfPao6 az6TiujYGRH9FnxGsIZld7vLSniAOr7cf99+fJh3EiIVJUXKPuxSSn6O97+J2N5Eiy3h iDy6Uq5HVCuH2Fve/bjGhE8H21u+NjAa25qzJlQ0lcu+FzbgdUIj7xAPBI3yE7tFeorv 4sNGf/IY4qdmR7TOuOf6irwqQh9YHBpqLI1vFdDAUQiLylw4EfYKv8mdXO1qTLGOPmpA G9tQTpqeeRWPofjXnK4vypBuB13k7p+mTzTnNzGFE7jvoYXW5d7aCHFQ42mdAz3vS+H6 ywCQ== X-Gm-Message-State: AOAM533nfL/aRCz3As2pCFNCJgOrMC2Js4NvA4oZEbdzkVoXE9w4qNxM d7XdzMfIsP70ZM5HxI7Orq6oEK+94p54yHO7jwc6TA== X-Received: by 2002:a4a:a22a:: with SMTP id m42mr6474615ool.22.1613070329249; Thu, 11 Feb 2021 11:05:29 -0800 (PST) MIME-Version: 1.0 References: <20210211025149.3544593-1-ndesaulniers@google.com> <20210211025149.3544593-2-ndesaulniers@google.com> In-Reply-To: From: Nick Desaulniers Date: Thu, 11 Feb 2021 11:05:17 -0800 Message-ID: Subject: Re: [PATCH v5 1/2] ARM: kprobes: fix UNPREDICTABLE warnings To: Ard Biesheuvel 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, Feb 11, 2021 at 12:15 AM Ard Biesheuvel wrote: > > 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 Sure, that's a good idea. > 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. I'll add: Ard notes: These are selftests that aim to ensure that kprobe never attempts to replace the opcodes in question with a probe, but they are not actually executed, or expected to occur in real code. to the commit message, when submitting to RMK's queue. Thanks for taking a look and the feedback. > > > --- > > 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 > > -- Thanks, ~Nick Desaulniers