xref: /OK3568_Linux_fs/kernel/arch/arm64/include/asm/kvm_ras.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 */
2*4882a593Smuzhiyun /* Copyright (C) 2018 - Arm Ltd */
3*4882a593Smuzhiyun 
4*4882a593Smuzhiyun #ifndef __ARM64_KVM_RAS_H__
5*4882a593Smuzhiyun #define __ARM64_KVM_RAS_H__
6*4882a593Smuzhiyun 
7*4882a593Smuzhiyun #include <linux/acpi.h>
8*4882a593Smuzhiyun #include <linux/errno.h>
9*4882a593Smuzhiyun #include <linux/types.h>
10*4882a593Smuzhiyun 
11*4882a593Smuzhiyun #include <asm/acpi.h>
12*4882a593Smuzhiyun 
13*4882a593Smuzhiyun /*
14*4882a593Smuzhiyun  * Was this synchronous external abort a RAS notification?
15*4882a593Smuzhiyun  * Returns '0' for errors handled by some RAS subsystem, or -ENOENT.
16*4882a593Smuzhiyun  */
kvm_handle_guest_sea(phys_addr_t addr,unsigned int esr)17*4882a593Smuzhiyun static inline int kvm_handle_guest_sea(phys_addr_t addr, unsigned int esr)
18*4882a593Smuzhiyun {
19*4882a593Smuzhiyun 	/* apei_claim_sea(NULL) expects to mask interrupts itself */
20*4882a593Smuzhiyun 	lockdep_assert_irqs_enabled();
21*4882a593Smuzhiyun 
22*4882a593Smuzhiyun 	return apei_claim_sea(NULL);
23*4882a593Smuzhiyun }
24*4882a593Smuzhiyun 
25*4882a593Smuzhiyun #endif /* __ARM64_KVM_RAS_H__ */
26