Commit 0db5e022 authored by James Morse's avatar James Morse Committed by Rafael J. Wysocki
Browse files

KVM: arm/arm64: Add kvm_ras.h to collect kvm specific RAS plumbing



To split up APEIs in_nmi() path, the caller needs to always be
in_nmi(). KVM shouldn't have to know about this, pull the RAS plumbing
out into a header file.

Currently guest synchronous external aborts are claimed as RAS
notifications by handle_guest_sea(), which is hidden in the arch codes
mm/fault.c. 32bit gets a dummy declaration in system_misc.h.

There is going to be more of this in the future if/when the kernel
supports the SError-based firmware-first notification mechanism and/or
kernel-first notifications for both synchronous external abort and
SError. Each of these will come with some Kconfig symbols and a
handful of header files.

Create a header file for all this.

This patch gives handle_guest_sea() a 'kvm_' prefix, and moves the
declarations to kvm_ras.h as preparation for a future patch that moves
the ACPI-specific RAS code out of mm/fault.c.

Signed-off-by: default avatarJames Morse <james.morse@arm.com>
Reviewed-by: default avatarPunit Agrawal <punit.agrawal@arm.com>
Acked-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
Tested-by: default avatarTyler Baicar <tbaicar@codeaurora.org>
Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 255097c8
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (C) 2018 - Arm Ltd */

#ifndef __ARM_KVM_RAS_H__
#define __ARM_KVM_RAS_H__

#include <linux/types.h>

static inline int kvm_handle_guest_sea(phys_addr_t addr, unsigned int esr)
{
	return -1;
}

#endif /* __ARM_KVM_RAS_H__ */
+0 −5
Original line number Diff line number Diff line
@@ -38,11 +38,6 @@ static inline void harden_branch_predictor(void)

extern unsigned int user_debug;

static inline int handle_guest_sea(phys_addr_t addr, unsigned int esr)
{
	return -1;
}

#endif /* !__ASSEMBLY__ */

#endif /* __ASM_ARM_SYSTEM_MISC_H */
+11 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (C) 2018 - Arm Ltd */

#ifndef __ARM64_KVM_RAS_H__
#define __ARM64_KVM_RAS_H__

#include <linux/types.h>

int kvm_handle_guest_sea(phys_addr_t addr, unsigned int esr);

#endif /* __ARM64_KVM_RAS_H__ */
+0 −2
Original line number Diff line number Diff line
@@ -46,8 +46,6 @@ extern void __show_regs(struct pt_regs *);

extern void (*arm_pm_restart)(enum reboot_mode reboot_mode, const char *cmd);

int handle_guest_sea(phys_addr_t addr, unsigned int esr);

#endif	/* __ASSEMBLY__ */

#endif	/* __ASM_SYSTEM_MISC_H */
+1 −1
Original line number Diff line number Diff line
@@ -733,7 +733,7 @@ static const struct fault_info fault_info[] = {
	{ do_bad,		SIGKILL, SI_KERNEL,	"unknown 63"			},
};

int handle_guest_sea(phys_addr_t addr, unsigned int esr)
int kvm_handle_guest_sea(phys_addr_t addr, unsigned int esr)
{
	return ghes_notify_sea();
}
Loading