Files
Centos-kernel-stream-10/drivers/virt
Rafael Aquini 4fb663615a x86/mm: Reduce header dependencies in <asm/set_memory.h>
JIRA: https://redhat.atlassian.net/browse/RHEL-145694

commit 95c4cc5a585400982ae5b3bf9e3be6de71768376
Author: Kevin Brodsky <kevin.brodsky@arm.com>
Date:   Thu Dec 12 08:09:04 2024 +0000

    x86/mm: Reduce header dependencies in <asm/set_memory.h>

    Commit:

      03b122da74 ("x86/sgx: Hook arch_memory_failure() into mainline code")

    ... added <linux/mm.h> to <asm/set_memory.h> to provide some helpers.

    However the following commit:

      b3fdf9398a ("x86/mce: relocate set{clear}_mce_nospec() functions")

    ... moved the inline definitions someplace else, and now <asm/set_memory.h>
    just declares a bunch of mostly self-contained functions.

    No need for the whole <linux/mm.h> inclusion to declare functions; just
    remove that include. This helps avoid circular dependency headaches
    (e.g. if <linux/mm.h> ends up including <linux/set_memory.h>).

    This change requires a couple of include fixups not to break the
    build:

    * <asm/smp.h>: including <asm/thread_info.h> directly relies on
      <linux/thread_info.h> having already been included, because the
      former needs the BAD_STACK/NOT_STACK constants defined in the
      latter. This is no longer the case when <asm/smp.h> is included from
      some driver file - just include <linux/thread_info.h> to stay out
      of trouble.

    * sev-guest.c relies on <asm/set_memory.h> including <linux/mm.h>,
      so we just need to make that include explicit.

    [ mingo: Cleaned up the changelog ]

    Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Acked-by: David Hildenbrand <david@redhat.com>
    Link: https://lore.kernel.org/r/20241212080904.2089632-3-kevin.brodsky@arm.com

Signed-off-by: Rafael Aquini <raquini@redhat.com>
2026-07-01 16:16:11 -04:00
..