Commit e2aa39b3 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'x86_misc_for_6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull misc x86 updates from Dave Hansen:
 "The most significant are some changes to ensure that symbols exported
  for KVM are used only by KVM modules themselves, along with some
  related cleanups.

  In true x86/misc fashion, the other patch is completely unrelated and
  just enhances an existing pr_warn() to make it clear to users how they
  have tainted their kernel when something is mucking with MSRs.

  Summary:

   - Make MSR-induced taint easier for users to track down

   - Restrict KVM-specific exports to KVM itself"

* tag 'x86_misc_for_6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86: Restrict KVM-induced symbol exports to KVM modules where obvious/possible
  x86/mm: Drop unnecessary export of "ptdump_walk_pgd_level_debugfs"
  x86/mtrr: Drop unnecessary export of "mtrr_state"
  x86/bugs: Drop unnecessary export of "x86_spec_ctrl_base"
  x86/msr: Add CPU_OUT_OF_SPEC taint name to "unrecognized" pr_warn(msg)
parents 54de197c 6276c67f
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
 */

#include <linux/export.h>
#include <linux/kvm_types.h>
#include <linux/linkage.h>
#include <linux/objtool.h>
#include <asm/msr-index.h>
@@ -29,8 +30,7 @@ SYM_FUNC_START(write_ibpb)
	FILL_RETURN_BUFFER %rax, RSB_CLEAR_LOOPS, X86_BUG_IBPB_NO_RET
	RET
SYM_FUNC_END(write_ibpb)
/* For KVM */
EXPORT_SYMBOL_GPL(write_ibpb);
EXPORT_SYMBOL_FOR_KVM(write_ibpb);

SYM_FUNC_START(__WARN_trap)
	ANNOTATE_NOENDBR
@@ -56,8 +56,7 @@ SYM_CODE_START_NOALIGN(x86_verw_sel)
	.word __KERNEL_DS
.align L1_CACHE_BYTES, 0xcc
SYM_CODE_END(x86_verw_sel);
/* For KVM */
EXPORT_SYMBOL_GPL(x86_verw_sel);
EXPORT_SYMBOL_FOR_KVM(x86_verw_sel);

.popsection

+2 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
 * - idtentry:		Define exception entry points.
 */
#include <linux/export.h>
#include <linux/kvm_types.h>
#include <linux/linkage.h>
#include <asm/segment.h>
#include <asm/cache.h>
@@ -1566,5 +1567,5 @@ SYM_FUNC_START(clear_bhb_loop)
	pop	%rbp
	RET
SYM_FUNC_END(clear_bhb_loop)
EXPORT_SYMBOL_GPL(clear_bhb_loop)
EXPORT_SYMBOL_FOR_KVM(clear_bhb_loop)
STACK_FRAME_NON_STANDARD(clear_bhb_loop)
+2 −1
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
 */

#include <linux/export.h>
#include <linux/kvm_types.h>

#include <asm/asm.h>
#include <asm/fred.h>
@@ -146,5 +147,5 @@ SYM_FUNC_START(asm_fred_entry_from_kvm)
	RET

SYM_FUNC_END(asm_fred_entry_from_kvm)
EXPORT_SYMBOL_GPL(asm_fred_entry_from_kvm);
EXPORT_SYMBOL_FOR_KVM(asm_fred_entry_from_kvm);
#endif
+3 −2
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
#include <linux/perf_event.h>
#include <linux/jump_label.h>
#include <linux/export.h>
#include <linux/kvm_types.h>
#include <linux/types.h>
#include <linux/init.h>
#include <linux/slab.h>
@@ -1574,7 +1575,7 @@ void amd_pmu_enable_virt(void)
	/* Reload all events */
	amd_pmu_reload_virt();
}
EXPORT_SYMBOL_GPL(amd_pmu_enable_virt);
EXPORT_SYMBOL_FOR_KVM(amd_pmu_enable_virt);

void amd_pmu_disable_virt(void)
{
@@ -1591,4 +1592,4 @@ void amd_pmu_disable_virt(void)
	/* Reload all events */
	amd_pmu_reload_virt();
}
EXPORT_SYMBOL_GPL(amd_pmu_disable_virt);
EXPORT_SYMBOL_FOR_KVM(amd_pmu_disable_virt);
+4 −3
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
#include <linux/export.h>
#include <linux/init.h>
#include <linux/kdebug.h>
#include <linux/kvm_types.h>
#include <linux/sched/mm.h>
#include <linux/sched/clock.h>
#include <linux/uaccess.h>
@@ -723,7 +724,7 @@ struct perf_guest_switch_msr *perf_guest_get_msrs(int *nr, void *data)
{
	return static_call(x86_pmu_guest_get_msrs)(nr, data);
}
EXPORT_SYMBOL_GPL(perf_guest_get_msrs);
EXPORT_SYMBOL_FOR_KVM(perf_guest_get_msrs);

/*
 * There may be PMI landing after enabled=0. The PMI hitting could be before or
@@ -3078,7 +3079,7 @@ void perf_get_x86_pmu_capability(struct x86_pmu_capability *cap)
	cap->events_mask_len	= x86_pmu.events_mask_len;
	cap->pebs_ept		= x86_pmu.pebs_ept;
}
EXPORT_SYMBOL_GPL(perf_get_x86_pmu_capability);
EXPORT_SYMBOL_FOR_KVM(perf_get_x86_pmu_capability);

u64 perf_get_hw_event_config(int hw_event)
{
@@ -3089,4 +3090,4 @@ u64 perf_get_hw_event_config(int hw_event)

	return 0;
}
EXPORT_SYMBOL_GPL(perf_get_hw_event_config);
EXPORT_SYMBOL_FOR_KVM(perf_get_hw_event_config);
Loading