lkml.org 
[lkml]   [2021]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 2/2] KVM: SVM: Extend host physical APIC ID field to support more than 8-bit
From
Paolo,

On 11/17/2021 8:06 PM, Paolo Bonzini wrote:
> On 11/10/21 11:18, Suravee Suthikulpanit wrote:
>> +    if (level_type != 2 || !x2apic_mode) {
>> +        avic_host_physical_id_mask = 0xffULL;
>> +        goto out;
>> +    }
>> +
>> +    core_mask_width = eax & 0xF;
>> +
>> +    max_phys_mask_width = get_count_order(apic_get_max_phys_apicid());
>> +
>> +    /*
>> +     * Sanity check to ensure core_mask_width for a processor does not
>> +     * exceed the calculated mask.
>> +     */
>> +    if (WARN_ON(core_mask_width > max_phys_mask_width))
>> +        return -EINVAL;
>
> Can it just use apic_get_max_phys_apicid() in x2apic mode, and 0xff in !x2apic mode?  I'm not sure why you need to check CPUID[0xb,0x1].

This is mainly for sanity check of the max_physical_apicid (derived from information in ACPI or MP table),
which can be removed if you think not necessary.

Suravee

\
 
 \ /
  Last update: 2021-12-01 16:16    [W:0.098 / U:0.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site