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:
Roger Pau Monné authored and Jan Beulich committed 2024-02-27 10:17:59 +01:00
1 parent 84b9617c03
commit ca7c872c70
10 files changed
+26 -13

No files matched your search

+17
View File
@@ -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
+1
View File
@@ -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
+1 -2
View File
@@ -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
View File
@@ -1,5 +1,6 @@
config PPC
def_bool y
select FUNCTION_ALIGNMENT_4B
select HAS_DEVICE_TREE
config PPC64
-5
View File
@@ -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
View File
@@ -1,5 +1,6 @@
config RISCV
def_bool y
select FUNCTION_ALIGNMENT_16B
config RISCV_64
def_bool y
-1
View File
@@ -132,7 +132,6 @@
/* Linkage for RISCV */
#ifdef __ASSEMBLY__
#define CODE_ALIGN 16
#define CODE_FILL /* empty */
#endif
+1
View File
@@ -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
+1 -2
View File
@@ -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)
+3 -3
View File
@@ -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...) \
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.