Il 19/05/2013 06:52, Jun Nakajima ha scritto: > + switch (type) { > + case VMX_EPT_EXTENT_GLOBAL: > + if (!(nested_vmx_ept_caps & VMX_EPT_EXTENT_GLOBAL_BIT)) > + nested_vmx_failValid(vcpu, > + VMXERR_INVALID_OPERAND_TO_INVEPT_INVVPID); > + else { > + /* > + * Do nothing: when L1 changes EPT12, we already > + * update EPT02 (the shadow EPT table) and call INVEPT. > + * So when L1 calls INVEPT, there's nothing left to do. > + */ > + nested_vmx_succeed(vcpu); > + } > + break; Duplicate code: switch (type) { case VMX_EPT_EXTENT_GLOBAL ok = (nested_vmx_ept_caps & VMX_EPT_EXTENT_GLOBAL_BIT) != 0; break; ... default: ok = false; break; } if (ok) { /* Do nothing: ... */ nested_vmx_succeed(vcpu); } else { nested_vmx_failValid(vcpu, ...); } break; Paolo > + case VMX_EPT_EXTENT_CONTEXT: > + if (!(nested_vmx_ept_caps & VMX_EPT_EXTENT_CONTEXT_BIT)) > + nested_vmx_failValid(vcpu, > + VMXERR_INVALID_OPERAND_TO_INVEPT_INVVPID); > + else { > + /* Do nothing */ > + nested_vmx_succeed(vcpu); > + } > + break; > + case VMX_EPT_EXTENT_INDIVIDUAL_ADDR: > + if (!(nested_vmx_ept_caps & VMX_EPT_EXTENT_INDIVIDUAL_BIT)) > + nested_vmx_failValid(vcpu, > + VMXERR_INVALID_OPERAND_TO_INVEPT_INVVPID); > + else { > + /* Do nothing */ > + nested_vmx_succeed(vcpu); > + } > + break; > + default: > + nested_vmx_failValid(vcpu, > + VMXERR_INVALID_OPERAND_TO_INVEPT_INVVPID); -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html