Re: [tip: x86/cpu] x86/cpu: Clear SVM feature if disabled by BIOS

From: Borislav Petkov
Date: Fri Sep 22 2023 - 06:37:21 EST


On Fri, Sep 22, 2023 at 12:26:09PM +0200, Ingo Molnar wrote:
> It's a bit sad that we are duplicating identical code.
>
> 2)
>
> We are doing it in other cases as well: for example nearby_node() is
> duplicated between arch/x86/kernel/cpu/amd.c and
> arch/x86/kernel/cpu/hygon.c too.

We could do a unification pass at some point. At the moment is not worth
the effort, IMO, for only a handful of small functions.

> BTW., while look at this code I noticed that the 'Author' copyright
> tag in arch/x86/kernel/cpu/hygon.c seems to be inaccurate:
>
> // SPDX-License-Identifier: GPL-2.0+
> /*
> * Hygon Processor Support for Linux
> *
> * Copyright (C) 2018 Chengdu Haiguang IC Design Co., Ltd.
> *
> * Author: Pu Wen <puwen@xxxxxxxx>
> */
>
> ... as for example the nearby_node() was clearly copied & derived from
> arch/x86/kernel/cpu/amd.c, which does not appear to be accurately reflected
> in this copyright notice?

Perhaps it should say "copied from amd.c and adjusted" or so. That whole
file has pretty-much copied parts of amd.c AFAICT.

Thx.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette