From patchwork Tue Nov 26 17:34:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rong Xu X-Patchwork-Id: 13886278 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF8471CEE9B for ; Tue, 26 Nov 2024 17:34:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732642457; cv=none; b=p5svVTmUBbqWNY31/mctW6mFHFTHtrwSnGTtfhvFfKfsynRB/C4Se9KlMKJ6BlWNUe09T0Jiw3SNe56MekP+KYIezLGXrlaHfrKXYhN4zmLlROEMcMv7y7uedgZnUqs5HsyKLlmbiyR2AgXNEnvv/omLTr0MdKnMQdMhAzzY70c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732642457; c=relaxed/simple; bh=mGFTtX6XXg5VLNadn4sVwmluKYYuu0Mt7yyAn3iW9cg=; h=Date:Mime-Version:Message-ID:Subject:From:To:Content-Type; b=pnEspiVy2kevQppqKrF+jlpD/F1mcrs1Q2vKbE6mJngJHZlYin6Ov5zsvt+mUgtkbv/eaGivHyI6mLihhXi2l0yBpMNx6PZyqBv88AnHtaje5AxVXGw1jRk92KVIg/jOUy0O5Ux3ODFVfUVXr1D76KtIZak7b5bKfaLkk99t6NQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--xur.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=pNuaXkMJ; arc=none smtp.client-ip=209.85.216.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--xur.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="pNuaXkMJ" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-2e5efb04da7so5810462a91.0 for ; Tue, 26 Nov 2024 09:34:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1732642454; x=1733247254; darn=vger.kernel.org; h=to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=A90IYmUCselE4qTryd9IxmYXZiUDGR9//N6PGP0Z5oI=; b=pNuaXkMJSgG459n86F/vKNVs/ZfHGGrvPuD1C9YrWVsF9jLGkYJqZSJjw4FzX/H5Xe 4+ZWWCUqvAvDJFv54U2JzLy1x8AhTm2TxxYP0iZ767KcTUvP0z+f8QWJr2C55iLiw6p4 s8cMNVRaQGvW4tu4yw0D90RlyOa8CEb7zIV4SmYXhJ+TSx4tp7HekmB8Hoj+Vy637st8 zDOCT4Edr/eukcNqxTQh7v+mo3s82/CVvHvoJGFhwx0HSmDzMDUfqh/CEfRNeG0IxCLj FBHRQOGbvFnj2ISggcZBFm6sf41m5bPtzc6qvGBVDtH1csuxiFFLe6BDZ7CUJTF+0XlN kutw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732642454; x=1733247254; h=to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=A90IYmUCselE4qTryd9IxmYXZiUDGR9//N6PGP0Z5oI=; b=HvFm4GE7jHfYvSigZ8XV6Gh89w6iuIgyoSRA+U8Yxh7ZdFNo8Wws0D6mpJn/5n87bk HbwzZTiM0amDIBA14ZEPSLqXKv7ABXxJnuJgLwVunab4e8lYTi1TXJ4JfuZN0CPWxpng HCqPP8fKvocNPhvqYrY6waj1QkK60aIvPN8MMN6ilw3hnd1toy2oaoVrjownH4C0MJNh TM6Ppp0VGmRkoyle3PpadSduhj4QxR4opuU5Nh5tlUZ8CNjsS/40X0BAGDFxWd7G7l3J Ax1ZAFWvkQI/K0ohA1YxkGXmX3ls6Dz49V9Twr8cVPpbvKlvLm0x89iMyeYzP5/xozwQ ctng== X-Forwarded-Encrypted: i=1; AJvYcCVlsu+/ZRwvl2fH4oMt7MhYohhL4UJcNWmL4dWx9/fjVB5rjpw3z2h7h2xzM7oO4l+ecbUBWPOiTYE+@vger.kernel.org X-Gm-Message-State: AOJu0YxjejQ+3bPH4JVxvqBDBrQrDVNZ4mF21eWCZrBaFZidlnNG83sR a6uQpKOZ0Y7zGi9SWN8LuHAsfjLRcSyy/iT8aaNvmA6YjXIkIoA7FOQOXPbnlfozkQ== X-Google-Smtp-Source: AGHT+IGzrM6FvnCM634BZvjuGUEkX5BfMb0HbEZwyhF6T4V9Rxe+LZz2q7yU8kaH9JCYzhnBYVXRWyo= X-Received: from pjbrr4.prod.google.com ([2002:a17:90b:2b44:b0:2ea:5824:7f25]) (user=xur job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:1d81:b0:2ea:4e9e:df87 with SMTP id 98e67ed59e1d1-2ee08eb62b0mr146049a91.19.1732642454261; Tue, 26 Nov 2024 09:34:14 -0800 (PST) Date: Tue, 26 Nov 2024 09:34:09 -0800 Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.47.0.338.g60cca15819-goog Message-ID: <20241126173409.3728585-1-xur@google.com> Subject: [PATCH v2] [MIPS] Place __kernel_entry at the beginning of text section From: Rong Xu To: Thomas Bogendoerfer , Masahiro Yamada , Klara Modin , Rong Xu , Christophe Leroy , Michael Ellerman , Nicolas Schier , Chris Packham , "Maciej W. Rozycki" , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Mark __kernel_entry as ".head.text" and place HEAD_TEXT before TEXT_TEXT in the linker script. This ensures that __kernel_entry will be placed at the beginning of text section. Drop mips from scripts/head-object-list.txt. Signed-off-by: Rong Xu Reported-by: Chris Packham Closes: https://lore.kernel.org/lkml/c6719149-8531-4174-824e-a3caf4bc6d0e@alliedtelesis.co.nz/T/ Tested-by: Chris Packham --- arch/mips/kernel/head.S | 1 + arch/mips/kernel/vmlinux.lds.S | 1 + scripts/head-object-list.txt | 1 - 3 files changed, 2 insertions(+), 1 deletion(-) base-commit: 3596c721c4348b2a964e43f9296a0c01509ba927 diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S index e90695b2b60e..c7528d96dd1a 100644 --- a/arch/mips/kernel/head.S +++ b/arch/mips/kernel/head.S @@ -59,6 +59,7 @@ #endif .endm + __HEAD #ifndef CONFIG_NO_EXCEPT_FILL /* * Reserved space for exception handlers. diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S index d575f945d422..c9c1ba85ac7b 100644 --- a/arch/mips/kernel/vmlinux.lds.S +++ b/arch/mips/kernel/vmlinux.lds.S @@ -62,6 +62,7 @@ SECTIONS _text = .; /* Text and read-only data */ _stext = .; .text : { + HEAD_TEXT TEXT_TEXT SCHED_TEXT LOCK_TEXT diff --git a/scripts/head-object-list.txt b/scripts/head-object-list.txt index fd5d00bac447..f12b4a7b8406 100644 --- a/scripts/head-object-list.txt +++ b/scripts/head-object-list.txt @@ -23,7 +23,6 @@ arch/m68k/coldfire/head.o arch/m68k/kernel/head.o arch/m68k/kernel/sun3-head.o arch/microblaze/kernel/head.o -arch/mips/kernel/head.o arch/nios2/kernel/head.o arch/openrisc/kernel/head.o arch/parisc/kernel/head.o