Skip to content

Commit 77c860d

Browse files
mrathor99liuw
authored andcommitted
x86/hyperv: Enable build of hypervisor crashdump collection files
Enable build of the new files introduced in the earlier commits and add call to do the setup during boot. Signed-off-by: Mukesh Rathor <mrathor@linux.microsoft.com> [ wei: fix build ] Signed-off-by: Wei Liu <wei.liu@kernel.org>
1 parent 94212d3 commit 77c860d

3 files changed

Lines changed: 16 additions & 0 deletions

File tree

arch/x86/hyperv/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,10 @@ obj-$(CONFIG_HYPERV_VTL_MODE) += hv_vtl.o
55

66
ifdef CONFIG_X86_64
77
obj-$(CONFIG_PARAVIRT_SPINLOCKS) += hv_spinlock.o
8+
9+
ifdef CONFIG_MSHV_ROOT
10+
CFLAGS_REMOVE_hv_trampoline.o += -pg
11+
CFLAGS_hv_trampoline.o += -fno-stack-protector
12+
obj-$(CONFIG_CRASH_DUMP) += hv_crash.o hv_trampoline.o
13+
endif
814
endif

arch/x86/hyperv/hv_init.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,7 @@ void __init hyperv_init(void)
554554
memunmap(src);
555555

556556
hv_remap_tsc_clocksource();
557+
hv_root_crash_init();
557558
} else {
558559
hypercall_msr.guest_physical_address = vmalloc_to_pfn(hv_hypercall_pg);
559560
wrmsrq(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);

arch/x86/include/asm/mshyperv.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,15 @@ static __always_inline u64 hv_raw_get_msr(unsigned int reg)
237237
}
238238
int hv_apicid_to_vp_index(u32 apic_id);
239239

240+
#if IS_ENABLED(CONFIG_MSHV_ROOT) && IS_ENABLED(CONFIG_CRASH_DUMP)
241+
void hv_root_crash_init(void);
242+
void hv_crash_asm32(void);
243+
void hv_crash_asm64(void);
244+
void hv_crash_asm_end(void);
245+
#else /* CONFIG_MSHV_ROOT && CONFIG_CRASH_DUMP */
246+
static inline void hv_root_crash_init(void) {}
247+
#endif /* CONFIG_MSHV_ROOT && CONFIG_CRASH_DUMP */
248+
240249
#else /* CONFIG_HYPERV */
241250
static inline void hyperv_init(void) {}
242251
static inline void hyperv_setup_mmu_ops(void) {}

0 commit comments

Comments
 (0)