From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id iVUdJH6YBmragDsAWB0awg (envelope-from ) for ; Thu, 14 May 2026 23:52:30 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=I/f16RTs; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 81ECE1E093; Thu, 14 May 2026 23:52:30 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 3CBA11E093 for ; Thu, 14 May 2026 23:52:29 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 330F740A00DD for ; Fri, 15 May 2026 03:52:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 330F740A00DD Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=I/f16RTs Received: from mail-dl1-x1229.google.com (mail-dl1-x1229.google.com [IPv6:2607:f8b0:4864:20::1229]) by sourceware.org (Postfix) with ESMTPS id C883140A24BD for ; Fri, 15 May 2026 03:50:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C883140A24BD Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C883140A24BD Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1229 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1778817034; cv=none; b=deYPxvZa+xtVCaWeIVj4BGhibgvjeHgd297BsHx/TETrOfuDvedNqVamzobp2duyCVmK7xTKBEPgfL2a9E59s8dGrUWBpue1MhRxCv/ZU2WjbIh65xt825KGUMPoLpv+N8idfPc8Obqe4YsHhRUNyZKQ0aZ9b0BruWel2Mjzvz8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1778817034; c=relaxed/simple; bh=477VWXO8yrfVi5zQFXUFMLgpmeNFnrm2siGoKVkKplw=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=dfEFnSXuN2Yniigwflc5EH6zyrRDK7OdpsGHHA7FalAlbYmOn3PFqfzc8krXRJPFkPTyosxZ+a1PZfpmZfl65QmvfG7zyIJCfMtCfdQjsFjUwNAIe/Zz62ENQozpHyGDxOV2PXAS5nB1rrB8i4TwNl9BcpxSvMo8jzA+sef6I0k= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=I/f16RTs DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C883140A24BD Received: by mail-dl1-x1229.google.com with SMTP id a92af1059eb24-132830d8281so3685641c88.1 for ; Thu, 14 May 2026 20:50:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778817032; x=1779421832; darn=sourceware.org; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=1RoX/VTeyaF/6P2VQKiE6gHDZJevC/jDiWUfeyZWiBk=; b=I/f16RTs5H1wJ6A+PLW4Nfc/abhxSKOv/PcIlq5sZECMbHOYj1iHRxjnUwdO8S0lws v5NSF22n0jJ52RSDm7aIaEeywq1zlR9hVTB5jpnz5k3VokR3mfyJPVr2d7QzWrXO89ru qPvh7aD3yRqNYy0nuPaDVyGDlwhDdVVNQZo0D26TGBSwZgX5W0L6egwMYFKsZBeV/UlS J8Sp0ayQ1Ej8r3SPHQMOv2Oga5q873juw/yP7PFtY8x3FMH1dWLOisfmb+qe61pk7Rnb 1hbGDKTEwSzEMlhQPex3wfM70bwjwXsWxHqKP3TWEaeiwENnBkd3Ts2j+fIJpugy7ohB RLpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778817032; x=1779421832; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=1RoX/VTeyaF/6P2VQKiE6gHDZJevC/jDiWUfeyZWiBk=; b=iW3AoTscqri+xNTNRokkNPDW/dZ/A8AwLqh4MbJwx2qTDtViSLzTHO/x18jbbyd/ca YR+wirb0JTDJaqdjuJ48b12Rii5aZQRMAWfIKsDgdS7urecytdbA55R8Vnj8nNUHq0k1 UWWOreIlx9Bp5xuRCjqBieGSiD36wA81u7QTlXsjkuShVFSnEJt/IEeSnISj3qeTM8dr cGUzDRld8TqVz6cGqp0TTnOPMDTAeuy1tw8UeQP8zDfweaJaZxi/XA7wY3XlmQQg8SY/ d6P3JmWAjVR34N5PjPXi3+thMJTMyJKLuXAAo+b4osXhRrlHs0x3jdoO8kJ48TfQNZPa iIlQ== X-Gm-Message-State: AOJu0Yxpo4HyTGDNzHyf1JTBIufkjfn3/uQ1+YqDHTcZJoqarMdHJT9b 7OlaBR3dqlxMmL+khanR80c97j8+h6Gy5ah/1GSdV02Q1kriag7NWMQ4xo0E1nbh/WXbTUCIUqp 9qar3 X-Gm-Gg: Acq92OFT3pELlnalVSuySNVgKAXOp38iwtYCZVhpVmACnoVC5VCL6VY0FrLkUgCk3WQ ySMzE3+grXD3CkyujaoLhM2OQ6misXK5hpqaOS87Bk0+k6KdeEB7F5ETqsiz7YBdKqUYZlngMqy BW90qDtTG/jzyJPLaNsUDII7uCPabg6JixN4HHqk0XHAPhZlYk8s+tTeKoWwsbV4clmv30YGKF9 n1RyJIHzqHSRNpZsvMF6FaVSc3q1/z91IoIvwpRPZlVnYHCEVuDZrXl79HkBGEkhDl7B8yEgAbW LHf+akn50yViXaQfks9DLilZG2Yxs5igPeCdkAJBZ8U89YdC4HWJsZYBPv6/ELOWYCLvfhrzaaY vYzA/i1CYIMjMzLXSfKQXBRPWp6IiQ5ljfU8Oavi2o8KlAbd5M+zrgGwMFSyHZuk1ebTjbn6rJh sHKSu+iKMg2UBvluR9aDKwF4FbB8pH9WTxGlRQRtmHOxu0 X-Received: by 2002:a05:7022:6729:b0:12a:7165:7405 with SMTP id a92af1059eb24-13504b5c8d3mr928788c88.8.1778817032364; Thu, 14 May 2026 20:50:32 -0700 (PDT) Received: from localhost ([2804:14d:7e39:8083:f04c:42e3:5943:38f6]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-134cc33aac9sm6081626c88.14.2026.05.14.20.50.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 May 2026 20:50:31 -0700 (PDT) From: Thiago Jung Bauermann To: Cc: , , Subject: Re: [PATCH v2 1/4] gdb/aarch64: record/replay support for LRCPC3 In-Reply-To: <20260512231707.18123-2-Ezra.Sitorus@arm.com> (Ezra Sitorus's message of "Wed, 13 May 2026 00:17:04 +0100") References: <20260512231707.18123-1-Ezra.Sitorus@arm.com> <20260512231707.18123-2-Ezra.Sitorus@arm.com> User-Agent: mu4e 1.14.1; emacs 30.2 Date: Fri, 15 May 2026 00:50:30 -0300 Message-ID: <874ik9covt.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Hello Ezra, Mostly looks good to me. Just a couple of comments in allow_aarch64_lrcpc3_tests and a question on how to test: writes: > diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp > index 28709004..3f3197cb 100644 > --- a/gdb/testsuite/lib/gdb.exp > +++ b/gdb/testsuite/lib/gdb.exp > @@ -5287,6 +5287,69 @@ gdb_caching_proc allow_aarch64_fpmr_tests {} { > return $allow_fpmr_tests > } > > +# Run a test on the target to see if it supports AArch64 LRCPC3 (Load-Acquire > +# RCpc instructions) extensions. Return 1 if so, 0 if it does not. Note this > +# causes a restart of GDB. > + > +gdb_caching_proc allow_aarch64_lrcpc3_tests {} { > + global srcdir subdir gdb_prompt inferior_exited_re > + > + set me "allow_aarch64_lrcpc3_tests" > + > + if { ![is_aarch64_target] } { > + return 0 > + } > + > + # Take the opportunity to check whether the toolchain knows about LRCPC3. > + set compile_flags "{additional_flags=-march=armv8-a+rcpc3}" > + > + # Compile a program that tests the LRCPC3 feature. > + set src { > + #include > + #include > + > + /* Feature check for LRCPC3. */ > + #ifndef HWCAP_LRCPC3 > + #define HWCAP_LRCPC3 (1ULL << 46) > + #endif In the system headers, this constant is called HWCAP2_LRCPC3. > + > + int main (void) { > + bool lrcpc3_supported = getauxval (AT_HWCAP2) & HWCAP_LRCPC3; > + > + /* Return success if LRCPC3 is supported. */ > + return !lrcpc3_supported; > + } > + } > + > + if {![gdb_simple_compile $me $src executable $compile_flags]} { > + return 0 > + } > + > + # Compilation succeeded so now run it via gdb. > + clean_restart > + gdb_load $obj > + gdb_run_cmd > + gdb_expect { > + -re ".*Illegal instruction.*${gdb_prompt} $" { > + verbose -log "\n$me lrcpc3 support not detected" > + set allow_lrcpc3_tests 0 > + } > + -re ".*$inferior_exited_re normally.*${gdb_prompt} $" { > + verbose -log "\n$me: lrcpc3 support detected" > + set allow_lrcpc3_tests 1 > + } > + default { > + warning "\n$me: default case taken" > + set allow_lrcpc3_tests 0 > + } > + } The test program in v1 tried to execute an instruction to detect whether LRCPC3 is supported, and in v2 it checks a bit in HWCAP. Nothing wrong with that, but the gdb_expect above needs to be adapted accordingly. On a machine which doesn't support the feature I see a WARNING, but the test program just behaved as expected: (gdb) file /home/bauermann/.cache/builds/gdb-native/gdb/testsuite/temp/1223/allow_aarch64_lrcpc3_tests.x Reading symbols from /home/bauermann/.cache/builds/gdb-native/gdb/testsuite/temp/1223/allow_aarch64_lrcpc3_tests.x... (gdb) run Starting program: /home/bauermann/.cache/builds/gdb-native/gdb/testsuite/temp/1223/allow_aarch64_lrcpc3_tests.x [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/aarch64-linux-gnu/libthread_db.so.1". [Inferior 1 (process 1299) exited with code 01] (gdb) WARNING: allow_aarch64_lrcpc3_tests: default case taken gdb_caching_proc allow_aarch64_lrcpc3_tests caused gdb_exit to be called gdb_caching_proc allow_aarch64_lrcpc3_tests marked as called gdb_caching_proc get_compiler_info_1 marked as called gdb_caching_proc is_aarch32_target marked as called gdb_caching_proc universal_compile_options_c marked as called UNSUPPORTED: gdb.reverse/aarch64-lrcpc3.exp: require failed: allow_aarch64_lrcpc3_tests testcase /home/bauermann/src/binutils-gdb/gdb/testsuite/gdb.reverse/aarch64-lrcpc3.exp completed in 26 seconds By the way, is there something specific I need to do to get an FVP supporting LRCPC3? I set up FVP with: $ shrinkwrap build --overlay=arch/v9.6.yaml ns-edk2.yaml But then inside the guest the CPU features in /proc/cpuinfo and the HWCAP2 don't mention LRCPC3. If I hard-code the testcase to run anyway, then the inferior dies with a SIGILL. > + gdb_exit > + remote_file build delete $obj > + > + verbose "$me: returning $allow_lrcpc3_tests" 2 > + return $allow_lrcpc3_tests > +} > + > # Run a test on the target to see if it supports AArch64 MOPS (Memory > # Operations) extensions. Return 1 if so, 0 if it does not. Note this > # causes a restart of GDB. -- Thiago