Skip to content

Commit 9c11112

Browse files
jbeulichjgross1
authored andcommitted
xen/x86: adjust data placement
Both xen_pvh and xen_start_flags get written just once early during init. Using the respective annotation then allows the open-coded placing in .data to go away. Additionally the former, like the latter, wants exporting, or else xen_pvh_domain() can't be used from modules. Signed-off-by: Jan Beulich <[email protected]> Reviewed-by: Juergen Gross <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Juergen Gross <[email protected]>
1 parent 59f7e53 commit 9c11112

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

arch/x86/xen/enlighten.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ EXPORT_SYMBOL_GPL(xen_have_vector_callback);
7575
*/
7676
enum xen_domain_type __ro_after_init xen_domain_type = XEN_NATIVE;
7777
EXPORT_SYMBOL_GPL(xen_domain_type);
78-
uint32_t xen_start_flags __section(".data") = 0;
78+
uint32_t __ro_after_init xen_start_flags;
7979
EXPORT_SYMBOL(xen_start_flags);
8080

8181
/*

arch/x86/xen/enlighten_pvh.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0
22
#include <linux/acpi.h>
3+
#include <linux/export.h>
34

45
#include <xen/hvc-console.h>
56

@@ -18,10 +19,11 @@
1819
/*
1920
* PVH variables.
2021
*
21-
* The variable xen_pvh needs to live in the data segment since it is used
22+
* The variable xen_pvh needs to live in a data segment since it is used
2223
* after startup_{32|64} is invoked, which will clear the .bss segment.
2324
*/
24-
bool xen_pvh __section(".data") = 0;
25+
bool __ro_after_init xen_pvh;
26+
EXPORT_SYMBOL_GPL(xen_pvh);
2527

2628
void __init xen_pvh_init(struct boot_params *boot_params)
2729
{

0 commit comments

Comments
 (0)