Re: [PATCH 1/2] KVM: nVMX: Validate EFER values for VM_ENTRY/EXIT_LOAD_IA32_EFER

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Il 14/04/2013 12:44, Jan Kiszka ha scritto:
> +	if (vmcs12->vm_entry_controls & VM_ENTRY_LOAD_IA32_EFER &&
> +	    (!kvm_valid_efer(vcpu, vmcs12->guest_ia32_efer) ||
> +	     !!(vmcs12->vm_entry_controls & VM_ENTRY_IA32E_MODE) !=
> +	     !!(vmcs12->guest_ia32_efer & EFER_LMA) ||
> +	     (vmcs12->guest_cr0 & X86_CR0_PG &&
> +	      !!(vmcs12->vm_entry_controls & VM_ENTRY_IA32E_MODE) !=
> +	      !!(vmcs12->guest_ia32_efer & EFER_LME)))) {
> +		nested_vmx_entry_failure(vcpu, vmcs12,
> +			EXIT_REASON_INVALID_STATE, ENTRY_FAIL_DEFAULT);
> +		return 1;
> +	}

    if (vmcs12->vm_entry_controls & VM_ENTRY_LOAD_IA32_EFER) {
        bool ia32e = (vmcs12->vm_entry_controls & VM_ENTRY_IA32E_MODE) != 0;
        if (...) {
        }
    }

Also please put parentheses around the & operator.

The exit tests can similarly extract the host address space size bit to a bool.

Paolo
--
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




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux