From nobody Sun Nov 24 04:46:44 2024 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2053.outbound.protection.outlook.com [40.107.236.53]) (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 E3386374F6 for ; Fri, 23 Aug 2024 19:36:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.53 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724441803; cv=fail; b=r7wbV0wwftqWRlinUsSBnjaP8aIOINt9MXMUUbr7LmJIhYIwURpDN8+IWbTRRluVWs4YGg0y9QZjGSC8rGmFcngclBlbefzUjqm7ZVZpzZn5Xt3YlDTquCwNUq3OSHeYhYYw0tKVMjqzxKgDEYjx5Db2/m0HjNFqGbLtMOpOW7o= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724441803; c=relaxed/simple; bh=MwV05Gr3lEkATUM+Z3skJAmQOe4rGIn/hUTxC08nFf4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VvJl0LVHRl2aSHe4OqnbGeTjSuiGxwZ/c4h034ftGaj3MOyZdosTHtS3FIoceiCOvIISlwRWZyOGDwoRDmWfFRwGL6fAj+h7YHGf3YjosghrvWI/Cqa8/JoFt+zABt0/f2iwsbqhx7mEAVSD3H7PvvCtFTH55P2sfyy6JHBB+gg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=J8yek0ka; arc=fail smtp.client-ip=40.107.236.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="J8yek0ka" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=glKcDYjbTAAV9QqRFb3gE29XVc5EUgIBABxXIjd7IKvkId4JZU7pDco/neWOWoJ3DfaJR6ap3LvGcsV7MB7yKWNcQ+e69neisjInrfNqsuEinmkk5xLnSY/SzmdyK58nZVIPr91keS3XWtxtLnDOQMDtNiVZa5SybzqOi1eBFSFNcioPw6G+Tyyg4n74gHRlnoqjpAYIAL+D61v+mTiFhnzPrWdVfc/dEqCgnU8BO8R8PZTTwcKzh9ruDAg+URjXTYYev4w/wqEmVFJLnAGULL8ggnsOuvCV8IvH2AUjlHvDAt4wYrNn0tII93az+OCOGboK5/x5JVsSZdntG1IWjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=55nJnnKdgeDx4oUSXrJ9Q+OVSfhHt48p1gn05H5VmsQ=; b=ipZLfcKjewCf/5hEs5ZX5Qux+kItX4LeWjZiGxnezz4tUmwjMNd3kmj2C+oqOQt7Rzcho6PmLrlXl0qOegxS67wk+CFcc7UZ/pHTnAmEXT8L1i+CMedaJW571BY73IECjPfUGVPBa+126HyTo5mdg51jGjXN8Qi/lwhKEBZtsHn/ca/0yKn9XXtm7sojbMZof/jUL0oAwe3nyj8lYLFzeBdY4A0FNtg9Q4BYxNELRBhBDN/NihMTLl5ZVNQ1jGUQapVklySs3djzPmNNDBR1F+ODIu69xUvdJTHXiqiquL5glAv9I8YubBlqH4y6zkpMqZ6I7AZuXOn1v59ove4rmw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=55nJnnKdgeDx4oUSXrJ9Q+OVSfhHt48p1gn05H5VmsQ=; b=J8yek0kab9gu+QiruPgP5X+JOvunBFxIfZ8KqKBv0rtNILjdlofoXBrNWKihFAVyKj4oo05urZb/49GbhxKhYKWEw1+SriCoNwE8Z7IVtHwIfVPEAJJve3WYIEiUM1GZ0jc8v6KnXXUZKR1D/Er9HtwDux5UnuTm4sPGBaw+TzA= Received: from BN9PR03CA0787.namprd03.prod.outlook.com (2603:10b6:408:13f::12) by MW6PR12MB8867.namprd12.prod.outlook.com (2603:10b6:303:249::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Fri, 23 Aug 2024 19:36:37 +0000 Received: from BN2PEPF000044A9.namprd04.prod.outlook.com (2603:10b6:408:13f:cafe::41) by BN9PR03CA0787.outlook.office365.com (2603:10b6:408:13f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.22 via Frontend Transport; Fri, 23 Aug 2024 19:36:37 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN2PEPF000044A9.mail.protection.outlook.com (10.167.243.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7897.11 via Frontend Transport; Fri, 23 Aug 2024 19:36:37 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 23 Aug 2024 14:36:35 -0500 Received: from fedora.mshome.net (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Fri, 23 Aug 2024 14:36:33 -0500 From: Jason Andryuk To: Juergen Gross , Boris Ostrovsky , Thomas Gleixner , "Ingo Molnar" , Borislav Petkov , Dave Hansen , , "H. Peter Anvin" , Stefano Stabellini , "Oleksandr Tyshchenko" , Paolo Bonzini , Brian Gerst CC: , , "Jason Andryuk" Subject: [PATCH v3 1/5] xen: sync elfnote.h from xen tree Date: Fri, 23 Aug 2024 15:36:26 -0400 Message-ID: <20240823193630.2583107-2-jason.andryuk@amd.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240823193630.2583107-1-jason.andryuk@amd.com> References: <20240823193630.2583107-1-jason.andryuk@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: None (SATLEXMB04.amd.com: jason.andryuk@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN2PEPF000044A9:EE_|MW6PR12MB8867:EE_ X-MS-Office365-Filtering-Correlation-Id: 679b3fdf-9c96-4805-eb13-08dcc3aae788 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|82310400026|1800799024|376014|7416014|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?xC/E2Uf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hY1?= =?us-ascii?Q?GwU7c2XsMonJ9iJfjVGjimpHz2RkceBIG+vTSjrZOW1MT4Az0U4j152rSyNb?= =?us-ascii?Q?ICkKFrRlOvgBpwPcuAZx+QNii1l+47Ei1yvq2pEyvQ4ZDU+tWXemQCCv+EZn?= =?us-ascii?Q?WyaE8yzUfMreZ1F0wZKb9puhYCeJbJe3ez9qZPFzRv+kJWW2KkpWQhpLwPBg?= =?us-ascii?Q?0VDpBsguaaVvm7mtUPvTVgH38Zo6OhXDkyvs6d58/4Cadj8Cr6jYPqiPZXnf?= =?us-ascii?Q?d3wtXkiUu0JClc21O2QIE6uVA2Qyt0joUKxd0zyTZNG3adntykm24cC7fZIU?= =?us-ascii?Q?bu29wmIHeNntx/ouaVW+EEY9XZuuq8jRSf1LY5qfiGt1eiYdetm0QQJcKSA0?= =?us-ascii?Q?uXAk7/7aGCzLSQrCBuzxGOxPaDUNZq2KTzk8ylt32Ds1390jXrGjkLLuEhFo?= =?us-ascii?Q?TF2CjAL65TXsiIAjFZrFAO9YMeCK0xHrbfw4J4wBTe0YInKD7mqh60wbFtxc?= =?us-ascii?Q?smJpnsd6Yv39Eam3RQxxxPMVv63p3NyaLCQS5WBJLiymiTl0tHmMhCiajmGZ?= =?us-ascii?Q?jYj1eW07QFUaOBUp+Nyo2CaKbmA817SRxeBYTL7GGeNVKn2ItAHiCQ=3D=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(82310400026)(1800799024)(376014)(7416014)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2024 19:36:37.5509 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 679b3fdf-9c96-4805-eb13-08dcc3aae788 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN2PEPF000044A9.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB8867 Content-Type: text/plain; charset="utf-8" Sync Xen's elfnote.h header from xen.git to pull in the XEN_ELFNOTE_PHYS32_RELOC define. xen commit dfc9fab00378 ("x86/PVH: Support relocatable dom0 kernels") This is a copy except for the removal of the emacs editor config at the end of the file. Signed-off-by: Jason Andryuk Reviewed-by: Juergen Gross --- include/xen/interface/elfnote.h | 93 +++++++++++++++++++++++++++++++-- 1 file changed, 88 insertions(+), 5 deletions(-) diff --git a/include/xen/interface/elfnote.h b/include/xen/interface/elfnot= e.h index 38deb1214613..918f47d87d7a 100644 --- a/include/xen/interface/elfnote.h +++ b/include/xen/interface/elfnote.h @@ -11,7 +11,9 @@ #define __XEN_PUBLIC_ELFNOTE_H__ =20 /* - * The notes should live in a SHT_NOTE segment and have "Xen" in the + * `incontents 200 elfnotes ELF notes + * + * The notes should live in a PT_NOTE segment and have "Xen" in the * name field. * * Numeric types are either 4 or 8 bytes depending on the content of @@ -22,6 +24,8 @@ * * String values (for non-legacy) are NULL terminated ASCII, also known * as ASCIZ type. + * + * Xen only uses ELF Notes contained in x86 binaries. */ =20 /* @@ -52,7 +56,7 @@ #define XEN_ELFNOTE_VIRT_BASE 3 =20 /* - * The offset of the ELF paddr field from the acutal required + * The offset of the ELF paddr field from the actual required * pseudo-physical address (numeric). * * This is used to maintain backwards compatibility with older kernels @@ -92,7 +96,12 @@ #define XEN_ELFNOTE_LOADER 8 =20 /* - * The kernel supports PAE (x86/32 only, string =3D "yes" or "no"). + * The kernel supports PAE (x86/32 only, string =3D "yes", "no" or + * "bimodal"). + * + * For compatibility with Xen 3.0.3 and earlier the "bimodal" setting + * may be given as "yes,bimodal" which will cause older Xen to treat + * this kernel as PAE. * * LEGACY: PAE (n.b. The legacy interface included a provision to * indicate 'extended-cr3' support allowing L3 page tables to be @@ -149,7 +158,9 @@ * The (non-default) location the initial phys-to-machine map should be * placed at by the hypervisor (Dom0) or the tools (DomU). * The kernel must be prepared for this mapping to be established using - * large pages, despite such otherwise not being available to guests. + * large pages, despite such otherwise not being available to guests. Note + * that these large pages may be misaligned in PFN space (they'll obviously + * be aligned in MFN and virtual address spaces). * The kernel must also be able to handle the page table pages used for * this mapping not being accessible through the initial mapping. * (Only x86-64 supports this at present.) @@ -185,9 +196,81 @@ */ #define XEN_ELFNOTE_PHYS32_ENTRY 18 =20 +/* + * Physical loading constraints for PVH kernels + * + * The presence of this note indicates the kernel supports relocating itse= lf. + * + * The note may include up to three 32bit values to place constraints on t= he + * guest physical loading addresses and alignment for a PVH kernel. Values + * are read in the following order: + * - a required start alignment (default 0x200000) + * - a minimum address for the start of the image (default 0; see below) + * - a maximum address for the last byte of the image (default 0xffffffff) + * + * When this note specifies an alignment value, it is used. Otherwise the + * maximum p_align value from loadable ELF Program Headers is used, if it = is + * greater than or equal to 4k (0x1000). Otherwise, the default is used. + */ +#define XEN_ELFNOTE_PHYS32_RELOC 19 + /* * The number of the highest elfnote defined. */ -#define XEN_ELFNOTE_MAX XEN_ELFNOTE_PHYS32_ENTRY +#define XEN_ELFNOTE_MAX XEN_ELFNOTE_PHYS32_RELOC + +/* + * System information exported through crash notes. + * + * The kexec / kdump code will create one XEN_ELFNOTE_CRASH_INFO + * note in case of a system crash. This note will contain various + * information about the system, see xen/include/xen/elfcore.h. + */ +#define XEN_ELFNOTE_CRASH_INFO 0x1000001 + +/* + * System registers exported through crash notes. + * + * The kexec / kdump code will create one XEN_ELFNOTE_CRASH_REGS + * note per cpu in case of a system crash. This note is architecture + * specific and will contain registers not saved in the "CORE" note. + * See xen/include/xen/elfcore.h for more information. + */ +#define XEN_ELFNOTE_CRASH_REGS 0x1000002 + + +/* + * xen dump-core none note. + * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_NONE + * in its dump file to indicate that the file is xen dump-core + * file. This note doesn't have any other information. + * See tools/libxc/xc_core.h for more information. + */ +#define XEN_ELFNOTE_DUMPCORE_NONE 0x2000000 + +/* + * xen dump-core header note. + * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_HEADER + * in its dump file. + * See tools/libxc/xc_core.h for more information. + */ +#define XEN_ELFNOTE_DUMPCORE_HEADER 0x2000001 + +/* + * xen dump-core xen version note. + * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_XEN_VERSION + * in its dump file. It contains the xen version obtained via the + * XENVER hypercall. + * See tools/libxc/xc_core.h for more information. + */ +#define XEN_ELFNOTE_DUMPCORE_XEN_VERSION 0x2000002 + +/* + * xen dump-core format version note. + * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_FORMAT_VERSION + * in its dump file. It contains a format version identifier. + * See tools/libxc/xc_core.h for more information. + */ +#define XEN_ELFNOTE_DUMPCORE_FORMAT_VERSION 0x2000003 =20 #endif /* __XEN_PUBLIC_ELFNOTE_H__ */ --=20 2.34.1