]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 9 Apr 2024 09:40:51 +0000 (11:40 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 9 Apr 2024 09:40:51 +0000 (11:40 +0200)
added patches:
objtool-add-asm-version-of-stack_frame_non_standard.patch
x86-cpufeatures-add-cpuid_lnx_5-to-track-recently-added-linux-defined-word.patch

queue-5.10/objtool-add-asm-version-of-stack_frame_non_standard.patch [new file with mode: 0644]
queue-5.10/series
queue-5.10/x86-cpufeatures-add-cpuid_lnx_5-to-track-recently-added-linux-defined-word.patch [new file with mode: 0644]

diff --git a/queue-5.10/objtool-add-asm-version-of-stack_frame_non_standard.patch b/queue-5.10/objtool-add-asm-version-of-stack_frame_non_standard.patch
new file mode 100644 (file)
index 0000000..c357a54
--- /dev/null
@@ -0,0 +1,71 @@
+From 081df94301e317e84c3413686043987da2c3e39d Mon Sep 17 00:00:00 2001
+From: Josh Poimboeuf <jpoimboe@redhat.com>
+Date: Thu, 21 Jan 2021 15:29:23 -0600
+Subject: objtool: Add asm version of STACK_FRAME_NON_STANDARD
+
+From: Josh Poimboeuf <jpoimboe@redhat.com>
+
+commit 081df94301e317e84c3413686043987da2c3e39d upstream.
+
+To be used for adding asm functions to the ignore list.  The "aw" is
+needed to help the ELF section metadata match GCC-created sections.
+Otherwise the linker creates duplicate sections instead of combining
+them.
+
+Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
+Link: https://lore.kernel.org/r/8faa476f9a5ac89af27944ec184c89f95f3c6c49.1611263462.git.jpoimboe@redhat.com
+Signed-off-by: Daniel Sneddon <daniel.sneddon@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ include/linux/objtool.h       |    8 ++++++++
+ tools/include/linux/objtool.h |    8 ++++++++
+ 2 files changed, 16 insertions(+)
+
+--- a/include/linux/objtool.h
++++ b/include/linux/objtool.h
+@@ -141,6 +141,12 @@ struct unwind_hint {
+       .popsection
+ .endm
++.macro STACK_FRAME_NON_STANDARD func:req
++      .pushsection .discard.func_stack_frame_non_standard, "aw"
++              .long \func - .
++      .popsection
++.endm
++
+ #endif /* __ASSEMBLY__ */
+ #else /* !CONFIG_STACK_VALIDATION */
+@@ -158,6 +164,8 @@ struct unwind_hint {
+ .endm
+ .macro ANNOTATE_NOENDBR
+ .endm
++.macro STACK_FRAME_NON_STANDARD func:req
++.endm
+ #endif
+ #endif /* CONFIG_STACK_VALIDATION */
+--- a/tools/include/linux/objtool.h
++++ b/tools/include/linux/objtool.h
+@@ -141,6 +141,12 @@ struct unwind_hint {
+       .popsection
+ .endm
++.macro STACK_FRAME_NON_STANDARD func:req
++      .pushsection .discard.func_stack_frame_non_standard, "aw"
++              .long \func - .
++      .popsection
++.endm
++
+ #endif /* __ASSEMBLY__ */
+ #else /* !CONFIG_STACK_VALIDATION */
+@@ -158,6 +164,8 @@ struct unwind_hint {
+ .endm
+ .macro ANNOTATE_NOENDBR
+ .endm
++.macro STACK_FRAME_NON_STANDARD func:req
++.endm
+ #endif
+ #endif /* CONFIG_STACK_VALIDATION */
index 26d36a93c6b9451aae398e474d4abeebeeb8a02b..13177b9108038e1015e10cddbfb983addc0b2ca9 100644 (file)
@@ -241,3 +241,5 @@ riscv-fix-spurious-errors-from-__get-put_kernel_nofault.patch
 x86-bugs-fix-the-srso-mitigation-on-zen3-4.patch
 x86-retpoline-do-the-necessary-fixup-to-the-zen3-4-srso-return-thunk-for-srso.patch
 mptcp-don-t-account-accept-of-non-mpc-client-as-fallback-to-tcp.patch
+x86-cpufeatures-add-cpuid_lnx_5-to-track-recently-added-linux-defined-word.patch
+objtool-add-asm-version-of-stack_frame_non_standard.patch
diff --git a/queue-5.10/x86-cpufeatures-add-cpuid_lnx_5-to-track-recently-added-linux-defined-word.patch b/queue-5.10/x86-cpufeatures-add-cpuid_lnx_5-to-track-recently-added-linux-defined-word.patch
new file mode 100644 (file)
index 0000000..2071db8
--- /dev/null
@@ -0,0 +1,60 @@
+From 8cb4a9a82b21623dbb4b3051dd30d98356cf95bc Mon Sep 17 00:00:00 2001
+From: Sean Christopherson <seanjc@google.com>
+Date: Thu, 4 Apr 2024 17:16:14 -0700
+Subject: x86/cpufeatures: Add CPUID_LNX_5 to track recently added Linux-defined word
+
+From: Sean Christopherson <seanjc@google.com>
+
+commit 8cb4a9a82b21623dbb4b3051dd30d98356cf95bc upstream.
+
+Add CPUID_LNX_5 to track cpufeatures' word 21, and add the appropriate
+compile-time assert in KVM to prevent direct lookups on the features in
+CPUID_LNX_5.  KVM uses X86_FEATURE_* flags to manage guest CPUID, and so
+must translate features that are scattered by Linux from the Linux-defined
+bit to the hardware-defined bit, i.e. should never try to directly access
+scattered features in guest CPUID.
+
+Opportunistically add NR_CPUID_WORDS to enum cpuid_leafs, along with a
+compile-time assert in KVM's CPUID infrastructure to ensure that future
+additions update cpuid_leafs along with NCAPINTS.
+
+No functional change intended.
+
+Fixes: 7f274e609f3d ("x86/cpufeatures: Add new word for scattered features")
+Cc: Sandipan Das <sandipan.das@amd.com>
+Signed-off-by: Sean Christopherson <seanjc@google.com>
+Acked-by: Dave Hansen <dave.hansen@linux.intel.com>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Daniel Sneddon <daniel.sneddon@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/x86/include/asm/cpufeature.h |    2 ++
+ arch/x86/kvm/cpuid.h              |    2 ++
+ 2 files changed, 4 insertions(+)
+
+--- a/arch/x86/include/asm/cpufeature.h
++++ b/arch/x86/include/asm/cpufeature.h
+@@ -33,6 +33,8 @@ enum cpuid_leafs
+       CPUID_7_EDX,
+       CPUID_8000_001F_EAX,
+       CPUID_8000_0021_EAX,
++      CPUID_LNX_5,
++      NR_CPUID_WORDS,
+ };
+ #ifdef CONFIG_X86_FEATURE_NAMES
+--- a/arch/x86/kvm/cpuid.h
++++ b/arch/x86/kvm/cpuid.h
+@@ -76,10 +76,12 @@ static const struct cpuid_reg reverse_cp
+  */
+ static __always_inline void reverse_cpuid_check(unsigned int x86_leaf)
+ {
++      BUILD_BUG_ON(NR_CPUID_WORDS != NCAPINTS);
+       BUILD_BUG_ON(x86_leaf == CPUID_LNX_1);
+       BUILD_BUG_ON(x86_leaf == CPUID_LNX_2);
+       BUILD_BUG_ON(x86_leaf == CPUID_LNX_3);
+       BUILD_BUG_ON(x86_leaf == CPUID_LNX_4);
++      BUILD_BUG_ON(x86_leaf == CPUID_LNX_5);
+       BUILD_BUG_ON(x86_leaf >= ARRAY_SIZE(reverse_cpuid));
+       BUILD_BUG_ON(reverse_cpuid[x86_leaf].function == 0);
+ }