From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id GUVzEQdfqWrJng4AWB0awg (envelope-from ) for ; Tue, 15 Sep 2026 11:06:47 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=AtVmyGq3; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 41C481E06B; Tue, 15 Sep 2026 11:06:47 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,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 870961E01F for ; Tue, 15 Sep 2026 11:06:46 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4FBA54BA9024 for ; Tue, 15 Sep 2026 15:06:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4FBA54BA9024 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=AtVmyGq3 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id C0D9F4BA79BF for ; Tue, 15 Sep 2026 15:06:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C0D9F4BA79BF Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C0D9F4BA79BF Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1789484774; cv=none; b=ha04gL1VfKqrpzni8sj0Sv0NUBCB8fW7Z5vsR2SkD3K53zgZIIphkTz9LNoT27SaCZK75kssTNllUqIPp9uh6phXpIV5z9ez9FRBGJS6b8YfmMOrLXrxNJ8oV68WLCOKBwLl2ipAXCBoEruJ1+WlGVZarfgOBatVjPpMsHLTQb4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1789484774; c=relaxed/simple; bh=r3ne9RhVREt8UvS9rbbgKC106DTiVzpWG0EQI3olQzU=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=LEzL5FXWI10nUmBVl1yShSYaxMr0MMkteMW89HNCitOkpJk38b4AzhTa7XRmeOfEATaIFXnpgC202lTRhdOcy9v7tSQRqeglL7RJpD4aoZ/0ZM43HwfwkNWWw0hbB75LEdJCxGxz0YxEMVqME5B0dJqfhSYqkAgICVz84cSlaXI= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=AtVmyGq3 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C0D9F4BA79BF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1789484774; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=a/bS0cnEbwTyP+wDiWxwuUOEpj04tsjfgAtftMijqKs=; b=AtVmyGq3wkq0//AXaT9IACou7ak9bRDNxAsetMCGvSfyPMGe81/f/7khOcUjJWKwUank54 azFGQpiGi09RceZdhyJqE4qUyN/WatHWUmWYVwSQLzRfFXKGiXrsXi3OPmL9PImiPPfpto 23sOdsK6rO+fhfp6Gtwc5e5uRd11mmQ= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-221-lcFJY8miPD6yzfQ2IPQW6g-1; Tue, 15 Sep 2026 11:06:13 -0400 X-MC-Unique: lcFJY8miPD6yzfQ2IPQW6g-1 X-Mimecast-MFC-AGG-ID: lcFJY8miPD6yzfQ2IPQW6g_1789484772 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-48585fce16fso829933f8f.0 for ; Tue, 15 Sep 2026 08:06:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789484772; x=1790089572; h=content-type:mime-version:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to:content-type; bh=a/bS0cnEbwTyP+wDiWxwuUOEpj04tsjfgAtftMijqKs=; b=Nk0ZetYKaWgdQhQJOvFdJklOL+rSNkqwBGRGqxCuXQ2aunhyXEkE+DNHd8Yq7PbBC7 6SSsjgKrWCrvg2RKczjf29Hp2rdFgzU7annf7F0+lm5ATgB/yf3IJ1VPDHPqgAIRV+cu i+wwK6ti5L3t798g3V1xC/MldtpeE+CdoS8Qo1SQHAdS7tDxppwo9hKSOvD07VROllrl Iw/bA8TDf3C68KC6v3h9XdDT7bo9VCEJSpkOAOpUHs3n2TLlU8e2nTkT64KJhVf1L7ai SeTILmaYmYSPav5bHM2ra5ZiQcNrI4lDFvcIBCgLeZQSmEP40qsYNj7rYTCXOVZqJ1yk pwbQ== X-Forwarded-Encrypted: i=1; AKwUvByWLSzYahorhmjoKcMQ3dt8Yozmfqa5UQvZOqfIIOfA0EjhXp8Y+M7vFuH6ddhEnfxn4ypJCT7ieV7wIA==@sourceware.org X-Gm-Message-State: AFuF++kFWbHK86CyCXWW8vRf+xkIAqQwBmGNtDIkOziOAUxbeE48mGcW cugAtI6x1Q5EPyAuElULb6SdKn4bh898xTnFgMzR1myhM+Dk7A4DHBqsAFqMJ1lPN8h+EeCKyj3 copyN2byjL5Zp2fZJRgC1+tkITGbgmcdRvTwHHZUYEwmvmMSFuBMhDlTVqyQly/pD8HguoCU= X-Gm-Gg: AYBFou28k8/TpAnjwcKkqULRlnQZhfiYzXzyFCFv8HvPgjY8gq64zE4dtvefMLYtiqr GKQ8LUswmggF1Td/tFp8XhDpGGXrVuSOO7JVgRyylRiBLnHqf3w88MdU6O3nYOu96qTzmzOy6va bqo+hND3N+o6TFYJO7OjPARJTr2tYlFDTSNB+QQwlLPkd7m7VGi2G9mQCAza32GRajPq1jMMohV pTCciomO71hOCfyZPjRKxGwYDRZcWbVTzLS688nLmYcNB6iS6SxiY9f6rDCM8vTf+pkOyxxICBy n3ZUCUw5Wt1FjigkRxPLnXPi5SHjNK+EBWeLc0ow+uDYgeEPQiPk9csQuZbbPLPidw7XnPc632U AM4UaInfmaSs6/duj X-Received: by 2002:a05:6000:310c:b0:487:403:f2eb with SMTP id ffacd0b85a97d-4870403f45dmr14762564f8f.17.1789484771758; Tue, 15 Sep 2026 08:06:11 -0700 (PDT) X-Received: by 2002:a05:6000:310c:b0:487:403:f2eb with SMTP id ffacd0b85a97d-4870403f45dmr14762462f8f.17.1789484771301; Tue, 15 Sep 2026 08:06:11 -0700 (PDT) Received: from localhost (59.6.93.209.dyn.plus.net. [209.93.6.59]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4870b389c54sm630850f8f.4.2026.09.15.08.06.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2026 08:06:10 -0700 (PDT) From: Andrew Burgess To: Christina Joos , gdb-patches@sourceware.org Cc: stephan.rohr@intel.com Subject: Re: [PATCH v2 1/1] gdb: Enable OS generated corefiles on systems with Intel AMX support. In-Reply-To: <20260911163001.3365986-1-christina.joos@intel.com> References: <20260911163001.3365986-1-christina.joos@intel.com> Date: Tue, 15 Sep 2026 16:06:10 +0100 Message-ID: <8733vad065.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: JrrSETmZa6bjVkN0EbbKky0ym8FzTejt_Ag8-RKtnhc_1789484772 X-Mimecast-Originator: redhat.com 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 Christina Joos writes: > This patch addresses the issue described in PR gdb/34561. On systems > with Intel AMX support the xsave size is 11008. This xsave size is not > handled by gdb/i387-tdep.c:i387_guess_xsave_layout and is causing > problems for corefiles generated by the linux kernel. The problem is > visible regardless of the AMX enablement state in the dumping process, > so all corefiles on newer systems with AMX are broken. > > ~~~ > $ gdb > GNU gdb (GDB) 19.0.50.20260814-git > Copyright (C) 2026 Free Software Foundation, Inc. > [...] > (gdb) core core_main_SEGV > [New LWP 2162880 (id 1)] > [...] > Core was generated by `./main'. > Program terminated with signal SIGSEGV, Segmentation fault. > 4 *pointer = 3; > (gdb) p $ymm0 > $1 = void > ~~~ > > We should be able to print the register $ymm0 (or any other register > belonging to a feature higher than SSE). > > For a live debug session we can print it: > ~~~ > Reading symbols from main... > (gdb) start > Temporary breakpoint 1 at 0x1131: file main.c, line 3. > Starting program: /tmp/main > [Thread debugging using libthread_db enabled] > Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". > > Temporary breakpoint 1, main () at main.c:3 > 3 int *pointer = 0; > (gdb) p $ymm0 > $1 = {v16_bfloat16 = {0, 2.342e-38, 0 }, v16_half = {0, 1.5199e-05, 0 }, v8_float = { > 2.34180515e-38, 0, 0, 0, 0, 0, 0, 0}, v4_double = {8.256666972292243e-317, 0, 0, 0}, v32_int8 = {0, 0, -1, > 0 }, v16_int16 = {0, 255, 0 }, v8_int32 = {16711680, 0, 0, 0, 0, 0, 0, 0}, v4_int64 = { > 16711680, 0, 0, 0}, v2_int128 = {16711680, 0}} > [...] > ~~~ > > Note that this is not reproducible for corefiles generated by the gcore > command, since in such corefiles the GDB target description is > available and gdb/i387-tdep.c:i387_fallback_xsave_layout configures > the xsave_layout based on xcr0 derived from the target description. > > This patch fixes this issue by handling the new xsave size in > i387_guess_xsave_layout. It is necessary even though GDB does not > support AMX yet, since we still pass the full xsave_size (11008) > extracted from the corefile to i387_guess_xsave_layout. > The patch does not fix i387_fallback_xsave_layout to configure the new > xsave size. Configuring sizeof_xsave to 2696 is fine at this point, > since truncating to 2696 drops only the parts GDB doesn't model yet. > > As a quick solution for the upcoming release and CPUs supporting > Intel AMX this patch should be sufficient. > > Testing: > > I noticed that we don't have tests for corefiles for the features AVX, > AVX512 and PKRU in the GDB testsuite. So this commit adds corefile tests > for AVX, AVX512 and PKRU registers. > > As a result of this patch, the warning: > > warning: Unexpected size of section `.reg-xstate/1373786' in core file. > > which was causing failure in gdb.base/coredump-filter.exp and > gdb.arch/i386-tls-regs.exp on Intel AMX systems disappears, these tests now > pass. > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34561 Thanks for your work on this patch. I added a NEWS file entry for this as it felt like something that was NEWS worthy, especially on the gdb-18-branch. I also changed "corefile" to "core file" in the commit message and comments. Then I pushed this to master and gdb-18-branch. Thanks, Andrew