Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp222897lqb; Thu, 14 Mar 2024 09:30:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVGYC1e08elECQB/ZdZNB/qlhA6Js9/+rX0m9AFfy9yEj6rbtXgGqi1+yeV7rpgwnwvmLLuntKBVa6ANqEPJJXlKyKFrMBQ7+UO3MTh7g== X-Google-Smtp-Source: AGHT+IEHOePaiNIV+EBYFJ+mXvoudwGRGiIlHYIKgtuQBlwtQ2VrJ0WJe36fwGs27n0T+38WCKxL X-Received: by 2002:a17:902:db0e:b0:1dd:54a6:6401 with SMTP id m14-20020a170902db0e00b001dd54a66401mr8467340plx.17.1710433829610; Thu, 14 Mar 2024 09:30:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710433829; cv=pass; d=google.com; s=arc-20160816; b=0KNTsjRiQ0l2mCt2Ah4S/iXzRbebTldBWcuQGL/fBi1NkBWreNc+2AVM0ZQeZ1aGaO 5vFiHXFFgOs+7EWPvTBtY2YD/pFWcpF0VWKNmdiu4Z77Krv1193os8YjDV8rPWJCjA8W dd3fiUQmwyQ4uTdMWyUyDjYzk9GY7HVksSdk3SjDHy2j0KG5fyDPkF3dNx/LH6d1ram2 WnWjOr2le706W0IbuEY3i1zQLLnctyMwMxlGXoKZbgDXgDoN0czRDY5M7xmkXxqWYxvL r5aUmszcknEGZXva+ciZyDY+0Oc6Izt2LWQA8o/sP/ne75F4nfVLoFOBlJTgooAWnWfq jteg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=TDNTVQ6N/4Ma+VE1wv9KFMROi1UWZqALylRp98/G0mU=; fh=36Fu/QmwTbgr1F+AapOoq+jdE4YIVHxe3Rl9Fup3WQo=; b=xyFsr+zYRr4cikcQwwmBaFgHMA0PtdKXfliRzacWLS/pGdqIajCCc+KQzLh4+aLujq MMaSP/nlnoicMLo+4p4z/JRVsFEW2hKaoo7K/QSRlhJ7/NAmV1ESHsKmaeajitsQK7nU NGhLt04PtBj7OW70R2nmDnIXmlooCXGAHlBl/+Aaf0W6j1J3CATnnrD5oArEmmolwkjD b34ZzIIIs67zVrF/REgb0sps1cUXYox+teI/uZVdb8SMUWAL+9EHjsGnSO3PaR+oVDuH dv1hfu2gEiJLMBE1VN9hdF/30H2+QMqhoqmnWrmB+5dRn/fneuokn93xOrZ7nAxzxSZ6 Og+g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=ddlCZvhK; arc=pass (i=1 spf=pass spfdomain=alien8.de dkim=pass dkdomain=alien8.de dmarc=pass fromdomain=alien8.de); spf=pass (google.com: domain of linux-kernel+bounces-103573-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103573-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id e17-20020a170902f1d100b001dc8344a2bcsi1664204plc.217.2024.03.14.09.30.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 09:30:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-103573-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=ddlCZvhK; arc=pass (i=1 spf=pass spfdomain=alien8.de dkim=pass dkdomain=alien8.de dmarc=pass fromdomain=alien8.de); spf=pass (google.com: domain of linux-kernel+bounces-103573-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103573-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 4F12E281EDF for ; Thu, 14 Mar 2024 16:30:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D8C8574407; Thu, 14 Mar 2024 16:30:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b="ddlCZvhK" Received: from mail.alien8.de (mail.alien8.de [65.109.113.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E386A6E605; Thu, 14 Mar 2024 16:30:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=65.109.113.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710433825; cv=none; b=P448IYXRyf/+B4PzY8uWS1/q+9aso7dic/rn165+vIy/QKsCjZ6s+Qcl/FZc5i6G457wnTmuIH/72Pnl13kPyI3kPM5RXLEpSFbf8ldQWs0qhK7mzTZqb9YCxuRmOwf9lkeJH+5Q2S6j4X6oysb9WlaoiaU++skUO7OAzD349G4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710433825; c=relaxed/simple; bh=TZ7kb0JpX2EDeDNiQSqRVWw8cf5MgXlt1NOM1zD3RNY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uMRWYVxQe9PXK/DiSNArQ1qoLwKz189p9+NAc9zgKVNgTXPswVEMkKXzkft0a6OUyodvLoksYm5X0v35bmAGPMLn7fHgOwCaaUcP/462I8NLunvP1usnkPk5ez37MAJP+V27MFfaDepRzexJnxJ27xRHs96lzttfJkzdlCgToNs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de; spf=pass smtp.mailfrom=alien8.de; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b=ddlCZvhK; arc=none smtp.client-ip=65.109.113.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alien8.de Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id 7B2F840E0174; Thu, 14 Mar 2024 16:30:20 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.alien8.de Authentication-Results: mail.alien8.de (amavisd-new); dkim=pass (4096-bit key) header.d=alien8.de Received: from mail.alien8.de ([127.0.0.1]) by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id co3JfxzjaIvC; Thu, 14 Mar 2024 16:30:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1710433818; bh=TDNTVQ6N/4Ma+VE1wv9KFMROi1UWZqALylRp98/G0mU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ddlCZvhK2bva1wkCFISPWhSgA7oIf8S2dPWHppglYZqtz2vSxx8HWA+RSdmHdKToP OXiDCpFXON42bb3RABzcGuvB1VcNP+f46sdsuckHwDSIGgbzUfxd2sW7VA45U7YhIY zKGAvZ2OsSZrlyo2UNQNOAnwT3d6RBb8y3L/G/4yPBqpQXrINgbYSoCXWF6d9IrIu8 uJviBtaXalfqUB+yQlT6brtKj8nY0vqkvoYeSyoYRcYvm+04ai8X4NBVX/jGJ+hew+ dsMNF2MHZyedo8t1y17yeo+d6xZHxKm7ufX97aqPVNYq41tpTncoXBicw2r50mUTab Y4wNs/ovE3xZVjvzgyAEUg6yZFVua6Fu9WByko2XBA9PFBaQbG7yZekZ23pq+K4wDY aFgxfQyTkKc8iNPSfuZoVynMtbBCaVJIV9sAiMdWw8iqFQcXtRI3kYZpu00yHs9Q4W 6UmIy+mT3JGW8uuvS6LAMEFBS6pwCeeCkkFAKrK+e7UuPvDcf+qXmARG2CkCym2cH3 dYYYwQntIQfkZPc0hf9tjG7WLVcILOT2TUw0TebHm/cIgFKLNTpwdEPDbTZBikrpzx boTN8C5W0q/AR9R7VsUiKow4otv0wXPMKJjbw1ZeycSxcXSns3SGs0P1gthQAv0Kpv TMQv0SmS6/g1mehnnlDUuNsE= Received: from zn.tnic (pd953021b.dip0.t-ipconnect.de [217.83.2.27]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 27BBC40E016B; Thu, 14 Mar 2024 16:29:59 +0000 (UTC) Date: Thu, 14 Mar 2024 17:29:54 +0100 From: Borislav Petkov To: Dave Hansen Cc: Vignesh Balasubramanian , linux-kernel@vger.kernel.org, linux-toolchains@vger.kernel.org, mpe@ellerman.id.au, npiggin@gmail.com, christophe.leroy@csgroup.eu, aneesh.kumar@kernel.org, naveen.n.rao@linux.ibm.com, ebiederm@xmission.com, keescook@chromium.org, x86@kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, jinisusan.george@amd.com, matz@suse.de, binutils@sourceware.org, jhb@freebsd.org, felix.willgerodt@intel.com Subject: Re: [PATCH 1/1] x86/elf: Add a new .note section containing Xfeatures information to x86 core files Message-ID: <20240314162954.GAZfMmAnYQoRjRbRzc@fat_crate.local> References: <20240314112359.50713-1-vigbalas@amd.com> <20240314112359.50713-2-vigbalas@amd.com> <20240314160824.GDZfMg-J1VOyjxIMiV@fat_crate.local> <6ce6aa20-25d2-4784-823f-2a18f592e002@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <6ce6aa20-25d2-4784-823f-2a18f592e002@intel.com> On Thu, Mar 14, 2024 at 09:19:15AM -0700, Dave Hansen wrote: > Are you envisioning an *XSAVE* state component that's not described by > CPUID? I want to be prepared. You can imagine some of the short cuts and corners cutting hw guys would do so I'd want to be prepared there and not tie this to CPUID. > Or some _other_ (non-XSAVE) component in a core dump that isn't > described by CPUID? Yes, that too. Since the format of this buffer is so simple and machine-independent, it can be extended as needed without issues. > That argument breaks down a bit on the flags though: > > xc.xfeat_flags = xstate_flags[i]; > > Because it comes _directly_ from CPUID with zero filtering: > > cpuid_count(XSTATE_CPUID, i, &eax, &ebx, &ecx, &edx); > ... > xstate_flags[i] = ecx; > > So this layout is quite dependent on what's in x86's CPUID. Yeah, no, this should not be copying CPUID flags - those flags should be *translated* to independently defined flags which describe those buffers. This is even more important if we change our xstate_flags[] machinery. This buffer should not use any kernel-internal definitions and structures but be completely self-describing. Vignesh, pls fix that. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette