lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4b7ef6d8-c140-7efa-5d72-3e9b8a9b360f@amd.com>
Date:   Wed, 1 Dec 2021 22:13:15 +0700
From:   "Suthikulpanit, Suravee" <suravee.suthikulpanit@....com>
To:     Paolo Bonzini <pbonzini@...hat.com>, linux-kernel@...r.kernel.org,
        kvm@...r.kernel.org, x86@...nel.org
Cc:     joro@...tes.org, tglx@...utronix.de, mingo@...hat.com,
        bp@...en8.de, peterz@...radead.org, hpa@...or.com,
        thomas.lendacky@....com, jon.grimm@....com
Subject: Re: [PATCH 2/2] KVM: SVM: Extend host physical APIC ID field to
 support more than 8-bit

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