On Wed, Jan 28, 2015 at 5:55 AM, Paolo Bonzini <[email protected]> wrote: > > > On 24/01/2015 11:24, Wincy Van wrote: >> if (!nested_cpu_has_virt_x2apic_mode(vmcs12) && >> !nested_cpu_has_apic_reg_virt(vmcs12) && >> - !nested_cpu_has_vid(vmcs12)) >> + !nested_cpu_has_vid(vmcs12) && >> + !nested_cpu_has_posted_intr(vmcs12)) >> return 0; >> >> if (nested_cpu_has_virt_x2apic_mode(vmcs12)) >> r = nested_vmx_check_virt_x2apic(vcpu, vmcs12); >> if (nested_cpu_has_vid(vmcs12)) >> r |= nested_vmx_check_vid(vcpu, vmcs12); >> + if (nested_cpu_has_posted_intr(vmcs12)) >> + r |= nested_vmx_check_posted_intr(vcpu, vmcs12); > > These "if"s are always true. >
Why? L1 may config these features seperately, we should check them one by one. e.g. L1 may enable posted interrupt processing and virtual interrupt delivery, but leaving virtualize x2apic mode disabled, then nested_cpu_has_virt_x2apic_mode will return false. > Paolo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

