From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 8JjYKt0Ws2MVJQ4AWB0awg (envelope-from ) for ; Mon, 02 Jan 2023 12:39:41 -0500 Received: by simark.ca (Postfix, from userid 112) id AD71E1E222; Mon, 2 Jan 2023 12:39:41 -0500 (EST) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=hILyQ+Jf; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 5EB081E112 for ; Mon, 2 Jan 2023 12:39:41 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 722CC3858433 for ; Mon, 2 Jan 2023 17:39:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 722CC3858433 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1672681180; bh=cZMp2XTjdcL4YjOZD8qqq2Fh4J2RH8f2I12ATI3pU9M=; h=References:In-Reply-To:Date:Subject:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=hILyQ+JfmK4q9JKqE2LXtO7PfwmvK9hJw/UqpC/imib6/Pdrlyg0dY6q04Kn5hX/E sckeCslzhjT8FHAWgBGK8QN3Wg5AMTqQfroAWhBHQo/ikHJ0oKUxWLBMLxKil/jO18 TA7HRqjKEYsMZJtcRCU1LfXd5u3j/+vPByC2BEKw= Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by sourceware.org (Postfix) with ESMTPS id DD8023858C39 for ; Mon, 2 Jan 2023 17:39:13 +0000 (GMT) Received: by mail-pl1-x62c.google.com with SMTP id c2so2587232plc.5 for ; Mon, 02 Jan 2023 09:39:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=cZMp2XTjdcL4YjOZD8qqq2Fh4J2RH8f2I12ATI3pU9M=; b=I+BnzQnNrg+7YvX8dYghWbf1oQ70Pfzj1W+mGW9pOrqsmbI/aTjZL+jUWydtX+aKpi ArHsNjR0GZ/l0oHy1p+JclmsON8rlRz4ncJZROI0rp0ZKjU5shKIeCQ1/B7cVCFAmzKK h4WyXga7DqAsQkbDep8LZHpcCZ3/W8iT37jLq+sid6z8ik0VNDCaafpZ02PakJzOUlld w/eELosHT74b0X1ZhBbmjldpSm817TzvAd8MnEAbRwwjJ2yW1li7Ip0o2jadvtfkbk9B EPt7vM5YTvKealpHqgOh/BiSbW4lePOWKUMhCHRCeKSKkZzbijTUEFwC2zenUoYJEd2/ oZmQ== X-Gm-Message-State: AFqh2kqHAIXh41C20bLJXZtclpqqn9tdQYDyGrT/WlyTqG01aAznTbpk ZT/V/JpdZj201sfwtD6SaH+EkSHzF65igCcldow= X-Google-Smtp-Source: AMrXdXtokF86kI85aBpNr8+aHfRD1WUYLzWNkuvrfCGYb6O/Lr5KFb9o3ToeeN8Fa30RhS40MOIueIBXP42arGXIp5Q= X-Received: by 2002:a17:90a:7881:b0:226:7905:ca40 with SMTP id x1-20020a17090a788100b002267905ca40mr334356pjk.180.1672681152923; Mon, 02 Jan 2023 09:39:12 -0800 (PST) MIME-Version: 1.0 References: <87tu18naqq.fsf@oldenburg.str.redhat.com> In-Reply-To: Date: Mon, 2 Jan 2023 09:39:00 -0800 Message-ID: Subject: Re: Hardware watchpoints on GNU/Linux AArch64 To: Florian Weimer Cc: gdb@sourceware.org, Dmitry Belyavskiy Content-Type: text/plain; charset="UTF-8" X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Andrew Pinski via Gdb Reply-To: Andrew Pinski Errors-To: gdb-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb" On Mon, Jan 2, 2023 at 9:28 AM Andrew Pinski wrote: > > On Mon, Jan 2, 2023 at 8:49 AM Florian Weimer via Gdb > wrote: > > > > Running > > > > gdb-12.1-10.fc38.aarch64 > > kernel-6.2.0-0.rc1.20221230gitbff687b3dad6.15.fc38.aarch64 > > > > I do not seem to be able to use hardware watchpoints. GDB just logs > > warnings: > > > > warning: Unable to determine the number of hardware watchpoints available. > > warning: Unable to determine the number of hardware breakpoints available. > > This shows up when the ptrace either fails or ptrace returns an > unknown value for AARCH64_DEBUG_ARCH value. > In the boot log there should be a message saying how many HW > breakpoint and watchpoints there are and what version of the debug > arch is there. > The supported values for debug arch are: > #define AARCH64_DEBUG_ARCH_V8 0x6 > #define AARCH64_DEBUG_ARCH_V8_1 0x7 > #define AARCH64_DEBUG_ARCH_V8_2 0x8 > #define AARCH64_DEBUG_ARCH_V8_4 0x9 > > I don't know of any other values that can be reported, especially for > Neoverse-N1 (which should be 8_2). Neoverse-N2 is 8_4. The kernel fills in that field with ptrace via: u8 debug_monitors_arch(void) { return cpuid_feature_extract_unsigned_field(read_sanitised_ftr_reg(SYS_ID_AA64DFR0_EL1), ID_AA64DFR0_EL1_DebugVer_SHIFT); } So either kvm/qemu is setting that EL1 (system) register incorrectly or the KVM Invocation didn't turn on HW breakpoints. Or KVM does not support HW breakpoints yet. Thanks, Andrew > > Thanks, > Andrew Pinski > > > > > I see AArch64-specific code in GDB, so this is a bit of a surprise to > > me. > > > > The machine uses virtualization: > > > > Architecture: aarch64 > > CPU op-mode(s): 32-bit, 64-bit > > Byte Order: Little Endian > > CPU(s): 3 > > On-line CPU(s) list: 0-2 > > Vendor ID: ARM > > BIOS Vendor ID: QEMU > > Model name: Neoverse-N1 > > BIOS Model name: virt-rhel8.6.0 CPU @ 2.0GHz > > BIOS CPU family: 1 > > Model: 1 > > Thread(s) per core: 1 > > Core(s) per socket: 1 > > Socket(s): 3 > > Stepping: r3p1 > > BogoMIPS: 50.00 > > Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp > > asimdhp cpuid asimdrdm lrcpc dcpop asimddp ssbs > > > > Is this actually expected to work? Would we have more luck on a > > bare-metal system? > > > > Thanks, > > Florian > >