diff options
-rw-r--r-- | arch/x86/include/asm/mem_encrypt.h | 4 | ||||
-rw-r--r-- | arch/x86/include/asm/mpspec.h | 1 | ||||
-rw-r--r-- | arch/x86/kernel/apic/apic.c | 2 | ||||
-rw-r--r-- | arch/x86/mm/mem_encrypt.c | 2 | ||||
-rw-r--r-- | include/linux/mem_encrypt.h | 13 |
5 files changed, 13 insertions, 9 deletions
diff --git a/arch/x86/include/asm/mem_encrypt.h b/arch/x86/include/asm/mem_encrypt.h index 8e618fcf1f7c..6a77c63540f7 100644 --- a/arch/x86/include/asm/mem_encrypt.h +++ b/arch/x86/include/asm/mem_encrypt.h | |||
@@ -21,7 +21,7 @@ | |||
21 | 21 | ||
22 | #ifdef CONFIG_AMD_MEM_ENCRYPT | 22 | #ifdef CONFIG_AMD_MEM_ENCRYPT |
23 | 23 | ||
24 | extern unsigned long sme_me_mask; | 24 | extern u64 sme_me_mask; |
25 | 25 | ||
26 | void sme_encrypt_execute(unsigned long encrypted_kernel_vaddr, | 26 | void sme_encrypt_execute(unsigned long encrypted_kernel_vaddr, |
27 | unsigned long decrypted_kernel_vaddr, | 27 | unsigned long decrypted_kernel_vaddr, |
@@ -49,7 +49,7 @@ void swiotlb_set_mem_attributes(void *vaddr, unsigned long size); | |||
49 | 49 | ||
50 | #else /* !CONFIG_AMD_MEM_ENCRYPT */ | 50 | #else /* !CONFIG_AMD_MEM_ENCRYPT */ |
51 | 51 | ||
52 | #define sme_me_mask 0UL | 52 | #define sme_me_mask 0ULL |
53 | 53 | ||
54 | static inline void __init sme_early_encrypt(resource_size_t paddr, | 54 | static inline void __init sme_early_encrypt(resource_size_t paddr, |
55 | unsigned long size) { } | 55 | unsigned long size) { } |
diff --git a/arch/x86/include/asm/mpspec.h b/arch/x86/include/asm/mpspec.h index 831eb7895535..c471ca1f9412 100644 --- a/arch/x86/include/asm/mpspec.h +++ b/arch/x86/include/asm/mpspec.h | |||
@@ -86,7 +86,6 @@ static inline void e820__memblock_alloc_reserved_mpc_new(void) { } | |||
86 | #endif | 86 | #endif |
87 | 87 | ||
88 | int generic_processor_info(int apicid, int version); | 88 | int generic_processor_info(int apicid, int version); |
89 | int __generic_processor_info(int apicid, int version, bool enabled); | ||
90 | 89 | ||
91 | #define PHYSID_ARRAY_SIZE BITS_TO_LONGS(MAX_LOCAL_APIC) | 90 | #define PHYSID_ARRAY_SIZE BITS_TO_LONGS(MAX_LOCAL_APIC) |
92 | 91 | ||
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 8315e2f517a7..d705c769f77d 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c | |||
@@ -2130,7 +2130,7 @@ int generic_processor_info(int apicid, int version) | |||
2130 | * Since fixing handling of boot_cpu_physical_apicid requires | 2130 | * Since fixing handling of boot_cpu_physical_apicid requires |
2131 | * another discussion and tests on each platform, we leave it | 2131 | * another discussion and tests on each platform, we leave it |
2132 | * for now and here we use read_apic_id() directly in this | 2132 | * for now and here we use read_apic_id() directly in this |
2133 | * function, __generic_processor_info(). | 2133 | * function, generic_processor_info(). |
2134 | */ | 2134 | */ |
2135 | if (disabled_cpu_apicid != BAD_APICID && | 2135 | if (disabled_cpu_apicid != BAD_APICID && |
2136 | disabled_cpu_apicid != read_apic_id() && | 2136 | disabled_cpu_apicid != read_apic_id() && |
diff --git a/arch/x86/mm/mem_encrypt.c b/arch/x86/mm/mem_encrypt.c index 0fbd09269757..3fcc8e01683b 100644 --- a/arch/x86/mm/mem_encrypt.c +++ b/arch/x86/mm/mem_encrypt.c | |||
@@ -37,7 +37,7 @@ static char sme_cmdline_off[] __initdata = "off"; | |||
37 | * reside in the .data section so as not to be zeroed out when the .bss | 37 | * reside in the .data section so as not to be zeroed out when the .bss |
38 | * section is later cleared. | 38 | * section is later cleared. |
39 | */ | 39 | */ |
40 | unsigned long sme_me_mask __section(.data) = 0; | 40 | u64 sme_me_mask __section(.data) = 0; |
41 | EXPORT_SYMBOL_GPL(sme_me_mask); | 41 | EXPORT_SYMBOL_GPL(sme_me_mask); |
42 | 42 | ||
43 | /* Buffer used for early in-place encryption by BSP, no locking needed */ | 43 | /* Buffer used for early in-place encryption by BSP, no locking needed */ |
diff --git a/include/linux/mem_encrypt.h b/include/linux/mem_encrypt.h index 1255f09f5e42..265a9cd21cb4 100644 --- a/include/linux/mem_encrypt.h +++ b/include/linux/mem_encrypt.h | |||
@@ -21,7 +21,7 @@ | |||
21 | 21 | ||
22 | #else /* !CONFIG_ARCH_HAS_MEM_ENCRYPT */ | 22 | #else /* !CONFIG_ARCH_HAS_MEM_ENCRYPT */ |
23 | 23 | ||
24 | #define sme_me_mask 0UL | 24 | #define sme_me_mask 0ULL |
25 | 25 | ||
26 | #endif /* CONFIG_ARCH_HAS_MEM_ENCRYPT */ | 26 | #endif /* CONFIG_ARCH_HAS_MEM_ENCRYPT */ |
27 | 27 | ||
@@ -30,18 +30,23 @@ static inline bool sme_active(void) | |||
30 | return !!sme_me_mask; | 30 | return !!sme_me_mask; |
31 | } | 31 | } |
32 | 32 | ||
33 | static inline unsigned long sme_get_me_mask(void) | 33 | static inline u64 sme_get_me_mask(void) |
34 | { | 34 | { |
35 | return sme_me_mask; | 35 | return sme_me_mask; |
36 | } | 36 | } |
37 | 37 | ||
38 | #ifdef CONFIG_AMD_MEM_ENCRYPT | ||
38 | /* | 39 | /* |
39 | * The __sme_set() and __sme_clr() macros are useful for adding or removing | 40 | * The __sme_set() and __sme_clr() macros are useful for adding or removing |
40 | * the encryption mask from a value (e.g. when dealing with pagetable | 41 | * the encryption mask from a value (e.g. when dealing with pagetable |
41 | * entries). | 42 | * entries). |
42 | */ | 43 | */ |
43 | #define __sme_set(x) ((unsigned long)(x) | sme_me_mask) | 44 | #define __sme_set(x) ((x) | sme_me_mask) |
44 | #define __sme_clr(x) ((unsigned long)(x) & ~sme_me_mask) | 45 | #define __sme_clr(x) ((x) & ~sme_me_mask) |
46 | #else | ||
47 | #define __sme_set(x) (x) | ||
48 | #define __sme_clr(x) (x) | ||
49 | #endif | ||
45 | 50 | ||
46 | #endif /* __ASSEMBLY__ */ | 51 | #endif /* __ASSEMBLY__ */ |
47 | 52 | ||