[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2de6c090-6927-e976-55f4-5ef29bd148f2@maciej.szmigiero.name>
Date: Mon, 18 Jun 2018 20:11:53 +0200
From: "Maciej S. Szmigiero" <mail@...iej.szmigiero.name>
To: Borislav Petkov <bp@...en8.de>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v6 8/8] x86/microcode/AMD: Don't scan past the CPU
equivalence table data
On 18.06.2018 18:44, Borislav Petkov wrote:
> On Tue, Jun 12, 2018 at 11:08:31PM +0200, Maciej S. Szmigiero wrote:
>> That was the solution before this patch series version (6) - there was
>> a variable holding the CPU equivalence table size for the late loader,
>> but you didn't like it:> Instead of adding yet another global var which needs handling too,
>>> and touching so many places, just do all checks and preparations in
>>> install_equiv_cpu_table() so that the rest of the code can get what it
>>> expects: terminating zero entry and proper size.
>
> So what's wrong with computing the size in the late loader just like you
> do in parse_container()?
>
The equivalence table size can be computed in the late loader - there is
no problem there.
However, this computed size needs to be passed somehow to functions
scanning the equivalence table.
One of such functions, __find_equiv_id() can be called from
->collect_cpu_info() and ->apply_microcode() microcode_ops callbacks
which do not allow passing any specific state to the microcode update
driver.
This means that the size would need to be stored in a global variable,
just like a pointer to the equivalence table itself is.
Maciej
Powered by blists - more mailing lists