2023-11-29 13:34:34

by Juergen Gross

[permalink] [raw]
Subject: [PATCH v5 0/5] 86/paravirt: Get rid of paravirt patching

This is a small series getting rid of paravirt patching by switching
completely to alternative patching for the same functionality.

The basic idea is to add the capability to switch from indirect to
direct calls via a special alternative patching option.

This removes _some_ of the paravirt macro maze, but most of it needs
to stay due to the need of hiding the call instructions from the
compiler in order to avoid needless register save/restore.

What is going away is the nasty stacking of alternative and paravirt
patching and (of course) the special .parainstructions linker section.

I have tested the series on bare metal and as Xen PV domain to still
work.

Note that objtool might need some changes to cope with the new
indirect call patching mechanism. Additionally some paravirt handling
can probably be removed from it.

Changes in V5:
- addressed Boris' comments
- rebased on top of the tip/master branch

Changes in V4:
- addressed Boris' comments in patch 1
- fixed bugs found by kernel test robot (patch 2)

Changes in V3:
- split v2 patch 3 into 2 patches as requested by Peter and Ingo

Changes in V2:
- split last patch into 2
- rebase of patch 2 as suggested by Peter
- addressed Peter's comments for patch 3

Juergen Gross (5):
x86/paravirt: introduce ALT_NOT_XEN
x86/paravirt: move some functions and defines to alternative
x86/alternative: add indirect call patching
x86/paravirt: switch mixed paravirt/alternative calls to alternative_2
x86/paravirt: remove no longer needed paravirt patching code

arch/x86/include/asm/alternative.h | 30 +++++-
arch/x86/include/asm/paravirt.h | 77 ++++---------
arch/x86/include/asm/paravirt_types.h | 85 +++++----------
arch/x86/include/asm/qspinlock_paravirt.h | 4 +-
arch/x86/include/asm/text-patching.h | 12 ---
arch/x86/kernel/alternative.c | 125 ++++++++++------------
arch/x86/kernel/callthunks.c | 17 ++-
arch/x86/kernel/kvm.c | 4 +-
arch/x86/kernel/module.c | 20 +---
arch/x86/kernel/paravirt.c | 54 ++--------
arch/x86/kernel/vmlinux.lds.S | 13 ---
arch/x86/tools/relocs.c | 2 +-
arch/x86/xen/irq.c | 2 +-
13 files changed, 161 insertions(+), 284 deletions(-)

--
2.35.3


2023-11-29 13:35:03

by Juergen Gross

[permalink] [raw]
Subject: [PATCH v5 4/5] x86/paravirt: switch mixed paravirt/alternative calls to alternative_2

Instead of stacking alternative and paravirt patching, use the new
ALT_FLAG_CALL flag to switch those mixed calls to pure alternative
handling.

This eliminates the need to be careful regarding the sequence of
alternative and paravirt patching.

Signed-off-by: Juergen Gross <[email protected]>
Acked-by: Peter Zijlstra (Intel) <[email protected]>
---
V5:
- remove no longer needed extern declarations from alternative.c
(Boris Petkov)
- add comment about ALTERNATIVE[_2]() macro usage (Boris Petkov)
- rebase to tip/master (Boris Petkov)
---
arch/x86/include/asm/alternative.h | 5 ++--
arch/x86/include/asm/paravirt.h | 9 ++++--
arch/x86/include/asm/paravirt_types.h | 40 +++++++++++++++------------
arch/x86/kernel/alternative.c | 1 -
arch/x86/kernel/callthunks.c | 17 ++++++------
arch/x86/kernel/module.c | 20 ++++----------
6 files changed, 44 insertions(+), 48 deletions(-)

diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alternative.h
index 472334eed6f3..fcd20c6dc7f9 100644
--- a/arch/x86/include/asm/alternative.h
+++ b/arch/x86/include/asm/alternative.h
@@ -89,6 +89,8 @@ struct alt_instr {
u8 replacementlen; /* length of new instruction */
} __packed;

+extern struct alt_instr __alt_instructions[], __alt_instructions_end[];
+
/*
* Debug flag that can be tested to see whether alternative
* instructions were patched in already:
@@ -104,11 +106,10 @@ extern void apply_fineibt(s32 *start_retpoline, s32 *end_retpoine,
s32 *start_cfi, s32 *end_cfi);

struct module;
-struct paravirt_patch_site;

struct callthunk_sites {
s32 *call_start, *call_end;
- struct paravirt_patch_site *pv_start, *pv_end;
+ struct alt_instr *alt_start, *alt_end;
};

#ifdef CONFIG_CALL_THUNKS
diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h
index f18bfa7f3070..88bb5c34a171 100644
--- a/arch/x86/include/asm/paravirt.h
+++ b/arch/x86/include/asm/paravirt.h
@@ -738,20 +738,23 @@ void native_pv_lock_init(void) __init;

#ifdef CONFIG_X86_64
#ifdef CONFIG_PARAVIRT_XXL
+#ifdef CONFIG_DEBUG_ENTRY

#define PARA_PATCH(off) ((off) / 8)
#define PARA_SITE(ptype, ops) _PVSITE(ptype, ops)
#define PARA_INDIRECT(addr) *addr(%rip)

-#ifdef CONFIG_DEBUG_ENTRY
.macro PARA_IRQ_save_fl
PARA_SITE(PARA_PATCH(PV_IRQ_save_fl),
ANNOTATE_RETPOLINE_SAFE;
call PARA_INDIRECT(pv_ops+PV_IRQ_save_fl);)
+ ANNOTATE_RETPOLINE_SAFE;
+ call PARA_INDIRECT(pv_ops+PV_IRQ_save_fl);
.endm

-#define SAVE_FLAGS ALTERNATIVE "PARA_IRQ_save_fl;", "pushf; pop %rax;", \
- ALT_NOT_XEN
+#define SAVE_FLAGS ALTERNATIVE_2 "PARA_IRQ_save_fl;", \
+ ALT_CALL_INSTR, ALT_CALL_ALWAYS, \
+ "pushf; pop %rax;", ALT_NOT_XEN
#endif
#endif /* CONFIG_PARAVIRT_XXL */
#endif /* CONFIG_X86_64 */
diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h
index 166e9618158f..9cad536fc08d 100644
--- a/arch/x86/include/asm/paravirt_types.h
+++ b/arch/x86/include/asm/paravirt_types.h
@@ -276,15 +276,11 @@ extern struct paravirt_patch_template pv_ops;
#define NATIVE_LABEL(a,x,b) "\n\t.globl " a #x "_" #b "\n" a #x "_" #b ":\n\t"

unsigned int paravirt_patch(u8 type, void *insn_buff, unsigned long addr, unsigned int len);
+#define paravirt_ptr(op) [paravirt_opptr] "m" (pv_ops.op)

int paravirt_disable_iospace(void);

-/*
- * This generates an indirect call based on the operation type number.
- * The type number, computed in PARAVIRT_PATCH, is derived from the
- * offset into the paravirt_patch_template structure, and can therefore be
- * freely converted back into a structure offset.
- */
+/* This generates an indirect call based on the operation type number. */
#define PARAVIRT_CALL \
ANNOTATE_RETPOLINE_SAFE \
"call *%[paravirt_opptr];"
@@ -317,12 +313,6 @@ int paravirt_disable_iospace(void);
* However, x86_64 also has to clobber all caller saved registers, which
* unfortunately, are quite a bit (r8 - r11)
*
- * The call instruction itself is marked by placing its start address
- * and size into the .parainstructions section, so that
- * apply_paravirt() in arch/i386/kernel/alternative.c can do the
- * appropriate patching under the control of the backend pv_init_ops
- * implementation.
- *
* Unfortunately there's no way to get gcc to generate the args setup
* for the call, and then allow the call itself to be generated by an
* inline asm. Because of this, we must do the complete arg setup and
@@ -421,14 +411,27 @@ int paravirt_disable_iospace(void);
__mask & __eax; \
})

