On 06/06/2023 6:23 pm, Roger Pau Monne wrote:
> diff --git a/xen/arch/x86/include/asm/alternative.h 
> b/xen/arch/x86/include/asm/alternative.h
> index a1cd6a9fe5b8..688b554099b3 100644
> --- a/xen/arch/x86/include/asm/alternative.h
> +++ b/xen/arch/x86/include/asm/alternative.h
> @@ -24,7 +24,9 @@ struct __packed alt_instr {
>  
>  extern void add_nops(void *insns, unsigned int len);
>  /* Similar to alternative_instructions except it can be run with IRQs 
> enabled. */
> +#ifdef CONFIG_LIVEPATCH
>  extern void apply_alternatives(struct alt_instr *start, struct alt_instr 
> *end);
> +#endif

Given that this is called by common code, it shouldn't live in an
arch-specific header, and it absolutely shouldn't live identically in 2
different arch's header files.

As this is a cleanup patch, we should gain a xen/alternative.h which
depending on CONFIG_ALTERNATIVE includes asm/alternative.h

This will help RISC-V too (a little).

~Andrew

Reply via email to