[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <dbcff3a5-8b02-4cc0-9d8e-1116ff7a3ffd@intel.com>
Date: Thu, 1 Feb 2024 23:44:33 +0800
From: "Huang, Kai" <kai.huang@...el.com>
To: Paolo Bonzini <pbonzini@...hat.com>, <linux-kernel@...r.kernel.org>,
<kvm@...r.kernel.org>
CC: Zixi Chen <zixchen@...hat.com>, Adam Dunlap <acdunlap@...gle.com>, "Kirill
A . Shutemov" <kirill.shutemov@...ux.intel.com>, Xiaoyao Li
<xiaoyao.li@...el.com>, Dave Hansen <dave.hansen@...ux.intel.com>, "Thomas
Gleixner" <tglx@...utronix.de>, Ingo Molnar <mingo@...nel.org>,
<x86@...nel.org>, <stable@...r.kernel.org>
Subject: Re: [PATCH v2 1/2] x86/cpu: allow reducing x86_phys_bits during
early_identify_cpu()
On 1/02/2024 7:09 am, Paolo Bonzini wrote:
> In commit fbf6449f84bf ("x86/sev-es: Set x86_virt_bits to the correct
> value straight away, instead of a two-phase approach"), the initialization
> of c->x86_phys_bits was moved after this_cpu->c_early_init(c). This is
> incorrect because early_init_amd() expected to be able to reduce the
> value according to the contents of CPUID leaf 0x8000001f.
>
> Fortunately, the bug was negated by init_amd()'s call to early_init_amd(),
> which does reduce x86_phys_bits in the end. However, this is very
> late in the boot process and, most notably, the wrong value is used for
> x86_phys_bits when setting up MTRRs.
>
> To fix this, call get_cpu_address_sizes() as soon as X86_FEATURE_CPUID is
> set/cleared, and c->extended_cpuid_level is retrieved.
>
> Fixes: fbf6449f84bf ("x86/sev-es: Set x86_virt_bits to the correct value straight away, instead of a two-phase approach")
> Cc: Adam Dunlap <acdunlap@...gle.com>
> Cc: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
> Cc: Xiaoyao Li <xiaoyao.li@...el.com>
> Cc: Kai Huang <kai.huang@...el.com>
> Cc: Dave Hansen <dave.hansen@...ux.intel.com>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Ingo Molnar <mingo@...nel.org>
> Cc: x86@...nel.org
> Cc: stable@...r.kernel.org
> Signed-off-by: Paolo Bonzini <pbonzini@...hat.com>
Acked-by: Kai Huang <kai.huang@...el.com>
Powered by blists - more mailing lists