]> xenbits.xensource.com Git - people/dariof/xen.git/commitdiff
arm/alternatives: Drop the !HAS_ALTERNATIVE infrastructure
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 30 Jan 2018 11:08:45 +0000 (11:08 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 1 Feb 2018 10:54:10 +0000 (10:54 +0000)
ARM now unconditionally selects HAS_ALTERNATIVE, which has caused the
!HAS_ALTERNATIVE code in include/asm-arm/alternative.h to bitrot to the point
of failing to compile.

Expand all the CONFIG_HAS_ALTERNATIVE references in ARM code.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
xen/arch/arm/xen.lds.S
xen/include/asm-arm/alternative.h
xen/include/asm-arm/cpuerrata.h
xen/test/livepatch/xen_hello_world_func.c

index c9b9546435e76a7bc6773795a7d020539a589f9e..b0390180b4bd20784f9bcfd602960ac4e2d4ae6b 100644 (file)
@@ -154,14 +154,12 @@ SECTIONS
        *(.initcall1.init)
        __initcall_end = .;
 
-#ifdef CONFIG_HAS_ALTERNATIVE
        . = ALIGN(4);
        __alt_instructions = .;
        *(.altinstructions)
        __alt_instructions_end = .;
        . = ALIGN(4);
        *(.altinstr_replacement)
-#endif
 
        *(.init.data)
        *(.init.data.rel)
index 6cc9d0dc5f68f5802324e28efece2e3b6158f6bb..4e33d1cdf7088a72de03211bf3670a535d1e62b1 100644 (file)
@@ -3,8 +3,6 @@
 
 #include <asm/cpufeature.h>
 
-#ifdef CONFIG_HAS_ALTERNATIVE
-
 #ifndef __ASSEMBLY__
 
 #include <xen/init.h>
@@ -152,17 +150,4 @@ int apply_alternatives(const struct alt_instr *start, const struct alt_instr *en
 #define ALTERNATIVE(oldinstr, newinstr, ...)   \
        _ALTERNATIVE_CFG(oldinstr, newinstr, __VA_ARGS__, 1)
 
-#else /* !CONFIG_HAS_ALTERNATIVE */
-
-static inline void apply_alternatives_all(void)
-{
-}
-
-static inline int apply_alternatives(void *start, size_t length)
-{
-    return 0;
-}
-
-#endif
-
 #endif /* __ASM_ALTERNATIVE_H */
index 7de68361ff2c7d8ff47e674ac52829b3e41355ce..4e45b237c871339f4578d707cbf48898dacb4e29 100644 (file)
@@ -7,8 +7,6 @@
 void check_local_cpu_errata(void);
 void enable_errata_workarounds(void);
 
-#ifdef CONFIG_HAS_ALTERNATIVE
-
 #define CHECK_WORKAROUND_HELPER(erratum, feature, arch)         \
 static inline bool check_workaround_##erratum(void)             \
 {                                                               \
@@ -27,19 +25,6 @@ static inline bool check_workaround_##erratum(void)             \
     }                                                           \
 }
 
-#else /* CONFIG_HAS_ALTERNATIVE */
-
-#define CHECK_WORKAROUND_HELPER(erratum, feature, arch)         \
-static inline bool check_workaround_##erratum(void)             \
-{                                                               \
-    if ( !IS_ENABLED(arch) )                                    \
-        return false;                                           \
-    else                                                        \
-        return unlikely(cpus_have_cap(feature));                \
-}
-
-#endif
-
 CHECK_WORKAROUND_HELPER(766422, ARM32_WORKAROUND_766422, CONFIG_ARM_32)
 CHECK_WORKAROUND_HELPER(834220, ARM64_WORKAROUND_834220, CONFIG_ARM_64)
 
index 1518f71e3ee8600596d9ffaaf9b64b770581357b..b358224e3ea054a79fd4146ebca9c1def4f0fb80 100644 (file)
@@ -29,7 +29,7 @@ const char *xen_hello_world(void)
     rc = __get_user(tmp, non_canonical_addr);
     BUG_ON(rc != -EFAULT);
 #endif
-#if defined(CONFIG_ARM) && defined(CONFIG_HAS_ALTERNATIVE)
+#if defined(CONFIG_ARM)
     asm(ALTERNATIVE("nop", "nop", LIVEPATCH_FEATURE));
 #endif