mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
drivers/vfio: Support EEH error injection
The patch adds one more EEH sub-command (VFIO_EEH_PE_INJECT_ERR) to inject the specified EEH error, which is represented by (struct vfio_eeh_pe_err), to the indicated PE for testing purpose. Signed-off-by: Gavin Shan <[email protected]> Reviewed-by: David Gibson <[email protected]> Acked-by: Alex Williamson <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
This commit is contained in:
parent
ec33d36e5a
commit
68cbbc3a9d
3 changed files with 35 additions and 1 deletions
|
|
@ -85,6 +85,16 @@ long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group,
|
|||
case VFIO_EEH_PE_CONFIGURE:
|
||||
ret = eeh_pe_configure(pe);
|
||||
break;
|
||||
case VFIO_EEH_PE_INJECT_ERR:
|
||||
minsz = offsetofend(struct vfio_eeh_pe_op, err.mask);
|
||||
if (op.argsz < minsz)
|
||||
return -EINVAL;
|
||||
if (copy_from_user(&op, (void __user *)arg, minsz))
|
||||
return -EFAULT;
|
||||
|
||||
ret = eeh_pe_inject_err(pe, op.err.type, op.err.func,
|
||||
op.err.addr, op.err.mask);
|
||||
break;
|
||||
default:
|
||||
ret = -EINVAL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue