lkml.org 
[lkml]   [2021]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [RFC PATCH v2 32/69] KVM: x86: Allow host-initiated WRMSR to set X2APIC regardless of CPUID
    From
    Date
    On 03/07/21 00:04, isaku.yamahata@intel.com wrote:
    > Let userspace, or in the case of TDX, KVM itself, enable X2APIC even if
    > X2APIC is not reported as supported in the guest's CPU model. KVM
    > generally does not force specific ordering between ioctls(), e.g. this
    > forces userspace to configure CPUID before MSRs.

    You already have to do this, see for example MSR_IA32_PERF_CAPABILITIES:

    struct kvm_msr_entry msr_ent = {.index = msr, .data = 0};

    if (!msr_info->host_initiated)
    return 1;
    if (guest_cpuid_has(vcpu, X86_FEATURE_PDCM) && kvm_get_msr_feature(&msr_ent))
    return 1;
    if (data & ~msr_ent.data)
    return 1;

    Is this patch necessary? If not, I think it can be dropped.

    Paolo

    > And for TDX, vCPUs
    > will always run with X2APIC enabled, e.g. KVM will want/need to enable
    > X2APIC from time zero.

    \
     
     \ /
      Last update: 2021-07-06 16:43    [W:4.062 / U:0.156 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site