Re: [PATCH] KVM: nVMX: consult PFEC_MASK and PFEC_MATCH when generating #PF VM-exit

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

 




On 15/12/2014 21:56, Eugene Korenevsky wrote:
> +	u32 inequality, bit;
> +
> +	bit = (vmcs12->exception_bitmap & (1u << PF_VECTOR)) ? 1u : 0;
> +	inequality =
> +		(error_code & vmcs12->page_fault_error_code_mask) !=
> +		 vmcs12->page_fault_error_code_match ? 1u : 0;

You should either remove "? 1u : 0" (which is redundant), or flip the
bit in the exception bitmap, like

    inequality = ...
          ? (1u << PF_VECTOR) : 0;
    return ((vmcs12->exception_bitmap ^ inequality)
            & (1u << PF_VECTOR)) != 0;

If you choose the former, please use "!= 0" in the assignment of "bit"
instead of the ternary operator, and make the two variables bool.  Then
you can remove the "!= 0" in the "return" below.

Paolo

> +	return (inequality ^ bit) != 0;
> +}
--
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