From patchwork Mon Jul 10 08:51:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13306489 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 781B8EB64D9 for ; Mon, 10 Jul 2023 08:51:59 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.561088.877391 (Exim 4.92) (envelope-from ) id 1qImcY-0005JL-Q4; Mon, 10 Jul 2023 08:51:50 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 561088.877391; Mon, 10 Jul 2023 08:51:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qImcY-0005JC-Lz; Mon, 10 Jul 2023 08:51:50 +0000 Received: by outflank-mailman (input) for mailman id 561088; Mon, 10 Jul 2023 08:51:49 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qImcX-0005Iv-Qk for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 08:51:49 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on0616.outbound.protection.outlook.com [2a01:111:f400:fe0c::616]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 01668577-1eff-11ee-b239-6b7b168915f2; Mon, 10 Jul 2023 10:51:48 +0200 (CEST) Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21) by AS4PR04MB9315.eurprd04.prod.outlook.com (2603:10a6:20b:4e6::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.29; Mon, 10 Jul 2023 08:51:46 +0000 Received: from AS8PR04MB8788.eurprd04.prod.outlook.com ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023 08:51:46 +0000 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: 01668577-1eff-11ee-b239-6b7b168915f2 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=boDeWuly+CArVxcmaeYsFzKsPDXCvc5MRTx6r1Ccapry0XZHNmgdMumajk9xRITRvNAHB1GnWOnxzrGpLzs0XJvyw3sjw9vdYYtbTrNJP7gqIfKlojLsFJLqGJbc81qoAaQWLzE/MShv2YsKTysxKY6VaYd36HkBPTpbxiwNkDoAxl61wQhsmBILzGfZcJxFVkjd2GbhYh8gI6v/G9qrzdCIiL0VIKFw3wg8rfSynRsDtphc591zU6ja5+rHoDxS9vzKn7bCK/r69X3/3TYS0YeKJ3Dafb1yLBGYL+Fz8YqAY4Sq1CsjC3rR735bbLa+L4+IRRai+mK4SZzcI9BtXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=tEZqfEecVCoAUXwOun3bnx9/68WK0/jJ2cWnhbpIMB4=; b=PF6xwndGerjT8tw/LkfWcGZvKVmwzQie0114bTUZj1VOlqH/bmAz7HYgWW7hMmiBgFgU0tIkO/yjTtQ358Zn+CRzKjKolvGvcG6PDMhB6uHp5sttfM2YB/uZXhq81+H2Z+Ng6uoBIs35PfnmcFN9js25yqRz09qpkkOKW2IZEgUvl1mDLUtzE8XOnvjZTsNUZMOrOQEXe9W1EzZ8ZnbwAjchIlOuKuAEH0lt+LMl0tcKWlku9TWSADxgD5TDfU7LNeHUKpYADYQfTWgjx5ME+SeN9pYypJlLYTBlWpvrzuJc84bwCSdHAt6LOyhRzmke56Hl14N9XNRjYs7gwdmXuQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tEZqfEecVCoAUXwOun3bnx9/68WK0/jJ2cWnhbpIMB4=; b=r4HjOhRjApcM5FmymXKsMvObQOvyu9f13oaaqCEnXaLo12sIz4mFmAUwqcut376jyD2Zef5UFdeyWArb5fAdMj0mZusmkCyWV8sBHj8rAALwvcu4wXRdKR4u//uyIjLiqgaYThrsefLdsToNTJ7sfWDivXD5bd4/hdJpQHK9N6MaiKV0bngpY7sahg7kMBgRlb0W3ZUJECrAMG8hDcoUB2NbvM5i56zRKkpNYdjUANl66vAl+idvrLu4xzf4aO9zZJpHqMzusu2K9Eu18UKdwWvn6iFjSsIhLM86PNBE7Bv5r4ZQ06CSWyeUzkRZYhNkPqI39iMlOy3Lv6fhZFcG+w== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: <109efb43-a519-73f6-2a26-2b420090ab2b@suse.com> Date: Mon, 10 Jul 2023 10:51:45 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: [PATCH v3 1/8] common: move a few macros out of xen/lib.h Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , Julien Grall , Stefano Stabellini , George Dunlap References: In-Reply-To: X-ClientProxiedBy: FR2P281CA0117.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:9d::7) To AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AS4PR04MB9315:EE_ X-MS-Office365-Filtering-Correlation-Id: 29d5f7fb-262d-4b15-2534-08db8122e498 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6vWreUL6Zd5iA+zK4pxxSyIOGGKfsuQt5MUGif/pKDea0KefKenLB8eieNCWIa9MK2fUTQTWvYrWtY2OByGhlxs8dqr0gjcI93WO0GArl6nC4/gYTo6RXrIHDiGTmqQGNaZkGXUv+3ztpXA77ADopESSgC2mVy0AzxKXuI4WJLUrmW5aDvFQ/Q33twwyq6CPGFfyLZXJ1GxhNY29jMu1y03RO+X8Rm/x/G6XiIU5FN+CUc9oed2PFrD2Vzm06Sg1HhyHDE3l8fEZu06rIW2o4kVvBnoa5D+KF3STwT9s8YBCvNY5ftAs5oDUwSTisiPcoFNtyeWJR+9zGQmc/31EjWmdyGYwBisVAORtCt/6TT6PIHDT/38RbvivDqq3FSHBAmVubZhU8q+DDbtfboIYJkI5cpoNL0jDDfR5HFZlcZge6DODQJU8LHpyLITqOb5W7D62Cp8F4+ljq9xp7qJBNaKeVyOqbbVAtYe7Xnu6AtTY0NPQAzs49m+b6brlYmRGqMAkaNbWKzt4VWKmUW8nVxBklw3ZLqYgQp/reqjhuhZmjThahQRQLjxsMPCrhrixzTMzfuzR0KySJ/xai5PzvVJc+9TbH3kXA+I7avtyM1Nga3cVxJtF3e3SUC0UiohHhVySUs+bD2/D5IcNf4Y6UA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(396003)(346002)(39860400002)(136003)(376002)(451199021)(31686004)(478600001)(4326008)(54906003)(2616005)(86362001)(31696002)(36756003)(2906002)(26005)(6512007)(6506007)(6486002)(186003)(38100700002)(66556008)(5660300002)(316002)(41300700001)(8936002)(66476007)(66946007)(8676002)(6916009)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?LHqge01mVVpCTYvgqq50FM986bgg?= =?utf-8?q?B0j3fxClf4628q3HbZZ4xgu1SvQOhSz63qDgnB6GJEQfaGA2eIHDDNngZo51WK3Va?= =?utf-8?q?zHUQi+9/ypj+NYqkvS3n0Mb9oAO3ZHnGQjWJYbga+79+x4J/lpcCbuf48SvLyqEWV?= =?utf-8?q?gqM/Pk3/ObaAGOtTQaa+ZHzGpRIZb+dJbQFgizz1N622aUR88ONaQX9RtPDjw618Y?= =?utf-8?q?LFErudd4VqEdCftNAM2hQgqXWKPlxJAEpGVCeUW1aWbsOUb3OPdaOrDWcXGFgZ0zw?= =?utf-8?q?dPcLWqElQO/Q1MASiGwjqGCY5eyI+JNhcmC1A1BZuaTOfTdQ1l7uixerGARQdIed7?= =?utf-8?q?0EpYQ3evJnRPe8sxvdOofG7S7VlsL+n4vhu5hY/t/2B6OR99iCzdFOtb6sMKztFJK?= =?utf-8?q?X0P4fmbmWhp6u6iEP1cHHr7/QWZYIh1fjlqQyg/JWk4GvwLzIAqeg4L/zDtgyi7tE?= =?utf-8?q?WQpSb1f7ycD9ST6Msds3YMMp7pWk2n8uZgT5bI/s74UwWSSOhSYnraF/lIkkW0TQs?= =?utf-8?q?JkPXhfzv2D4DFgQz2HumDY946k0sqbxFsCs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NBVlAH5sdjy+ClWMlhT?= =?utf-8?q?tRhlGr/qq3wHTFJiZxcpOYWCm909FpBWx/k8YiWwe439IYwfooeG5QVs45ZtjnzMd?= =?utf-8?q?9r7XRju62ZQT?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 29d5f7fb-262d-4b15-2534-08db8122e498 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 08:51:46.7935 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: U4v3w9ptASt+7jWppW4uYPuHow5qQtkVuzmJ5TMXeVoUFksc8KOPnyma5aa8aDjk/EQoc2H4YtJ4+1aHvsiMoA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9315 Introduce xen/macros.h for this purpose. For now xen/lib.h simply includes xen/macro.h, until consumers can be suitable cleaned up. Signed-off-by: Jan Beulich Reviewed-by: Oleksii Kurochko Reviewed-by: Shawn Anastasio --- v3: New. --- a/xen/include/xen/lib.h +++ b/xen/include/xen/lib.h @@ -1,26 +1,7 @@ #ifndef __LIB_H__ #define __LIB_H__ -#define ROUNDUP(x, a) (((x) + (a) - 1) & ~((a) - 1)) - -#define IS_ALIGNED(val, align) (!((val) & ((align) - 1))) - -#define DIV_ROUND(n, d) (((n) + (d) / 2) / (d)) -#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) - -#define MASK_EXTR(v, m) (((v) & (m)) / ((m) & -(m))) -#define MASK_INSR(v, m) (((v) * ((m) & -(m))) & (m)) - -#define count_args_(dot, a1, a2, a3, a4, a5, a6, a7, a8, x, ...) x -#define count_args(args...) \ - count_args_(., ## args, 8, 7, 6, 5, 4, 3, 2, 1, 0) - -/* Indirect macros required for expanded argument pasting. */ -#define PASTE_(a, b) a ## b -#define PASTE(a, b) PASTE_(a, b) - -#define __STR(...) #__VA_ARGS__ -#define STR(...) __STR(__VA_ARGS__) +#include #ifndef __ASSEMBLY__ --- /dev/null +++ b/xen/include/xen/macros.h @@ -0,0 +1,34 @@ +#ifndef __MACROS_H__ +#define __MACROS_H__ + +#define ROUNDUP(x, a) (((x) + (a) - 1) & ~((a) - 1)) + +#define IS_ALIGNED(val, align) (!((val) & ((align) - 1))) + +#define DIV_ROUND(n, d) (((n) + (d) / 2) / (d)) +#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) + +#define MASK_EXTR(v, m) (((v) & (m)) / ((m) & -(m))) +#define MASK_INSR(v, m) (((v) * ((m) & -(m))) & (m)) + +#define count_args_(dot, a1, a2, a3, a4, a5, a6, a7, a8, x, ...) x +#define count_args(args...) \ + count_args_(., ## args, 8, 7, 6, 5, 4, 3, 2, 1, 0) + +/* Indirect macros required for expanded argument pasting. */ +#define PASTE_(a, b) a ## b +#define PASTE(a, b) PASTE_(a, b) + +#define __STR(...) #__VA_ARGS__ +#define STR(...) __STR(__VA_ARGS__) + +#endif /* __MACROS_H__ */ + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ From patchwork Mon Jul 10 08:52:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13306490 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 3F125EB64D9 for ; Mon, 10 Jul 2023 08:52:56 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.561092.877400 (Exim 4.92) (envelope-from ) id 1qImdM-0005q1-2c; Mon, 10 Jul 2023 08:52:40 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 561092.877400; Mon, 10 Jul 2023 08:52:40 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qImdL-0005pu-Vx; Mon, 10 Jul 2023 08:52:39 +0000 Received: by outflank-mailman (input) for mailman id 561092; Mon, 10 Jul 2023 08:52:38 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qImdK-0005pm-RI for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 08:52:38 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on060d.outbound.protection.outlook.com [2a01:111:f400:fe0c::60d]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 1eb69bf3-1eff-11ee-b239-6b7b168915f2; Mon, 10 Jul 2023 10:52:38 +0200 (CEST) Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21) by AS4PR04MB9315.eurprd04.prod.outlook.com (2603:10a6:20b:4e6::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.29; Mon, 10 Jul 2023 08:52:36 +0000 Received: from AS8PR04MB8788.eurprd04.prod.outlook.com ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023 08:52:35 +0000 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: 1eb69bf3-1eff-11ee-b239-6b7b168915f2 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L+En57oQQSPTZAqHAmSxPyhTAHgvj17DALtgge4jIsYs6oA2IL+4Mqriy9EKO9rPZ3Otd2WnA634fC1SvBKAb+jkpL4GELtqRm56l7CSqGY2Ydj+ayewcjU7iZrWpbfEKhHocy/k3LM1birIGrA5BkTYHlGrk9abiZXpKwRFgI1QbVm2Ci4CTz78iD7cFJ0g0DHosjeixbbeIXJ+FzkOAfZq++vz6cT+NdTIr0RIzbtsLokkUnx0l5NO1X2XXqvQ9hIO1ias5bgD2HOIccvBDRi3JxKU4niSeiTn7paZpchhrbeFbWxzMZgTMq+bLcVpdAs7O2DYJrXS8gEBaFLxZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=Njshz39xQXWzUhA0rIyJzlUroK26ZOgCP1y5HqVWGkc=; b=l9N+oSAPoI4ar5xQtsr3s7vg3AHX3vuVeTjz4JjVXGsBhu5UJ3TMzGcpxCygkCVD56071oeo8Js0MG1e6BrRVVOrf+axH+nE/unX2F4JrhGBHn1umbLCnkh24tEW+vejH6MF6/V3ohtK0WvxayFLf65HqCdKxcfdtD0XUbhX6fUfLjsu8hmmlNyeVBzK18buwMNKl8hg2oGiav2hyCaxKGmu94Zx2DTADJ5mLZiWZY0ToaA8HlT0jBeMSEx8XElpnhfRkzI5wTj8hN+0OuocHzTauecCGEBCybohp5+Gjk6Z8MMsgnwO6HYJyXKA15pLHkWhB7db48n3C7naG0ptIQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Njshz39xQXWzUhA0rIyJzlUroK26ZOgCP1y5HqVWGkc=; b=PpHfwbxubi50Zze7hViJybvADhiYC0wPvmGdysQQ2ZpjEVlci1DuXu5pCclt2GTY9bRH7yrjcTd5HEXnxdrYHlMQYx32/p4nQwGQbRok/KTcUeJ28VbT0TDM9LOEJ9di29/zqHj7Y9rNi77v7Cr2wB60voJVfYO7eQjiFhDt5sRy20zmdNkxPwsFdOex9zcQ1Ub0a5cVQBJYz5N+EIJAH7/YJQHqLCMFy1aZZ6j9q6UdVJvT7pVNClwo9RtNIPVYCjM9yHfOrnvYrQvxpuDOcEnOjW8ah8dBJvBbHbyn1s8gNFQKWNfVa0x2uEy7nfLWdQRg2V4JgTJ5ylIhiSR+hg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: Date: Mon, 10 Jul 2023 10:52:34 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: [PATCH v3 2/8] common: assembly entry point type/size annotations Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Julien Grall , Stefano Stabellini , George Dunlap References: In-Reply-To: X-ClientProxiedBy: FR2P281CA0125.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:9d::19) To AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AS4PR04MB9315:EE_ X-MS-Office365-Filtering-Correlation-Id: 74920813-a889-4af5-2e54-08db812301e8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WvBd+tBkx6BccUgQIQNEALAMP8Q53U+xgUI7QJG/S/jahPI4Iqamyabdo52axjc3aeYpN9fvjskEIlsBMJcR/SlwmJ1AQ3ffvaBtWrczsOs1c084by4kvst/3CdvgiqjUzZGqxAuswcAusokCF6tFi2AnaG5DE/ZdDLfjezheV2vPlrHmQ7lhLg2TYBvZxyTs80SVecBTySzxo4VDWHfUr2ZggWAsNrNU3ShwMti95eOjtdh9gBI12fzauh9SJaVx2L5lk97x5TCW6vCrsVR79oaqrbaqsH0cvrlsnKKer2HLD1KiX06ZIgGdrLk9RdxBD8XjnH/PPTiupAdknjN2Uhjeg+JaNKI65QeCqrf6uHIPUDB6UO/Y14yCC12dvpxWO17OnQymiv1yChlXwANvmn1WRqUpJySWp7c0lGzyMPsXYlKdStV0NggIlz25fqcUiK2HzqxlVXtnA+I+vbs9zyu//RAWmtuFL7Dnf1Z4J2S/CWdiV7N1UzEHN3g2rqmz9u8cciVArEWhTuj1za1vMAjalYxHVigkE2OgZHh4JgYUZSmQgFWZv5sEG0iImzUwqxy0vFqgh3JRhm29CyyUl5fCqODtwzArdoPuAff1Mg1mE/Ke32x7I5pdLX68ZZLldg7qBTTj/MDZQu5OrE48A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(396003)(346002)(39860400002)(136003)(376002)(451199021)(31686004)(478600001)(4326008)(54906003)(2616005)(86362001)(31696002)(36756003)(2906002)(966005)(26005)(6512007)(6506007)(6486002)(186003)(38100700002)(66556008)(5660300002)(316002)(41300700001)(8936002)(66476007)(66946007)(8676002)(6916009)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-A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mahsG?= =?utf-8?q?Cq6gAfmK3fKVHYyfncwOPve7ucIfJRlCUdP6wICfalBk/tSpuDYCKdmNjrUiLMWKM?= =?utf-8?q?dNUAIbuU2X3LXU1RAIkHIPXz8MSw04Rjlr1AqYOcBP/cvGBaIrEOzR7VKhpT4JmF2?= =?utf-8?q?WwvEAH89pobA13XYeMa+9zTnESLy/wWYbDVu33ouCE/UhMDlUq6VD8ECRcArp8CNw?= =?utf-8?q?mNGHPSG0yKLf/smQ3NgzfUOricECuTwVUYqjZHIRkU+eN8Ru42+hc4uDzmxaSZumE?= =?utf-8?q?42cj1Lz6h5pKKqmkle5tEstKa6YFxxvoXgbNeOiOYiKQ93IzHLjFkX/adAZj0VEUw?= =?utf-8?q?YGSE7iaUE4b1u/Iy1gBlArozZbt730oYB5/BGsHvBdVldRnN/dgCgBvGDLXogKzH1?= =?utf-8?q?7kcnUrEXNTelnmK2tC+ZER6G0tFDsDRNa/ptSAgEP5nnvlTGaEOU2UEb4NU/U/zfw?= =?utf-8?q?rOp769QjM4n8RbNtN6xHsMECl/TH1Moad+Ain2KU2yj/GKpAwTeWLRLFurSavhV0I?= =?utf-8?q?URl3A1cdT2phqEBi9VS44TLVtZECkpCQcrRJNtwTrZvJ2II2aoA4tofBCKd+ECR1G?= =?utf-8?q?AbTBy1AyZVMRzUrT20BLZDzcZFj6T+aksjz1bi5wGLvCDTZoKWuYfds58h6SEubHo?= =?utf-8?q?ZNJtl/LtEAcmaamFsnFYIhWwl09CJEgLOrozHnmIipRiDPrC4KcYviZuIClV7rEb1?= =?utf-8?q?mSfBAw1qvCcz?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 74920813-a889-4af5-2e54-08db812301e8 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 08:52:35.9723 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 28CeclLfKUPr5AFGA+2dmN3r2sss919lvKYpuYPIJV1Kze1UqCoTEA/6hMTp4ksFSFAeup1hqtZ1r5X8kwwaRg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9315 Recent gas versions generate minimalistic Dwarf debug info for items annotated as functions and having their sizes specified [1]. Furthermore generating live patches wants items properly annotated. "Borrow" Arm's END() and (remotely) derive other annotation infrastructure from Linux'es, for all architectures to use. Signed-off-by: Jan Beulich [1] https://sourceware.org/git?p=binutils-gdb.git;a=commitdiff;h=591cc9fbbfd6d51131c0f1d4a92e7893edcc7a28 --- v3: New, generalized from earlier x86-only version. LAST() (now LASTARG()) moved to macros.h. --- TBD: What to set CODE_ALIGN to by default? Or should we requires arch-es to define that in all cases? TBD: {CODE,DATA}_ALIGN are byte granular, such that a value of 0 can be specified (in case this has some special meaning on an arch; conceivably it could mean to use some kind of arch default). We may not strictly need that, and hence we could also make these power-of -2 values (using .p2align). Note that we can't use ALIGN() (in place of SYM_ALIGN()) as long as we still have ALIGN. Note further that FUNC()'s etc "algn" parameter is intended to allow for only no or a single argument. If we wanted to also make the fill value customizable per call site, the constructs would need re-doing to some degree. --- /dev/null +++ b/xen/include/xen/linkage.h @@ -0,0 +1,56 @@ +#ifndef __LINKAGE_H__ +#define __LINKAGE_H__ + +#ifdef __ASSEMBLY__ + +#include + +#ifndef CODE_ALIGN +# define CODE_ALIGN ?? +#endif +#ifndef CODE_FILL +# define CODE_FILL ~0 +#endif + +#ifndef DATA_ALIGN +# define DATA_ALIGN 0 +#endif +#ifndef DATA_FILL +# define DATA_FILL ~0 +#endif + +#define SYM_ALIGN(algn...) .balign algn + +#define SYM_L_GLOBAL(name) .globl name +#define SYM_L_WEAK(name) .weak name +#define SYM_L_LOCAL(name) /* nothing */ + +#define SYM_T_FUNC STT_FUNC +#define SYM_T_DATA STT_OBJECT +#define SYM_T_NONE STT_NOTYPE + +#define SYM(name, typ, linkage, algn...) \ + .type name, SYM_T_ ## typ; \ + SYM_L_ ## linkage(name); \ + SYM_ALIGN(algn); \ + name: + +#define END(name) .size name, . - name + +#define FUNC(name, algn...) \ + SYM(name, FUNC, GLOBAL, LASTARG(CODE_ALIGN, ## algn), CODE_FILL) +#define LABEL(name, algn...) \ + SYM(name, NONE, GLOBAL, LASTARG(CODE_ALIGN, ## algn), CODE_FILL) +#define DATA(name, algn...) \ + SYM(name, DATA, GLOBAL, LASTARG(DATA_ALIGN, ## algn), DATA_FILL) + +#define FUNC_LOCAL(name, algn...) \ + SYM(name, FUNC, LOCAL, LASTARG(CODE_ALIGN, ## algn), CODE_FILL) +#define LABEL_LOCAL(name, algn...) \ + SYM(name, NONE, LOCAL, LASTARG(CODE_ALIGN, ## algn), CODE_FILL) +#define DATA_LOCAL(name, algn...) \ + SYM(name, DATA, LOCAL, LASTARG(DATA_ALIGN, ## algn), DATA_FILL) + +#endif /* __ASSEMBLY__ */ + +#endif /* __LINKAGE_H__ */ --- a/xen/include/xen/macros.h +++ b/xen/include/xen/macros.h @@ -15,6 +15,15 @@ #define count_args(args...) \ count_args_(., ## args, 8, 7, 6, 5, 4, 3, 2, 1, 0) +#define ARG1_(x, y...) (x) +#define ARG2_(x, y...) ARG1_(y) +#define ARG3_(x, y...) ARG2_(y) +#define ARG4_(x, y...) ARG3_(y) + +#define ARG__(nr) ARG ## nr ## _ +#define ARG_(nr) ARG__(nr) +#define LASTARG(x, y...) ARG_(count_args(x, ## y))(x, ## y) + /* Indirect macros required for expanded argument pasting. */ #define PASTE_(a, b) a ## b #define PASTE(a, b) PASTE_(a, b) From patchwork Mon Jul 10 08:53:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13306491 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 6D922EB64D9 for ; Mon, 10 Jul 2023 08:54:13 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.561099.877421 (Exim 4.92) (envelope-from ) id 1qImed-0006tm-OM; Mon, 10 Jul 2023 08:53:59 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 561099.877421; Mon, 10 Jul 2023 08:53:59 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qImed-0006tf-Lc; Mon, 10 Jul 2023 08:53:59 +0000 Received: by outflank-mailman (input) for mailman id 561099; Mon, 10 Jul 2023 08:53:58 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qImec-0006t6-AK for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 08:53:58 +0000 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0617.outbound.protection.outlook.com [2a01:111:f400:fe1f::617]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 4dd87f37-1eff-11ee-b239-6b7b168915f2; Mon, 10 Jul 2023 10:53:57 +0200 (CEST) Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21) by DU2PR04MB9051.eurprd04.prod.outlook.com (2603:10a6:10:2e6::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Mon, 10 Jul 2023 08:53:54 +0000 Received: from AS8PR04MB8788.eurprd04.prod.outlook.com ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023 08:53:54 +0000 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: 4dd87f37-1eff-11ee-b239-6b7b168915f2 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BKcM6lj5xgrKkCGO/e1BI5hhk93ZzWSVDp6J0acdonOzXnKUJn6EFVTkv8IHxHYkNNQo157/Ws3SfXva3HPe8fkuubN1L0E5ghtRpCFFcIXiUDePGig2Nd07xarI3Fuybk9QuvdKpKT3EtVoXQTwIWhhvEvjseTMXgOjOxYB7Ww5Z5OuDPVbLcvuDMzgewtITqLQdDdiXoVJ9LR5rHW6HRebePHv2w9SdSZJljj/tc3Gf+s2U7zEO2HOF548ZtWedwtNK31IfznZM/23tU6wzh2JNqRqLsq4n6YAIf2BJn0K8eCK0QvzUshy3Wym+eHmRmXo0wRZgnuRDsMj5dc/bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=DwE2DaHJIT8yUh1v7GuvfaHzm8FBrIyxUnyTwmDfL0E=; b=OXcZDMCtRc1NDCuEG/G+RGHseDhYwrki6Y6qDc7Yq3UyFZMK20rVxvOzrd854hM74PLZrU8/B7MO+/ztdYEW9pCIj+eSOCmucVau+YhU/QvNIqFsRoDNT/D5Kh0/4JQI/gaVBFLZti3Yqhst4uHVQjPajHVMXB8np5SfaaM6gQ32D/tIhQeTU/UNo69kYxB6/IXbGE6DSIcWwCjhLRuzULGPVOATgIn2oktPhubRjOnNSUHgW/t06yQrpUynnLoYklfPVf0ZhV7pO+gYkzy+Od2fu3sfd65m45TVKpoxIMjpUWdcuWjrXbciazm3VbEt+WEQs6vKJSS4g/qqHsEKwQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DwE2DaHJIT8yUh1v7GuvfaHzm8FBrIyxUnyTwmDfL0E=; b=bZlxfdQnvYYyqm370ANX9c+7xrp6+VTU39DWjdM0eXJH01VOU/89+MZtEOFcZFv5julM2UrpK/+c+MIn0EcUOjRFrd/exyCYMC6TG4QGMdjc4rfRyK5ECLpIHQu2DzOQNv17dZfU4YDwhC8G0bI/ESy4RLzj9znEWVgkacvJghfTCyeGXe+H3Crd3toB1fRCln0lxAmNTR8XshSV+xuPvIpC/bg8o8S4GMGWqcJJJGa5e/z004KIXn7zF7IwF176MM8gYNMPmQIrCtV/1oGiWY13pT95XngYrckOTUQdIQx+XsefFpyBXBqLpdO3G2CFTaQIMQJPv5TOt3IY4xFd+w== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: Date: Mon, 10 Jul 2023 10:53:53 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: [PATCH v3 3/8] x86: annotate entry points with type and size Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= References: In-Reply-To: X-ClientProxiedBy: FRYP281CA0002.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10::12) To AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|DU2PR04MB9051:EE_ X-MS-Office365-Filtering-Correlation-Id: 58ac6bcd-6d4e-4aed-f69e-08db812330c7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gepJeBp3vSConBujNck6eS4elbRpcimWZXgDLG8GIUebYd768+v6UPASyv+4smgrFyf81S4EEmpjEjnC7Ru/CmtqSyINPYIqeJL65bgZTdi2JnyahUbLIbJoSnHjOvvcBXydYtR9pTE6ElYLClDIa9a2rNPyEUPAdTADlO+l4ddw3Ixy5Cgpn3Ghlpf37V11le+wl3jpRnpvn7w1RhMfwC5kMxiGNShJugKb3h8kCQktL3hqzwfR+259JV4knQbSkCQLurDF/kh5g/05BLxqmsMiqLf2gerhcAKte20MXfslrRXHlDLU0Z/t0+Hz4D1ksTJAyTFXYmDhg1hIkkks0gs0bMwrfuGWkMbxqnp6WNBhk2GE+44tbukhUh+9EtBAERNyG8ZrLtzLaSQWO1SHZ1iM3RGQhlLWkl8cEdmzOvtO5Lgpa0vAudZCvtYnJbKV0/nSFrizjeUvy5P2mY6N1G1HO8HOAlmEDmvxHz2L/U6+ZLcKbK0SGGHPNUasEOkn3LnjPlX8Trn1N1FROAA06OPAgjPemptqfHFyO/z3lp8LIAFKcL8gjL2ecHqI9qb/cbG8sqEvLgTuP1PXqyi2Lp6FSF65yB++WSAI7ITTA9eoBkBkQ10oi0oB6U8wEmAA5+6R0SJUs9yQQxuYGmdq9w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39850400004)(376002)(136003)(346002)(396003)(366004)(451199021)(186003)(26005)(6506007)(2616005)(6512007)(83380400001)(41300700001)(30864003)(4326008)(6916009)(2906002)(66556008)(316002)(5660300002)(66476007)(8676002)(8936002)(478600001)(66946007)(6486002)(54906003)(36756003)(38100700002)(31696002)(86362001)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?+CjWpiz6aJTTFhoth8POQB1zkLYA?= =?utf-8?q?ayPp1DqkNUuxbm3Krma0LwJSkGsGLW8M622F3AQmuEashtSXb1XRE3BefYuVD6Xvl?= =?utf-8?q?1BB7RK+T2osSrXE2CQrMvouDq0Yjs/LyTPkwnf2pUxSxQxJM6hSY8NkLSTIIl3WnJ?= =?utf-8?q?4DahrLcLRuNe2VrVox6lrsQHkIQGtSvxEoHxKHsLOzeVmC9UU15EDLVxeJHkQMNir?= =?utf-8?q?7AbCrCWixxxrhO2cQKCHt4J8iSsKi2a1MTmhcERIYZttEss6iC7yRh2U/10xJdHVK?= =?utf-8?q?GogOOtOgGHgFy8rlJUsZMNuFswqgLsLPwOF32/WVCmVC10QCrQhfw2J/oaX4iIQr8?= =?utf-8?q?8f3qmT/v+ca0aNB5kWtLa0C6uMjbdfg5o41zMUGC6JamVYKk2rm0EWE8nEJjh5FNq?= =?utf-8?q?BMKZvc7B2pApfbOXiDdcBcSC7j1MPQB75pCcGZpUg03U2ROYBTgfaAbJAl1kXCkfB?= =?utf-8?q?CEgZ9b7DjKlckyNZkEX234J5bjzZSVxmCsJTFgG3Rz6agAShC5sdvSDYYjD1fGr0L?= =?utf-8?q?c/xAuARkaRoQ51QQWExWBoGgzv7T2Yg/odOxLOMeH/P1ag6DCbTReZZ+TkUnJoXdI?= =?utf-8?q?Vyjm+XrHnrdvOMHcRxav/kjCQWWk8dq2AzXow6y5JMC1ywoDZdjTlx0TxDeQNFytX?= =?utf-8?q?6QG5ZcG0z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?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 58ac6bcd-6d4e-4aed-f69e-08db812330c7 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 08:53:54.6463 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 28zBy9h3pnI9bjrTnkleCuiZqEekbw2ZFukAiTRfQfPqBQFgrfqfdbFiJwohlFs3iKdNdrpX+3Kiddeor1dO5w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9051 Use the generic framework in xen/linkage.h. For switch_to_kernel() and restore_all_guest() so far implicit alignment (from being first in their respective sections) is being made explicit (as in: using FUNC() without 2nd argument). Whereas for {,compat}create_bounce_frame() and autogen_entrypoints[] alignment is newly arranged for. Except for the added/adjusted alignment padding (including their knock-on effects) no change in generated code/data. Note that the basis for support of weak definitions is added despite them not having any use right now. Note that ASM_INT() is switched to DATA(), not DATA_LOCAL(), as the only use site wants the symbol global anyway. Signed-off-by: Jan Beulich --- v3: !PV variant of ret_from_intr is local. Introduction of macros split off to separate patch. Also adjust ASM_INT(). Re-base. v2: Full rework. --- Only two of the assembly files are being converted for now. More could be done right here or as follow-on in separate patches. Note that the FB-label in autogen_stubs() cannot be converted just yet: Such labels cannot be used with .type. We could further diverge from Linux'es model and avoid setting STT_NOTYPE explicitly (that's the type labels get by default anyway). The ASM_INT() redundancy of .global will be eliminated by a subsequent patch. I didn't think that I should make CODE_FILL evaluate to 0xCC right here; IMO that wants to be a separate patch. --- a/xen/arch/x86/include/asm/asm_defns.h +++ b/xen/arch/x86/include/asm/asm_defns.h @@ -13,6 +13,7 @@ #include #ifdef __ASSEMBLY__ +#include #include #ifndef CONFIG_INDIRECT_THUNK .equ CONFIG_INDIRECT_THUNK, 0 @@ -343,10 +344,7 @@ static always_inline void stac(void) .popsection #define ASM_INT(label, val) \ - .p2align 2; \ -label: .long (val); \ - .size label, . - label; \ - .type label, @object + DATA(label, 4) .long (val); END(label) #define ASM_CONSTANT(name, value) \ asm ( ".equ " #name ", %P0; .global " #name \ --- a/xen/arch/x86/include/asm/config.h +++ b/xen/arch/x86/include/asm/config.h @@ -43,7 +43,9 @@ /* Linkage for x86 */ #ifdef __ASSEMBLY__ -#define ALIGN .align 16,0x90 +#define CODE_ALIGN 16 +#define CODE_FILL 0x90 +#define ALIGN .align CODE_ALIGN, CODE_FILL #define ENTRY(name) \ .globl name; \ ALIGN; \ --- a/xen/arch/x86/x86_64/compat/entry.S +++ b/xen/arch/x86/x86_64/compat/entry.S @@ -11,7 +11,7 @@ #include #include -ENTRY(entry_int82) +FUNC(entry_int82) ENDBR64 ALTERNATIVE "", clac, X86_FEATURE_XEN_SMAP pushq $0 @@ -27,9 +27,10 @@ ENTRY(entry_int82) mov %rsp, %rdi call do_entry_int82 +END(entry_int82) /* %rbx: struct vcpu */ -ENTRY(compat_test_all_events) +FUNC(compat_test_all_events) ASSERT_NOT_IN_ATOMIC cli # tests must not race interrupts /*compat_test_softirqs:*/ @@ -66,24 +67,21 @@ compat_test_guest_events: call compat_create_bounce_frame jmp compat_test_all_events - ALIGN /* %rbx: struct vcpu */ -compat_process_softirqs: +LABEL_LOCAL(compat_process_softirqs) sti call do_softirq jmp compat_test_all_events - ALIGN /* %rbx: struct vcpu, %rdx: struct trap_bounce */ -.Lcompat_process_trapbounce: +LABEL_LOCAL(.Lcompat_process_trapbounce) sti .Lcompat_bounce_exception: call compat_create_bounce_frame jmp compat_test_all_events - ALIGN /* %rbx: struct vcpu */ -compat_process_mce: +LABEL_LOCAL(compat_process_mce) testb $1 << VCPU_TRAP_MCE,VCPU_async_exception_mask(%rbx) jnz .Lcompat_test_guest_nmi sti @@ -97,9 +95,8 @@ compat_process_mce: movb %dl,VCPU_async_exception_mask(%rbx) jmp compat_process_trap - ALIGN /* %rbx: struct vcpu */ -compat_process_nmi: +LABEL_LOCAL(compat_process_nmi) testb $1 << VCPU_TRAP_NMI,VCPU_async_exception_mask(%rbx) jnz compat_test_guest_events sti @@ -116,9 +113,10 @@ compat_process_trap: leaq VCPU_trap_bounce(%rbx),%rdx call compat_create_bounce_frame jmp compat_test_all_events +END(compat_test_all_events) /* %rbx: struct vcpu, interrupts disabled */ -ENTRY(compat_restore_all_guest) +FUNC(compat_restore_all_guest) ASSERT_INTERRUPTS_DISABLED mov $~(X86_EFLAGS_IOPL | X86_EFLAGS_VM), %r11d and UREGS_eflags(%rsp),%r11d @@ -161,9 +159,10 @@ ENTRY(compat_restore_all_guest) RESTORE_ALL adj=8 compat=1 .Lft0: iretq _ASM_PRE_EXTABLE(.Lft0, handle_exception) +END(compat_restore_all_guest) /* This mustn't modify registers other than %rax. */ -ENTRY(cr4_pv32_restore) +FUNC(cr4_pv32_restore) push %rdx GET_CPUINFO_FIELD(cr4, dx) mov (%rdx), %rax @@ -193,8 +192,9 @@ ENTRY(cr4_pv32_restore) pop %rdx xor %eax, %eax ret +END(cr4_pv32_restore) -ENTRY(compat_syscall) +FUNC(compat_syscall) /* Fix up reported %cs/%ss for compat domains. */ movl $FLAT_COMPAT_USER_SS, UREGS_ss(%rsp) movl $FLAT_COMPAT_USER_CS, UREGS_cs(%rsp) @@ -222,8 +222,9 @@ UNLIKELY_END(compat_syscall_gpf) movw %si,TRAPBOUNCE_cs(%rdx) movb %cl,TRAPBOUNCE_flags(%rdx) jmp .Lcompat_bounce_exception +END(compat_syscall) -ENTRY(compat_sysenter) +FUNC(compat_sysenter) CR4_PV32_RESTORE movq VCPU_trap_ctxt(%rbx),%rcx cmpb $X86_EXC_GP, UREGS_entry_vector(%rsp) @@ -236,17 +237,19 @@ ENTRY(compat_sysenter) movw %ax,TRAPBOUNCE_cs(%rdx) call compat_create_bounce_frame jmp compat_test_all_events +END(compat_sysenter) -ENTRY(compat_int80_direct_trap) +FUNC(compat_int80_direct_trap) CR4_PV32_RESTORE call compat_create_bounce_frame jmp compat_test_all_events +END(compat_int80_direct_trap) /* CREATE A BASIC EXCEPTION FRAME ON GUEST OS (RING-1) STACK: */ /* {[ERRCODE,] EIP, CS, EFLAGS, [ESP, SS]} */ /* %rdx: trap_bounce, %rbx: struct vcpu */ /* On return only %rbx and %rdx are guaranteed non-clobbered. */ -compat_create_bounce_frame: +FUNC_LOCAL(compat_create_bounce_frame) ASSERT_INTERRUPTS_ENABLED mov %fs,%edi ALTERNATIVE "", stac, X86_FEATURE_XEN_SMAP @@ -352,3 +355,4 @@ compat_crash_page_fault: jmp .Lft14 .previous _ASM_EXTABLE(.Lft14, .Lfx14) +END(compat_create_bounce_frame) --- a/xen/arch/x86/x86_64/entry.S +++ b/xen/arch/x86/x86_64/entry.S @@ -24,7 +24,7 @@ #ifdef CONFIG_PV /* %rbx: struct vcpu */ -switch_to_kernel: +FUNC_LOCAL(switch_to_kernel) leaq VCPU_trap_bounce(%rbx),%rdx /* TB_eip = 32-bit syscall ? syscall32_addr : syscall_addr */ @@ -89,24 +89,21 @@ test_guest_events: call create_bounce_frame jmp test_all_events - ALIGN /* %rbx: struct vcpu */ -process_softirqs: +LABEL_LOCAL(process_softirqs) sti call do_softirq jmp test_all_events - ALIGN /* %rbx: struct vcpu, %rdx struct trap_bounce */ -.Lprocess_trapbounce: +LABEL_LOCAL(.Lprocess_trapbounce) sti .Lbounce_exception: call create_bounce_frame jmp test_all_events - ALIGN /* %rbx: struct vcpu */ -process_mce: +LABEL_LOCAL(process_mce) testb $1 << VCPU_TRAP_MCE, VCPU_async_exception_mask(%rbx) jnz .Ltest_guest_nmi sti @@ -120,9 +117,8 @@ process_mce: movb %dl, VCPU_async_exception_mask(%rbx) jmp process_trap - ALIGN /* %rbx: struct vcpu */ -process_nmi: +LABEL_LOCAL(process_nmi) testb $1 << VCPU_TRAP_NMI, VCPU_async_exception_mask(%rbx) jnz test_guest_events sti @@ -139,11 +135,12 @@ process_trap: leaq VCPU_trap_bounce(%rbx), %rdx call create_bounce_frame jmp test_all_events +END(switch_to_kernel) .section .text.entry, "ax", @progbits /* %rbx: struct vcpu, interrupts disabled */ -restore_all_guest: +FUNC_LOCAL(restore_all_guest) ASSERT_INTERRUPTS_DISABLED /* Stash guest SPEC_CTRL value while we can read struct vcpu. */ @@ -220,8 +217,7 @@ restore_all_guest: sysretq 1: sysretl - ALIGN -.Lrestore_rcx_iret_exit_to_guest: +LABEL_LOCAL(.Lrestore_rcx_iret_exit_to_guest) movq 8(%rsp), %rcx # RIP /* No special register assumptions. */ iret_exit_to_guest: @@ -230,6 +226,7 @@ iret_exit_to_guest: addq $8,%rsp .Lft0: iretq _ASM_PRE_EXTABLE(.Lft0, handle_exception) +END(restore_all_guest) /* * When entering SYSCALL from kernel mode: @@ -246,7 +243,7 @@ iret_exit_to_guest: * - Guest %rsp stored in %rax * - Xen stack loaded, pointing at the %ss slot */ -ENTRY(lstar_enter) +FUNC(lstar_enter) #ifdef CONFIG_XEN_SHSTK ALTERNATIVE "", "setssbsy", X86_FEATURE_XEN_SHSTK #endif @@ -281,9 +278,10 @@ ENTRY(lstar_enter) mov %rsp, %rdi call pv_hypercall jmp test_all_events +END(lstar_enter) /* See lstar_enter for entry register state. */ -ENTRY(cstar_enter) +FUNC(cstar_enter) #ifdef CONFIG_XEN_SHSTK ALTERNATIVE "", "setssbsy", X86_FEATURE_XEN_SHSTK #endif @@ -321,8 +319,9 @@ ENTRY(cstar_enter) jne compat_syscall #endif jmp switch_to_kernel +END(cstar_enter) -ENTRY(sysenter_entry) +FUNC(sysenter_entry) ENDBR64 #ifdef CONFIG_XEN_SHSTK ALTERNATIVE "", "setssbsy", X86_FEATURE_XEN_SHSTK @@ -331,7 +330,7 @@ ENTRY(sysenter_entry) pushq $FLAT_USER_SS pushq $0 pushfq -GLOBAL(sysenter_eflags_saved) +LABEL(sysenter_eflags_saved, 0) ALTERNATIVE "", clac, X86_FEATURE_XEN_SMAP pushq $3 /* ring 3 null cs */ pushq $0 /* null rip */ @@ -385,8 +384,9 @@ UNLIKELY_END(sysenter_gpf) jne compat_sysenter #endif jmp .Lbounce_exception +END(sysenter_entry) -ENTRY(int80_direct_trap) +FUNC(int80_direct_trap) ENDBR64 ALTERNATIVE "", clac, X86_FEATURE_XEN_SMAP pushq $0 @@ -474,6 +474,7 @@ int80_slow_path: */ GET_STACK_END(14) jmp handle_exception_saved +END(int80_direct_trap) /* create_bounce_frame & helpers don't need to be in .text.entry */ .text @@ -482,7 +483,7 @@ int80_slow_path: /* { RCX, R11, [ERRCODE,] RIP, CS, RFLAGS, RSP, SS } */ /* %rdx: trap_bounce, %rbx: struct vcpu */ /* On return only %rbx and %rdx are guaranteed non-clobbered. */ -create_bounce_frame: +FUNC_LOCAL(create_bounce_frame) ASSERT_INTERRUPTS_ENABLED testb $TF_kernel_mode,VCPU_thread_flags(%rbx) jnz 1f @@ -618,6 +619,7 @@ ENTRY(dom_crash_sync_extable) xorl %edi,%edi jmp asm_domain_crash_synchronous /* Does not return */ .popsection +END(create_bounce_frame) #endif /* CONFIG_PV */ /* --- CODE BELOW THIS LINE (MOSTLY) NOT GUEST RELATED --- */ @@ -626,7 +628,7 @@ ENTRY(dom_crash_sync_extable) /* No special register assumptions. */ #ifdef CONFIG_PV -ENTRY(continue_pv_domain) +FUNC(continue_pv_domain) ENDBR64 call check_wakeup_from_wait ret_from_intr: @@ -641,26 +643,28 @@ ret_from_intr: #else jmp test_all_events #endif +END(continue_pv_domain) #else -ret_from_intr: +FUNC_LOCAL(ret_from_intr, 0) ASSERT_CONTEXT_IS_XEN jmp restore_all_xen +END(ret_from_intr) #endif .section .init.text, "ax", @progbits -ENTRY(early_page_fault) +FUNC(early_page_fault) ENDBR64 movl $X86_EXC_PF, 4(%rsp) SAVE_ALL movq %rsp, %rdi call do_early_page_fault jmp restore_all_xen +END(early_page_fault) .section .text.entry, "ax", @progbits - ALIGN /* No special register assumptions. */ -restore_all_xen: +FUNC_LOCAL(restore_all_xen) /* * Check whether we need to switch to the per-CPU page tables, in * case we return to late PV exit code (from an NMI or #MC). @@ -677,8 +681,9 @@ UNLIKELY_END(exit_cr3) RESTORE_ALL adj=8 iretq +END(restore_all_xen) -ENTRY(common_interrupt) +FUNC(common_interrupt) ALTERNATIVE "", clac, X86_FEATURE_XEN_SMAP SAVE_ALL @@ -707,12 +712,14 @@ ENTRY(common_interrupt) mov %r15, STACK_CPUINFO_FIELD(xen_cr3)(%r14) mov %bl, STACK_CPUINFO_FIELD(use_pv_cr3)(%r14) jmp ret_from_intr +END(common_interrupt) -ENTRY(page_fault) +FUNC(page_fault) ENDBR64 movl $X86_EXC_PF, 4(%rsp) +END(page_fault) /* No special register assumptions. */ -GLOBAL(handle_exception) +FUNC(handle_exception, 0) ALTERNATIVE "", clac, X86_FEATURE_XEN_SMAP SAVE_ALL @@ -880,92 +887,108 @@ FATAL_exception_with_ints_disabled: xorl %esi,%esi movq %rsp,%rdi tailcall fatal_trap +END(handle_exception) -ENTRY(divide_error) +FUNC(divide_error) ENDBR64 pushq $0 movl $X86_EXC_DE, 4(%rsp) jmp handle_exception +END(divide_error) -ENTRY(coprocessor_error) +FUNC(coprocessor_error) ENDBR64 pushq $0 movl $X86_EXC_MF, 4(%rsp) jmp handle_exception +END(coprocessor_error) -ENTRY(simd_coprocessor_error) +FUNC(simd_coprocessor_error) ENDBR64 pushq $0 movl $X86_EXC_XM, 4(%rsp) jmp handle_exception +END(coprocessor_error) -ENTRY(device_not_available) +FUNC(device_not_available) ENDBR64 pushq $0 movl $X86_EXC_NM, 4(%rsp) jmp handle_exception +END(device_not_available) -ENTRY(debug) +FUNC(debug) ENDBR64 pushq $0 movl $X86_EXC_DB, 4(%rsp) jmp handle_ist_exception +END(debug) -ENTRY(int3) +FUNC(int3) ENDBR64 pushq $0 movl $X86_EXC_BP, 4(%rsp) jmp handle_exception +END(int3) -ENTRY(overflow) +FUNC(overflow) ENDBR64 pushq $0 movl $X86_EXC_OF, 4(%rsp) jmp handle_exception +END(overflow) -ENTRY(bounds) +FUNC(bounds) ENDBR64 pushq $0 movl $X86_EXC_BR, 4(%rsp) jmp handle_exception +END(bounds) -ENTRY(invalid_op) +FUNC(invalid_op) ENDBR64 pushq $0 movl $X86_EXC_UD, 4(%rsp) jmp handle_exception +END(invalid_op) -ENTRY(invalid_TSS) +FUNC(invalid_TSS) ENDBR64 movl $X86_EXC_TS, 4(%rsp) jmp handle_exception +END(invalid_TSS) -ENTRY(segment_not_present) +FUNC(segment_not_present) ENDBR64 movl $X86_EXC_NP, 4(%rsp) jmp handle_exception +END(segment_not_present) -ENTRY(stack_segment) +FUNC(stack_segment) ENDBR64 movl $X86_EXC_SS, 4(%rsp) jmp handle_exception +END(stack_segment) -ENTRY(general_protection) +FUNC(general_protection) ENDBR64 movl $X86_EXC_GP, 4(%rsp) jmp handle_exception +END(general_protection) -ENTRY(alignment_check) +FUNC(alignment_check) ENDBR64 movl $X86_EXC_AC, 4(%rsp) jmp handle_exception +END(alignment_check) -ENTRY(entry_CP) +FUNC(entry_CP) ENDBR64 movl $X86_EXC_CP, 4(%rsp) jmp handle_exception +END(entry_CP) -ENTRY(double_fault) +FUNC(double_fault) ENDBR64 movl $X86_EXC_DF, 4(%rsp) /* Set AC to reduce chance of further SMAP faults */ @@ -988,8 +1011,9 @@ ENTRY(double_fault) movq %rsp,%rdi tailcall do_double_fault +END(double_fault) -ENTRY(nmi) +FUNC(nmi) ENDBR64 pushq $0 movl $X86_EXC_NMI, 4(%rsp) @@ -1116,21 +1140,24 @@ handle_ist_exception: ASSERT_CONTEXT_IS_XEN jmp restore_all_xen #endif +END(nmi) -ENTRY(machine_check) +FUNC(machine_check) ENDBR64 pushq $0 movl $X86_EXC_MC, 4(%rsp) jmp handle_ist_exception +END(machine_check) /* No op trap handler. Required for kexec crash path. */ -GLOBAL(trap_nop) +FUNC(trap_nop, 0) ENDBR64 iretq +END(trap_nop) /* Table of automatically generated entry points. One per vector. */ .pushsection .init.rodata, "a", @progbits -GLOBAL(autogen_entrypoints) +DATA(autogen_entrypoints, 8) /* pop into the .init.rodata section and record an entry point. */ .macro entrypoint ent .pushsection .init.rodata, "a", @progbits @@ -1139,7 +1166,7 @@ GLOBAL(autogen_entrypoints) .endm .popsection -autogen_stubs: /* Automatically generated stubs. */ +FUNC_LOCAL(autogen_stubs, 0) /* Automatically generated stubs. */ vec = 0 .rept X86_NR_VECTORS @@ -1183,6 +1210,7 @@ autogen_stubs: /* Automatically generate vec = vec + 1 .endr +END(autogen_stubs) .section .init.rodata, "a", @progbits - .size autogen_entrypoints, . - autogen_entrypoints +END(autogen_entrypoints) From patchwork Mon Jul 10 08:54:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13306492 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 7B6FAEB64D9 for ; Mon, 10 Jul 2023 08:54:42 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.561108.877431 (Exim 4.92) (envelope-from ) id 1qImfD-0007a3-4x; Mon, 10 Jul 2023 08:54:35 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 561108.877431; Mon, 10 Jul 2023 08:54:35 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qImfD-0007Zw-29; Mon, 10 Jul 2023 08:54:35 +0000 Received: by outflank-mailman (input) for mailman id 561108; Mon, 10 Jul 2023 08:54:34 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qImfC-0006t6-1q for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 08:54:34 +0000 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0629.outbound.protection.outlook.com [2a01:111:f400:fe1f::629]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 63a90027-1eff-11ee-b239-6b7b168915f2; Mon, 10 Jul 2023 10:54:33 +0200 (CEST) Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21) by DU2PR04MB9051.eurprd04.prod.outlook.com (2603:10a6:10:2e6::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Mon, 10 Jul 2023 08:54:32 +0000 Received: from AS8PR04MB8788.eurprd04.prod.outlook.com ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023 08:54:32 +0000 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: 63a90027-1eff-11ee-b239-6b7b168915f2 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bp25ct+6Dnx6fYLb/4Niw5AR8CDyB9SDE32sSvRAhBVxklJfR5L5jrOAntIxHV4KjKOVjpwQZEdmMaDWjmz7QlXnjiQbtS+eZ/BHSw/nGRLRlP6hcxK9RAQFGqE0u+HkUprGaXI6ndjD0Djqo6Myf2aB4EczR4yrqlgadp6lCcMX61PL5it1K6Y0zixPC4C+5+8h/lLVDB8f3RkwX0ZW9/t1XcqwBcVKWwZ0ExUhwnURkpajPjKd1TtJY4qlC3k8m0Cmq4JzuY5bfH+l2agAWyXawMF0eoAs5FOr9naGf2r3OT9GOHX/k4G1XH9XLZ2h8vfKg0itXajkZtvx6mNrFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=bxqTYAMqHDtwTsaXt5W2izXbr1PoTAZ70AuZ6hPpGqA=; b=LCbJERBr5cTIVelRRPx1rC/Q/EUP6VoSWbj+zFwt3qI4QPwyvqye+/bQVAUWc+n5UXXet9mQWWrmxXU2/QYQKJCR7+Qmtti1K6mKE0P3fJ5d6PtLUKByTjsZt8PJGYQl3i2MUWUvpSJjvd3NlCsjXZ0kbVK9ToWRDGo6DoEZLbggq9dNpSNBEuI3Zh8x92XGi4EYYijxmpkGru2yvhNf7vsbm/cFSc6njrNwn2A/KTGL1P73mcM8w6+qJ2Hy9LejKnoDiwClFUstjvV+FPjEqAj5bfgu197GIYDz0VdsqUU51Chvim3gLq0BIbJsIiBo5AFzOSqmE0bro4BmPxts6w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bxqTYAMqHDtwTsaXt5W2izXbr1PoTAZ70AuZ6hPpGqA=; b=4pFBTGTp63DTqFOVXMOsI06QPZ7d2QL+kzE/m1y2tbBy8BTIe5+kPvRsDQhyoHASLpeLpkRzOW+YS6x0a4fcruGNrhwM0DNXeTdBQJuxADWP3cSBpwkOZMquLw2icWCUJUQlNZ/VMhrQ3P+L7IVNR5L2V57Ad4CygftXP4nL2U4sfgheF6MnvSOEsi5sH13X6tSZ8v/J8QEmB23YxTR3f/5lCxzdFcptmrDKoqdWLMk5Wv0cWRfc4/ZTiDt2DfyI5GqZOhqW/UxNrZzId+3MkDZJOWR6Vdx2UxgCJ44OGSXXM2CwNL0Ica8+o9HwRKiTiPsyEESP+saNaZgVy+nkLg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: <0bf03d56-d59d-7c71-c6da-d44de31e4711@suse.com> Date: Mon, 10 Jul 2023 10:54:30 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: [PATCH v3 4/8] x86: also mark assembler globals hidden Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Julien Grall , Stefano Stabellini , George Dunlap References: In-Reply-To: X-ClientProxiedBy: FRYP281CA0018.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10::28) To AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|DU2PR04MB9051:EE_ X-MS-Office365-Filtering-Correlation-Id: 49ddcea6-d4ee-4a04-06b4-08db81234734 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: smMA5YoXsAMj6jQdwfFijixLcl9Aaf3ci4ym76AW8FcoCr2rnvL72emOKUSSPvWyQkWsZiryv40lo4G5k0O/Q7QH5yUow4RRMGt5RLNXU6Hl5wzUlV98vFKBbwWI3xvOWxzn5pFQ12QNhcQHnM2xLS4auzUeNfOnxkErQVtTItKRm4fcqgq4Lozpxu6WNK+Dm6g4oEOuU0A/0HWEL7alrQvkPbCqcjlA1htKqP17l6wHhMmeKSLMtDNf/DOm8/u7sUTF15bDdjKINlsR7fThCvrb7JPHUcGNJTOO3dotRl6puoiBhVRC3hJABXMV4AbDT/1D//gSjC0g5OWuaBbgL6PWr6bWeypT3rDqcJiDv18aOcjmSOvc1x/s1sMUYsmeKqjzWuM84YQPgjs6X7dww95QOT5c6Iq5pSTWmxH9Ms7V65jj7d94uKnqOFTetGDGrrjmD77bYMPCyUgsl0r784f6tVXAMPFtsjPRLwQOT6XQ6WDV0PgNNTKRcdphfHdtZ7p4U9vjDN5sdJEuPEU1kzz/fIRShC38nRAbIXY5YYMVF09+vNEZ3xuRO/A4L0KUbvm4hCLDtlsnfDR0N/SBisgfLKgSj0rHD5WNgt/5TeZuSf1r87Tsm2UNyNEkJK9ZXVnemvLymfQjL1UWbInIfQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39850400004)(376002)(136003)(346002)(396003)(366004)(451199021)(186003)(26005)(6506007)(2616005)(6512007)(41300700001)(4326008)(6916009)(2906002)(66556008)(316002)(5660300002)(66476007)(8676002)(8936002)(478600001)(66946007)(6486002)(54906003)(36756003)(38100700002)(31696002)(86362001)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?CkDlafmj5Q2/kbAi3O4zzVwH8+9S?= =?utf-8?q?UCOK2YpN12brUU/nE0WU2x34ntr+XzFTJ2Zl7Ljc91ZoygucmWI+Geat6sWuE5Vvf?= =?utf-8?q?xVaXN7TDCqO3Lsz0md8/rgNQeyYYe7gwKkIPr1H49gUFzbGJFiW+gjhtX63DvA+yw?= =?utf-8?q?hTsbghqUx4UkTpEkVS3s/S0UKDZEIlFaAYOL5s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KlaAWNDSAXa6Zlll?= =?utf-8?q?PN8+FelQTPbOB0Hnatefaa7smKJ7KK6Om0xauMnk2qKN/CS+RTmhYHgLiqL4++GSX?= =?utf-8?q?WCa5Di8+h5eGcXeM/1qQPj1jQ2otYjYSABxJE+QNnKMw3nNYVqnPy/v2/VrGomzu7?= =?utf-8?q?Bf6K7DpSgPhQi1nUdTtoSWtVKueGrZVYQryNOGAFNWemVSSv9iw2XCiEyP3Xew5wZ?= =?utf-8?q?YNa+dGNEhErADNKxM2mPZcJiwjhwJJuBxlu8gl/GuonJXpfPHQd1mHWpEYiSEFlMe?= =?utf-8?q?3MfTdDkIxCY0bzBUXqsS5K81mu7WLtknQp0M1OCnbzNm4EEvJdYuKW5O064QQnJZH?= =?utf-8?q?wfkPfxW4t1E1i8OWKBV2aPhXCjqf5d/Omi/NIZSkhkCqTo5HiWhR10yYL4nSI9EWu?= =?utf-8?q?+exsVpEaaexnYWboLuwTQVh1mS+07YQlFlXh7BEe/tgCdsLgRP5xtdQJ4umtHLUgW?= =?utf-8?q?I3WCzooIdWB6?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 49ddcea6-d4ee-4a04-06b4-08db81234734 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 08:54:32.2569 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 3Orx4S5XLHhaAaSH4C/fzhNVz0NkiTAs9h99+2BqBa+MdYj/uYqdOyWXAdorvaNyGS5fUt3+lfzJSzH/X5nj2Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9051 Let's have assembler symbols be consistent with C ones. In principle there are (a few) cases where gas can produce smaller code this way, just that for now there's a gas bug causing smaller code to be emitted even when that shouldn't be the case. Signed-off-by: Jan Beulich Reviewed-by: Roger Pau Monné --- v3: Re-base over generalization of the annotations. v2: New. --- a/xen/arch/x86/include/asm/config.h +++ b/xen/arch/x86/include/asm/config.h @@ -47,11 +47,11 @@ #define CODE_FILL 0x90 #define ALIGN .align CODE_ALIGN, CODE_FILL #define ENTRY(name) \ - .globl name; \ ALIGN; \ - name: + GLOBAL(name) #define GLOBAL(name) \ .globl name; \ + .hidden name; \ name: #endif --- a/xen/include/xen/linkage.h +++ b/xen/include/xen/linkage.h @@ -21,7 +21,7 @@ #define SYM_ALIGN(algn...) .balign algn -#define SYM_L_GLOBAL(name) .globl name +#define SYM_L_GLOBAL(name) .globl name; .hidden name #define SYM_L_WEAK(name) .weak name #define SYM_L_LOCAL(name) /* nothing */ From patchwork Mon Jul 10 08:55:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13306493 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 2C53DEB64DC for ; Mon, 10 Jul 2023 08:55:51 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.561112.877441 (Exim 4.92) (envelope-from ) id 1qImg3-0008C2-EI; Mon, 10 Jul 2023 08:55:27 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 561112.877441; Mon, 10 Jul 2023 08:55:27 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qImg3-0008Bv-BZ; Mon, 10 Jul 2023 08:55:27 +0000 Received: by outflank-mailman (input) for mailman id 561112; Mon, 10 Jul 2023 08:55:26 +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 1qImg2-000866-Js for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 08:55:26 +0000 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on062e.outbound.protection.outlook.com [2a01:111:f400:fe1f::62e]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 8215b0f2-1eff-11ee-8611-37d641c3527e; Mon, 10 Jul 2023 10:55:24 +0200 (CEST) Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21) by DU2PR04MB9051.eurprd04.prod.outlook.com (2603:10a6:10:2e6::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Mon, 10 Jul 2023 08:55:23 +0000 Received: from AS8PR04MB8788.eurprd04.prod.outlook.com ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023 08:55:22 +0000 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: 8215b0f2-1eff-11ee-8611-37d641c3527e ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cddsQu99PE3DyMrHn0ulLf8nGqW6C09RoivrLbVe0a3Y1NDs/j62GYLBotRUInhy8I5ZMHEYIJfAqdElpiMOEvMV7sPZojUTshZooJavtkaDMvHulAzj43MmgDgPydfswynY56K96/bqzJ+tqFeDG7SZJE4hhRA/OQ98yWtscue4jEmyM0j70sBRiy5fVXLnyEaIXZCyx8vRKEJKR5vFh7Yd5MSIt8oJSJdsyG9BkGCHzeUpR6FxzaLdPMCYSx3icNuIiWGPCFf3uTPT3rsmjuOJpJuN8IBQEyVw+mFv36CCXMkss59bAHKE3aNhmSfonW2g2SYyJ2zAuQ/gMUR0BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=bblEvpBVoD14a8jtWBS2FnTxPcXC/Rz9Fz+d/NPUWJs=; b=LTPsxPpR2Wh6a90cPeFLRoDTVuxYoOuT/Wym1HcURMoF7Qcj8eMNogKFbZvRELbAyi2So+5vgRTxEnjQzvttUSaXm/ErPNDcS0y6BU1gERzl8Mp0Rx8rdgrY9TDHTjZLmy378o7XFrmjOZKKJr0BvemgtdHy4bEn8evQjUISFaUA7bvEw6kVF/10k2EUx8f/JsG/0+LIJqqr2qQcqOu3AkKUFVVTf5GpGAkXQWJ7c3Zoc2/MLpHuzo2B3YWil3OW3QDf0Ml2XxobevDgP0uuWcrvG6Ur1TRIdkQnarhO/wCtc+G2G+jqL1nldC0DpLQB4fc/SUj/3VK9waCzDxhNEw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bblEvpBVoD14a8jtWBS2FnTxPcXC/Rz9Fz+d/NPUWJs=; b=orM39li9zOSpCCIiK+vrjYXWgWtdt7bMkxewQ9LCbykRS0zauZYq2boFhhOyusSrP2vmdlWDBbfnp1HR5iatBESiDPp10EEvd0GkY9O2vQpGn/xAOw7ipDahglc7nDiX96CTBVfcPtuwVWr8JHmPZpHM9hjmZNtJzqWjEYuOHhAtxdkEczYncZu8JQQ0/RHxxf4nRF+1Y1IBH2raAmfVQiTstLGYzeVjlbrZwq6pD1Ny9RkWnpSVnUtvxFUnXlMvIzx3M8dDLg1tXWq9WT1smOZGeTJdQsjxFftQWW2iSxJ4YUG4BZa/jSVrqG5n2HXS7mSXqp5zldC61qXobvd0dQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: <36977cd0-37ae-d164-1a69-cf2161d08c4c@suse.com> Date: Mon, 10 Jul 2023 10:55:21 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: [PATCH v3 5/8] Arm: annotate entry points with type and size Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Julien Grall , Stefano Stabellini , Volodymyr Babchuk , Bertrand Marquis References: In-Reply-To: X-ClientProxiedBy: FR0P281CA0068.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:49::13) To AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|DU2PR04MB9051:EE_ X-MS-Office365-Filtering-Correlation-Id: 5f072aff-1c96-4237-c120-08db81236561 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rZyX7Wq8xgWGvDtI4nZ4wSMVMZVKYXPBnV3M9vcQHjHzQms+5FYeX6KmK7IJExbWUkNjtfqgkJdxleZ3rRg5ipQCbg+kXN8/H2/zboN1n5g6dFLkK4kHcOxYZWqXCFugSWgpT9vKnQOX57Q2H+wf73h2sWGQKVTfRDK6tjYqevhgQgadWcx0mg86YPLlUoufiSWQHgJYKhS7qQN67ECDJcIR2ny+tJZsQig4PxVlCNbAqKVGQH2T0zTwCMmFFM8Q2tuwFU/Y2IdD0ueQYGwTwuRDXL3ujzP+jEgatk1WrIu2+zaJX9eqDLUQaRQLQbm4Umj7YJQ1vDuvZfE9xV6mV++8yHdF1WLHqi1k/eH1fHdBIemNIctqiFuaL0QDFzU/hjBQqP9BcbFAjfbE6XKsEAoofEAwMmWgfUkg4VkWJ8XeWSl48Ng0vEPSnS9vK7wZ9KnkStlX/qh4Y1SyqFW5XmMc+0/affrsSP4CKbQh+iaVQvaesH4hKQc45C2h9RH+jnDyjbEuZRCsq5jXGw+OZplwg8t3wOM3WhIy1hWhQdLN8bQ9W9oo4gayT8DG8as2JjypdcJ9t+2Im8RMHLmciAlmTkbnsDPaFN9VoaDfm6jlitlPL/6nG82ls8RB2aLkhrSwY7+1cMD3mEgezSGU5g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39850400004)(376002)(136003)(346002)(396003)(366004)(451199021)(186003)(26005)(6506007)(2616005)(6512007)(41300700001)(4326008)(6916009)(2906002)(66556008)(316002)(5660300002)(66476007)(8676002)(8936002)(478600001)(66946007)(6486002)(54906003)(36756003)(38100700002)(31696002)(86362001)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?ID3pcck/pHduin+y+TtSoE8j8/2+?= =?utf-8?q?IyWmOF3zoZN1Cvm6fK6EyiMUUeUmlp/8QMkq3AdyZai8Ule5NFXIKticnU0Pce/od?= =?utf-8?q?nX4/Tp8eWZbLsDkcy92okZQP/tajIOCuADRREi+XXhvv8MeJ7t9FIQN46B/LyqzF/?= =?utf-8?q?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reYgHhv0nGbUcdWUMAVIY7zhAVlfaCAfaz07zkfQlzP5nY1yEs/qh5pIvywQ+meF1?= =?utf-8?q?fA6XQk89TMr7D7iL+2JN3ycdmvsTPvIQhIdiostpyz9fiit+8rB095g9DEeGH3vKG?= =?utf-8?q?AMsX3LmAblFIit/Sr4LBdin8cW7A8sForjmJE8ywxJWhHCdndftlEqrj0HmGo3gkR?= =?utf-8?q?+Mko7+pKXXCeeNQ68QL/ytYg+zEAdw3R3Bkb+sCCaWCaQqbMJzFviIDY0bSdHkvro?= =?utf-8?q?77JQP+4vz/fls9wrPYQ+33vbt9Sn0RNkyqQsmp57UT3Fh9oJa2p+8G0Z2DDDpZF0C?= =?utf-8?q?2/6GXYCEeyfxe0ljEHdu2zR9BfBuIxePGJiVBHnJnFQBeTl+t/X7oBnWBBpBWuFnZ?= =?utf-8?q?S0Tbb3KqzEZNVICR1IsUYDP3Wd/Lpn1Ofj0YnLaCkovXX0Xc5bgIBBJExmURrk40n?= =?utf-8?q?G8vo8oWglwNFIEZCK01FsEjy3eTyPRFOrx5sUxhFcCLfzMujmmqTQtTYq8ns2HT1d?= =?utf-8?q?0Ar1R9vHFcW8?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5f072aff-1c96-4237-c120-08db81236561 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 08:55:22.8893 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: TFRaJRulX5d3K8HnzyvOQEQhlUM1UBvBVIg6jZ/zlvJYGgpbevJ7leIPBiHukmAFw8oum5gNf2F/JqOG+HTQmw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9051 Use the generic framework in xen/linkage.h. No change in generated code except for the changed padding value (noticable when config.gz isn't a multiple of 4 in size). Plus of course the converted symbols change to be hidden ones. Note that ASM_INT() is switched to DATA(), not DATA_LOCAL(), as the only use site wants the symbol global anyway. Signed-off-by: Jan Beulich --- Only one each of the assembly files is being converted for now. More could be done right here or as follow-on in separate patches. The ASM_INT() redundancy of .global will be eliminated by a subsequent patch. --- v3: New. --- a/xen/arch/arm/arm32/lib/div64.S +++ b/xen/arch/arm/arm32/lib/div64.S @@ -42,7 +42,7 @@ * Clobbered regs: xl, ip */ -ENTRY(__do_div64) +FUNC(__do_div64) UNWIND(.fnstart) @ Test for easy paths first. @@ -206,4 +206,4 @@ Ldiv0_64: ldr pc, [sp], #8 UNWIND(.fnend) -ENDPROC(__do_div64) +END(__do_div64) --- a/xen/arch/arm/arm64/lib/clear_page.S +++ b/xen/arch/arm/arm64/lib/clear_page.S @@ -22,7 +22,7 @@ * Parameters: * x0 - dest */ -ENTRY(clear_page) +FUNC(clear_page) mrs x1, dczid_el0 and w1, w1, #0xf mov x2, #4 @@ -33,4 +33,4 @@ ENTRY(clear_page) tst x0, #(PAGE_SIZE - 1) b.ne 1b ret -ENDPROC(clear_page) +END(clear_page) --- a/xen/arch/arm/include/asm/asm_defns.h +++ b/xen/arch/arm/include/asm/asm_defns.h @@ -5,6 +5,7 @@ /* NB. Auto-generated from arch/.../asm-offsets.c */ #include #endif +#include #include /* Macros for generic assembly code */ @@ -28,10 +29,7 @@ label: .asciz msg; .popsection #define ASM_INT(label, val) \ - .p2align 2; \ -label: .long (val); \ - .size label, . - label; \ - .type label, %object + DATA(label, 4) .long (val); END(label) #endif /* __ARM_ASM_DEFNS_H__ */ /* --- a/xen/arch/arm/include/asm/config.h +++ b/xen/arch/arm/include/asm/config.h @@ -53,7 +53,8 @@ /* Linkage for ARM */ #ifdef __ASSEMBLY__ -#define ALIGN .align 2 +#define CODE_ALIGN 4 +#define ALIGN .balign CODE_ALIGN #define ENTRY(name) \ .globl name; \ ALIGN; \ @@ -61,8 +62,6 @@ #define GLOBAL(name) \ .globl name; \ name: -#define END(name) \ - .size name, .-name #define ENDPROC(name) \ .type name, %function; \ END(name) From patchwork Mon Jul 10 08:56:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13306494 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 B4CDFEB64D9 for ; Mon, 10 Jul 2023 08:56:18 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.561116.877451 (Exim 4.92) (envelope-from ) id 1qImgj-0000Jh-Me; Mon, 10 Jul 2023 08:56:09 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 561116.877451; Mon, 10 Jul 2023 08:56:09 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qImgj-0000Ja-Jn; Mon, 10 Jul 2023 08:56:09 +0000 Received: by outflank-mailman (input) for mailman id 561116; Mon, 10 Jul 2023 08:56:08 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qImgi-000090-9D for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 08:56:08 +0000 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2062b.outbound.protection.outlook.com [2a01:111:f400:fe16::62b]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 9b9c966c-1eff-11ee-b239-6b7b168915f2; Mon, 10 Jul 2023 10:56:07 +0200 (CEST) Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21) by PAXPR04MB8255.eurprd04.prod.outlook.com (2603:10a6:102:1ce::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Mon, 10 Jul 2023 08:56:05 +0000 Received: from AS8PR04MB8788.eurprd04.prod.outlook.com ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023 08:56:05 +0000 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: 9b9c966c-1eff-11ee-b239-6b7b168915f2 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lu0A/DS2UuzAyO2gdshBxW9ulJ+lmqn+PP7QeW/O0+GICA6KebbCL4u2LhgihvjaJl3u0UDVtUeD0JOcHp6WbC3Esd54xz3Ws0xnFbn+Z8hW7NGg+fOuEIVxvrEtzcSSTteAmLxgMbEKGF6x70XLp09yRbf39XN1wuWSfuTohXG0eA82WVrv32tyyBaKIufWvZvtoL040oAiOviYGe5yHpi47zN2XA/xmc+6PY+VobHXMKtEw1fyFNYpuQ5+Y25ba3fs8644zeS7s+jtg0bUTHo+gA1pXRNGVA2zb9S97Z1O8rmC7bnBYptbETcbNUFjo/SmNTVhf6B6nQOsYkXWnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=W7i9WRYxlNMflX/ncFgxWicqWWe8SycnajyCIM9YTRY=; b=BMikcid4xc6P45j3l2dXGtWiB9vl36OKquvs9ULvJx/pGgmgHukhSXgAKfkx9HHehIBMy56lczKEw7MgYzLk6C4wXk7JZMlNmtB4zh6N/I8KvocLSzdZYZx0aLfM+hzM78LTDclo6MyiT7rkdIVCkTg0VK2OLEcDR8rl1Dt088ksimwJ4rvjz2bb74vXIizgBjTz/ka3HigS2KeBzKoieTcJ3p4BOwLAgY1l7YHcZsJa4KPYfdM44annuWu2fikeuesH4CaRBr30OfgBj/F5nrTLmhrSVPSSW+mKqtnP2akcu2IMPpzWJKr/rQ/ztmhVcWPzhmBOum51gX0kRD7dog== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=W7i9WRYxlNMflX/ncFgxWicqWWe8SycnajyCIM9YTRY=; b=xtYT4B+bfFN9JQrd7+S3seghRxOP/R01o1oclF//cslzEaj5aGW7hFOYWW8Q7jHGRUNhgR0rFE30IDF+Otqg080PJAcZwR7Cqh3TR3aSLWGkvJZM3jqEnCwuAAGCkdKRxuWcm86nRF7LecAfU1uVApfmW1l1xvMTwZtl+QUzZZp4wPPoWF2qyxCiE/n8BHTjt+rqrRw5b0SZltIyanNa12biotmSBGFkBrUYSRvCBaDTBqDSUmxLC5KS0U3CzYjZWr4uZo+DT0mhgF0FOtx3TSUmxaGKbwsnYmcgpsqnquJAohBLjW3hMbxVPDHOqbyOwORY8RzWOIB6YA6+BIx2xQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: <959bdb6d-9b6c-cde0-9459-c83cd3f58b18@suse.com> Date: Mon, 10 Jul 2023 10:56:04 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: [PATCH v3 6/8] RISC-V: annotate entry points with type and size Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Bobby Eshleman , Alistair Francis , Connor Davis References: In-Reply-To: X-ClientProxiedBy: FR0P281CA0018.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:15::23) To AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|PAXPR04MB8255:EE_ X-MS-Office365-Filtering-Correlation-Id: 1c50e6d3-b4d1-4f23-05b1-08db81237e8d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mELQuRq6AIoL0lK2AYNEJd09J7mfWNrkvpET1TlNP7J9IwUAL1L012SCb0UnHfRbIRlFQPkgWtJaMiU+U1ooSbVgZshJaiMrhqA13HT2OYdADn75P7rZ1nNNPa2jU72xm1M/g2ZH5N2/BQ0NjgHLvOUTpWIixnwQVfXTXbJTFV4F50nPh9HzHPOeLXJCYtI2uYW99cKGbHN0g6kDOCvFnuDkSDexTg6DmuWEGUEVztlYZsgx8Kgj5UuHj+2D+QzDYZnz6IeRFx271in4AfIbOTdqV1iSwx6tEN5O02m7bgxKsjRPAUxY4WSAlnaRKCtT1Oy4/+0nA9XV9v+CDw+lpoxyK8GclWjrJRA3xJOz/EmI4sgwEBhkP8pX4rMCV7R6nwx+uYGj4X7VJlz8oQOeA4s8tDfIpcW92MVatsGJ0SCzv6/tUgoV1dLirIddA4T/eqcSTUdo+Jd44wqHlAHD9yI6VdAmfCNAFLFtbdo0Veou87Mj+vMaex+o+pDyYPB/zboIfID6BxhJU7aELPDtYOLJ5mEU0D8/Cr0srrA0XuDy80FTtKxfcHSMMPr6RejwjsiXS4kg/sR9Z3yGb+aKF01ftBjtapaVpPdGnhNhoBHjNpUKVga2Ul5Pm2hN8cTIyOIngHxZJachYQCsX8hwkQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(136003)(346002)(396003)(366004)(451199021)(186003)(26005)(6506007)(2616005)(6512007)(83380400001)(41300700001)(4326008)(6916009)(2906002)(66556008)(316002)(5660300002)(66476007)(8676002)(8936002)(478600001)(66946007)(6486002)(54906003)(36756003)(38100700002)(31696002)(86362001)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?HNUtkVoUb7CUmVdrDwFlGRLx3BsL?= =?utf-8?q?fXERa4h2dv8B3z+dWMKAeEiHtriJBUwPgikH3pFJ1dpFU8IG4C0whEOadaoIaU8sD?= =?utf-8?q?LgeL02GIHqpYaJT9HGVNO5HZTMZd/qGl5XIHxPU2sCYkcN9iYNkwa7AbV4YNRfKS+?= =?utf-8?q?5L4V0W0ssjtFRfg49zUd3xextXD6Sx0rnzAAM8D3W1QBzKQ5dhIVYmWbXKUy2yiSW?= =?utf-8?q?W2QCg9vqTodb/nAwoiWPWDvfBzLPcjW1KzGBrzrNtL5p/rPnSpxaJDkiQflPYht51?= =?utf-8?q?KOMXlGhAA70xtA5Pq/uNMTzs+zz5GAiEdMUazdCF1BSSwX3YQpoT7ZwHOuQtliGCI?= =?utf-8?q?Por8Al50UUhephfZq6TsdQbTjVTEop8HjISUUXgTnlVAKjPfgR68dkZtpq2PFKiDs?= =?utf-8?q?oq49nP4ak1/fbrkw5hw6clO5hBb7TUPiAL6rQVQhOCMGqPqsIe+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oDOCiMlxsAfpuR2EaJY?= =?utf-8?q?IGvT2Sho2tPEwWHUVQ1Yi3VlfPcvsUWGQS05YRFcKcKygLdFoqgLomNvvn6G+IhJk?= =?utf-8?q?OK0OMFfEbeYY1h+LlrnGTxipJlXH3XxycqrEfMRoCKERa6f/X3tV4D0dN0gGo+rcv?= =?utf-8?q?L+raVmn8G/+43EOTwlmbGTqQG/CrSdJXGUPrbRNAf29ihB3s7niZfT4yQox7lDqEv?= =?utf-8?q?8UNxxjsDBMCI?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1c50e6d3-b4d1-4f23-05b1-08db81237e8d X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 08:56:05.0735 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: PDV9hGOBbjs+pxBkgaKQ815Ahe4uZvjC2MrjQjZhN6gaw323Vn9PZ41ZpyeTz/P3XhPxMW2aZHs2OnrCZpPOEg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8255 Use the generic framework in xen/linkage.h. No change in generated code except of course the converted symbols change to be hidden ones and gain a valid size. Signed-off-by: Jan Beulich --- Probably count_args_exp() should move to macros.h, but I first wanted to see whether anyone can suggest any better approach for checking whether a defined macro expands to nothing. --- v3: New. --- a/xen/arch/riscv/entry.S +++ b/xen/arch/riscv/entry.S @@ -5,7 +5,7 @@ #include /* WIP: only works while interrupting Xen context */ -ENTRY(handle_trap) +FUNC(handle_trap) /* Exceptions from xen */ save_to_stack: @@ -92,3 +92,4 @@ restore_registers: REG_L sp, CPU_USER_REGS_SP(sp) sret +END(handle_trap) --- a/xen/arch/riscv/include/asm/asm.h +++ b/xen/arch/riscv/include/asm/asm.h @@ -7,6 +7,7 @@ #define _ASM_RISCV_ASM_H #ifdef __ASSEMBLY__ +#include #define __ASM_STR(x) x #else #define __ASM_STR(x) #x --- a/xen/arch/riscv/include/asm/config.h +++ b/xen/arch/riscv/include/asm/config.h @@ -67,12 +67,8 @@ /* Linkage for RISCV */ #ifdef __ASSEMBLY__ -#define ALIGN .align 4 - -#define ENTRY(name) \ - .globl name; \ - ALIGN; \ - name: +#define CODE_ALIGN 16 +#define CODE_FILL /* empty */ #endif #ifdef CONFIG_RISCV_64 --- a/xen/arch/riscv/riscv64/head.S +++ b/xen/arch/riscv/riscv64/head.S @@ -8,7 +8,7 @@ * a0 -> hart_id ( bootcpu_id ) * a1 -> dtb_base */ -ENTRY(start) +FUNC(start) /* Mask all interrupts */ csrw CSR_SIE, zero @@ -30,13 +30,14 @@ ENTRY(start) jal reset_stack tail start_xen +END(start) .section .text, "ax", %progbits -ENTRY(reset_stack) +FUNC(reset_stack) la sp, cpu0_boot_stack li t0, STACK_SIZE add sp, sp, t0 ret - +END(reset_stack) --- a/xen/include/xen/linkage.h +++ b/xen/include/xen/linkage.h @@ -37,17 +37,28 @@ #define END(name) .size name, . - name +/* + * CODE_FILL in particular may need to expand to nothing (e.g. for RISC-V), in + * which case we also need to get rid of the comma in the .balign directive. + */ +#define count_args_exp(args...) count_args(args) +#if count_args_exp(CODE_FILL) +# define DO_CODE_ALIGN(algn...) LASTARG(CODE_ALIGN, ## algn), CODE_FILL +#else +# define DO_CODE_ALIGN(algn...) LASTARG(CODE_ALIGN, ## algn) +#endif + #define FUNC(name, algn...) \ - SYM(name, FUNC, GLOBAL, LASTARG(CODE_ALIGN, ## algn), CODE_FILL) + SYM(name, FUNC, GLOBAL, DO_CODE_ALIGN(algn)) #define LABEL(name, algn...) \ - SYM(name, NONE, GLOBAL, LASTARG(CODE_ALIGN, ## algn), CODE_FILL) + SYM(name, NONE, GLOBAL, DO_CODE_ALIGN(algn)) #define DATA(name, algn...) \ SYM(name, DATA, GLOBAL, LASTARG(DATA_ALIGN, ## algn), DATA_FILL) #define FUNC_LOCAL(name, algn...) \ - SYM(name, FUNC, LOCAL, LASTARG(CODE_ALIGN, ## algn), CODE_FILL) + SYM(name, FUNC, LOCAL, DO_CODE_ALIGN(algn)) #define LABEL_LOCAL(name, algn...) \ - SYM(name, NONE, LOCAL, LASTARG(CODE_ALIGN, ## algn), CODE_FILL) + SYM(name, NONE, LOCAL, DO_CODE_ALIGN(algn)) #define DATA_LOCAL(name, algn...) \ SYM(name, DATA, LOCAL, LASTARG(DATA_ALIGN, ## algn), DATA_FILL) From patchwork Mon Jul 10 08:56:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13306495 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 24FD9EB64D9 for ; Mon, 10 Jul 2023 08:57:10 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.561122.877460 (Exim 4.92) (envelope-from ) id 1qImhK-0000vN-1T; Mon, 10 Jul 2023 08:56:46 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 561122.877460; Mon, 10 Jul 2023 08:56:46 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qImhJ-0000vG-V3; Mon, 10 Jul 2023 08:56:45 +0000 Received: by outflank-mailman (input) for mailman id 561122; Mon, 10 Jul 2023 08:56:44 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qImhI-000090-FT for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 08:56:44 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on20615.outbound.protection.outlook.com [2a01:111:f400:7e1b::615]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id b15cb6d7-1eff-11ee-b239-6b7b168915f2; Mon, 10 Jul 2023 10:56:44 +0200 (CEST) Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21) by PAXPR04MB8255.eurprd04.prod.outlook.com (2603:10a6:102:1ce::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Mon, 10 Jul 2023 08:56:42 +0000 Received: from AS8PR04MB8788.eurprd04.prod.outlook.com ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023 08:56:42 +0000 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: b15cb6d7-1eff-11ee-b239-6b7b168915f2 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kbc1KKsKJgEyrBjg5ntpwXl0dwQGj2DHkhDarLkIpZ2CDX5KWgxtpjt87qob0R1GJ3D6abnIB9rPJIHBC8KDbaCuV5NtKZcZ84qcyackOQKYtMaEDDcABVT1+mQjexXIYZCfyoA0v+5XYlp24o8UCFn0tcPnANFVk5Iv7gZ1EQS/mWJAUqYd5LPv+Y80CbzySPo6F9nk1jemXJCFbtIBuPL30qENHemBWxFtt0iocWZ50oA4yVflaP7mgf20PL8VuvRUcLgtlbIiOfT29569ERWvwGP5mVKdZ+GnQH7ldHEuyPviSIkap2gqcqom+LVqPxL/Dqkg9fTNOOy4ClB7xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=c/xR6YkWfKWV2eWIcLISE9nlBCFQDkrQgA4AhpXFs/s=; b=lwMzKG62PzYz2I4EwF3zFqhFpADK0C7AwcfJVIPCXPO0JENLH3ok024POdCuoE9DWgWr7RchKlyuw3Mfch7/kpMva7AgqW+cPfEDP5kRoyDjHeR5Hi4/qEG6zGqCjSZ5ex7j4TrZsFJeGVBim9VPxh7dARcdHlf0al49/IMVIlb5PqIFNLQPFbPQ6S8aL6bTR8/a+3PTv2Tdb1yvjAxBKp+VNyRWG7FZbiMwRdr/ukPwXvYdJci4SOUNyZQyL0rEtDIU177trmN7DozW6mb0GkCMrA9D6w0a/vM+2eFBt+Z4C0FZ8UAPbTksSgq2rrWEknlFWsJB4WBN+lQrhX3j5g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=c/xR6YkWfKWV2eWIcLISE9nlBCFQDkrQgA4AhpXFs/s=; b=iE3+MhXgnraMQ/sMwPAF1lQOq030esL6uo6gN3W7PECx+PD8N/UAqpwALoCo6Fj07Mzpj9qdLcmNzr+D497hscgLoHOaKq5GTrf7TObMktUfZgGYOAYYj6YcwLqT2v2zegqNiau8Gbll7pTjVM1VSsqoCwiqwz0weLcVdwju8bo0TlykGsuLmCE6yX8Y25rPIHxm4FZD8/quPXtEDDvZRFNiPT4bmv7FLKE/R1xmjXe90RGmlmW2tBSpf0XjR5Et1AUotAarSxagqc275psq4IaHK4MUWjOIa4612E2C7mGwZlhQrDIp/WMjvtgoDf7GOwLV1Sgf2aRz3zeOdfFsGA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: <283fbba2-4d96-2ed0-4e0b-8d432c612667@suse.com> Date: Mon, 10 Jul 2023 10:56:40 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: [PATCH v3 7/8] PPC: switch entry point annotations to common model Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Shawn Anastasio References: In-Reply-To: X-ClientProxiedBy: FR0P281CA0161.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:b3::8) To AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|PAXPR04MB8255:EE_ X-MS-Office365-Filtering-Correlation-Id: acd97017-f6ca-4644-3057-08db812394af X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jb1qfUgs4w1fY90Z1rsvsG/1iOWdHl2Vsdm7UhKZSmXimcUWPPqAdhR/vU9Kk0BUwmEsaVYrmrjPgnuueVKUhJimFOsBHFrfnG3xeKztpT/7OAufstyPZd/R23jxbhAkZZwkWsvqCQEzeBd8iEiCgAKVx2s84Pmt5Lq5/BRaSk+lX7oS4qug8SuvNrLmFbZKSWsMBybMWGqF7zn2GkyyTgR1vWHeddXdjnO0fYQ7qi2rixPNIYXiuv2OZgF2vJIpjSW5J2P7N0EiPgXaRqj83a2Sp2kCwgxf57MRAHNEYrDt0vyvYoHU6D+yPImPiEwfLJ+anY+/P3iZQOeljHTWDw6W73hIArDIPim7zhryhcNKz8j5f0WmpElvejvZcJIe2fpIXKjSrcFDiYYoT40BqaT9AG6TaHNt+Vv8HUWNWcJQhQAg6aS1KoWKnGCa8b0F83cnEaNoKmIs12E+enxfD/l06VSZOIrPg/LtQ/ab53TK67ccyUiaYS6NujSKfV/eWRcmeameik+sias/2YagaLBMwHLt8+dyLsDUXGQVHsjr/mmBws6U1l/G0IzYKSGtQz9I1uY+xrFTYzbHc/QE7+XbxC7itLumPkBsnbxKd3hgOsWJ+AM+G8IUVRryvepjwEOSqZ3SaiNXF26vqPwIRQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(136003)(346002)(396003)(366004)(451199021)(186003)(26005)(6506007)(2616005)(6512007)(83380400001)(41300700001)(4326008)(6916009)(2906002)(66556008)(316002)(5660300002)(66476007)(8676002)(8936002)(478600001)(66946007)(6486002)(36756003)(38100700002)(31696002)(86362001)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?jSoQYyKWzeyOlXJkYub2sr/25vTN?= =?utf-8?q?GESAVHNC5Z1G8nxLf33AWOFlPEbbjC0gbm0JbmRArQ81QGxOtXIIQptyKiWBW6pbU?= =?utf-8?q?mkiYTLTt8aclboqCSvMqpnh42XoNIF11cAItj2GUOa4IpNQbXQtj51D09532kSWty?= =?utf-8?q?qE3Z0pHPxTx5ZXpL6A9uiyRs30XafA2kL6PHteQ2szY/NcTMgffCBUzl4a6VTzJyI?= =?utf-8?q?ZgvZ6wG9kWo7wZnb8vNMkzjaNEfrLgd6ZwWIRuvjVEdlpO8TPGVMkqBNRFAa7u3Tx?= =?utf-8?q?cSKTky4f4bw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Ottm+pv76TEEdyX6QSsfUm6Ryba5rEJUbCytG8Zc5lpM6yX3X28?= =?utf-8?q?/v62AlT5/OVaQF7Q0cqQCrycChlbhm9sx3TB8VEoNg0arpI/cG/hm7adm7xM0J3Zj?= =?utf-8?q?MzV3l8YWH9EOzGiVumpC2dgDIw+Zaa6sbBHMhix/JybVQEjMy7FYXjZGb4NRXNfVb?= =?utf-8?q?9ZJCtVJzzo39aTwLoMnOtnDL7BGvuZ9+dh8WVTLlzabBnnKVcatfHOa9MlGt5AbKN?= =?utf-8?q?xsp2rZ81kR7tj0WKpzhl/iBxlEINYAqnSJJO344QqlTSNUcVlEkzdqOS9aiBa3zgr?= =?utf-8?q?uQlk5ZOmlPKtJ6mnQ646dfZ8NpIsVz8LRi7Hh8HBemHSeY3xNkyK5BnIWm+QNj2Rm?= =?utf-8?q?GY+8Dftoz40h?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: acd97017-f6ca-4644-3057-08db812394af X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 08:56:42.2309 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: prxM7UAnXhvqIVNjvipszabTyUjWP4EhDwOecgCAO4acjTgmtkzQ/db2VQ4SvaoC+uE9MJQYv7Cgikm8dDRiRQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8255 Use the generic framework in xen/linkage.h. No change in generated code except of course the converted symbol changes to be a hidden one. Signed-off-by: Jan Beulich --- v3: New. --- a/xen/arch/ppc/include/asm/config.h +++ b/xen/arch/ppc/include/asm/config.h @@ -31,12 +31,7 @@ /* Linkage for PPC */ #ifdef __ASSEMBLY__ -#define ALIGN .p2align 2 - -#define ENTRY(name) \ - .globl name; \ - ALIGN; \ - name: +#define CODE_ALIGN 4 #endif #define XEN_VIRT_START _AT(UL, 0x400000) --- a/xen/arch/ppc/ppc64/head.S +++ b/xen/arch/ppc/ppc64/head.S @@ -1,8 +1,10 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ +#include + .section .text.header, "ax", %progbits -ENTRY(start) +FUNC(start) /* * Depending on how we were booted, the CPU could be running in either * Little Endian or Big Endian mode. The following trampoline from Linux @@ -25,6 +27,4 @@ ENTRY(start) /* Now that the endianness is confirmed, continue */ 1: b 1b - - .size start, . - start - .type start, %function +END(start) From patchwork Mon Jul 10 08:57:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13306496 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 3E951EB64DA for ; Mon, 10 Jul 2023 08:57:51 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.561126.877470 (Exim 4.92) (envelope-from ) id 1qImi4-0001Uf-B1; Mon, 10 Jul 2023 08:57:32 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 561126.877470; Mon, 10 Jul 2023 08:57:32 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qImi4-0001UY-7q; Mon, 10 Jul 2023 08:57:32 +0000 Received: by outflank-mailman (input) for mailman id 561126; Mon, 10 Jul 2023 08:57:30 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qImi2-000090-Bw for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 08:57:30 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2062a.outbound.protection.outlook.com [2a01:111:f400:7e1a::62a]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id cca8e8f3-1eff-11ee-b239-6b7b168915f2; Mon, 10 Jul 2023 10:57:29 +0200 (CEST) Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21) by PAXPR04MB8960.eurprd04.prod.outlook.com (2603:10a6:102:20f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 10 Jul 2023 08:57:28 +0000 Received: from AS8PR04MB8788.eurprd04.prod.outlook.com ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023 08:57:28 +0000 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: cca8e8f3-1eff-11ee-b239-6b7b168915f2 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KqhmvAiGahJ8duQQHzJmRnOJ3n1Rg6hvRNaMtJ8e2iXR1VLHaGml/ujHjFsFYkDQeHyTK8ttM6N/3QuAfZGkGfjNkTylhhXuIvzGI9PcFRivFO3y964qABLn9SuRTpKQeR7VvqI3+Rfh0vhMBJE2RjWEtoxiL7Q9zAfuFiLgNIZqMiKBl7TdY3tm6plNcUtTIObxx47j4/EcdqIuG5UfLrnrOjW+2t+qcpztXpsTbpD59ZpZiQiZzbqfJV6S+T1QkGSsEt9pbYLE9dEM47RE9MH0yq1wIPQhlQ3J6OeYHoU8dDYQnuOLSho1ous+ETXgiOv+tCj/t9ZxBA0m6s/sGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=NsniVDfE1jEbPDiRAa4YFhSNPmca1KwD931ycm8eIt0=; b=BYM3j4R0yhxRcPdJs5jjgo1tuCpsz6cv/Z+wtREnDZActYTjScJp102wu6W05lMUd9WTD8CTA773wYAkRaZ7mbU0dykYQWnXMSKqTdp86i6jKxCohR1gXxZfBiFAnDCy0hqMSt+re6WQ0QLs6Tep3AQzTaD/bx0ikF+Ab0fA6uOPXc+xaok+9hyhKu4t3cEk2z4kRh+P0VL63U+XHB8WVw6NsUpyGcnOK68IAcwDwv12bzkv48UwiLVjZ6Bu9IoxgTR5qlYQ0AIIzM8rPtWDGx6O0UnEgT7caX7794luGnS7vv/wFTDvD8wKXgnHedqqEzCUt1EEcW4ty8e5WNbTuw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NsniVDfE1jEbPDiRAa4YFhSNPmca1KwD931ycm8eIt0=; b=bpEg4BDpgkgaIbGeGiYYBpwWRnrxzUb93VPtufmn9qSO7dh2Iu5rO8/9RJlcpGwKd4yj4jDStuBJS5IlPNZ6I3yzSCuq3Y5XbFAdHaaYUBFcufAuclE5yDSy8QvYqNj+OHxpEz4SOGuKBVbKTYV4XwtLZaH/1xlxzK2BmT8lUWmrh9INwLHhiqKW7D8SKr1RbweRmV3haPqE+egQg92AcFnWZSHfwVC4qufBYLjp7peaTrwd2d67gNHSXnP6EKx1jRg2V+IzNhHHe5dJhQE9e+P7KREVmS0KgPCrJA89P7zPW9Q/BZ5gJ+akvcCFvxhrElxunqbB7R6Tjhy6iQhinA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: <84b2fd88-d852-b1e6-0f4c-cecdcb8c7943@suse.com> Date: Mon, 10 Jul 2023 10:57:26 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: [PATCH v3 8/8] tools/binfile: switch to common annotations model Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Julien Grall , Stefano Stabellini , George Dunlap References: In-Reply-To: X-ClientProxiedBy: FR0P281CA0221.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:ac::17) To AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|PAXPR04MB8960:EE_ X-MS-Office365-Filtering-Correlation-Id: 91d91873-9b3f-4a8a-2c2b-08db8123b014 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yVhn8w4nJwd6URS7uBN1XHBU7MT9ohHrk1AVYuHvAoIuhlRg+Q1NQXmT0bs8LQ22bXtTUavYfHxSxm8qyk9sR/hoffg7mfiEEkpmrSsUE9MEtVFCUoMGbmq0eN57xnUZ53QJnKYNI7t8+sjQcu7YQ5W9ydQKI7FT628kJ/T94eYbV/HPkkDtSdfCCOBQ66c1QQ4hZRWkWfiQ6vY6WmrujGQ9HPXGWfjG3v4fKxDFE1ZA4YWJ9rvMop5OupipH8eFMHLsOz+jMSEEPvLGitE8ioNrQtWY6hFkkKTl+1xVSgsLpLXwVKx+DpDbn8W3RbspAdk17BNQb/KQNd9T10NlWasfVDL6aF4800tDjt9AYFT0FftDgN/qbb+CcLxWIxTY0SS/p2ABKeynXc1cavgzguXqJpHIbcj5RMndQ9nuOAL2yJQyOnhlRpEZkKlrGQkcHgh0krUu8hsUc3THW7tlzaoL1fenrlsECidJX7JRAAR+re/8aA6pgFuDWZ3ukNaUumNqDNLAlxYV8S9//63FHueYscrvl9z2q16j0Vq31eLzFrsnGsg5CClRmNVHOaWUSmlyEum1yRbHSPjlClz97Td0tcubaSo/+5J/KfaG3r/kU5x0rF1Bh2Fmz00yUN7mOEdCd9l6LIox6u4TemJXpg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(366004)(136003)(346002)(39860400002)(396003)(451199021)(66556008)(6506007)(66946007)(4326008)(66476007)(6916009)(38100700002)(41300700001)(478600001)(316002)(2616005)(6512007)(186003)(26005)(36756003)(6486002)(2906002)(8936002)(4744005)(5660300002)(31686004)(54906003)(86362001)(8676002)(31696002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?f2yiG21gojqAaSnZ0t4zDY0bmRs2?= =?utf-8?q?jRpwWX5G3Mzqzn1bdJHLQSmqeKwvLeuyIGdhs9W6eufwGsPtf4QMiKRzMec8H3ZzZ?= =?utf-8?q?6cq6wTscSa1jktGnXbDOMPJ/mH6gF+TtfkE3VLMziVcsE1Vj/MrWqsz5bl1zwumNw?= =?utf-8?q?6Q2Nn5m/tzZKoeFKWUdcoD0rn857sBk7KKe1fphI0zZvc0qV43u/bhfp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?utf-8?q?6BAYsyYv6zRcbmm8/Xi+HH8OsvJAP+qGiW1Fp6T7rT3tNLmhl5j4bydIY8C8/lfJ4?= =?utf-8?q?J2c4b+QbTE494vZqWafyZwQCUE0DNXGc0+D3CB+wU0SRKS3aDBOHblwoqFGPiorB9?= =?utf-8?q?LdG8y9bT4ntwyXUEE3lqdiBhht/BS+poNhaSCCtCY93eu+mYVI+6M2atTUmysOEfH?= =?utf-8?q?SupQ+RNGMlOLWrRDpSmH9uLnO3I9Cv7aLYdFfSqLlL2BpHrFpRwLfAtTEifVOBLYS?= =?utf-8?q?oVU0qr+5fhV5jmHSt2qEAxYKM3QlG/UzcdYxgmfYzuVqU/3U+lSRuLvWy0J49AVe9?= =?utf-8?q?X4yNWOQKGL4BsT2B+PZYDmvitSVimcSqo51d8UQbZOQbUvE7ZbVG3/myGD31u02RW?= =?utf-8?q?+7Vr1+q9q9/5mFCSdEyXqFyHneAKl5PSX4a8k5HqGxJO1oU9tZ6D4MOYaNzgPk8jO?= =?utf-8?q?LZwh5iiVa08U?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 91d91873-9b3f-4a8a-2c2b-08db8123b014 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 08:57:28.1738 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: X5S4axufVpW961kvUMGkkfhygwRLCpBkOUwJdd2cMyPI3I3e+EyQIKiBChmm2T7aBdn8x7JqHxeDGj1k0DIfZg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8960 Use DATA() / END() and drop the now redundant .global. No change in generated data; of course the two symbols now properly gain "hidden" binding. Signed-off-by: Jan Beulich --- v3: New. --- a/xen/tools/binfile +++ b/xen/tools/binfile @@ -29,15 +29,10 @@ cat <$target .section $section.rodata, "a", %progbits - .p2align $align - .global $varname -$varname: +DATA($varname, 1 << $align) .incbin "$binsource" .Lend: +END($varname) - .type $varname, %object - .size $varname, .Lend - $varname - - .global ${varname}_size ASM_INT(${varname}_size, .Lend - $varname) EOF From patchwork Mon Jul 17 14:18:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13315827 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 757C7C001DC for ; Mon, 17 Jul 2023 14:19:12 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.564623.882172 (Exim 4.92) (envelope-from ) id 1qLP3x-0004Fo-DR; Mon, 17 Jul 2023 14:18:57 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 564623.882172; Mon, 17 Jul 2023 14:18:57 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qLP3x-0004Fh-Al; Mon, 17 Jul 2023 14:18:57 +0000 Received: by outflank-mailman (input) for mailman id 564623; Mon, 17 Jul 2023 14:18:56 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qLP3w-0004FR-1k for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 14:18:56 +0000 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on20631.outbound.protection.outlook.com [2a01:111:f400:fe16::631]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id dc4ee748-24ac-11ee-b23a-6b7b168915f2; Mon, 17 Jul 2023 16:18:55 +0200 (CEST) Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23) by AS8PR04MB8979.eurprd04.prod.outlook.com (2603:10a6:20b:42e::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Mon, 17 Jul 2023 14:18:52 +0000 Received: from DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023 14:18:52 +0000 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: dc4ee748-24ac-11ee-b23a-6b7b168915f2 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Gu8kYuM2JX70fkP7sPPTy+9hIUC6XxdPTInF+Dv/vIpSGBFVUIWMc3bBDBlMM82u9WBaG5n20B0ekos7gRR2c/vb3YobSOw5ComvnCtpb+ktZV10aTwfkiy/7gXHStX5NI7PzqOLynr8LC7pcg6yfevQ6Y5MU4mAKLoaZZ+uzJWXQ1Slp/77tsUFQrOWznL73zw8vmbNWCUBBqs6mv9X9ySDB21Kkm/GReLR0wVhnCJ3dtdsRyBl8k95RaL1MOxB5EYhNMa6rVP61TAXeq0ZvhE66SahBhaT3BNDgsi4B2MaVCMU7R4Aoq6jrt0D1X2CbpjPzUNWhtBOrUu5+sWnzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=tuCRAFGTJjX+O7Q9upuBdqcebOL1clejJevbyHOYW7U=; b=Y/BO+eJ6didkn0EkhD+YF5mZrrj/Lb71vk/cG9X0mA1Z82CKrD2PGpoo2ZVHg6y7HRL/dAmD6vOUO4J9hESqiM1JOnXpcut5BJWzHcxUt2Lf3QMF3yf8XXeCH4+PGlf02AxjE4Vm5QXdXENeDsgSBfzMOGXWD+yvAJS2CCqyfST+e+ciR1On6mlKkV1Zc5QPJ2Vc25Ik0DClD69WAswqIaATWEmPpz3SFmMcmmRugam8C+HWq0WXid8XPsrKNn+qekILQyOh6X3lKJYZFmqKrHbHy2naPISJQmDVu16GmMmGLMB+EC0LRaUiRNV1U9IP3Dz4hykz1oURDmDnueCOTQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tuCRAFGTJjX+O7Q9upuBdqcebOL1clejJevbyHOYW7U=; b=nPm90ROfs7/5yz7mJ6xylqj2nSpjACziRJMsKlesKSS+eJJYDBKcbZFglBZAjSqbXe0zRODhKG662GkNw1PLz/rn2OfNtuyfIE2l09F789wreQO/5+AXXf6hI180QiArMOp1TrAOjE2Jrt/dYma7bzub5iXJK2HlRsITevqPXlx9vV1Z6up7kY/usYMF83mS9KARlHDaTVRI5/le4RgVID6gJcmNQNVQI0ebniLfYIvfBHk2qpamw0EhR6WV65umMUfJFdDn9b+3FYcqJrad269rXQC1sSIJCM/v2auvZUfg/h3ypteZ7Df79Fh3sYwvDqCO36AOUUrnWxiZXbo4PA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: Date: Mon, 17 Jul 2023 16:18:50 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: [PATCH v3 9/8] common: honor CONFIG_CC_SPLIT_SECTIONS also for assembly functions Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Julien Grall , Stefano Stabellini , Volodymyr Babchuk , Bertrand Marquis , Bobby Eshleman , Alistair Francis , Connor Davis , George Dunlap , Shawn Anastasio References: In-Reply-To: X-ClientProxiedBy: FR3P281CA0195.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a4::7) To DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB8979:EE_ X-MS-Office365-Filtering-Correlation-Id: 7212d941-238c-4221-5021-08db86d0bf6a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PPmGgFwTFK628vuaR5TeHoshEUf65kQOVupv0qQjVkG+sG2+85vfB/aC23sW+QR8YewdWsmsdbXcds+mc+l73dRP6M02xxRwfm9yFFVmaFJQucwxi3WHhtjuMbkafZPr8iLNnNq6nEV1/BU33u4sWTpS5panGNW4/PaxDc29j58cmv+kfH8fKdxvxqS5lXaP2+AMOnIHcmUJZwegy331BVtYJQOWfd4KE4DUeW4nsSfBKVlI6H994z0QVxRtOYfcvUnHX28pebuc49zPp00OFCsMy0TOpCgbo+wc1m+WvbdjvWGrD/61wL/PegebiDeCZcSD2sWNeU/qkWCzIOf64R5ljQNvvgXe7vfpFELx+csbBZjnSKQIVsJL+fPBNLC0VZBpfskU8kV7qy+DVYlFfNZXjxPaQuHIGnlwx6THIhQUHmYQT3waRCCG8cGz8cZawqXXsZevZKJpqPg/jQv+qicVO5PsKno1SD3oW1IPmj7dyB5gGkGtNtsN4vefxTu3G1HE9XUqWISi+fbivntym700a1bdwtoXS5zp4IYxv6q4bjwXC16NRn1sN046KmBL4hM27f9u3N1fIEMze9BL0y3es7L/TQJFanT7IErMfrQgH6rd8AUfK2pdMHgmOAynFC65UrJ/dO8FUWf5hqsUtA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(346002)(366004)(136003)(396003)(451199021)(31686004)(6486002)(54906003)(478600001)(83380400001)(2616005)(36756003)(31696002)(2906002)(186003)(6506007)(86362001)(6512007)(26005)(38100700002)(66476007)(66556008)(6916009)(66946007)(41300700001)(4326008)(316002)(5660300002)(8936002)(8676002)(7416002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?HFEEV4ImpVCpsjjiMRwz3ikUDmDI?= =?utf-8?q?8EKRR7r3LzgGsteyQSM531wnlJoFpvo9oWUYeNU2Ct4trcbOJHQWgXKiM+TgtzC0C?= =?utf-8?q?y3jcVtA/cF+aGgDzhGKs3drJMr0bUANw+gFEPz1zLm4uDzBs3GQC4XxF4WTh9VBLI?= =?utf-8?q?mWCQsjqJlff4qy+lXjQeJEttUqlWNn1hFa4w/TI6LOQUWMqHxvLNrkkyjDbJxXZQR?= =?utf-8?q?dm5fv6V0yLeYLXXa6cIvcE/1DkXfEvWteuKNJ29Maj4rdBeRZlJBcyeXJwRZLxzgl?= =?utf-8?q?ThHUZbN1cxNMOsO+BmqubLnhBWsWqOdNL8D9VzTHly6MRJp1z7FOjP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= =?utf-8?q?3nVxHAM0upZKeGZcR8S7R+gcAs4JYiWlhjwd2ucaJHW1oxRqxE3+UskeyKiakGRVf?= =?utf-8?q?Lq2PnD89Alr5AfsL+l+OsdIwIcaZMy6i5zrIWIEuDQV0ODSg/ijtFJULSqHI9x4IP?= =?utf-8?q?OVhgzjXk5FiO84H9xptB3ed8trP4gXAhfEsRiBx0P5T6jsJDl88CmZ/QFb60Bvpy6?= =?utf-8?q?5fdaJwbkZoPkA4npnG4p8UawY/SB8uaW+CGLYUGVuJNGmtzk+j9G5DRmNmIWbBH04?= =?utf-8?q?saJbtJsZdtlwYLp7YokmTOh4ITTjBwyeZqoeEJIYj3jGG9VE3p91EMjn3ODrNGjxs?= =?utf-8?q?l2cehPwg7qxw?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7212d941-238c-4221-5021-08db86d0bf6a X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 14:18:52.6983 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ygw5Gx3bUQ3MTGFzzd81u8CnjgZO4fBtQ8MArH1rYCupmTLdtgwJ8kEAH4DOfcAF97iCh/KVIwlKDhajnrz5kw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8979 Leverage the new infrastructure in xen/linkage.h to also switch to per- function sections (when configured), deriving the specific name from the "base" section in use at the time FUNC() is invoked. Signed-off-by: Jan Beulich --- RFC: Since we use .subsection in UNLIKELY_START(), a perhaps not really wanted side effect of this change is that respective out-of-line code now moves much closer to its original (invoking) code. Note that we'd need to split DATA() in order to separate r/w and r/o contributions. Further splitting might be needed to also support more advanced attributes (e.g. merge), hence why this isn't done right here. Sadly while a new section's name can be derived from the presently in use, its attributes cannot be. Hence perhaps the only thing we can do is give DATA() a 2nd mandatory parameter. Then again I guess most data definitions could be moved to C anyway. --- a/xen/Makefile +++ b/xen/Makefile @@ -399,6 +399,9 @@ AFLAGS += -D__ASSEMBLY__ $(call cc-option-add,AFLAGS,CC,-Wa$(comma)--noexecstack) +# Check to see whether the assmbler supports the --sectname-subst option. +$(call cc-option-add,AFLAGS,CC,-Wa$$(comma)--sectname-subst -DHAVE_AS_SECTNAME_SUBST) + LDFLAGS-$(call ld-option,--warn-rwx-segments) += --no-warn-rwx-segments CFLAGS += $(CFLAGS-y) --- a/xen/arch/arm/xen.lds.S +++ b/xen/arch/arm/xen.lds.S @@ -154,6 +154,9 @@ SECTIONS .init.text : { _sinittext = .; *(.init.text) +#ifdef CONFIG_CC_SPLIT_SECTIONS + *(.init.text.*) +#endif _einittext = .; . = ALIGN(PAGE_SIZE); /* Avoid mapping alt insns executable */ *(.altinstr_replacement) --- a/xen/arch/ppc/xen.lds.S +++ b/xen/arch/ppc/xen.lds.S @@ -106,6 +106,9 @@ SECTIONS DECL_SECTION(.init.text) { _sinittext = .; *(.init.text) +#ifdef CONFIG_CC_SPLIT_SECTIONS + *(.init.text.*) +#endif _einittext = .; . = ALIGN(PAGE_SIZE); /* Avoid mapping alt insns executable */ } :text --- a/xen/arch/riscv/xen.lds.S +++ b/xen/arch/riscv/xen.lds.S @@ -92,6 +92,9 @@ SECTIONS .init.text : { _sinittext = .; *(.init.text) +#ifdef CONFIG_CC_SPLIT_SECTIONS + *(.init.text.*) +#endif _einittext = .; . = ALIGN(PAGE_SIZE); /* Avoid mapping alt insns executable */ } :text --- a/xen/arch/x86/xen.lds.S +++ b/xen/arch/x86/xen.lds.S @@ -86,6 +86,9 @@ SECTIONS . = ALIGN(PAGE_SIZE); _stextentry = .; *(.text.entry) +#ifdef CONFIG_CC_SPLIT_SECTIONS + *(.text.entry.*) +#endif . = ALIGN(PAGE_SIZE); _etextentry = .; @@ -214,6 +217,9 @@ SECTIONS #endif _sinittext = .; *(.init.text) +#ifdef CONFIG_CC_SPLIT_SECTIONS + *(.init.text.*) +#endif *(.text.startup) _einittext = .; /* --- a/xen/include/xen/linkage.h +++ b/xen/include/xen/linkage.h @@ -21,6 +21,14 @@ #define SYM_ALIGN(algn...) .balign algn +#if defined(HAVE_AS_SECTNAME_SUBST) && defined(CONFIG_CC_SPLIT_SECTIONS) +# define SYM_PUSH_SECTION(name, attr) \ + .pushsection %S.name, attr, %progbits; \ + .equ .Lsplit_section, 1 +#else +# define SYM_PUSH_SECTION(name, attr) +#endif + #define SYM_L_GLOBAL(name) .globl name; .hidden name #define SYM_L_WEAK(name) .weak name #define SYM_L_LOCAL(name) /* nothing */ @@ -35,7 +43,14 @@ SYM_ALIGN(algn); \ name: -#define END(name) .size name, . - name +#define END(name) \ + .size name, . - name; \ + .ifdef .Lsplit_section; \ + .if .Lsplit_section; \ + .popsection; \ + .equ .Lsplit_section, 0; \ + .endif; \ + .endif /* * CODE_FILL in particular may need to expand to nothing (e.g. for RISC-V), in @@ -49,6 +64,7 @@ #endif #define FUNC(name, algn...) \ + SYM_PUSH_SECTION(name, "ax"); \ SYM(name, FUNC, GLOBAL, DO_CODE_ALIGN(algn)) #define LABEL(name, algn...) \ SYM(name, NONE, GLOBAL, DO_CODE_ALIGN(algn)) @@ -56,6 +72,7 @@ SYM(name, DATA, GLOBAL, LASTARG(DATA_ALIGN, ## algn), DATA_FILL) #define FUNC_LOCAL(name, algn...) \ + SYM_PUSH_SECTION(name, "ax"); \ SYM(name, FUNC, LOCAL, DO_CODE_ALIGN(algn)) #define LABEL_LOCAL(name, algn...) \ SYM(name, NONE, LOCAL, DO_CODE_ALIGN(algn))