mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thorsten Blum <blum@kernel.org>
To: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	Dexuan Cui <decui@microsoft.com>,
	Michael Kelley <mhklinux@outlook.com>,
	"Pratyush Yadav (Google)" <pratyush@kernel.org>,
	Yunhong Jiang <yunhong.jiang@linux.intel.com>,
	"Mike Rapoport (Microsoft)" <rppt@kernel.org>
Cc: Thorsten Blum <blum@kernel.org>,
	Ricardo Neri <ricardo.neri-calderon@linux.intel.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] x86/realmode: Use const and u32 for embedded real-mode data
Date: Thu,  5 Nov 2026 19:10:05 +0100	[thread overview]
Message-ID: <20261105181008.366331-2-blum@kernel.org> (raw)

Declare the embedded real-mode blob and relocation table as const since
they are not modified.

Also declare the relocation table as a u32 array since it contains
32-bit entries, and remove the cast in setup_real_mode().

No functional change.

Signed-off-by: Thorsten Blum <blum@kernel.org>
---
 arch/x86/include/asm/realmode.h | 6 +++---
 arch/x86/realmode/init.c        | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/x86/include/asm/realmode.h b/arch/x86/include/asm/realmode.h
index e406a1e92c63..e48259f2e503 100644
--- a/arch/x86/include/asm/realmode.h
+++ b/arch/x86/include/asm/realmode.h
@@ -57,7 +57,7 @@ struct trampoline_header {
 };
 
 extern struct real_mode_header *real_mode_header;
-extern unsigned char real_mode_blob_end[];
+extern const unsigned char real_mode_blob_end[];
 
 extern unsigned long initial_code;
 extern unsigned long initial_stack;
@@ -67,8 +67,8 @@ extern unsigned long initial_vc_handler;
 
 extern u32 *trampoline_lock;
 
-extern unsigned char real_mode_blob[];
-extern unsigned char real_mode_relocs[];
+extern const unsigned char real_mode_blob[];
+extern const u32 real_mode_relocs[];
 
 #ifdef CONFIG_X86_32
 extern unsigned char startup_32_smp[];
diff --git a/arch/x86/realmode/init.c b/arch/x86/realmode/init.c
index 65110b2ee1a1..5430314d549d 100644
--- a/arch/x86/realmode/init.c
+++ b/arch/x86/realmode/init.c
@@ -118,7 +118,7 @@ static void __init setup_real_mode(void)
 	phys_base = __pa(base);
 	real_mode_seg = phys_base >> 4;
 
-	rel = (u32 *) real_mode_relocs;
+	rel = real_mode_relocs;
 
 	/* 16-bit segment relocations. */
 	count = *rel++;

             reply	other threads:[~2026-11-05 18:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-05 18:10 Thorsten Blum [this message]
2026-11-05 18:19 ` H. Peter Anvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261105181008.366331-2-blum@kernel.org \
    --to=blum@kernel.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=decui@microsoft.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhklinux@outlook.com \
    --cc=mingo@redhat.com \
    --cc=pratyush@kernel.org \
    --cc=ricardo.neri-calderon@linux.intel.com \
    --cc=rppt@kernel.org \
    --cc=tglx@kernel.org \
    --cc=x86@kernel.org \
    --cc=yunhong.jiang@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®