From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 23972C8303F for ; Thu, 28 Aug 2025 17:16:52 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1099782.1453508 (Exim 4.92) (envelope-from ) id 1urgEs-00061d-AO; Thu, 28 Aug 2025 17:16:42 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1099782.1453508; Thu, 28 Aug 2025 17:16:42 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1urgEs-00061W-7F; Thu, 28 Aug 2025 17:16:42 +0000 Received: by outflank-mailman (input) for mailman id 1099782; Thu, 28 Aug 2025 17:16:40 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1urgEq-00061O-IA for xen-devel@lists.xenproject.org; Thu, 28 Aug 2025 17:16:40 +0000 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on20615.outbound.protection.outlook.com [2a01:111:f403:2416::615]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id c0af379b-8432-11f0-8dd7-1b34d833f44b; Thu, 28 Aug 2025 19:16:38 +0200 (CEST) Received: from BL0PR01CA0018.prod.exchangelabs.com (2603:10b6:208:71::31) by MN0PR12MB6200.namprd12.prod.outlook.com (2603:10b6:208:3c3::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9052.21; Thu, 28 Aug 2025 17:16:28 +0000 Received: from BL02EPF0002992D.namprd02.prod.outlook.com (2603:10b6:208:71:cafe::55) by BL0PR01CA0018.outlook.office365.com (2603:10b6:208:71::31) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9073.17 via Frontend Transport; Thu, 28 Aug 2025 17:15:08 +0000 Received: from SATLEXMB03.amd.com (165.204.84.17) by BL02EPF0002992D.mail.protection.outlook.com (10.167.249.58) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.9052.8 via Frontend Transport; Thu, 28 Aug 2025 17:16:28 +0000 Received: from satlexmb08.amd.com (10.181.42.217) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 28 Aug 2025 12:16:27 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.1748.10; Thu, 28 Aug 2025 10:16:27 -0700 Received: from [172.20.7.230] (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 28 Aug 2025 12:16:26 -0500 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: c0af379b-8432-11f0-8dd7-1b34d833f44b ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=oiW6Gt8nLbHF91SiMLbv+ybUihk7i6sMupfXnZ02lXGoGPTiDtXyNxflSQuJjY1/96nXuZzkV+kIuSBBKcf0ud9gc9CK/0NkVmkeb4oxLjt1BACdfTVR0nPWuQIC/Q5JHKZfbC5P2h88lM1jK7WujiAYZzhf1QF5QtzrKERH0zPzrXrwh/FqImKawz2919YZgoiu+B+Nb0zOiyhIzbuYzRt5lUsnO9A/hBMRaowfwz1XAsx7B9bsCx3yhXkwrKX/fRiGgwwIm2BiiwaBnQ+vQKNkywDTPRGBArq6fndiD9bvJpywhZBwe+7AVymLZD+EBmBxe3a9xUn1kQSwMctk1w== 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=BW4cJHaShagW13xBVGHYT6aHXe8PZHmg3np/hi9J5TA=; b=R4eZArnSc0lHcYraeVy/O1sdSlxED8jMea34h1GWw7zdCLHY34W1BfW8pGtOTIZ9baE+k4rrlLCHwSZHpgX0d2P3Bde//TH+0KBdFsBF/fqVNT9rnn3gzNkTu5a63lnakrdC2YxUTSYnXmuJENDXEEA+1IL/J6hanxZL2JLa4tcM0VsDntIDwkTLxQGD4YxBqlJwed0NrmcdY0bYVmi+mYhxQrjLYJFDxz3DIMyXJSWcRLSRMIkBeCYtPQwFwp8iRywsiWj9rJQYnQkATTdWXY65N2fHIZ2bKzcZ/NcSR8FQBm+w98zssqGkyLB8PhTEawqtMvfnQ64YZfHSdf2FXA== 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=BW4cJHaShagW13xBVGHYT6aHXe8PZHmg3np/hi9J5TA=; b=5X2alMi+WCTG+O0xZO4Gl8DD6JfDyVsDdvMc96YMLVytRWB0N/YVgPXxPXsUQ/o4sehEhqOWt1/EfRC5wx5OTYAv2hLSijAGCtdZJlfwnIyX61QXzRv4xVYdXGRPPR6HOTeo5d8i0GCrfHSzatlFabU3JDWXIfWKwAzci6Oje3w= 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=SATLEXMB03.amd.com; pr=C Message-ID: <773a5f4e-2f73-4b84-bc56-90aee660acd2@amd.com> Date: Thu, 28 Aug 2025 13:16:25 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 3/5] symbols: arrange to know where functions end To: Jan Beulich CC: Andrew Cooper , Julien Grall , Stefano Stabellini , Anthony PERARD , Michal Orzel , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , "xen-devel@lists.xenproject.org" References: <10e116c5-5a62-4abc-a52a-e2ca12118cfe@suse.com> <24fd00b5-3053-43ae-8342-887eee94869a@amd.com> Content-Language: en-US From: Jason Andryuk In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0002992D:EE_|MN0PR12MB6200:EE_ X-MS-Office365-Filtering-Correlation-Id: c586007b-7d2e-45f2-cdd9-08dde6569ffb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: =?utf-8?B?NFZKWVFoUUNXZ2doek9lWE0zdXUxVFN5THQ1Z2FDd3QxcWlKVWNrSEVRSFFp?= =?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FRJbUs2M3hZekdBcFRvcXdpY1NMVktp?= =?utf-8?B?dWFVVkp4NG1CK20wdEc0TTNObitLOXZyNmptbEJPQS9ZT081UEF1WFI5U3hy?= =?utf-8?B?L3NPaHJwYWs3Qi85Y2k4OXZTM3N4a0NMRlBXbXFBZ2R2bkIwVmxJd1l5cjkv?= =?utf-8?B?NzJ1aUd5eTEvYkl6bUErZjk4dlBmYnZaSExPREtmTExOM1ljK0JmN1VteXRw?= =?utf-8?Q?kz+23z?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(36860700013)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2025 17:16:28.1691 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c586007b-7d2e-45f2-cdd9-08dde6569ffb 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=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF0002992D.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6200 On 2025-08-28 12:11, Jan Beulich wrote: > On 28.08.2025 09:28, Jan Beulich wrote: >> On 28.08.2025 03:03, Jason Andryuk wrote: >>> On 2025-04-02 09:58, Jan Beulich wrote: >>>> --- a/xen/tools/symbols.c >>>> +++ b/xen/tools/symbols.c >>> >>>> @@ -318,24 +334,42 @@ static void write_src(void) >>>> printf("#else\n"); >>>> output_label("symbols_offsets"); >>>> printf("#endif\n"); >>>> - for (i = 0; i < table_cnt; i++) { >>>> + for (i = 0, ends = 0; i < table_cnt; i++) { >>>> printf("\tPTR\t%#llx - SYMBOLS_ORIGIN\n", table[i].addr); >>>> + >>>> + table[i].addr_idx = i + ends; >>>> + >>>> + if (!want_symbol_end(i)) { >>>> + /* If there's another symbol at the same address, >>>> + * propagate this symbol's size if the next one has >>>> + * no size, or if the next one's size is larger. */ >>> >>> Why do we want to shrink the next symbol's size? >> >> First (see related post-commit-message remarks): In principle section symbols >> could come with a size, too. That would break everything as long as we don't >> strip those. >> >> The main reason though is that imo smallest granularity is what we want here, >> together with predictability. One symbol with a huge size could cover >> multiple other symbols with smaller sizes. We could omit that part of the >> change here, but then the processing in the hypervisor would need to change, >> to fish out the "best suitable" symbol when dealing with multiple ones at the >> same address. Other changes may then also be needed to the tool, to have such >> symbols come in a well-defined order (to keep the then-new code in the >> hypervisor as simple as possible). Look for "aliased symbol" in >> common/symbols.c to see how simplistic respective code is right now. > > Furthermore remember that we can't record sizes, but instead we insert fake > symbols. Obviously there can be only one (at least in the present scheme). > If we used too large a size, chances would increase that the end symbol (in > the sorted table) would have to live past some other symbol, thus becoming > that one's "end". The scenario I thought about is something like: a 0x100-0x10f b 0x100-0x1ff c 0x200-0x2ff If you shrink b, you are creating a hole that would otherwise be assigned to b. But I agree avoiding huge sizes covering multiple small variables would better be avoided. Do you have concrete examples to help illustrate the problem? Regards, Jason