android_kernel_motorola_sm6225/arch
Ard Biesheuvel dc573e5685 x86: Make ARCH_USE_MEMREMAP_PROT a generic Kconfig symbol
commit ce9084ba0d1d8030adee7038ace32f8d9d423d0f upstream.

Turn ARCH_USE_MEMREMAP_PROT into a generic Kconfig symbol, and fix the
dependency expression to reflect that AMD_MEM_ENCRYPT depends on it,
instead of the other way around. This will permit ARCH_USE_MEMREMAP_PROT
to be selected by other architectures.

Note that the encryption related early memremap routines in
arch/x86/mm/ioremap.c cannot be built for 32-bit x86 without triggering
the following warning:

     arch/x86//mm/ioremap.c: In function 'early_memremap_encrypted':
  >> arch/x86/include/asm/pgtable_types.h:193:27: warning: conversion from
                     'long long unsigned int' to 'long unsigned int' changes
                     value from '9223372036854776163' to '355' [-Woverflow]
      #define __PAGE_KERNEL_ENC (__PAGE_KERNEL | _PAGE_ENC)
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
     arch/x86//mm/ioremap.c:713:46: note: in expansion of macro '__PAGE_KERNEL_ENC'
       return early_memremap_prot(phys_addr, size, __PAGE_KERNEL_ENC);

which essentially means they are 64-bit only anyway. However, we cannot
make them dependent on CONFIG_ARCH_HAS_MEM_ENCRYPT, since that is always
defined, even for i386 (and changing that results in a slew of build errors)

So instead, build those routines only if CONFIG_AMD_MEM_ENCRYPT is
defined.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: AKASHI Takahiro <takahiro.akashi@linaro.org>
Cc: Alexander Graf <agraf@suse.de>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Jeffrey Hugo <jhugo@codeaurora.org>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Peter Jones <pjones@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-efi@vger.kernel.org
Link: http://lkml.kernel.org/r/20190202094119.13230-9-ard.biesheuvel@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-22 09:19:01 +01:00
..
alpha alpha: Declare virt_to_phys and virt_to_bus parameter as pointer to volatile 2021-10-06 15:31:18 +02:00
arc arch: pgtable: define MAX_POSSIBLE_PHYSMEM_BITS where needed 2021-11-06 13:58:45 +01:00
arm hugetlbfs: flush TLBs correctly after huge_pmd_unshare 2021-12-01 09:27:43 +01:00
arm64 arm64: dts: marvell: armada-37xx: Set pcie_reset_pin to gpio function 2021-12-01 09:27:41 +01:00
c6x
h8300 h8300: fix PREEMPTION build, TI_PRE_COUNT undefined 2021-02-23 15:00:58 +01:00
hexagon hexagon: export raw I/O routines for modules 2021-11-26 11:36:23 +01:00
ia64 hugetlbfs: flush TLBs correctly after huge_pmd_unshare 2021-12-01 09:27:43 +01:00
m68k m68k: set a default value for MEMORY_RESERVE 2021-11-26 11:36:15 +01:00
microblaze microblaze: Prevent the overflow of the start 2020-02-24 08:34:53 +01:00
mips MIPS: use 3-level pgtable for 64KB page size on MIPS_VA_BITS_48 2021-12-01 09:27:43 +01:00
nds32 nds32: fix up stack guard gap 2021-07-28 11:13:51 +02:00
nios2 nios2: Make NIOS2_DTB_SOURCE_BOOL depend on !COMPILE_TEST 2021-11-02 18:26:45 +01:00
openrisc openrisc: don't printk() unconditionally 2021-09-22 11:48:01 +02:00
parisc parisc: Mark cr16 CPU clocksource unstable on all SMP machines 2021-12-08 08:50:15 +01:00
powerpc powerpc/dcr: Use cmplwi instead of 3-argument cmpli 2021-11-26 11:36:21 +01:00
riscv arch: pgtable: define MAX_POSSIBLE_PHYSMEM_BITS where needed 2021-11-06 13:58:45 +01:00
s390 s390/setup: avoid using memblock_enforce_memory_limit 2021-12-08 08:50:11 +01:00
sh hugetlbfs: flush TLBs correctly after huge_pmd_unshare 2021-12-01 09:27:43 +01:00
sparc sparc64: fix pci_iounmap() when CONFIG_PCI is not set 2021-10-09 14:11:03 +02:00
um hugetlbfs: flush TLBs correctly after huge_pmd_unshare 2021-12-01 09:27:43 +01:00
unicore32
x86 x86: Make ARCH_USE_MEMREMAP_PROT a generic Kconfig symbol 2021-12-22 09:19:01 +01:00
xtensa xtensa: use CONFIG_USE_OF instead of CONFIG_OF 2021-12-01 09:27:39 +01:00
.gitignore
Kconfig x86: Make ARCH_USE_MEMREMAP_PROT a generic Kconfig symbol 2021-12-22 09:19:01 +01:00