x86 fixes
Linus,
Please pull the latest x86-urgent-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-urgent-for-linus
# HEAD: e2329b4252f373c244e75928be38bf1dd45b35da x86/cpu: Remove unused and undefined __generic_processor_info() declaration
Two fixes: dead code removal, plus a SME memory encryption fix on 32-bit kernels that crashed Xen guests.
out-of-topic modifications in x86-urgent-for-linus:
-----------------------------------------------------
include/linux/mem_encrypt.h # 21d9bb4a05ba: x86/mm: Make the SME mask a
Thanks,
Ingo
------------------>
Borislav Petkov (1):
x86/mm: Make the SME mask a u64
Dou Liyang (1):
x86/cpu: Remove unused and undefined __generic_processor_info() declaration
arch/x86/include/asm/mem_encrypt.h | 4 ++-- arch/x86/include/asm/mpspec.h | 1 - arch/x86/kernel/apic/apic.c | 2 +- arch/x86/mm/mem_encrypt.c | 2 +- include/linux/mem_encrypt.h | 13 +++++++++---- 5 files changed, 13 insertions(+), 9 deletions(-)
arch/x86/include/asm/mem_encrypt.h +2 -2
@@ -21,7 +21,7 @@#ifdef CONFIG_AMD_MEM_ENCRYPT -extern unsigned long sme_me_mask; +extern u64 sme_me_mask; void sme_encrypt_execute(unsigned long encrypted_kernel_vaddr, unsigned long decrypted_kernel_vaddr,
@@ -49,7 +49,7 @@ void swiotlb_set_mem_attributes(void *vaddr, unsigned long size);#else /* !CONFIG_AMD_MEM_ENCRYPT */ -#define sme_me_mask 0UL +#define sme_me_mask 0ULLstatic inline void __init sme_early_encrypt (resource_size_t paddr,unsigned long size) { }
arch/x86/include/asm/mpspec.h +0 -1
@@ -86,7 +86,6 @@ static inline void e820__memblock_alloc_reserved_mpc_new(void) { }#endif int generic_processor_info (int apicid,int version); -int __generic_processor_info (int apicid,int version,bool enabled);#define PHYSID_ARRAY_SIZE BITS_TO_LONGS(MAX_LOCAL_APIC)
arch/x86/kernel/apic/apic.c +1 -1
@@ -2130,7 +2130,7 @@ int generic_processor_info(int apicid, int version)* Since fixing handling of boot_cpu_physical_apicid requires * another discussion and tests on each platform, we leave it * for now and here we use read_apic_id() directly in this -* function, __generic_processor_info(). +* function, generic_processor_info(). */ if (disabled_cpu_apicid != BAD_APICID && disabled_cpu_apicid != read_apic_id() &&
arch/x86/mm/mem_encrypt.c +1 -1
@@ -37,7 +37,7 @@ static char sme_cmdline_off[] __initdata = "off";* reside in the .data section so as not to be zeroed out when the .bss * section is later cleared. */ -unsigned long sme_me_mask __section(.data) = 0; +u64 sme_me_mask __section(.data) = 0;EXPORT_SYMBOL_GPL (sme_me_mask);/* Buffer used for early in-place encryption by BSP, no locking needed */
include/linux/mem_encrypt.h +9 -4
@@ -21,7 +21,7 @@#else /* !CONFIG_ARCH_HAS_MEM_ENCRYPT */ -#define sme_me_mask 0UL +#define sme_me_mask 0ULL#endif /* CONFIG_ARCH_HAS_MEM_ENCRYPT */
@@ -30,18 +30,23 @@ static inline bool sme_active(void) return !!sme_me_mask; } -static inline unsigned long sme_get_me_mask (void ) +static inline u64 sme_get_me_mask (void ) {return sme_me_mask; } +#ifdef CONFIG_AMD_MEM_ENCRYPT /* * The __sme_set() and __sme_clr() macros are useful for adding or removing * the encryption mask from a value (e.g. when dealing with pagetable * entries). */ -#define __sme_set (x) ((unsigned long)(x) | sme_me_mask) -#define __sme_clr (x) ((unsigned long)(x) & ~sme_me_mask) +#define __sme_set (x) ((x) | sme_me_mask) +#define __sme_clr (x) ((x) & ~sme_me_mask) +#else +#define __sme_set (x) (x) +#define __sme_clr (x) (x) +#endif #endif /* __ASSEMBLY__ */