| 1845 | } |
| 1846 | |
| 1847 | int |
| 1848 | vm_exit_intinfo(struct vm *vm, int vcpuid, uint64_t info) |
| 1849 | { |
| 1850 | struct vcpu *vcpu; |
| 1851 | int type, vector; |
| 1852 | |
| 1853 | if (vcpuid < 0 || vcpuid >= vm->maxcpus) |
| 1854 | return (EINVAL); |
| 1855 | |
| 1856 | vcpu = &vm->vcpu[vcpuid]; |
| 1857 | |
| 1858 | if (info & VM_INTINFO_VALID) { |
| 1859 | type = info & VM_INTINFO_TYPE; |
| 1860 | vector = info & 0xff; |
| 1861 | if (type == VM_INTINFO_NMI && vector != IDT_NMI) |
| 1862 | return (EINVAL); |
| 1863 | if (type == VM_INTINFO_HWEXCEPTION && vector >= 32) |
| 1864 | return (EINVAL); |
| 1865 | if (info & VM_INTINFO_RSVD) |
| 1866 | return (EINVAL); |
| 1867 | } else { |
| 1868 | info = 0; |
| 1869 | } |
| 1870 | VCPU_CTR2(vm, vcpuid, "%s: info1(%#lx)", __func__, info); |
| 1871 | vcpu->exitintinfo = info; |
| 1872 | return (0); |
| 1873 | } |
| 1874 | |
| 1875 | enum exc_class { |
| 1876 | EXC_BENIGN, |
no outgoing calls
no test coverage detected