-
+/*
+ * Use alternative patching for paravirt calls:
+ * - For replacing an indirect call with a direct one, use the "normal"
+ * ALTERNATIVE() macro with the indirect call as the initial code sequence,
+ * which will be replaced with the related direct call by using the
+ * ALT_FLAG_DIRECT_CALL special case and the "always on" feature.
+ * - In case the replacement is either a direct call or a short code sequence
+ * depending on a feature bit, the ALTERNATIVE_2() macro is being used.
+ * The indirect call is the initial code sequence again, while the special
+ * code sequence is selected with the specified feature bit. In case the
+ * feature is not active, the direct call is used as above via the
+ * ALT_FLAG_DIRECT_CALL special case and the "always on" feature.
+ */
#define ____PVOP_CALL(ret, op, call_clbr, extra_clbr, ...) \
({ \
PVOP_CALL_ARGS; \
PVOP_TEST_NULL(op); \
- asm volatile(paravirt_alt(PARAVIRT_CALL) \
+ asm volatile(ALTERNATIVE(PARAVIRT_CALL, ALT_CALL_INSTR, \
+ ALT_CALL_ALWAYS) \
: call_clbr, ASM_CALL_CONSTRAINT \
- : paravirt_type(op), \
+ : paravirt_ptr(op), \
##__VA_ARGS__ \
: "memory", "cc" extra_clbr); \
ret; \
@@ -439,10 +442,11 @@ int paravirt_disable_iospace(void);
({ \
PVOP_CALL_ARGS; \
PVOP_TEST_NULL(op); \
- asm volatile(ALTERNATIVE(paravirt_alt(PARAVIRT_CALL), \
- alt, cond) \
+ asm volatile(ALTERNATIVE_2(PARAVIRT_CALL, \
+ ALT_CALL_INSTR, ALT_CALL_ALWAYS, \
+ alt, cond) \
: call_clbr, ASM_CALL_CONSTRAINT \
- : paravirt_type(op), \
+ : paravirt_ptr(op), \
##__VA_ARGS__ \
: "memory", "cc" extra_clbr); \
ret; \
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index e7e53b9e801b..1f605079f982 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -160,7 +160,6 @@ extern s32 __retpoline_sites[], __retpoline_sites_end[];
extern s32 __return_sites[], __return_sites_end[];
extern s32 __cfi_sites[], __cfi_sites_end[];
extern s32 __ibt_endbr_seal[], __ibt_endbr_seal_end[];
-extern struct alt_instr __alt_instructions[], __alt_instructions_end[];
extern s32 __smp_locks[], __smp_locks_end[];
void text_poke_early(void *addr, const void *opcode, size_t len);

diff --git a/arch/x86/kernel/callthunks.c b/arch/x86/kernel/callthunks.c
index 57e5c2e75c2a..64ad2ddea121 100644
--- a/arch/x86/kernel/callthunks.c
+++ b/arch/x86/kernel/callthunks.c
@@ -233,14 +233,13 @@ patch_call_sites(s32 *start, s32 *end, const struct core_text *ct)
}

static __init_or_module void
-patch_paravirt_call_sites(struct paravirt_patch_site *start,
- struct paravirt_patch_site *end,
- const struct core_text *ct)
+patch_alt_call_sites(struct alt_instr *start, struct alt_instr *end,
+ const struct core_text *ct)
{
- struct paravirt_patch_site *p;
+ struct alt_instr *a;

- for (p = start; p < end; p++)
- patch_call((void *)&p->instr_offset + p->instr_offset, ct);
+ for (a = start; a < end; a++)
+ patch_call((void *)&a->instr_offset + a->instr_offset, ct);
}

static __init_or_module void
@@ -248,7 +247,7 @@ callthunks_setup(struct callthunk_sites *cs, const struct core_text *ct)
{
prdbg("Patching call sites %s\n", ct->name);
patch_call_sites(cs->call_start, cs->call_end, ct);
- patch_paravirt_call_sites(cs->pv_start, cs->pv_end, ct);
+ patch_alt_call_sites(cs->alt_start, cs->alt_end, ct);
prdbg("Patching call sites done%s\n", ct->name);
}

@@ -257,8 +256,8 @@ void __init callthunks_patch_builtin_calls(void)
struct callthunk_sites cs = {
.call_start = __call_sites,
.call_end = __call_sites_end,
- .pv_start = __parainstructions,
- .pv_end = __parainstructions_end
+ .alt_start = __alt_instructions,
+ .alt_end = __alt_instructions_end
};

if (!cpu_feature_enabled(X86_FEATURE_CALL_DEPTH))
diff --git a/arch/x86/kernel/module.c b/arch/x86/kernel/module.c
index 5f71a0cf4399..e18914c0e38a 100644
--- a/arch/x86/kernel/module.c
+++ b/arch/x86/kernel/module.c
@@ -276,7 +276,7 @@ int module_finalize(const Elf_Ehdr *hdr,
struct module *me)
{
const Elf_Shdr *s, *alt = NULL, *locks = NULL,
- *para = NULL, *orc = NULL, *orc_ip = NULL,
+ *orc = NULL, *orc_ip = NULL,
*retpolines = NULL, *returns = NULL, *ibt_endbr = NULL,
*calls = NULL, *cfi = NULL;
char *secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
@@ -286,8 +286,6 @@ int module_finalize(const Elf_Ehdr *hdr,
alt = s;
if (!strcmp(".smp_locks", secstrings + s->sh_name))
locks = s;
- if (!strcmp(".parainstructions", secstrings + s->sh_name))
- para = s;
if (!strcmp(".orc_unwind", secstrings + s->sh_name))
orc = s;
if (!strcmp(".orc_unwind_ip", secstrings + s->sh_name))
@@ -304,14 +302,6 @@ int module_finalize(const Elf_Ehdr *hdr,
ibt_endbr = s;
}

- /*
- * See alternative_instructions() for the ordering rules between the
- * various patching types.
- */
- if (para) {
- void *pseg = (void *)para->sh_addr;
- apply_paravirt(pseg, pseg + para->sh_size);
- }
if (retpolines || cfi) {
void *rseg = NULL, *cseg = NULL;
unsigned int rsize = 0, csize = 0;
@@ -341,7 +331,7 @@ int module_finalize(const Elf_Ehdr *hdr,
void *aseg = (void *)alt->sh_addr;
apply_alternatives(aseg, aseg + alt->sh_size);
}
- if (calls || para) {
+ if (calls || alt) {
struct callthunk_sites cs = {};

if (calls) {
@@ -349,9 +339,9 @@ int module_finalize(const Elf_Ehdr *hdr,
cs.call_end = (void *)calls->sh_addr + calls->sh_size;
}

- if (para) {
- cs.pv_start = (void *)para->sh_addr;
- cs.pv_end = (void *)para->sh_addr + para->sh_size;
+ if (alt) {
+ cs.alt_start = (void *)alt->sh_addr;
+ cs.alt_end = (void *)alt->sh_addr + alt->sh_size;
}

callthunks_patch_module_calls(&cs, me);
--
2.35.3

2023-11-29 13:35:20

by Juergen Gross

[permalink] [raw]
Subject: [PATCH v5 5/5] x86/paravirt: remove no longer needed paravirt patching code

Now that paravirt is using the alternatives patching infrastructure,
remove the paravirt patching code.

Signed-off-by: Juergen Gross <[email protected]>
Acked-by: Peter Zijlstra (Intel) <[email protected]>
---
arch/x86/include/asm/paravirt.h | 16 -------
arch/x86/include/asm/paravirt_types.h | 38 ---------------
arch/x86/include/asm/text-patching.h | 12 -----
arch/x86/kernel/alternative.c | 67 +--------------------------
arch/x86/kernel/paravirt.c | 30 ------------
arch/x86/kernel/vmlinux.lds.S | 13 ------
arch/x86/tools/relocs.c | 2 +-
7 files changed, 3 insertions(+), 175 deletions(-)

diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h
index 88bb5c34a171..f09acce9432c 100644
--- a/arch/x86/include/asm/paravirt.h
+++ b/arch/x86/include/asm/paravirt.h
@@ -725,29 +725,13 @@ void native_pv_lock_init(void) __init;

#else /* __ASSEMBLY__ */

-#define _PVSITE(ptype, ops) \
-771:; \
- ops; \
-772:; \
- .pushsection .parainstructions,"a"; \
- .long 771b-.; \
- .byte ptype; \
- .byte 772b-771b; \
- .popsection
-
-
#ifdef CONFIG_X86_64
#ifdef CONFIG_PARAVIRT_XXL
#ifdef CONFIG_DEBUG_ENTRY

-#define PARA_PATCH(off) ((off) / 8)
-#define PARA_SITE(ptype, ops) _PVSITE(ptype, ops)
#define PARA_INDIRECT(addr) *addr(%rip)

.macro PARA_IRQ_save_fl
- PARA_SITE(PARA_PATCH(PV_IRQ_save_fl),
- ANNOTATE_RETPOLINE_SAFE;
- call PARA_INDIRECT(pv_ops+PV_IRQ_save_fl);)
ANNOTATE_RETPOLINE_SAFE;
call PARA_INDIRECT(pv_ops+PV_IRQ_save_fl);
.endm
diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h
index 9cad536fc08d..d8e85d2cf8d5 100644
--- a/arch/x86/include/asm/paravirt_types.h
+++ b/arch/x86/include/asm/paravirt_types.h
@@ -2,15 +2,6 @@
#ifndef _ASM_X86_PARAVIRT_TYPES_H
#define _ASM_X86_PARAVIRT_TYPES_H

-#ifndef __ASSEMBLY__
-/* These all sit in the .parainstructions section to tell us what to patch. */
-struct paravirt_patch_site {
- s32 instr_offset; /* original instructions */
- u8 type; /* type of this instruction */
- u8 len; /* length of original instruction */
-} __packed;
-#endif
-
#ifdef CONFIG_PARAVIRT

#ifndef __ASSEMBLY__
@@ -250,32 +241,6 @@ struct paravirt_patch_template {
extern struct pv_info pv_info;
extern struct paravirt_patch_template pv_ops;

-#define PARAVIRT_PATCH(x) \
- (offsetof(struct paravirt_patch_template, x) / sizeof(void *))
-
-#define paravirt_type(op) \
- [paravirt_typenum] "i" (PARAVIRT_PATCH(op)), \
- [paravirt_opptr] "m" (pv_ops.op)
-/*
- * Generate some code, and mark it as patchable by the
- * apply_paravirt() alternate instruction patcher.
- */
-#define _paravirt_alt(insn_string, type) \
- "771:\n\t" insn_string "\n" "772:\n" \
- ".pushsection .parainstructions,\"a\"\n" \
- " .long 771b-.\n" \
- " .byte " type "\n" \
- " .byte 772b-771b\n" \
- ".popsection\n"
-
-/* Generate patchable code, with the default asm parameters. */
-#define paravirt_alt(insn_string) \
- _paravirt_alt(insn_string, "%c[paravirt_typenum]")
-
-/* Simple instruction patching code. */
-#define NATIVE_LABEL(a,x,b) "\n\t.globl " a #x "_" #b "\n" a #x "_" #b ":\n\t"
-
-unsigned int paravirt_patch(u8 type, void *insn_buff, unsigned long addr, unsigned int len);
#define paravirt_ptr(op) [paravirt_opptr] "m" (pv_ops.op)

int paravirt_disable_iospace(void);
@@ -555,9 +520,6 @@ unsigned long pv_native_read_cr2(void);

#define paravirt_nop ((void *)nop_func)

-extern struct paravirt_patch_site __parainstructions[],
- __parainstructions_end[];
-
#endif /* __ASSEMBLY__ */

#define ALT_NOT_XEN ALT_NOT(X86_FEATURE_XENPV)
diff --git a/arch/x86/include/asm/text-patching.h b/arch/x86/include/asm/text-patching.h
index 29832c338cdc..0b70653a98c1 100644
--- a/arch/x86/include/asm/text-patching.h
+++ b/arch/x86/include/asm/text-patching.h
@@ -6,18 +6,6 @@
#include <linux/stddef.h>
#include <asm/ptrace.h>

-struct paravirt_patch_site;
-#ifdef CONFIG_PARAVIRT
-void apply_paravirt(struct paravirt_patch_site *start,
- struct paravirt_patch_site *end);
-#else
-static inline void apply_paravirt(struct paravirt_patch_site *start,
- struct paravirt_patch_site *end)
-{}
-#define __parainstructions NULL
-#define __parainstructions_end NULL
-#endif
-
/*
* Currently, the max observed size in the kernel code is
* JUMP_LABEL_NOP_SIZE/RELATIVEJUMP_SIZE, which are 5.
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index 1f605079f982..4781f781f7db 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -1467,48 +1467,6 @@ int alternatives_text_reserved(void *start, void *end)
}
#endif /* CONFIG_SMP */

-#ifdef CONFIG_PARAVIRT
-
-/* Use this to add nops to a buffer, then text_poke the whole buffer. */
-static void __init_or_module add_nops(void *insns, unsigned int len)
-{
- while (len > 0) {
- unsigned int noplen = len;
- if (noplen > ASM_NOP_MAX)
- noplen = ASM_NOP_MAX;
- memcpy(insns, x86_nops[noplen], noplen);
- insns += noplen;
- len -= noplen;
- }
-}
-
-void __init_or_module apply_paravirt(struct paravirt_patch_site *start,
- struct paravirt_patch_site *end)
-{
- struct paravirt_patch_site *p;
- char insn_buff[MAX_PATCH_LEN];
- u8 *instr;
-
- for (p = start; p < end; p++) {
- unsigned int used;
-
- instr = (u8 *)&p->instr_offset + p->instr_offset;
- BUG_ON(p->len > MAX_PATCH_LEN);
- /* prep the buffer with the original instructions */
- memcpy(insn_buff, instr, p->len);
- used = paravirt_patch(p->type, insn_buff, (unsigned long)instr, p->len);
-
- BUG_ON(used > p->len);
-
- /* Pad the rest with nops */
- add_nops(insn_buff + used, p->len - used);
- text_poke_early(instr, insn_buff, p->len);
- }
-}
-extern struct paravirt_patch_site __start_parainstructions[],
- __stop_parainstructions[];
-#endif /* CONFIG_PARAVIRT */
-
/*
* Self-test for the INT3 based CALL emulation code.
*
@@ -1644,28 +1602,11 @@ void __init alternative_instructions(void)
*/

/*
- * Paravirt patching and alternative patching can be combined to
- * replace a function call with a short direct code sequence (e.g.
- * by setting a constant return value instead of doing that in an
- * external function).
- * In order to make this work the following sequence is required:
- * 1. set (artificial) features depending on used paravirt
- * functions which can later influence alternative patching
- * 2. apply paravirt patching (generally replacing an indirect
- * function call with a direct one)
- * 3. apply alternative patching (e.g. replacing a direct function
- * call with a custom code sequence)
- * Doing paravirt patching after alternative patching would clobber
- * the optimization of the custom code with a function call again.
+ * Make sure to set (artificial) features depending on used paravirt
+ * functions which can later influence alternative patching.
*/
paravirt_set_cap();

- /*
- * First patch paravirt functions, such that we overwrite the indirect
- * call with the direct call.
- */
- apply_paravirt(__parainstructions, __parainstructions_end);
-
__apply_fineibt(__retpoline_sites, __retpoline_sites_end,
__cfi_sites, __cfi_sites_end, true);

@@ -1676,10 +1617,6 @@ void __init alternative_instructions(void)
apply_retpolines(__retpoline_sites, __retpoline_sites_end);
apply_returns(__return_sites, __return_sites_end);

- /*
- * Then patch alternatives, such that those paravirt calls that are in
- * alternatives can be overwritten by their immediate fragments.
- */
apply_alternatives(__alt_instructions, __alt_instructions_end);

/*
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index acc5b1004f0f..5358d43886ad 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -43,14 +43,6 @@ void __init default_banner(void)
pv_info.name);
}

-static unsigned paravirt_patch_call(void *insn_buff, const void *target,
- unsigned long addr, unsigned len)
-{
- __text_gen_insn(insn_buff, CALL_INSN_OPCODE,
- (void *)addr, target, CALL_INSN_SIZE);
- return CALL_INSN_SIZE;
-}
-
#ifdef CONFIG_PARAVIRT_XXL
DEFINE_ASM_FUNC(_paravirt_ident_64, "mov %rdi, %rax", .text);
DEFINE_ASM_FUNC(pv_native_save_fl, "pushf; pop %rax", .noinstr.text);
@@ -73,28 +65,6 @@ static void native_tlb_remove_table(struct mmu_gather *tlb, void *table)
tlb_remove_page(tlb, table);
}

-unsigned int paravirt_patch(u8 type, void *insn_buff, unsigned long addr,
- unsigned int len)
-{
- /*
- * Neat trick to map patch type back to the call within the
- * corresponding structure.
- */
- void *opfunc = *((void **)&pv_ops + type);
- unsigned ret;
-
- if (opfunc == NULL)
- /* If there's no function, patch it with BUG_func() */
- ret = paravirt_patch_call(insn_buff, BUG_func, addr, len);
- else if (opfunc == nop_func)
- ret = 0;
- else
- /* Otherwise call the function. */
- ret = paravirt_patch_call(insn_buff, opfunc, addr, len);
-
- return ret;
-}
-
struct static_key paravirt_steal_enabled;
struct static_key paravirt_steal_rq_enabled;

diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index 54a5596adaa6..a349dbfc6d5a 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -267,19 +267,6 @@ SECTIONS
}
#endif

- /*
- * start address and size of operations which during runtime
- * can be patched with virtualization friendly instructions or
- * baremetal native ones. Think page table operations.
- * Details in paravirt_types.h
- */
- . = ALIGN(8);
- .parainstructions : AT(ADDR(.parainstructions) - LOAD_OFFSET) {
- __parainstructions = .;
- *(.parainstructions)
- __parainstructions_end = .;
- }
-
#ifdef CONFIG_RETPOLINE
/*
* List of instructions that call/jmp/jcc to retpoline thunks
diff --git a/arch/x86/tools/relocs.c b/arch/x86/tools/relocs.c
index d30949e25ebd..a3bae2b24626 100644
--- a/arch/x86/tools/relocs.c
+++ b/arch/x86/tools/relocs.c
@@ -66,7 +66,7 @@ static const char * const sym_regex_kernel[S_NSYMTYPES] = {
[S_REL] =
"^(__init_(begin|end)|"
"__x86_cpu_dev_(start|end)|"
- "(__parainstructions|__alt_instructions)(_end)?|"
+ "__alt_instructions(_end)?|"
"(__iommu_table|__apicdrivers|__smp_locks)(_end)?|"
"__(start|end)_pci_.*|"
#if CONFIG_FW_LOADER
--
2.35.3

2023-12-06 14:15:31

by Borislav Petkov

[permalink] [raw]
Subject: Re: [PATCH v5 4/5] x86/paravirt: switch mixed paravirt/alternative calls to alternative_2

On Wed, Nov 29, 2023 at 02:33:31PM +0100, Juergen Gross wrote:
> Instead of stacking alternative and paravirt patching, use the new
> ALT_FLAG_CALL flag to switch those mixed calls to pure alternative
> handling.
>
> This eliminates the need to be careful regarding the sequence of
> alternative and paravirt patching.
>
> Signed-off-by: Juergen Gross <[email protected]>
> Acked-by: Peter Zijlstra (Intel) <[email protected]>
> ---
> V5:
> - remove no longer needed extern declarations from alternative.c
> (Boris Petkov)
> - add comment about ALTERNATIVE[_2]() macro usage (Boris Petkov)
> - rebase to tip/master (Boris Petkov)
> ---
> arch/x86/include/asm/alternative.h | 5 ++--
> arch/x86/include/asm/paravirt.h | 9 ++++--
> arch/x86/include/asm/paravirt_types.h | 40 +++++++++++++++------------
> arch/x86/kernel/alternative.c | 1 -
> arch/x86/kernel/callthunks.c | 17 ++++++------
> arch/x86/kernel/module.c | 20 ++++----------
> 6 files changed, 44 insertions(+), 48 deletions(-)

After this one: (.config is attached).

early console in setup code
[ 0.000000] Linux version 6.7.0-rc1+ (boris@zn) (gcc (Debian 12.2.0-9) 12.2.0, GNU ld (GNU Binutils for Debian) 2.41) #8 SMP PREEMPT_DYNAMIC Wed Dec 6 11:19:09 CET 2023
[ 0.000000] Command line: root=/dev/sda1 resume=/dev/sda2 debug ignore_loglevel log_buf_len=16M earlyprintk=ttyS0,115200 console=ttyS0,115200 console=tty0 no_console_suspend net.ifnames=0 debug-alternative=0x1
[ 0.000000] BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
[ 0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000007ffdffff] usable
[ 0.000000] BIOS-e820: [mem 0x000000007ffe0000-0x000000007fffffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000feffc000-0x00000000feffffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved
[ 0.000000] printk: debug: ignoring loglevel setting.
[ 0.000000] printk: legacy bootconsole [earlyser0] enabled
[ 0.000000] NX (Execute Disable) protection: active
[ 0.000000] APIC: Static calls initialized
[ 0.000000] SMBIOS 2.8 present.
[ 0.000000] DMI: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
[ 0.000000] Hypervisor detected: KVM
[ 0.000000] kvm-clock: Using msrs 4b564d01 and 4b564d00
[ 0.000001] kvm-clock: using sched offset of 1530064946 cycles
[ 0.000675] clocksource: kvm-clock: mask: 0xffffffffffffffff max_cycles: 0x1cd42e4dffb, max_idle_ns: 881590591483 ns
[ 0.002799] tsc: Detected 3699.996 MHz processor
[ 0.004360] e820: update [mem 0x00000000-0x00000fff] usable ==> reserved
[ 0.005222] e820: remove [mem 0x000a0000-0x000fffff] usable
[ 0.005940] last_pfn = 0x7ffe0 max_arch_pfn = 0x400000000
[ 0.006678] MTRR map: 4 entries (3 fixed + 1 variable; max 19), built from 8 variable MTRRs
[ 0.007750] x86/PAT: Configuration [0-7]: WB WC UC- UC WB WP UC- WT
[ 0.011229] found SMP MP-table at [mem 0x000f5b80-0x000f5b8f]
[ 0.011979] Using GB pages for direct mapping
[ 0.012711] ACPI: Early table checksum verification disabled
[ 0.013441] ACPI: RSDP 0x00000000000F59C0 000014 (v00 BOCHS )
[ 0.014188] ACPI: RSDT 0x000000007FFE1E93 000034 (v01 BOCHS BXPC 00000001 BXPC 00000001)
[ 0.015337] ACPI: FACP 0x000000007FFE1CCF 000074 (v01 BOCHS BXPC 00000001 BXPC 00000001)
[ 0.016895] ACPI: DSDT 0x000000007FFE0040 001C8F (v01 BOCHS BXPC 00000001 BXPC 00000001)
[ 0.017997] ACPI: FACS 0x000000007FFE0000 000040
[ 0.018614] ACPI: APIC 0x000000007FFE1D43 0000F0 (v01 BOCHS BXPC 00000001 BXPC 00000001)
[ 0.019724] ACPI: HPET 0x000000007FFE1E33 000038 (v01 BOCHS BXPC 00000001 BXPC 00000001)
[ 0.020822] ACPI: WAET 0x000000007FFE1E6B 000028 (v01 BOCHS BXPC 00000001 BXPC 00000001)
[ 0.021921] ACPI: Reserving FACP table memory at [mem 0x7ffe1ccf-0x7ffe1d42]
[ 0.022836] ACPI: Reserving DSDT table memory at [mem 0x7ffe0040-0x7ffe1cce]
[ 0.023743] ACPI: Reserving FACS table memory at [mem 0x7ffe0000-0x7ffe003f]
[ 0.024649] ACPI: Reserving APIC table memory at [mem 0x7ffe1d43-0x7ffe1e32]
[ 0.025555] ACPI: Reserving HPET table memory at [mem 0x7ffe1e33-0x7ffe1e6a]
[ 0.026468] ACPI: Reserving WAET table memory at [mem 0x7ffe1e6b-0x7ffe1e92]
[ 0.027413] No NUMA configuration found
[ 0.027908] Faking a node at [mem 0x0000000000000000-0x000000007ffdffff]
[ 0.028771] NODE_DATA(0) allocated [mem 0x7ffde000-0x7ffdffff]
[ 0.029579] Zone ranges:
[ 0.029906] DMA [mem 0x0000000000001000-0x0000000000ffffff]
[ 0.030761] DMA32 [mem 0x0000000001000000-0x000000007ffdffff]
[ 0.031554] Normal empty
[ 0.031850] Movable zone start for each node
[ 0.032257] Early memory node ranges
[ 0.032925] node 0: [mem 0x0000000000001000-0x000000000009efff]
[ 0.033527] node 0: [mem 0x0000000000100000-0x000000007ffdffff]
[ 0.034127] Initmem setup node 0 [mem 0x0000000000001000-0x000000007ffdffff]
[ 0.037037] On node 0, zone DMA: 1 pages in unavailable ranges
[ 0.037187] On node 0, zone DMA: 97 pages in unavailable ranges
[ 0.059277] On node 0, zone DMA32: 32 pages in unavailable ranges
[ 0.060137] ACPI: PM-Timer IO Port: 0x608
[ 0.061128] ACPI: LAPIC_NMI (acpi_id[0xff] dfl dfl lint[0x1])
[ 0.061710] IOAPIC[0]: apic_id 0, version 17, address 0xfec00000, GSI 0-23
[ 0.062439] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
[ 0.063051] ACPI: INT_SRC_OVR (bus 0 bus_irq 5 global_irq 5 high level)
[ 0.063695] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
[ 0.064334] ACPI: INT_SRC_OVR (bus 0 bus_irq 10 global_irq 10 high level)
[ 0.064993] ACPI: INT_SRC_OVR (bus 0 bus_irq 11 global_irq 11 high level)
[ 0.066019] ACPI: Using ACPI (MADT) for SMP configuration information
[ 0.066651] ACPI: HPET id: 0x8086a201 base: 0xfed00000
[ 0.067150] TSC deadline timer available
[ 0.067533] smpboot: Allowing 16 CPUs, 0 hotplug CPUs
[ 0.068031] kvm-guest: APIC: eoi() replaced with kvm_guest_apic_eoi_write()
[ 0.068719] kvm-guest: KVM setup pv remote TLB flush
[ 0.069211] kvm-guest: setup PV sched yield
[ 0.069623] PM: hibernation: Registered nosave memory: [mem 0x00000000-0x00000fff]
[ 0.070361] PM: hibernation: Registered nosave memory: [mem 0x0009f000-0x0009ffff]
[ 0.071087] PM: hibernation: Registered nosave memory: [mem 0x000a0000-0x000effff]
[ 0.071808] PM: hibernation: Registered nosave memory: [mem 0x000f0000-0x000fffff]
[ 0.072536] [mem 0x80000000-0xfeffbfff] available for PCI devices
[ 0.073121] Booting paravirtualized kernel on KVM
[ 0.073578] clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645519600211568 ns
[ 0.077806] setup_percpu: NR_CPUS:16 nr_cpumask_bits:16 nr_cpu_ids:16 nr_node_ids:1
[ 0.081707] percpu: Embedded 60 pages/cpu s208896 r8192 d28672 u262144
[ 0.082367] pcpu-alloc: s208896 r8192 d28672 u262144 alloc=1*2097152
[ 0.083338] pcpu-alloc: [0] 00 01 02 03 04 05 06 07 [0] 08 09 10 11 12 13 14 15
[ 0.084087] kvm-guest: PV spinlocks enabled
[ 0.084508] PV qspinlock hash table entries: 256 (order: 0, 4096 bytes, linear)
[ 0.085251] Kernel command line: root=/dev/sda1 resume=/dev/sda2 debug ignore_loglevel log_buf_len=16M earlyprintk=ttyS0,115200 console=ttyS0,115200 console=tty0 no_console_suspend net.ifnames=0 debug-alternative=0x1
[ 0.087276] random: crng init done
[ 0.088913] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes, linear)
[ 0.090257] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[ 0.091093] Fallback order for Node 0: 0
[ 0.091100] Built 1 zonelists, mobility grouping on. Total pages: 515808
[ 0.092179] Policy zone: DMA32
[ 0.092484] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.096016] Memory: 1877780K/2096632K available (14336K kernel code, 116149K rwdata, 5240K rodata, 2864K init, 35484K bss, 218596K reserved, 0K cma-reserved)
[ 0.097598] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=16, Nodes=1
[ 0.098278] ftrace: allocating 38262 entries in 150 pages
[ 0.104138] ftrace: allocated 150 pages with 4 groups
[ 0.104716] Dynamic Preempt: full
[ 0.105101] rcu: Preemptible hierarchical RCU implementation.
[ 0.105679] Trampoline variant of Tasks RCU enabled.
[ 0.106184] Rude variant of Tasks RCU enabled.
[ 0.106689] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[ 0.109444] NR_IRQS: 4352, nr_irqs: 552, preallocated irqs: 16
[ 0.110209] rcu: srcu_init: Setting srcu_struct sizes based on contention.
[ 0.119199] Console: colour VGA+ 80x25
[ 0.119575] printk: legacy console [tty0] enabled
[ 0.120169] printk: legacy bootconsole [earlyser0] disabled
[ 0.000000] Linux version 6.7.0-rc1+ (boris@zn) (gcc (Debian 12.2.0-9) 12.2.0, GNU ld (GNU Binutils for Debian) 2.41) #8 SMP PREEMPT_DYNAMIC Wed Dec 6 11:19:09 CET 2023
[ 0.000000] Command line: root=/dev/sda1 resume=/dev/sda2 debug ignore_loglevel log_buf_len=16M earlyprintk=ttyS0,115200 console=ttyS0,115200 console=tty0 no_console_suspend net.ifnames=0 debug-alternative=0x1
[ 0.000000] BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
[ 0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000007ffdffff] usable
[ 0.000000] BIOS-e820: [mem 0x000000007ffe0000-0x000000007fffffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000feffc000-0x00000000feffffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved
[ 0.000000] printk: debug: ignoring loglevel setting.
[ 0.000000] printk: legacy bootconsole [earlyser0] enabled
[ 0.000000] NX (Execute Disable) protection: active
[ 0.000000] APIC: Static calls initialized
[ 0.000000] SMBIOS 2.8 present.
[ 0.000000] DMI: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
[ 0.000000] Hypervisor detected: KVM
[ 0.000000] kvm-clock: Using msrs 4b564d01 and 4b564d00
[ 0.000001] kvm-clock: using sched offset of 1530064946 cycles
[ 0.000675] clocksource: kvm-clock: mask: 0xffffffffffffffff max_cycles: 0x1cd42e4dffb, max_idle_ns: 881590591483 ns
[ 0.002799] tsc: Detected 3699.996 MHz processor
[ 0.004360] e820: update [mem 0x00000000-0x00000fff] usable ==> reserved
[ 0.005222] e820: remove [mem 0x000a0000-0x000fffff] usable
[ 0.005940] last_pfn = 0x7ffe0 max_arch_pfn = 0x400000000
[ 0.006678] MTRR map: 4 entries (3 fixed + 1 variable; max 19), built from 8 variable MTRRs
[ 0.007750] x86/PAT: Configuration [0-7]: WB WC UC- UC WB WP UC- WT
[ 0.011229] found SMP MP-table at [mem 0x000f5b80-0x000f5b8f]
[ 0.011979] Using GB pages for direct mapping
[ 0.012711] ACPI: Early table checksum verification disabled
[ 0.013441] ACPI: RSDP 0x00000000000F59C0 000014 (v00 BOCHS )
[ 0.014188] ACPI: RSDT 0x000000007FFE1E93 000034 (v01 BOCHS BXPC 00000001 BXPC 00000001)
[ 0.015337] ACPI: FACP 0x000000007FFE1CCF 000074 (v01 BOCHS BXPC 00000001 BXPC 00000001)
[ 0.016895] ACPI: DSDT 0x000000007FFE0040 001C8F (v01 BOCHS BXPC 00000001 BXPC 00000001)
[ 0.017997] ACPI: FACS 0x000000007FFE0000 000040
[ 0.018614] ACPI: APIC 0x000000007FFE1D43 0000F0 (v01 BOCHS BXPC 00000001 BXPC 00000001)
[ 0.019724] ACPI: HPET 0x000000007FFE1E33 000038 (v01 BOCHS BXPC 00000001 BXPC 00000001)
[ 0.020822] ACPI: WAET 0x000000007FFE1E6B 000028 (v01 BOCHS BXPC 00000001 BXPC 00000001)
[ 0.021921] ACPI: Reserving FACP table memory at [mem 0x7ffe1ccf-0x7ffe1d42]
[ 0.022836] ACPI: Reserving DSDT table memory at [mem 0x7ffe0040-0x7ffe1cce]
[ 0.023743] ACPI: Reserving FACS table memory at [mem 0x7ffe0000-0x7ffe003f]
[ 0.024649] ACPI: Reserving APIC table memory at [mem 0x7ffe1d43-0x7ffe1e32]
[ 0.025555] ACPI: Reserving HPET table memory at [mem 0x7ffe1e33-0x7ffe1e6a]
[ 0.026468] ACPI: Reserving WAET table memory at [mem 0x7ffe1e6b-0x7ffe1e92]
[ 0.027413] No NUMA configuration found
[ 0.027908] Faking a node at [mem 0x0000000000000000-0x000000007ffdffff]
[ 0.028771] NODE_DATA(0) allocated [mem 0x7ffde000-0x7ffdffff]
[ 0.029579] Zone ranges:
[ 0.029906] DMA [mem 0x0000000000001000-0x0000000000ffffff]
[ 0.030761] DMA32 [mem 0x0000000001000000-0x000000007ffdffff]
[ 0.031554] Normal empty
[ 0.031850] Movable zone start for each node
[ 0.032257] Early memory node ranges
[ 0.032925] node 0: [mem 0x0000000000001000-0x000000000009efff]
[ 0.033527] node 0: [mem 0x0000000000100000-0x000000007ffdffff]
[ 0.034127] Initmem setup node 0 [mem 0x0000000000001000-0x000000007ffdffff]
[ 0.037037] On node 0, zone DMA: 1 pages in unavailable ranges
[ 0.037187] On node 0, zone DMA: 97 pages in unavailable ranges
[ 0.059277] On node 0, zone DMA32: 32 pages in unavailable ranges
[ 0.060137] ACPI: PM-Timer IO Port: 0x608
[ 0.061128] ACPI: LAPIC_NMI (acpi_id[0xff] dfl dfl lint[0x1])
[ 0.061710] IOAPIC[0]: apic_id 0, version 17, address 0xfec00000, GSI 0-23
[ 0.062439] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
[ 0.063051] ACPI: INT_SRC_OVR (bus 0 bus_irq 5 global_irq 5 high level)
[ 0.063695] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
[ 0.064334] ACPI: INT_SRC_OVR (bus 0 bus_irq 10 global_irq 10 high level)
[ 0.064993] ACPI: INT_SRC_OVR (bus 0 bus_irq 11 global_irq 11 high level)
[ 0.066019] ACPI: Using ACPI (MADT) for SMP configuration information
[ 0.066651] ACPI: HPET id: 0x8086a201 base: 0xfed00000
[ 0.067150] TSC deadline timer available
[ 0.067533] smpboot: Allowing 16 CPUs, 0 hotplug CPUs
[ 0.068031] kvm-guest: APIC: eoi() replaced with kvm_guest_apic_eoi_write()
[ 0.068719] kvm-guest: KVM setup pv remote TLB flush
[ 0.069211] kvm-guest: setup PV sched yield
[ 0.069623] PM: hibernation: Registered nosave memory: [mem 0x00000000-0x00000fff]
[ 0.070361] PM: hibernation: Registered nosave memory: [mem 0x0009f000-0x0009ffff]
[ 0.071087] PM: hibernation: Registered nosave memory: [mem 0x000a0000-0x000effff]
[ 0.071808] PM: hibernation: Registered nosave memory: [mem 0x000f0000-0x000fffff]
[ 0.072536] [mem 0x80000000-0xfeffbfff] available for PCI devices
[ 0.073121] Booting paravirtualized kernel on KVM
[ 0.073578] clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645519600211568 ns
[ 0.077806] setup_percpu: NR_CPUS:16 nr_cpumask_bits:16 nr_cpu_ids:16 nr_node_ids:1
[ 0.081707] percpu: Embedded 60 pages/cpu s208896 r8192 d28672 u262144
[ 0.082367] pcpu-alloc: s208896 r8192 d28672 u262144 alloc=1*2097152
[ 0.083338] pcpu-alloc: [0] 00 01 02 03 04 05 06 07 [0] 08 09 10 11 12 13 14 15
[ 0.084087] kvm-guest: PV spinlocks enabled
[ 0.084508] PV qspinlock hash table entries: 256 (order: 0, 4096 bytes, linear)
[ 0.085251] Kernel command line: root=/dev/sda1 resume=/dev/sda2 debug ignore_loglevel log_buf_len=16M earlyprintk=ttyS0,115200 console=ttyS0,115200 console=tty0 no_console_suspend net.ifnames=0 debug-alternative=0x1
[ 0.087276] random: crng init done
[ 0.088913] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes, linear)
[ 0.090257] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[ 0.091093] Fallback order for Node 0: 0
[ 0.091100] Built 1 zonelists, mobility grouping on. Total pages: 515808
[ 0.092179] Policy zone: DMA32
[ 0.092484] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.096016] Memory: 1877780K/2096632K available (14336K kernel code, 116149K rwdata, 5240K rodata, 2864K init, 35484K bss, 218596K reserved, 0K cma-reserved)
[ 0.097598] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=16, Nodes=1
[ 0.098278] ftrace: allocating 38262 entries in 150 pages
[ 0.104138] ftrace: allocated 150 pages with 4 groups
[ 0.104716] Dynamic Preempt: full
[ 0.105101] rcu: Preemptible hierarchical RCU implementation.
[ 0.105679] Trampoline variant of Tasks RCU enabled.
[ 0.106184] Rude variant of Tasks RCU enabled.
[ 0.106689] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[ 0.109444] NR_IRQS: 4352, nr_irqs: 552, preallocated irqs: 16
[ 0.110209] rcu: srcu_init: Setting srcu_struct sizes based on contention.
[ 0.119199] Console: colour VGA+ 80x25
[ 0.119575] printk: legacy console [tty0] enabled
[ 0.120169] printk: legacy bootconsole [earlyser0] disabled
[ 0.120888] printk: legacy console [ttyS0] enabled
[ 0.193214] ACPI: Core revision 20230628
[ 0.193834] clocksource: hpet: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604467 ns
[ 0.195041] APIC: Switch to symmetric I/O mode setup
[ 0.195844] x2apic enabled
[ 0.196453] APIC: Switched APIC routing to: physical x2apic
[ 0.197169] kvm-guest: APIC: send_IPI_mask() replaced with kvm_send_ipi_mask()
[ 0.198075] kvm-guest: APIC: send_IPI_mask_allbutself() replaced with kvm_send_ipi_mask_allbutself()
[ 0.199236] kvm-guest: setup PV IPIs
[ 0.200612] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
[ 0.201683] tsc: Marking TSC unstable due to TSCs unsynchronized
[ 0.202828] Calibrating delay loop (skipped) preset value.. 7399.99 BogoMIPS (lpj=14799984)
[ 0.208119] AMD Zen1 DIV0 bug detected. Disable SMT for full protection.
[ 0.209425] Last level iTLB entries: 4KB 512, 2MB 255, 4MB 127
[ 0.210826] Last level dTLB entries: 4KB 512, 2MB 255, 4MB 127, 1GB 0
[ 0.212028] Spectre V1 : Mitigation: usercopy/swapgs barriers and __user pointer sanitization
[ 0.213631] Spectre V2 : Mitigation: Retpolines
[ 0.214514] Spectre V2 : Spectre v2 / SpectreRSB mitigation: Filling RSB on context switch
[ 0.216052] Spectre V2 : Spectre v2 / SpectreRSB : Filling RSB on VMEXIT
[ 0.217288] Spectre V2 : Enabling Speculation Barrier for firmware calls
[ 0.218530] RETBleed: Mitigation: untrained return thunk
[ 0.219619] Spectre V2 : mitigation: Enabling conditional Indirect Branch Prediction Barrier
[ 0.221725] Speculative Store Bypass: Mitigation: Speculative Store Bypass disabled via prctl
[ 0.222826] Speculative Return Stack Overflow: IBPB-extending microcode not applied!
[ 0.224311] Speculative Return Stack Overflow: WARNING: See https://kernel.org/doc/html/latest/admin-guide/hw-vuln/srso.html for mitigation options.
[ 0.224312] Speculative Return Stack Overflow: Vulnerable: Safe RET, no microcode
[ 0.228269] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
[ 0.230825] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
[ 0.231999] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
[ 0.233169] x86/fpu: xstate_offset[2]: 576, xstate_sizes[2]: 256
[ 0.234308] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.245557] SMP alternatives: alt table ffffffff89b2fe28, -> ffffffff89b47454
[ 0.246826] SMP alternatives: feat: 3*32+21, old: (start_kernel+0x43/0x6f0 (ffffffff898b79e3) len: 6), repl: (ffffffff89b47454, len: 5)
[ 0.248998] SMP alternatives: ffffffff82403da2: [5:6) optimized NOPs: e8 18 9c 1a f8 90
[ 0.250513] SMP alternatives: ffffffff898b79e3: old_insn: ff 15 2f 1c b7 f8
[ 0.251872] SMP alternatives: ffffffff89b47454: rpl_insn: e8 97 7e f1 f7
[ 0.253119] SMP alternatives: ffffffff898b79e3: final_insn: e8 18 9c 1a f8 90
[ 0.254828] SMP alternatives: feat: !8*32+16, old: (start_kernel+0x43/0x6f0 (ffffffff898b79e3) len: 6), repl: (ffffffff89b47459, len: 1)
[ 0.258827] SMP alternatives: ffffffff82403da2: [1:6) optimized NOPs: fa 0f 1f 44 00 00
[ 0.260331] SMP alternatives: ffffffff898b79e3: old_insn: e8 18 9c 1a f8 90
[ 0.261614] SMP alternatives: ffffffff89b47459: rpl_insn: fa
[ 0.262825] SMP alternatives: ffffffff898b79e3: final_insn: fa 0f 1f 44 00 00
[ 0.264110] SMP alternatives: feat: 3*32+21, old: (start_kernel+0x253/0x6f0 (ffffffff898b7bf3) len: 6), repl: (ffffffff89b4745a, len: 5)
[ 0.266290] SMP alternatives: ffffffff82403da2: [5:6) optimized NOPs: e8 e8 99 1a f8 90
[ 0.266825] SMP alternatives: ffffffff898b7bf3: old_insn: ff 15 17 1a b7 f8
[ 0.268108] SMP alternatives: ffffffff89b4745a: rpl_insn: e8 91 7e f1 f7
[ 0.269353] SMP alternatives: ffffffff898b7bf3: final_insn: e8 e8 99 1a f8 90
[ 0.270826] SMP alternatives: feat: !8*32+16, old: (start_kernel+0x253/0x6f0 (ffffffff898b7bf3) len: 6), repl: (ffffffff89b4745f, len: 2)
[ 0.273033] SMP alternatives: ffffffff82403da2: [2:6) optimized NOPs: 9c 58 0f 1f 40 00
[ 0.275988] SMP alternatives: ffffffff898b7bf3: old_insn: e8 e8 99 1a f8 90
[ 0.277270] SMP alternatives: ffffffff89b4745f: rpl_insn: 9c 58
[ 0.278388] SMP alternatives: ffffffff898b7bf3: final_insn: 9c 58 0f 1f 40 00
[ 0.279861] SMP alternatives: feat: 3*32+21, old: (start_kernel+0x2fc/0x6f0 (ffffffff898b7c9c) len: 6), repl: (ffffffff89b47461, len: 5)
[ 0.282052] SMP alternatives: ffffffff82403da2: [5:6) optimized NOPs: e8 3f 99 1a f8 90
[ 0.282826] SMP alternatives: ffffffff898b7c9c: old_insn: ff 15 6e 19 b7 f8
[ 0.284107] SMP alternatives: ffffffff89b47461: rpl_insn: e8 8a 7e f1 f7
[ 0.285350] SMP alternatives: ffffffff898b7c9c: final_insn: e8 3f 99 1a f8 90
[ 0.286826] SMP alternatives: feat: !8*32+16, old: (start_kernel+0x2fc/0x6f0 (ffffffff898b7c9c) len: 6), repl: (ffffffff89b47466, len: 2)
[ 0.289030] SMP alternatives: ffffffff82403da2: [2:6) optimized NOPs: 9c 58 0f 1f 40 00
[ 0.291987] SMP alternatives: ffffffff898b7c9c: old_insn: e8 3f 99 1a f8 90
[ 0.293268] SMP alternatives: ffffffff89b47466: rpl_insn: 9c 58
[ 0.294384] SMP alternatives: ffffffff898b7c9c: final_insn: 9c 58 0f 1f 40 00
[ 0.295861] SMP alternatives: feat: 3*32+21, old: (start_kernel+0x320/0x6f0 (ffffffff898b7cc0) len: 6), repl: (ffffffff89b47468, len: 5)
[ 0.298040] SMP alternatives: ffffffff82403da2: [5:6) optimized NOPs: e8 5b 99 1a f8 90
[ 0.298826] SMP alternatives: ffffffff898b7cc0: old_insn: ff 15 5a 19 b7 f8
[ 0.300110] SMP alternatives: ffffffff89b47468: rpl_insn: e8 83 7e f1 f7
[ 0.301355] SMP alternatives: ffffffff898b7cc0: final_insn: e8 5b 99 1a f8 90
[ 0.302826] SMP alternatives: feat: !8*32+16, old: (start_kernel+0x320/0x6f0 (ffffffff898b7cc0) len: 6), repl: (ffffffff89b4746d, len: 1)
[ 0.305553] SMP alternatives: ffffffff82403da2: [1:6) optimized NOPs: fb 0f 1f 44 00 00
[ 0.307998] SMP alternatives: ffffffff898b7cc0: old_insn: e8 5b 99 1a f8 90
[ 0.309282] SMP alternatives: ffffffff89b4746d: rpl_insn: fb
[ 0.310362] SMP alternatives: ffffffff898b7cc0: final_insn: fb 0f 1f 44 00 00
[ 0.311868] SMP alternatives: feat: 3*32+21, old: (start_kernel+0x641/0x6f0 (ffffffff898b7fe1) len: 6), repl: (ffffffff89b4746e, len: 5)
[ 0.314062] SMP alternatives: ffffffff82403da2: [5:6) optimized NOPs: e8 1a 96 1a f8 90
[ 0.314826] SMP alternatives: ffffffff898b7fe1: old_insn: ff 15 31 16 b7 f8
[ 0.316116] SMP alternatives: ffffffff89b4746e: rpl_insn: e8 7d 7e f1 f7
[ 0.317367] SMP alternatives: ffffffff898b7fe1: final_insn: e8 1a 96 1a f8 90
[ 0.318826] SMP alternatives: feat: !8*32+16, old: (start_kernel+0x641/0x6f0 (ffffffff898b7fe1) len: 6), repl: (ffffffff89b47473, len: 1)
[ 0.321548] SMP alternatives: ffffffff82403da2: [1:6) optimized NOPs: fa 0f 1f 44 00 00
[ 0.324001] SMP alternatives: ffffffff898b7fe1: old_insn: e8 1a 96 1a f8 90
[ 0.325283] SMP alternatives: ffffffff89b47473: rpl_insn: fa
[ 0.326357] SMP alternatives: ffffffff898b7fe1: final_insn: fa 0f 1f 44 00 00
[ 0.326826] SMP alternatives: feat: 3*32+21, old: (do_one_initcall+0x76/0x240 (ffffffff81001ac6) len: 6), repl: (ffffffff89b47474, len: 5)
[ 0.329053] SMP alternatives: ffffffff82403da2: [5:6) optimized NOPs: e8 15 fb a5 00 90
[ 0.330825] SMP alternatives: ffffffff81001ac6: old_insn: ff 15 44 7b 42 01
[ 0.332117] SMP alternatives: ffffffff89b47474: rpl_insn: e8 77 7e f1 f7
[ 0.333369] SMP alternatives: ffffffff81001ac6: final_insn: e8 15 fb a5 00 90
[ 0.334826] SMP alternatives: feat: !8*32+16, old: (do_one_initcall+0x76/0x240 (ffffffff81001ac6) len: 6), repl: (ffffffff89b47479, len: 2)
[ 0.337549] SMP alternatives: ffffffff82403da2: [2:6) optimized NOPs: 9c 58 0f 1f 40 00
[ 0.339987] SMP alternatives: ffffffff81001ac6: old_insn: e8 15 fb a5 00 90
[ 0.342827] SMP alternatives: ffffffff89b47479: rpl_insn: 9c 58
[ 0.344020] SMP alternatives: ffffffff81001ac6: final_insn: 9c 58 0f 1f 40 00
[ 0.346826] SMP alternatives: feat: 3*32+21, old: (do_one_initcall+0x1c0/0x240 (ffffffff81001c10) len: 6), repl: (ffffffff89b4747b, len: 5)
[ 0.349032] SMP alternatives: ffffffff82403da2: [5:6) optimized NOPs: e8 0b fa a5 00 90
[ 0.350826] SMP alternatives: ffffffff81001c10: old_insn: ff 15 0a 7a 42 01
[ 0.352102] SMP alternatives: ffffffff89b4747b: rpl_insn: e8 70 7e f1 f7
[ 0.353390] SMP alternatives: ffffffff81001c10: final_insn: e8 0b fa a5 00 90
[ 0.354826] SMP alternatives: feat: !8*32+16, old: (do_one_initcall+0x1c0/0x240 (ffffffff81001c10) len: 6), repl: (ffffffff89b47480, len: 1)
[ 0.357046] SMP alternatives: ffffffff82403da2: [1:6) optimized NOPs: fb 0f 1f 44 00 00
[ 0.358826] SMP alternatives: ffffffff81001c10: old_insn: e8 0b fa a5 00 90
[ 0.360841] SMP alternatives: ffffffff89b47480: rpl_insn: fb
[ 0.361925] SMP alternatives: ffffffff81001c10: final_insn: fb 0f 1f 44 00 00
[ 0.362826] SMP alternatives: feat: 3*32+21, old: (tdx_early_init+0x6e/0x160 (ffffffff898ba9be) len: 6), repl: (ffffffff89b47481, len: 5)
[ 0.365002] SMP alternatives: ffffffff82403da2: [5:6) optimized NOPs: e8 0d 62 7c f7 90
[ 0.366826] SMP alternatives: ffffffff898ba9be: old_insn: ff 15 0c ec b6 f8
[ 0.368108] SMP alternatives: ffffffff89b47481: rpl_insn: e8 6a 7e f1 f7
[ 0.369397] SMP alternatives: ffffffff898ba9be: final_insn: e8 0d 62 7c f7 90
[ 0.370826] SMP alternatives: feat: 3*32+21, old: (tdx_handle_virt_exception+0xb9/0x110 (ffffffff810032c9) len: 6), repl: (ffffffff89b47486, len: 5)
[ 0.373172] SMP alternatives: ffffffff82403da2: [5:6) optimized NOPs: e8 12 e3 a5 00 90
[ 0.374826] SMP alternatives: ffffffff810032c9: old_insn: ff 15 41 63 42 01
[ 0.377006] SMP alternatives: ffffffff89b47486: rpl_insn: e8 65 7e f1 f7
[ 0.378254] SMP alternatives: ffffffff810032c9: final_insn: e8 12 e3 a5 00 90
[ 0.378826] SMP alternatives: feat: !8*32+16, old: (tdx_handle_virt_exception+0xb9/0x110 (ffffffff810032c9) len: 6), repl: (ffffffff89b4748b, len: 2)
[ 0.381201] SMP alternatives: ffffffff82403da2: [2:6) optimized NOPs: 9c 58 0f 1f 40 00
[ 0.382826] SMP alternatives: ffffffff810032c9: old_insn: e8 12 e3 a5 00 90
[ 0.384119] SMP alternatives: ffffffff89b4748b: rpl_insn: 9c 58
[ 0.385235] SMP alternatives: ffffffff810032c9: final_insn: 9c 58 0f 1f 40 00
[ 0.386826] SMP alternatives: feat: 11*32+15, old: (entry_SYSCALL_64_after_hwframe+0x5a/0x77 (ffffffff81c000c2) len: 16), repl: (ffffffff89b4748d, len: 5)
[ 0.389268] SMP alternatives: ffffffff82403da2: [5:16) optimized NOPs: e8 19 29 e7 ff 66 66 2e 0f 1f 84 00 00 00 00 00
[ 0.390826] SMP alternatives: ffffffff81c000c2: old_insn: 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90
[ 0.393312] SMP alternatives: ffffffff89b4748d: rpl_insn: e8 4e b5 f2 f7
[ 0.394826] SMP alternatives: ffffffff81c000c2: final_insn: e8 19 29 e7 ff 66 66 2e 0f 1f 84 00 00 00 00 00
[ 0.396621] SMP alternatives: ffffffff81c000c2: [5:16) optimized NOPs: e8 19 29 e7 ff 66 66 2e 0f 1f 84 00 00 00 00 00
[ 0.398826] SMP alternatives: ffffffff81c000c2: [5:16) optimized NOPs: e8 19 29 e7 ff 66 66 2e 0f 1f 84 00 00 00 00 00
[ 0.400824] SMP alternatives: feat: 7*32+19, old: (__switch_to_asm+0x2c/0x70 (ffffffff8100347c) len: 44), repl: (ffffffff89b474ac, len: 44)
[ 0.402828] SMP alternatives: ffffffff8100347c: old_insn: eb 2a 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90
[ 0.406825] SMP alternatives: ffffffff89b474ac: rpl_insn: 49 c7 c4 10 00 00 00 e8 01 00 00 00 cc e8 01 00 00 00 cc 48 83 c4 10 49 ff cc 75 eb 0f ae e8 65 48 c7 04 25 d0 03 03 00 ff ff ff ff
[ 0.410826] SMP alternatives: ffffffff8100347c: final_insn: 49 c7 c4 10 00 00 00 e8 01 00 00 00 cc e8 01 00 00 00 cc 48 83 c4 10 49 ff cc 75 eb 0f ae e8 65 48 c7 04 25 d0 03 03 00 ff ff ff ff
[ 0.413914] SMP alternatives: ffffffff810034c0: [0:10) optimized NOPs: 66 2e 0f 1f 84 00 00 00 00 00
[ 0.416156] SMP alternatives: feat: 11*32+15, old: (xen_error_entry+0x44/0x60 (ffffffff81c00174) len: 15), repl: (ffffffff89b474f1, len: 5)
[ 0.418827] SMP alternatives: ffffffff82403da2: [5:15) optimized NOPs: e8 67 28 e7 ff 66 2e 0f 1f 84 00 00 00 00 00
[ 0.425545] SMP alternatives: ffffffff81c00174: old_insn: 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90
[ 0.428204] SMP alternatives: ffffffff89b474f1: rpl_insn: e8 ea b4 f2 f7
[ 0.429464] SMP alternatives: ffffffff81c00174: final_insn: e8 67 28 e7 ff 66 2e 0f 1f 84 00 00 00 00 00
[ 0.430827] SMP alternatives: ffffffff81c00174: [5:15) optimized NOPs: e8 67 28 e7 ff 66 2e 0f 1f 84 00 00 00 00 00
[ 0.432821] SMP alternatives: ffffffff81c00174: [5:15) optimized NOPs: e8 67 28 e7 ff 66 2e 0f 1f 84 00 00 00 00 00
[ 0.434826] SMP alternatives: feat: 9*32+20, old: (asm_exc_divide_error+0x4/0x20 (ffffffff81c00f94) len: 3), repl: (ffffffff89b4750a, len: 3)
[ 0.437088] SMP alternatives: ffffffff81c00f94: old_insn: 90 90 90
[ 0.438825] SMP alternatives: ffffffff89b4750a: rpl_insn: 0f 01 ca
[ 0.439984] SMP alternatives: ffffffff81c00f94: final_insn: 0f 01 ca
[ 0.441315] SMP alternatives: feat: 9*32+20, old: (asm_exc_overflow+0x4/0x20 (ffffffff81c00fb4) len: 3), repl: (ffffffff89b47512, len: 3)
[ 0.442826] SMP alternatives: ffffffff81c00fb4: old_insn: 90 90 90
[ 0.443986] SMP alternatives: ffffffff89b47512: rpl_insn: 0f 01 ca
[ 0.445167] SMP alternatives: ffffffff81c00fb4: final_insn: 0f 01 ca
[ 0.446827] SMP alternatives: feat: 9*32+20, old: (asm_exc_bounds+0x4/0x20 (ffffffff81c00fd4) len: 3), repl: (ffffffff89b4751a, len: 3)
[ 0.449001] SMP alternatives: ffffffff81c00fd4: old_insn: 90 90 90
[ 0.450825] SMP alternatives: ffffffff89b4751a: rpl_insn: 0f 01 ca
[ 0.451986] SMP alternatives: ffffffff81c00fd4: final_insn: 0f 01 ca
[ 0.453143] SMP alternatives: feat: 9*32+20, old: (asm_exc_device_not_available+0x4/0x20 (ffffffff81c00ff4) len: 3), repl: (ffffffff89b47522, len: 3)
[ 0.454826] SMP alternatives: ffffffff81c00ff4: old_insn: 90 90 90
[ 0.456288] SMP alternatives: ffffffff89b47522: rpl_insn: 0f 01 ca
[ 0.457456] SMP alternatives: ffffffff81c00ff4: final_insn: 0f 01 ca
[ 0.458827] SMP alternatives: feat: 9*32+20, old: (asm_exc_coproc_segment_overrun+0x4/0x20 (ffffffff81c01014) len: 3), repl: (ffffffff89b4752a, len: 3)
[ 0.461678] SMP alternatives: ffffffff81c01014: old_insn: 90 90 90
[ 0.462826] SMP alternatives: ffffffff89b4752a: rpl_insn: 0f 01 ca
[ 0.463985] SMP alternatives: ffffffff81c01014: final_insn: 0f 01 ca
[ 0.465144] SMP alternatives: feat: 9*32+20, old: (asm_exc_spurious_interrupt_bug+0x4/0x20 (ffffffff81c01034) len: 3), repl: (ffffffff89b47532, len: 3)
[ 0.466826] SMP alternatives: ffffffff81c01034: old_insn: 90 90 90
[ 0.467987] SMP alternatives: ffffffff89b47532: rpl_insn: 0f 01 ca
[ 0.469153] SMP alternatives: ffffffff81c01034: final_insn: 0f 01 ca
[ 0.471755] SMP alternatives: feat: 9*32+20, old: (asm_exc_coprocessor_error+0x4/0x20 (ffffffff81c01054) len: 3), repl: (ffffffff89b4753a, len: 3)
[ 0.474395] SMP alternatives: ffffffff81c01054: old_insn: 90 90 90
[ 0.474825] SMP alternatives: ffffffff89b4753a: rpl_insn: 0f 01 ca
[ 0.476398] SMP alternatives: ffffffff81c01054: final_insn: 0f 01 ca
[ 0.477566] SMP alternatives: feat: 9*32+20, old: (asm_exc_simd_coprocessor_error+0x4/0x20 (ffffffff81c01074) len: 3), repl: (ffffffff89b47542, len: 3)
[ 0.480796] SMP alternatives: ffffffff81c01074: old_insn: 90 90 90
[ 0.481956] SMP alternatives: ffffffff89b47542: rpl_insn: 0f 01 ca
[ 0.482825] SMP alternatives: ffffffff81c01074: final_insn: 0f 01 ca
[ 0.483984] SMP alternatives: feat: 9*32+20, old: (asm_exc_invalid_tss+0x4/0x30 (ffffffff81c01094) len: 3), repl: (ffffffff89b4754a, len: 3)
[ 0.486234] SMP alternatives: ffffffff81c01094: old_insn: 90 90 90
[ 0.487751] SMP alternatives: ffffffff89b4754a: rpl_insn: 0f 01 ca
[ 0.489199] SMP alternatives: ffffffff81c01094: final_insn: 0f 01 ca
[ 0.490368] SMP alternatives: feat: 9*32+20, old: (asm_exc_segment_not_present+0x4/0x30 (ffffffff81c010c4) len: 3), repl: (ffffffff89b47552, len: 3)
[ 0.492760] SMP alternatives: ffffffff81c010c4: old_insn: 90 90 90
[ 0.494262] SMP alternatives: ffffffff89b47552: rpl_insn: 0f 01 ca
[ 0.494826] SMP alternatives: ffffffff81c010c4: final_insn: 0f 01 ca
[ 0.495997] SMP alternatives: feat: 9*32+20, old: (asm_exc_stack_segment+0x4/0x30 (ffffffff81c010f4) len: 3), repl: (ffffffff89b4755a, len: 3)
[ 0.498826] SMP alternatives: ffffffff81c010f4: old_insn: 90 90 90
[ 0.499986] SMP alternatives: ffffffff89b4755a: rpl_insn: 0f 01 ca
[ 0.501147] SMP alternatives: ffffffff81c010f4: final_insn: 0f 01 ca
[ 0.502315] SMP alternatives: feat: 9*32+20, old: (asm_exc_general_protection+0x4/0x30 (ffffffff81c01124) len: 3), repl: (ffffffff89b47562, len: 3)
[ 0.505053] SMP alternatives: ffffffff81c01124: old_insn: 90 90 90
[ 0.506224] SMP alternatives: ffffffff89b47562: rpl_insn: 0f 01 ca
[ 0.506825] SMP alternatives: ffffffff81c01124: final_insn: 0f 01 ca
[ 0.507985] SMP alternatives: feat: 9*32+20, old: (asm_exc_alignment_check+0x4/0x30 (ffffffff81c01154) len: 3), repl: (ffffffff89b4756a, len: 3)
[ 0.510826] SMP alternatives: ffffffff81c01154: old_insn: 90 90 90
[ 0.511995] SMP alternatives: ffffffff89b4756a: rpl_insn: 0f 01 ca
[ 0.513158] SMP alternatives: ffffffff81c01154: final_insn: 0f 01 ca
[ 0.514827] SMP alternatives: feat: 9*32+20, old: (asm_exc_invalid_op+0x4/0x20 (ffffffff81c01184) len: 3), repl: (ffffffff89b47572, len: 3)
[ 0.517065] SMP alternatives: ffffffff81c01184: old_insn: 90 90 90
[ 0.518234] SMP alternatives: ffffffff89b47572: rpl_insn: 0f 01 ca
[ 0.518826] SMP alternatives: ffffffff81c01184: final_insn: 0f 01 ca
[ 0.520281] SMP alternatives: feat: 9*32+20, old: (asm_exc_int3+0x4/0x40 (ffffffff81c011a4) len: 3), repl: (ffffffff89b4757a, len: 3)
[ 0.522826] SMP alternatives: ffffffff81c011a4: old_insn: 90 90 90
[ 0.523990] SMP alternatives: ffffffff89b4757a: rpl_insn: 0f 01 ca
[ 0.525152] SMP alternatives: ffffffff81c011a4: final_insn: 0f 01 ca
[ 0.526826] SMP alternatives: feat: 9*32+20, old: (asm_exc_page_fault+0x4/0x30 (ffffffff81c011e4) len: 3), repl: (ffffffff89b47582, len: 3)
[ 0.529064] SMP alternatives: ffffffff81c011e4: old_insn: 90 90 90
[ 0.530231] SMP alternatives: ffffffff89b47582: rpl_insn: 0f 01 ca
[ 0.531754] SMP alternatives: ffffffff81c011e4: final_insn: 0f 01 ca
[ 0.532912] SMP alternatives: feat: 9*32+20, old: (asm_exc_machine_check+0x4/0x40 (ffffffff81c01214) len: 3), repl: (ffffffff89b4758a, len: 3)
[ 0.534826] SMP alternatives: ffffffff81c01214: old_insn: 90 90 90
[ 0.536268] SMP alternatives: ffffffff89b4758a: rpl_insn: 0f 01 ca
[ 0.537437] SMP alternatives: ffffffff81c01214: final_insn: 0f 01 ca
[ 0.538826] SMP alternatives: feat: 9*32+20, old: (asm_xenpv_exc_machine_check+0x4/0x20 (ffffffff81c01254) len: 3), repl: (ffffffff89b47592, len: 3)
[ 0.541186] SMP alternatives: ffffffff81c01254: old_insn: 90 90 90
[ 0.542353] SMP alternatives: ffffffff89b47592: rpl_insn: 0f 01 ca
[ 0.543752] SMP alternatives: ffffffff81c01254: final_insn: 0f 01 ca
[ 0.544923] SMP alternatives: feat: 9*32+20, old: (asm_xenpv_exc_nmi+0x4/0x20 (ffffffff81c01274) len: 3), repl: (ffffffff89b4759a, len: 3)
[ 0.546826] SMP alternatives: ffffffff81c01274: old_insn: 90 90 90
[ 0.547988] SMP alternatives: ffffffff89b4759a: rpl_insn: 0f 01 ca
[ 0.549163] SMP alternatives: ffffffff81c01274: final_insn: 0f 01 ca
[ 0.550826] SMP alternatives: feat: 9*32+20, old: (asm_exc_debug+0x4/0x40 (ffffffff81c01294) len: 3), repl: (ffffffff89b475a2, len: 3)
[ 0.553271] SMP alternatives: ffffffff81c01294: old_insn: 90 90 90
[ 0.554825] SMP alternatives: ffffffff89b475a2: rpl_insn: 0f 01 ca
[ 0.555990] SMP alternatives: ffffffff81c01294: final_insn: 0f 01 ca
[ 0.557151] SMP alternatives: feat: 9*32+20, old: (asm_xenpv_exc_debug+0x4/0x20 (ffffffff81c012d4) len: 3), repl: (ffffffff89b475aa, len: 3)
[ 0.558826] SMP alternatives: ffffffff81c012d4: old_insn: 90 90 90
[ 0.560387] SMP alternatives: ffffffff89b475aa: rpl_insn: 0f 01 ca
[ 0.561560] SMP alternatives: ffffffff81c012d4: final_insn: 0f 01 ca
[ 0.562826] SMP alternatives: feat: 9*32+20, old: (asm_exc_double_fault+0x4/0x30 (ffffffff81c012f4) len: 3), repl: (ffffffff89b475b2, len: 3)
[ 0.565090] SMP alternatives: ffffffff81c012f4: old_insn: 90 90 90
[ 0.566826] SMP alternatives: ffffffff89b475b2: rpl_insn: 0f 01 ca
[ 0.568287] SMP alternatives: ffffffff81c012f4: final_insn: 0f 01 ca
[ 0.569451] SMP alternatives: feat: 9*32+20, old: (asm_xenpv_exc_double_fault+0x4/0x30 (ffffffff81c01324) len: 3), repl: (ffffffff89b475b5, len: 3)
[ 0.570826] SMP alternatives: ffffffff81c01324: old_insn: 90 90 90
[ 0.571987] SMP alternatives: ffffffff89b475b5: rpl_insn: 0f 01 ca
[ 0.573153] SMP alternatives: ffffffff81c01324: final_insn: 0f 01 ca
[ 0.574826] SMP alternatives: feat: 9*32+20, old: (asm_exc_control_protection+0x4/0x30 (ffffffff81c01354) len: 3), repl: (ffffffff89b475bd, len: 3)
[ 0.577618] SMP alternatives: ffffffff81c01354: old_insn: 90 90 90
[ 0.578826] SMP alternatives: ffffffff89b475bd: rpl_insn: 0f 01 ca
[ 0.579991] SMP alternatives: ffffffff81c01354: final_insn: 0f 01 ca
[ 0.581152] SMP alternatives: feat: 9*32+20, old: (asm_exc_vmm_communication+0x4/0x60 (ffffffff81c01384) len: 3), repl: (ffffffff89b475c5, len: 3)
[ 0.582826] SMP alternatives: ffffffff81c01384: old_insn: 90 90 90
[ 0.583989] SMP alternatives: ffffffff89b475c5: rpl_insn: 0f 01 ca
[ 0.586826] SMP alternatives: ffffffff81c01384: final_insn: 0f 01 ca
[ 0.587987] SMP alternatives: feat: 9*32+20, old: (asm_exc_xen_hypervisor_callback+0x4/0x20 (ffffffff81c013e4) len: 3), repl: (ffffffff89b475cd, len: 3)
[ 0.590415] SMP alternatives: ffffffff81c013e4: old_insn: 90 90 90
[ 0.591752] SMP alternatives: ffffffff89b475cd: rpl_insn: 0f 01 ca
[ 0.593495] SMP alternatives: ffffffff81c013e4: final_insn: 0f 01 ca
[ 0.594665] SMP alternatives: feat: 9*32+20, old: (asm_exc_xen_unknown_trap+0x4/0x20 (ffffffff81c01404) len: 3), repl: (ffffffff89b475d5, len: 3)
[ 0.596730] SMP alternatives: ffffffff81c01404: old_insn: 90 90 90
[ 0.597896] SMP alternatives: ffffffff89b475d5: rpl_insn: 0f 01 ca
[ 0.598826] SMP alternatives: ffffffff81c01404: final_insn: 0f 01 ca
[ 0.600280] SMP alternatives: feat: 9*32+20, old: (asm_exc_virtualization_exception+0x4/0x20 (ffffffff81c01424) len: 3), repl: (ffffffff89b475dd, len: 3)
[ 0.602826] SMP alternatives: ffffffff81c01424: old_insn: 90 90 90
[ 0.603990] SMP alternatives: ffffffff89b475dd: rpl_insn: 0f 01 ca
[ 0.605152] SMP alternatives: ffffffff81c01424: final_insn: 0f 01 ca
[ 0.606826] SMP alternatives: feat: 9*32+20, old: (asm_common_interrupt+0x4/0x40 (ffffffff81c01444) len: 3), repl: (ffffffff89b475e5, len: 3)
[ 0.609082] SMP alternatives: ffffffff81c01444: old_insn: 90 90 90
[ 0.610826] SMP alternatives: ffffffff89b475e5: rpl_insn: 0f 01 ca
[ 0.611994] SMP alternatives: ffffffff81c01444: final_insn: 0f 01 ca
[ 0.613161] SMP alternatives: feat: 9*32+20, old: (asm_spurious_interrupt+0x4/0x30 (ffffffff81c01484) len: 3), repl: (ffffffff89b475ed, len: 3)
[ 0.614826] SMP alternatives: ffffffff81c01484: old_insn: 90 90 90
[ 0.616283] SMP alternatives: ffffffff89b475ed: rpl_insn: 0f 01 ca
[ 0.617453] SMP alternatives: ffffffff81c01484: final_insn: 0f 01 ca
[ 0.618826] SMP alternatives: feat: 9*32+20, old: (asm_sysvec_error_interrupt+0x4/0x20 (ffffffff81c014b4) len: 3), repl: (ffffffff89b475f5, len: 3)
[ 0.621165] SMP alternatives: ffffffff81c014b4: old_insn: 90 90 90
[ 0.622825] SMP alternatives: ffffffff89b475f5: rpl_insn: 0f 01 ca
[ 0.623994] SMP alternatives: ffffffff81c014b4: final_insn: 0f 01 ca
[ 0.625157] SMP alternatives: feat: 9*32+20, old: (asm_sysvec_spurious_apic_interrupt+0x4/0x20 (ffffffff81c014d4) len: 3), repl: (ffffffff89b475fd, len: 3)
[ 0.626826] SMP alternatives: ffffffff81c014d4: old_insn: 90 90 90
[ 0.628001] SMP alternatives: ffffffff89b475fd: rpl_insn: 0f 01 ca
[ 0.629168] SMP alternatives: ffffffff81c014d4: final_insn: 0f 01 ca
[ 0.631753] SMP alternatives: feat: 9*32+20, old: (asm_sysvec_apic_timer_interrupt+0x4/0x20 (ffffffff81c014f4) len: 3), repl: (ffffffff89b47605, len: 3)
[ 0.634472] SMP alternatives: ffffffff81c014f4: old_insn: 90 90 90
[ 0.635754] SMP alternatives: ffffffff89b47605: rpl_insn: 0f 01 ca
[ 0.636914] SMP alternatives: ffffffff81c014f4: final_insn: 0f 01 ca
[ 0.638081] SMP alternatives: feat: 9*32+20, old: (asm_sysvec_x86_platform_ipi+0x4/0x20 (ffffffff81c01514) len: 3), repl: (ffffffff89b4760d, len: 3)
[ 0.638826] SMP alternatives: ffffffff81c01514: old_insn: 90 90 90
[ 0.639988] SMP alternatives: ffffffff89b4760d: rpl_insn: 0f 01 ca
[ 0.642825] SMP alternatives: ffffffff81c01514: final_insn: 0f 01 ca
[ 0.646827] SMP alternatives: feat: 9*32+20, old: (asm_sysvec_reschedule_ipi+0x4/0x20 (ffffffff81c01534) len: 3), repl: (ffffffff89b47615, len: 3)
[ 0.649454] SMP alternatives: ffffffff81c01534: old_insn: 90 90 90
[ 0.650628] SMP alternatives: ffffffff89b47615: rpl_insn: 0f 01 ca
[ 0.651753] SMP alternatives: ffffffff81c01534: final_insn: 0f 01 ca
[ 0.652916] SMP alternatives: feat: 9*32+20, old: (asm_sysvec_reboot+0x4/0x20 (ffffffff81c01554) len: 3), repl: (ffffffff89b4761d, len: 3)
[ 0.654826] SMP alternatives: ffffffff81c01554: old_insn: 90 90 90
[ 0.655994] SMP alternatives: ffffffff89b4761d: rpl_insn: 0f 01 ca
[ 0.657161] SMP alternatives: ffffffff81c01554: final_insn: 0f 01 ca
[ 0.658826] SMP alternatives: feat: 9*32+20, old: (asm_sysvec_call_function_single+0x4/0x20 (ffffffff81c01574) len: 3), repl: (ffffffff89b47625, len: 3)
[ 0.661680] SMP alternatives: ffffffff81c01574: old_insn: 90 90 90
[ 0.662826] SMP alternatives: ffffffff89b47625: rpl_insn: 0f 01 ca
[ 0.664275] SMP alternatives: ffffffff81c01574: final_insn: 0f 01 ca
[ 0.665439] SMP alternatives: feat: 9*32+20, old: (asm_sysvec_call_function+0x4/0x20 (ffffffff81c01594) len: 3), repl: (ffffffff89b4762d, len: 3)
[ 0.666826] SMP alternatives: ffffffff81c01594: old_insn: 90 90 90
[ 0.667996] SMP alternatives: ffffffff89b4762d: rpl_insn: 0f 01 ca
[ 0.669160] SMP alternatives: ffffffff81c01594: final_insn: 0f 01 ca
[ 0.670826] SMP alternatives: feat: 9*32+20, old: (asm_sysvec_threshold+0x4/0x20 (ffffffff81c015b4) len: 3), repl: (ffffffff89b47635, len: 3)
[ 0.673102] SMP alternatives: ffffffff81c015b4: old_insn: 90 90 90
[ 0.674826] SMP alternatives: ffffffff89b47635: rpl_insn: 0f 01 ca
[ 0.676443] SMP alternatives: ffffffff81c015b4: final_insn: 0f 01 ca
[ 0.677609] SMP alternatives: feat: 9*32+20, old: (asm_sysvec_deferred_error+0x4/0x20 (ffffffff81c015d4) len: 3), repl: (ffffffff89b4763d, len: 3)
[ 0.678826] SMP alternatives: ffffffff81c015d4: old_insn: 90 90 90
[ 0.679987] SMP alternatives: ffffffff89b4763d: rpl_insn: 0f 01 ca
[ 0.682825] SMP alternatives: ffffffff81c015d4: final_insn: 0f 01 ca
[ 0.683991] SMP alternatives: feat: 9*32+20, old: (asm_sysvec_thermal+0x4/0x20 (ffffffff81c015f4) len: 3), repl: (ffffffff89b47645, len: 3)
[ 0.686239] SMP alternatives: ffffffff81c015f4: old_insn: 90 90 90
[ 0.686825] SMP alternatives: ffffffff89b47645: rpl_insn: 0f 01 ca
[ 0.687992] SMP alternatives: ffffffff81c015f4: final_insn: 0f 01 ca
[ 0.689158] SMP alternatives: feat: 9*32+20, old: (asm_sysvec_irq_work+0x4/0x20 (ffffffff81c01614) len: 3), repl: (ffffffff89b4764d, len: 3)
[ 0.690826] SMP alternatives: ffffffff81c01614: old_insn: 90 90 90
[ 0.692409] SMP alternatives: ffffffff89b4764d: rpl_insn: 0f 01 ca
[ 0.694825] SMP alternatives: ffffffff81c01614: final_insn: 0f 01 ca
[ 0.696291] SMP alternatives: feat: 9*32+20, old: (asm_sysvec_kvm_posted_intr_ipi+0x4/0x20 (ffffffff81c01634) len: 3), repl: (ffffffff89b47655, len: 3)
[ 0.698826] SMP alternatives: ffffffff81c01634: old_insn: 90 90 90
[ 0.699988] SMP alternatives: ffffffff89b47655: rpl_insn: 0f 01 ca
[ 0.701151] SMP alternatives: ffffffff81c01634: final_insn: 0f 01 ca
[ 0.702319] SMP alternatives: feat: 9*32+20, old: (asm_sysvec_kvm_posted_intr_wakeup_ipi+0x4/0x20 (ffffffff81c01654) len: 3), repl: (ffffffff89b4765d, len: 3)
[ 0.704899] SMP alternatives: ffffffff81c01654: old_insn: 90 90 90
[ 0.706072] SMP alternatives: ffffffff89b4765d: rpl_insn: 0f 01 ca
[ 0.706825] SMP alternatives: ffffffff81c01654: final_insn: 0f 01 ca
[ 0.707991] SMP alternatives: feat: 9*32+20, old: (asm_sysvec_kvm_posted_intr_nested_ipi+0x4/0x20 (ffffffff81c01674) len: 3), repl: (ffffffff89b47665, len: 3)
[ 0.710826] SMP alternatives: ffffffff81c01674: old_insn: 90 90 90
[ 0.712298] SMP alternatives: ffffffff89b47665: rpl_insn: 0f 01 ca
[ 0.713492] SMP alternatives: ffffffff81c01674: final_insn: 0f 01 ca
[ 0.714828] SMP alternatives: feat: 9*32+20, old: (asm_sysvec_acrn_hv_callback+0x4/0x20 (ffffffff81c01694) len: 3), repl: (ffffffff89b4766d, len: 3)
[ 0.717175] SMP alternatives: ffffffff81c01694: old_insn: 90 90 90
[ 0.718825] SMP alternatives: ffffffff89b4766d: rpl_insn: 0f 01 ca
[ 0.719995] SMP alternatives: ffffffff81c01694: final_insn: 0f 01 ca
[ 0.721158] SMP alternatives: feat: 9*32+20, old: (asm_sysvec_xen_hvm_callback+0x4/0x20 (ffffffff81c016b4) len: 3), repl: (ffffffff89b47675, len: 3)
[ 0.722826] SMP alternatives: ffffffff81c016b4: old_insn: 90 90 90
[ 0.723990] SMP alternatives: ffffffff89b47675: rpl_insn: 0f 01 ca
[ 0.725587] SMP alternatives: ffffffff81c016b4: final_insn: 0f 01 ca
[ 0.727756] SMP alternatives: feat: 9*32+20, old: (asm_sysvec_kvm_asyncpf_interrupt+0x4/0x20 (ffffffff81c016d4) len: 3), repl: (ffffffff89b4767d, len: 3)
[ 0.730332] SMP alternatives: ffffffff81c016d4: old_insn: 90 90 90
[ 0.730826] SMP alternatives: ffffffff89b4767d: rpl_insn: 0f 01 ca
[ 0.731982] SMP alternatives: ffffffff81c016d4: final_insn: 0f 01 ca
[ 0.733140] SMP alternatives: ffffffff81c01717: [0:5) optimized NOPs: 0f 1f 44 00 00
[ 0.734826] SMP alternatives: ffffffff81c017f9: [0:3) optimized NOPs: 0f 1f 00
[ 0.736197] SMP alternatives: feat: 21*32+10, old: (asm_load_gs_index+0x17/0x40 (ffffffff81c01807) len: 7), repl: (ffffffff89b4768d, len: 7)
[ 0.738826] SMP alternatives: ffffffff81c01807: old_insn: 90 90 90 90 90 90 90
[ 0.740231] SMP alternatives: ffffffff89b4768d: rpl_insn: b8 2b 00 00 00 8e e8
[ 0.741636] SMP alternatives: ffffffff81c01807: final_insn: b8 2b 00 00 00 8e e8
[ 0.742826] SMP alternatives: feat: 9*32+0, old: (paranoid_entry+0x43/0xd0 (ffffffff81c01923) len: 2), repl: (ffffffff89b47694, len: 0)
[ 0.745297] SMP alternatives: ffffffff82403da2: [0:2) optimized NOPs: 66 90
[ 0.746826] SMP alternatives: ffffffff81c01923: old_insn: eb 24
[ 0.747942] SMP alternatives: ffffffff81c01923: final_insn: 66 90
[ 0.749055] SMP alternatives: feat: 11*32+5, old: (paranoid_entry+0x7e/0xd0 (ffffffff81c0195e) len: 3), repl: (ffffffff89b47694, len: 3)
[ 0.750826] SMP alternatives: ffffffff81c0195e: old_insn: 90 90 90
[ 0.751995] SMP alternatives: ffffffff89b47694: rpl_insn: 0f ae e8
[ 0.753168] SMP alternatives: ffffffff81c0195e: final_insn: 0f ae e8
[ 0.754826] SMP alternatives: feat: 11*32+15, old: (paranoid_entry+0xb2/0xd0 (ffffffff81c01992) len: 15), repl: (ffffffff89b47697, len: 5)
[ 0.757053] SMP alternatives: ffffffff82403da2: [5:15) optimized NOPs: e8 49 10 e7 ff 66 2e 0f 1f 84 00 00 00 00 00
[ 0.758826] SMP alternatives: ffffffff81c01992: old_insn: 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90
[ 0.761261] SMP alternatives: ffffffff89b47697: rpl_insn: e8 44 b3 f2 f7
[ 0.762826] SMP alternatives: ffffffff81c01992: final_insn: e8 49 10 e7 ff 66 2e 0f 1f 84 00 00 00 00 00
[ 0.764572] SMP alternatives: ffffffff81c01992: [5:15) optimized NOPs: e8 49 10 e7 ff 66 2e 0f 1f 84 00 00 00 00 00
[ 0.766826] SMP alternatives: ffffffff81c01992: [5:15) optimized NOPs: e8 49 10 e7 ff 66 2e 0f 1f 84 00 00 00 00 00
[ 0.768742] SMP alternatives: feat: 9*32+0, old: (paranoid_exit+0x12/0x30 (ffffffff81c019c2) len: 2), repl: (ffffffff89b476b0, len: 0)
[ 0.770826] SMP alternatives: ffffffff82403da2: [0:2) optimized NOPs: 66 90
[ 0.772085] SMP alternatives: ffffffff81c019c2: old_insn: eb 0a
[ 0.773219] SMP alternatives: ffffffff81c019c2: final_insn: 66 90
[ 0.774826] SMP alternatives: ffffffff81c01a30: [0:3) optimized NOPs: 0f 1f 00
[ 0.776903] SMP alternatives: feat: 11*32+15, old: (error_entry+0x6c/0x120 (ffffffff81c01a4c) len: 15), repl: (ffffffff89b476b3, len: 5)
[ 0.778828] SMP alternatives: ffffffff82403da2: [5:15) optimized NOPs: e8 8f 0f e7 ff 66 2e 0f 1f 84 00 00 00 00 00
[ 0.780732] SMP alternatives: ffffffff81c01a4c: old_insn: 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90
[ 0.782825] SMP alternatives: ffffffff89b476b3: rpl_insn: e8 28 b3 f2 f7
[ 0.784084] SMP alternatives: ffffffff81c01a4c: final_insn: e8 8f 0f e7 ff 66 2e 0f 1f 84 00 00 00 00 00
[ 0.785849] SMP alternatives: ffffffff81c01a4c: [5:15) optimized NOPs: e8 8f 0f e7 ff 66 2e 0f 1f 84 00 00 00 00 00
[ 0.786826] SMP alternatives: ffffffff81c01a4c: [5:15) optimized NOPs: e8 8f 0f e7 ff 66 2e 0f 1f 84 00 00 00 00 00
[ 0.788750] SMP alternatives: feat: 11*32+5, old: (error_entry+0xb3/0x120 (ffffffff81c01a93) len: 3), repl: (ffffffff89b476cc, len: 3)
[ 0.790826] SMP alternatives: ffffffff81c01a93: old_insn: 90 90 90
[ 0.791999] SMP alternatives: ffffffff89b476cc: rpl_insn: 0f ae e8
[ 0.794826] SMP alternatives: ffffffff81c01a93: final_insn: 0f ae e8
[ 0.795986] SMP alternatives: ffffffff81c01a96: [0:10) optimized NOPs: 66 2e 0f 1f 84 00 00 00 00 00
[ 0.797686] SMP alternatives: ffffffff81c01ab6: [0:3) optimized NOPs: 0f 1f 00
[ 0.798826] SMP alternatives: feat: 11*32+15, old: (error_entry+0xf2/0x120 (ffffffff81c01ad2) len: 15), repl: (ffffffff89b476dc, len: 5)
[ 0.801033] SMP alternatives: ffffffff82403da2: [5:15) optimized NOPs: e8 09 0f e7 ff 66 2e 0f 1f 84 00 00 00 00 00
[ 0.802826] SMP alternatives: ffffffff81c01ad2: old_insn: 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90
[ 0.804579] SMP alternatives: ffffffff89b476dc: rpl_insn: e8 ff b2 f2 f7
[ 0.806825] SMP alternatives: ffffffff81c01ad2: final_insn: e8 09 0f e7 ff 66 2e 0f 1f 84 00 00 00 00 00
[ 0.808872] SMP alternatives: ffffffff81c01ad2: [5:15) optimized NOPs: e8 09 0f e7 ff 66 2e 0f 1f 84 00 00 00 00 00
[ 0.810826] SMP alternatives: ffffffff81c01ad2: [5:15) optimized NOPs: e8 09 0f e7 ff 66 2e 0f 1f 84 00 00 00 00 00
[ 0.812745] SMP alternatives: feat: 3*32+21, old: (error_return+0x1/0x30 (ffffffff81c01b01) len: 12), repl: (ffffffff89b476f5, len: 5)
[ 0.814826] SMP alternatives: ALT_FLAG_DIRECT_CALL set for unrecognized indirect call
[ 0.816303] ------------[ cut here ]------------
[ 0.817179] kernel BUG at arch/x86/kernel/alternative.c:413!
[ 0.818830] invalid opcode: 0000 [#1] PREEMPT SMP
[ 0.819729] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 6.7.0-rc1+ #8
[ 0.820878] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
[ 0.822429] RIP: 0010:apply_alternatives+0x45d/0x470
[ 0.822824] Code: 08 e9 8e fe ff ff 48 89 d8 e9 6a ff ff ff 48 c7 c7 08 13 20 82 e8 a3 e3 0d 00 90 0f 0b 48 c7 c7 60 13 20 82 e8 94 e3 0d 00 90 <0f> 0b e8 8c 46 a2 00 66 66 2e 0f 1f 84 00 00 00 00 00 90 90 90 90
[ 0.822824] RSP: 0000:ffffffff82403d78 EFLAGS: 00010286
[ 0.822824] RAX: 0000000000000049 RBX: ffffffff81c01b01 RCX: 00000000ffefffff
[ 0.822824] RDX: 00000000ffffffea RSI: ffffffff82403c50 RDI: 0000000000000001
[ 0.822824] RBP: 000000000000000f R08: 00000000ffefffff R09: 0000000000000058
[ 0.822824] R10: 00000000ffefffff R11: ffffffff8244e900 R12: ffffffff82403da2
[ 0.822824] R13: 000000000000000c R14: ffffffff89b476f5 R15: ffffffff89b30640
[ 0.822824] FS: 0000000000000000(0000) GS:ffff88807da00000(0000) knlGS:0000000000000000
[ 0.822824] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 0.822824] CR2: ffff88800be01000 CR3: 0000000002419000 CR4: 00000000003506f0
[ 0.822824] Call Trace:
[ 0.822824] <TASK>
[ 0.822824] ? die+0x47/0xb0
[ 0.822824] ? do_trap+0x11a/0x150
[ 0.822824] ? apply_alternatives+0x45d/0x470
[ 0.822824] ? apply_alternatives+0x45d/0x470
[ 0.822824] ? exc_invalid_op+0xce/0x110
[ 0.822824] ? apply_alternatives+0x45d/0x470
[ 0.822824] ? asm_exc_invalid_op+0x1a/0x20
[ 0.822824] ? error_return+0x1/0x30
[ 0.822824] ? apply_alternatives+0x45d/0x470
[ 0.822824] ? apply_alternatives+0x45c/0x470
[ 0.822824] ? __x86_indirect_thunk_r15+0xa/0x20
[ 0.822824] ? srso_return_thunk+0x5/0x5f
[ 0.822824] ? apply_returns+0xbb/0x310
[ 0.822824] ? apply_retpolines+0x11c/0x4d0
[ 0.822824] ? __x86_indirect_thunk_r15+0xa/0x20
[ 0.822824] ? __x86_indirect_thunk_r15+0x19/0x20
[ 0.822824] ? __x86_indirect_thunk_r15+0xf/0x20
[ 0.822824] alternative_instructions+0x64/0x120
[ 0.822824] arch_cpu_finalize_init+0xe5/0x110
[ 0.822824] start_kernel+0x52c/0x6f0
[ 0.822824] ? __pfx_unknown_bootoption+0x10/0x10
[ 0.822824] x86_64_start_reservations+0x18/0x30
[ 0.822824] x86_64_start_kernel+0x82/0x90
[ 0.822824] secondary_startup_64_no_verify+0x16b/0x16b
[ 0.822824] </TASK>
[ 0.822824] Modules linked in:
[ 0.822829] ---[ end trace 0000000000000000 ]---
[ 0.823748] RIP: 0010:apply_alternatives+0x45d/0x470
[ 0.826827] Code: 08 e9 8e fe ff ff 48 89 d8 e9 6a ff ff ff 48 c7 c7 08 13 20 82 e8 a3 e3 0d 00 90 0f 0b 48 c7 c7 60 13 20 82 e8 94 e3 0d 00 90 <0f> 0b e8 8c 46 a2 00 66 66 2e 0f 1f 84 00 00 00 00 00 90 90 90 90
[ 0.830156] RSP: 0000:ffffffff82403d78 EFLAGS: 00010286
[ 0.831589] RAX: 0000000000000049 RBX: ffffffff81c01b01 RCX: 00000000ffefffff
[ 0.833177] RDX: 00000000ffffffea RSI: ffffffff82403c50 RDI: 0000000000000001
[ 0.834468] RBP: 000000000000000f R08: 00000000ffefffff R09: 0000000000000058
[ 0.834825] R10: 00000000ffefffff R11: ffffffff8244e900 R12: ffffffff82403da2
[ 0.836609] R13: 000000000000000c R14: ffffffff89b476f5 R15: ffffffff89b30640
[ 0.838828] FS: 0000000000000000(0000) GS:ffff88807da00000(0000) knlGS:0000000000000000
[ 0.840567] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 0.841820] CR2: ffff88800be01000 CR3: 0000000002419000 CR4: 00000000003506f0
[ 0.842829] Kernel panic - not syncing: Attempted to kill the idle task!
[ 0.844288] ---[ end Kernel panic - not syncing: Attempted to kill the idle task! ]---

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette


Attachments:
(No filename) (55.41 kB)
.config (149.04 kB)
Download all attachments

2023-12-08 11:54:04

by Juergen Gross

[permalink] [raw]
Subject: Re: [PATCH v5 4/5] x86/paravirt: switch mixed paravirt/alternative calls to alternative_2

On 06.12.23 12:08, Borislav Petkov wrote:
> On Wed, Nov 29, 2023 at 02:33:31PM +0100, Juergen Gross wrote:
>> Instead of stacking alternative and paravirt patching, use the new
>> ALT_FLAG_CALL flag to switch those mixed calls to pure alternative
>> handling.
>>
>> This eliminates the need to be careful regarding the sequence of
>> alternative and paravirt patching.
>>
>> Signed-off-by: Juergen Gross <[email protected]>
>> Acked-by: Peter Zijlstra (Intel) <[email protected]>
>> ---
>> V5:
>> - remove no longer needed extern declarations from alternative.c
>> (Boris Petkov)
>> - add comment about ALTERNATIVE[_2]() macro usage (Boris Petkov)
>> - rebase to tip/master (Boris Petkov)
>> ---
>> arch/x86/include/asm/alternative.h | 5 ++--
>> arch/x86/include/asm/paravirt.h | 9 ++++--
>> arch/x86/include/asm/paravirt_types.h | 40 +++++++++++++++------------
>> arch/x86/kernel/alternative.c | 1 -
>> arch/x86/kernel/callthunks.c | 17 ++++++------
>> arch/x86/kernel/module.c | 20 ++++----------
>> 6 files changed, 44 insertions(+), 48 deletions(-)
>
> After this one: (.config is attached).
...

Ouch.

Took me a while to find it. Patch 5 was repairing the issue again, and I tested
more thoroughly only with all 5 patches applied.


Juergen


Attachments:
OpenPGP_0xB0DE9DD628BF132F.asc (3.66 kB)
OpenPGP public key
OpenPGP_signature.asc (505.00 B)
OpenPGP digital signature
Download all attachments

2023-12-08 15:17:07

by Juergen Gross

[permalink] [raw]
Subject: Re: [PATCH v5 4/5] x86/paravirt: switch mixed paravirt/alternative calls to alternative_2

On 08.12.23 13:57, Borislav Petkov wrote:
> On Fri, Dec 08, 2023 at 12:53:47PM +0100, Juergen Gross wrote:
>> Took me a while to find it. Patch 5 was repairing the issue again
>
> Can't have that. Any patch in any set must build and boot successfully
> for bisection reasons.
>

Of course.

The problem will be fixed in V6.


Juergen


Attachments:
OpenPGP_0xB0DE9DD628BF132F.asc (3.66 kB)
OpenPGP public key
OpenPGP_signature.asc (505.00 B)
OpenPGP digital signature
Download all attachments

2023-12-08 15:26:07

by Borislav Petkov

[permalink] [raw]
Subject: Re: [PATCH v5 4/5] x86/paravirt: switch mixed paravirt/alternative calls to alternative_2

On Fri, Dec 08, 2023 at 12:53:47PM +0100, Juergen Gross wrote:
> Took me a while to find it. Patch 5 was repairing the issue again

Can't have that. Any patch in any set must build and boot successfully
for bisection reasons.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette