Skip to content

Commit

Permalink
xen/x86: adjust data placement
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
jbeulich authored and jgross1 committed Oct 5, 2021
1 parent 59f7e53 commit 9c11112
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion arch/x86/xen/enlighten.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ EXPORT_SYMBOL_GPL(xen_have_vector_callback);
*/
enum xen_domain_type __ro_after_init xen_domain_type = XEN_NATIVE;
EXPORT_SYMBOL_GPL(xen_domain_type);
uint32_t xen_start_flags __section(".data") = 0;
uint32_t __ro_after_init xen_start_flags;
EXPORT_SYMBOL(xen_start_flags);

/*
Expand Down
6 changes: 4 additions & 2 deletions arch/x86/xen/enlighten_pvh.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
#include <linux/acpi.h>
#include <linux/export.h>

#include <xen/hvc-console.h>

Expand All @@ -18,10 +19,11 @@
/*
* PVH variables.
*
* The variable xen_pvh needs to live in the data segment since it is used
* The variable xen_pvh needs to live in a data segment since it is used
* after startup_{32|64} is invoked, which will clear the .bss segment.
*/
bool xen_pvh __section(".data") = 0;
bool __ro_after_init xen_pvh;
EXPORT_SYMBOL_GPL(xen_pvh);

void __init xen_pvh_init(struct boot_params *boot_params)
{
Expand Down

0 comments on commit 9c11112

Please sign in to comment.