| 3287 | } |
| 3288 | |
| 3289 | static int |
| 3290 | vmx_modify_intr_shadow(struct vmx *vmx, int vcpu, int running, uint64_t val) |
| 3291 | { |
| 3292 | struct vmcs *vmcs; |
| 3293 | uint64_t gi; |
| 3294 | int error, ident; |
| 3295 | |
| 3296 | /* |
| 3297 | * Forcing the vcpu into an interrupt shadow is not supported. |
| 3298 | */ |
| 3299 | if (val) { |
| 3300 | error = EINVAL; |
| 3301 | goto done; |
| 3302 | } |
| 3303 | |
| 3304 | vmcs = &vmx->vmcs[vcpu]; |
| 3305 | ident = VMCS_IDENT(VMCS_GUEST_INTERRUPTIBILITY); |
| 3306 | error = vmcs_getreg(vmcs, running, ident, &gi); |
| 3307 | if (error == 0) { |
| 3308 | gi &= ~HWINTR_BLOCKING; |
| 3309 | error = vmcs_setreg(vmcs, running, ident, gi); |
| 3310 | } |
| 3311 | done: |
| 3312 | VCPU_CTR2(vmx->vm, vcpu, "Setting intr_shadow to %#lx %s", val, |
| 3313 | error ? "failed" : "succeeded"); |
| 3314 | return (error); |
| 3315 | } |
| 3316 | |
| 3317 | static int |
| 3318 | vmx_shadow_reg(int reg) |
no test coverage detected