Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp452201imi; Fri, 22 Jul 2022 02:40:57 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tYe87QBIwt7UUXVQefooAgI3h7rAIEjEProX9j82TeBLiQ9xGPfAMVfsZGq3Q6vPGc9PS0 X-Received: by 2002:a63:c006:0:b0:411:c33f:b4bb with SMTP id h6-20020a63c006000000b00411c33fb4bbmr2459039pgg.433.1658482856866; Fri, 22 Jul 2022 02:40:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658482856; cv=none; d=google.com; s=arc-20160816; b=fuhIUDaBIxMj+DenEZKW/47BbTZHokq5I9YYxAzmCABMMKgnBvlHANpu/2ph+vAMz1 NBI/9KIupMFZ/uIPTJSwoxsVA6gVily9nhJb9Zo7A+B0cQbtbsT9BgUfZ0i41gieiNyp mJSup1JHwg7lIUimkTerjpv3WujBQknCMlmGFzmhFH0OBWtHl+fGAiFhFBh8XIDFEoD4 kqh2Ue5ThiclzAYwZdAwn99yIICin4bF+KW9YC65E+5hjO3WCOVp3ge1kBFJzhp+/53m /I3iKAI5rH4h5ekCsO4Us49XBtodCtQKlszc67q31QZrguWXYeWZg2hfQVhWUHDIhQF/ nniQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=wb8DNu2REjAOwbASgbT4WC/2UYmsBEeIsxT77AReJgU=; b=R9829qRJTshna0wn5YYtmKTrdp6twNKTGG9/t77lsLzOwnacYNWWxoQuOYrCENvKR8 TJ5c0Td0oYWyoBVF+2TP+zkIuynKjI11pUOftzLZVyQtp+YqJeHhFSUpZ+jhEJFtA6nk J4rO/eVzlDWF6AHUmCUKWzc0fe1ZYh6Ya55Q9+hi+ZSm1OLR0D+w23FOmx7DHlMOQmTJ 1FWburmc87vZvqxQH28+53ubdJO4rhEYvR1DIcD4fRpp4QwYKyks7Pp24NSWR1X7mGRL 6EAeB1L2m+Sh0hZG/QupRFqcvUq2sz7DQEBAgd1nEX/0p1545l7UszoqwU2qikfgsw0t tQqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O6jq7Tg0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g8-20020a170902740800b0016382c70069si5066937pll.150.2022.07.22.02.40.42; Fri, 22 Jul 2022 02:40:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O6jq7Tg0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S235521AbiGVJOj (ORCPT + 99 others); Fri, 22 Jul 2022 05:14:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235505AbiGVJNx (ORCPT ); Fri, 22 Jul 2022 05:13:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D52DAF73F; Fri, 22 Jul 2022 02:10:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D4C1C61F64; Fri, 22 Jul 2022 09:10:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D77DEC341C6; Fri, 22 Jul 2022 09:10:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658481052; bh=OK8LmIuAEgVsEBkiSNzzMiMp+U1+ADxlXeHm7mqZaTk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=O6jq7Tg0q/Eyh5XpZi+1zP+fDCj3KuU5UDAW1Ag0JjkZO6LADytvyqolI3M5Ry9LJ hCGcCabPhjJ4MjZCSRLlp3PrOWzYf8PHjea3ra8LLSwS7QVHk3r61PAB9XgxBnAdHB EJqVnJ4tLsYyZdUtLioD8mw3Hl952UiFipEYHkWB5aM+kgMra18AG00yGBcpovRvW6 iMntJBfP4kNuYx2/n/l/iDfPq2xgbmG9umL/fQBgjdXJtLVYYyHHHSuxIdsFkEuZ/F i7px0y0ZYE8xBCXcidwYouibNMVc0kt77QKBeU3J5z5qqAFFiDHyb5yn/0O91DMB7w nxaLpIimgYyhg== Date: Fri, 22 Jul 2022 10:10:45 +0100 From: Will Deacon To: Mark Rutland Cc: Marco Elver , Peter Zijlstra , Frederic Weisbecker , Ingo Molnar , Thomas Gleixner , Arnaldo Carvalho de Melo , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Dmitry Vyukov , Michael Ellerman , linuxppc-dev@lists.ozlabs.org, linux-perf-users@vger.kernel.org, x86@kernel.org, linux-sh@vger.kernel.org, kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 01/14] perf/hw_breakpoint: Add KUnit test for constraints accounting Message-ID: <20220722091044.GC18125@willie-the-truck> References: <20220704150514.48816-1-elver@google.com> <20220704150514.48816-2-elver@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 21, 2022 at 05:22:07PM +0100, Mark Rutland wrote: > Hi Marco, > > [adding Will] > > On Mon, Jul 04, 2022 at 05:05:01PM +0200, Marco Elver wrote: > > Add KUnit test for hw_breakpoint constraints accounting, with various > > interesting mixes of breakpoint targets (some care was taken to catch > > interesting corner cases via bug-injection). > > > > The test cannot be built as a module because it requires access to > > hw_breakpoint_slots(), which is not inlinable or exported on all > > architectures. > > > > Signed-off-by: Marco Elver > > As mentioned on IRC, I'm seeing these tests fail on arm64 when applied atop > v5.19-rc7: > > | TAP version 14 > | 1..1 > | # Subtest: hw_breakpoint > | 1..9 > | ok 1 - test_one_cpu > | ok 2 - test_many_cpus > | # test_one_task_on_all_cpus: ASSERTION FAILED at kernel/events/hw_breakpoint_test.c:70 > | Expected IS_ERR(bp) to be false, but is true > | not ok 3 - test_one_task_on_all_cpus > | # test_two_tasks_on_all_cpus: ASSERTION FAILED at kernel/events/hw_breakpoint_test.c:70 > | Expected IS_ERR(bp) to be false, but is true > | not ok 4 - test_two_tasks_on_all_cpus > | # test_one_task_on_one_cpu: ASSERTION FAILED at kernel/events/hw_breakpoint_test.c:70 > | Expected IS_ERR(bp) to be false, but is true > | not ok 5 - test_one_task_on_one_cpu > | # test_one_task_mixed: ASSERTION FAILED at kernel/events/hw_breakpoint_test.c:70 > | Expected IS_ERR(bp) to be false, but is true > | not ok 6 - test_one_task_mixed > | # test_two_tasks_on_one_cpu: ASSERTION FAILED at kernel/events/hw_breakpoint_test.c:70 > | Expected IS_ERR(bp) to be false, but is true > | not ok 7 - test_two_tasks_on_one_cpu > | # test_two_tasks_on_one_all_cpus: ASSERTION FAILED at kernel/events/hw_breakpoint_test.c:70 > | Expected IS_ERR(bp) to be false, but is true > | not ok 8 - test_two_tasks_on_one_all_cpus > | # test_task_on_all_and_one_cpu: ASSERTION FAILED at kernel/events/hw_breakpoint_test.c:70 > | Expected IS_ERR(bp) to be false, but is true > | not ok 9 - test_task_on_all_and_one_cpu > | # hw_breakpoint: pass:2 fail:7 skip:0 total:9 > | # Totals: pass:2 fail:7 skip:0 total:9 > > ... which seems to be becasue arm64 currently forbids per-task > breakpoints/watchpoints in hw_breakpoint_arch_parse(), where we have: > > /* > * Disallow per-task kernel breakpoints since these would > * complicate the stepping code. > */ > if (hw->ctrl.privilege == AARCH64_BREAKPOINT_EL1 && bp->hw.target) > return -EINVAL; > > ... which has been the case since day one in commit: > > 478fcb2cdb2351dc ("arm64: Debugging support") > > I'm not immediately sure what would be necessary to support per-task kernel > breakpoints, but given a lot of that state is currently per-cpu, I imagine it's > invasive. I would actually like to remove HW_BREAKPOINT completely for arm64 as it doesn't really work and causes problems for other interfaces such as ptrace and kgdb. Will