Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Christina Joos <christina.joos@intel.com>
To: gdb-patches@sourceware.org
Cc: aburgess@redhat.com
Subject: [PATCH 2/2] gdb, testsuite: Handle unexpected PRKU value in linux corefiles.
Date: Fri,  4 Sep 2026 12:06:48 +0200	[thread overview]
Message-ID: <20260904100648.1705702-3-christina.joos@intel.com> (raw)
In-Reply-To: <20260904100648.1705702-1-christina.joos@intel.com>

I observed that for linux corefiles the value of PKRU register is
sometimes the default value (0x55555554), introduced with commit
"x86/pkeys: Default to a restrictive init PKRU" [1] in linux kernel
v4.9. even though we expect a different value at this point.

I have seen the default init value on Ubuntu 24.04.4 LTS with linux
kernel version 6.8.0, but the expected value (0x12345678) on Ubuntu
26.04 LTS with linux kernel version 7.0.0.

Accepts both values for now until the reason is identified and we can
change it to an appropriate xfail.

[1] https://github.com/torvalds/linux/commit/acd547b29880800d29222c4632d2c145e401988c
---
 gdb/testsuite/gdb.arch/i386-pkru.exp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.arch/i386-pkru.exp b/gdb/testsuite/gdb.arch/i386-pkru.exp
index c455891b8de..ce9e17a4493 100644
--- a/gdb/testsuite/gdb.arch/i386-pkru.exp
+++ b/gdb/testsuite/gdb.arch/i386-pkru.exp
@@ -119,7 +119,12 @@ proc test_corefile {core_filename} {
     gdb_test "core $core_filename" "Core was generated by .*" \
 	"load corefile"
 
-    gdb_test "info register pkru" ".*pkru.*$::val1.*" \
+    set pkru_val_re $::val1
+    if { [istarget *-*-linux*] } {
+	# Some linux kernel write the default PKRU value to the register.
+	set pkru_val_re ($pkru_val_re|0x55555554)
+    }
+    gdb_test "info register pkru" ".*pkru.*$pkru_val_re.*" \
 	"read pkru register"
 }
 
-- 
2.53.0

________________________________________
Intel Deutschland GmbH 

Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany 

Tel: +49 (89) 99143-0 

www.intel.de 

Managing Directors: Candice Moore, Jeffrey Schneiderman, Ramachandran Sitaraman

Chairperson of the Supervisory Board: Sonja Pierer

Registered Seat: Munich Commercial Register B: Amtsgericht Munich HRB 186928

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


      parent reply	other threads:[~2026-09-04 10:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-04 10:06 [PATCH 0/2] Problem with linux corefiles for CPUs with Intel AMX support Christina Joos
2026-09-04 10:06 ` [PATCH 1/2] gdb: Enable OS generated corefiles on systems " Christina Joos
2026-09-07 10:05   ` Andrew Burgess
2026-09-08 13:28     ` Joos, Christina
2026-09-11 16:45       ` Joos, Christina
2026-09-04 10:06 ` Christina Joos [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260904100648.1705702-3-christina.joos@intel.com \
    --to=christina.joos@intel.com \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox