From nobody Wed Nov 5 05:35:04 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1726761599; cv=none; d=zohomail.com; s=zohoarc; b=jFzgPycynbKbpPeY6yDX9c4K1ghQY22xMZtyMjXOV1o8wekxbHfdgSjQJynrXaDECE4LP910J5ry2HI39b0VR5Taq5lj84fxvBok9qmycFTgIyUzukoZ/y6bZMhnZdoymLnKw+eUfFpkztAWLbnInO4R2N0OpT1ex743eXE0cns= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1726761599; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=EKAfkZ7wyQ029mmkdNEAuODIEACdmHMLY1z97j/M+8w=; b=TGYPqhShQJgbQboXnsyI+maCjEJMY3CSjgVzdhr2gh9ylZ0tRLnmhRxDtdWN1xfyZ/pQdTpu1U4KeBAO7ng6U3G/9a3dgnBzdxY571kMNsrGZVf1csgWlNcEe5sgxXrEE6akwo2JKKj7fqvYmQfFN/irUpR/tMV01tgOpw9C+sY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1726761598997459.1337762425335; Thu, 19 Sep 2024 08:59:58 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.800818.1210827 (Exim 4.92) (envelope-from ) id 1srJZB-0007Y6-FK; Thu, 19 Sep 2024 15:59:37 +0000 Received: by outflank-mailman (output) from mailman id 800818.1210827; Thu, 19 Sep 2024 15:59:37 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1srJZB-0007Xz-C5; Thu, 19 Sep 2024 15:59:37 +0000 Received: by outflank-mailman (input) for mailman id 800818; Thu, 19 Sep 2024 15:59:36 +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 1srJZA-0007Xh-Bu for xen-devel@lists.xenproject.org; Thu, 19 Sep 2024 15:59:36 +0000 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [2a00:1450:4864:20::134]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 29e35b9e-76a0-11ef-99a2-01e77a169b0f; Thu, 19 Sep 2024 17:59:34 +0200 (CEST) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-53660856a21so997071e87.2 for ; Thu, 19 Sep 2024 08:59:34 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5369fa5ceb3sm631423e87.32.2024.09.19.08.59.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Sep 2024 08:59:32 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 29e35b9e-76a0-11ef-99a2-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726761573; x=1727366373; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EKAfkZ7wyQ029mmkdNEAuODIEACdmHMLY1z97j/M+8w=; b=Uo7awTxOY4X2Bvez/0gpcbu4UxCmdSMxVkaLYUA4NUQ23AAQ9C3gcSGhvDFU6QDZh5 hSbL1xijCPxqVQWABHvSDG1N6gwFqNDdq7ZjmItzHbjqRbHCMk+ugOb6oYfwhbRLncoV lNus3QOQqLaSmrpvmOgjg60170RKk7c19aqnN0hZrfdcThD1B17TC53JANOmZqhup3A3 vwjvZYkAfHllw7+F03GEKPVXXxslqIjlDSu9nCzGD124RyG7XzQ0W+VQc1MW/HEmsR8X Yt1Nv/MbhDwAj55Ik3W/IGhPVEv1jNpkcRAWtidqYARGTWInSewfbXs8VCX7SClajDl3 9K6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726761573; x=1727366373; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EKAfkZ7wyQ029mmkdNEAuODIEACdmHMLY1z97j/M+8w=; b=J8I6y4ek70uRX4DaA3NsFKUJ5KlQR1K3coDl5JAQaSDWhGqW9h0VbUP6kUOCR/rUuF a9NBkrKupG/wEyD1XLU8+ouoiqQWpHqtZa0Zl1r+OHqA6YJDvdIhTC3kd2N3U/KZiZcN iTBUfLxZLGwbxt5uCmFQ8FUNIU0BL1DiXMmuVfAdNVlgVHdVdr5BJgUsUaWrH1MRG7wQ QpcOZOJzoWwNI/qKvx/MNBTxlYRQZhtvA/Te+VScGabf0Kz94cydFpH2rIZele7skZs6 EFZV66ZosFHYK+0mWBujqBmsv5wYq0dPdAiW0PA8Zu8mzaIfQT1OUYBC1LrG2CeAODUv 4feg== X-Gm-Message-State: AOJu0YxpfJv7kCyvv85SjmSuvEYj/FWzFVj9LsmQWN1/gc0udXThVzFA EyTOAEIQzBJk59AQRZhzwazhshr3Vhx+i1L/arfVuvI5tmHKFvWPYYC+Ug== X-Google-Smtp-Source: AGHT+IETsTQkWVYYKpKyErxKhsJ63imj/xKAaMLA0cSW0RdhCmBp8itNhvSNH2aAJyT9gMAOjyiTRg== X-Received: by 2002:a05:6512:130f:b0:532:ec7d:9c58 with SMTP id 2adb3069b0e04-5367ff338edmr11902128e87.56.1726761573269; Thu, 19 Sep 2024 08:59:33 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , Andrew Cooper , Jan Beulich , Shawn Anastasio , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH v1 1/2] xen: introduce common macros for per-CPU sections defintion Date: Thu, 19 Sep 2024 17:59:27 +0200 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1726761599768116600 Content-Type: text/plain; charset="utf-8" Introduce PERCPU_SECTION macro which manages: * Alignment of the section start * Insertion of per-CPU data sections * Alignment and start/end markers for per-CPU data This change simplifies the linker script maintenance and ensures a unified approach for per-CPU sections across different architectures. Refactor the linker scripts for Arm, PPC, and x86 architectures by using the common macro PERCPU_SECTION defined in xen/xen.lds.h to handle per-CPU data sections. No functional changes. Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich Acked-by: Julien Grall --- xen/arch/arm/xen.lds.S | 9 +-------- xen/arch/ppc/xen.lds.S | 9 +-------- xen/arch/x86/xen.lds.S | 9 +-------- xen/include/xen/xen.lds.h | 10 ++++++++++ 4 files changed, 13 insertions(+), 24 deletions(-) diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S index bd884664ad..669a882455 100644 --- a/xen/arch/arm/xen.lds.S +++ b/xen/arch/arm/xen.lds.S @@ -198,14 +198,7 @@ SECTIONS __bss_start =3D .; *(.bss.stack_aligned) *(.bss.page_aligned) - . =3D ALIGN(PAGE_SIZE); - __per_cpu_start =3D .; - *(.bss.percpu.page_aligned) - *(.bss.percpu) - . =3D ALIGN(SMP_CACHE_BYTES); - *(.bss.percpu.read_mostly) - . =3D ALIGN(SMP_CACHE_BYTES); - __per_cpu_data_end =3D .; + PERCPU_SECTION *(.bss .bss.*) . =3D ALIGN(POINTER_ALIGN); __bss_end =3D .; diff --git a/xen/arch/ppc/xen.lds.S b/xen/arch/ppc/xen.lds.S index 38cd857187..0833d80479 100644 --- a/xen/arch/ppc/xen.lds.S +++ b/xen/arch/ppc/xen.lds.S @@ -148,14 +148,7 @@ SECTIONS __bss_start =3D .; *(.bss.stack_aligned) *(.bss.page_aligned) - . =3D ALIGN(PAGE_SIZE); - __per_cpu_start =3D .; - *(.bss.percpu.page_aligned) - *(.bss.percpu) - . =3D ALIGN(SMP_CACHE_BYTES); - *(.bss.percpu.read_mostly) - . =3D ALIGN(SMP_CACHE_BYTES); - __per_cpu_data_end =3D .; + PERCPU_SECTION *(.bss .bss.*) . =3D ALIGN(POINTER_ALIGN); __bss_end =3D .; diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S index d48de67cfd..eea8edc02b 100644 --- a/xen/arch/x86/xen.lds.S +++ b/xen/arch/x86/xen.lds.S @@ -321,14 +321,7 @@ SECTIONS DECL_SECTION(.bss) { __bss_start =3D .; *(.bss.page_aligned*) - . =3D ALIGN(PAGE_SIZE); - __per_cpu_start =3D .; - *(.bss.percpu.page_aligned) - *(.bss.percpu) - . =3D ALIGN(SMP_CACHE_BYTES); - *(.bss.percpu.read_mostly) - . =3D ALIGN(SMP_CACHE_BYTES); - __per_cpu_data_end =3D .; + PERCPU_SECTION *(.bss .bss.*) . =3D ALIGN(POINTER_ALIGN); __bss_end =3D .; diff --git a/xen/include/xen/xen.lds.h b/xen/include/xen/xen.lds.h index a17810bb28..f043c7b6c0 100644 --- a/xen/include/xen/xen.lds.h +++ b/xen/include/xen/xen.lds.h @@ -151,6 +151,16 @@ #define LOCK_PROFILE_DATA #endif =20 +#define PERCPU_SECTION \ + . =3D ALIGN(PAGE_SIZE); \ + __per_cpu_start =3D .; \ + *(.bss.percpu.page_aligned) \ + *(.bss.percpu) \ + . =3D ALIGN(SMP_CACHE_BYTES); \ + *(.bss.percpu.read_mostly) \ + . =3D ALIGN(SMP_CACHE_BYTES); \ + __per_cpu_data_end =3D .; \ + #ifdef CONFIG_HAS_VPCI #define VPCI_ARRAY \ . =3D ALIGN(POINTER_ALIGN); \ --=20 2.46.0