mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
xen: introduce Kconfig function alignment option
And use it to replace CODE_ALIGN in assembly. This allows to generalize the way the code alignment gets set across all architectures. No functional change intended. Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Reviewed-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Michal Orzel <michal.orzel@amd.com> Acked-by: Shawn Anastasio <sanastasio@raptorengineering.com>
This commit is contained in:
1 parent
84b9617c03
commit
ca7c872c70
10 files changed
+26
-13
No files matched your search
+17
@@ -37,6 +37,23 @@ config CC_HAS_VISIBILITY_ATTRIBUTE
|
||||
config CC_SPLIT_SECTIONS
|
||||
bool
|
||||
|
||||
# Set code alignment.
|
||||
#
|
||||
# Allow setting on a boolean basis, and then convert such selection to an
|
||||
# integer for the build system and code to consume more easily.
|
||||
config FUNCTION_ALIGNMENT_4B
|
||||
bool
|
||||
config FUNCTION_ALIGNMENT_8B
|
||||
bool
|
||||
config FUNCTION_ALIGNMENT_16B
|
||||
bool
|
||||
config FUNCTION_ALIGNMENT
|
||||
int
|
||||
default 16 if FUNCTION_ALIGNMENT_16B
|
||||
default 8 if FUNCTION_ALIGNMENT_8B
|
||||
default 4 if FUNCTION_ALIGNMENT_4B
|
||||
default 0
|
||||
|
||||
source "arch/$(SRCARCH)/Kconfig"
|
||||
|
||||
config DEFCONFIG_LIST
|
||||
|
||||
@@ -11,6 +11,7 @@ config ARM_64
|
||||
|
||||
config ARM
|
||||
def_bool y
|
||||
select FUNCTION_ALIGNMENT_4B
|
||||
select HAS_ALTERNATIVE
|
||||
select HAS_DEVICE_TREE
|
||||
select HAS_PASSTHROUGH
|
||||
|
||||
@@ -53,8 +53,7 @@
|
||||
|
||||
/* Linkage for ARM */
|
||||
#ifdef __ASSEMBLY__
|
||||
#define CODE_ALIGN 4
|
||||
#define ALIGN .balign CODE_ALIGN
|
||||
#define ALIGN .balign CONFIG_FUNCTION_ALIGNMENT
|
||||
#define ENTRY(name) \
|
||||
.globl name; \
|
||||
ALIGN; \
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
config PPC
|
||||
def_bool y
|
||||
select FUNCTION_ALIGNMENT_4B
|
||||
select HAS_DEVICE_TREE
|
||||
|
||||
config PPC64
|
||||
|
||||
@@ -30,11 +30,6 @@
|
||||
#define OPT_CONSOLE_STR "dtuart"
|
||||
#define INVALID_VCPU_ID MAX_VIRT_CPUS
|
||||
|
||||
/* Linkage for PPC */
|
||||
#ifdef __ASSEMBLY__
|
||||
#define CODE_ALIGN 4
|
||||
#endif
|
||||
|
||||
#define XEN_VIRT_START _AC(0xc000000000000000, UL)
|
||||
|
||||
/* Fixed address for start of the section containing exception vectors */
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
config RISCV
|
||||
def_bool y
|
||||
select FUNCTION_ALIGNMENT_16B
|
||||
|
||||
config RISCV_64
|
||||
def_bool y
|
||||
|
||||
@@ -132,7 +132,6 @@
|
||||
|
||||
/* Linkage for RISCV */
|
||||
#ifdef __ASSEMBLY__
|
||||
#define CODE_ALIGN 16
|
||||
#define CODE_FILL /* empty */
|
||||
#endif
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ config X86
|
||||
select ARCH_MAP_DOMAIN_PAGE
|
||||
select ARCH_SUPPORTS_INT128
|
||||
imply CORE_PARKING
|
||||
select FUNCTION_ALIGNMENT_16B
|
||||
select GENERIC_BUG_FRAME
|
||||
select HAS_ALTERNATIVE
|
||||
select HAS_COMPAT
|
||||
|
||||
@@ -43,9 +43,8 @@
|
||||
|
||||
/* Linkage for x86 */
|
||||
#ifdef __ASSEMBLY__
|
||||
#define CODE_ALIGN 16
|
||||
#define CODE_FILL 0x90
|
||||
#define ALIGN .align CODE_ALIGN, CODE_FILL
|
||||
#define ALIGN .align CONFIG_FUNCTION_ALIGNMENT, CODE_FILL
|
||||
#define ENTRY(name) \
|
||||
ALIGN; \
|
||||
GLOBAL(name)
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
#include <xen/macros.h>
|
||||
|
||||
/* CODE_ALIGN needs to be specified by every architecture. */
|
||||
#ifndef CODE_FILL
|
||||
# define CODE_FILL ~0
|
||||
#endif
|
||||
@@ -41,9 +40,10 @@
|
||||
*/
|
||||
#define count_args_exp(args...) count_args(args)
|
||||
#if count_args_exp(CODE_FILL)
|
||||
# define DO_CODE_ALIGN(align...) LASTARG(CODE_ALIGN, ## align), CODE_FILL
|
||||
# define DO_CODE_ALIGN(align...) LASTARG(CONFIG_FUNCTION_ALIGNMENT, ## align), \
|
||||
CODE_FILL
|
||||
#else
|
||||
# define DO_CODE_ALIGN(align...) LASTARG(CODE_ALIGN, ## align)
|
||||
# define DO_CODE_ALIGN(align...) LASTARG(CONFIG_FUNCTION_ALIGNMENT, ## align)
|
||||
#endif
|
||||
|
||||
#define FUNC(name, align...) \
|
||||
|
||||