diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-11-13 17:13:48 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-11-13 17:13:48 -0500 |
commit | d6ec9d9a4def52a5094237564eaf6f6979fd7a27 (patch) | |
tree | adfb80f83f04a021e82cb25227b64b1bb9e793dc /include/linux | |
parent | 3e2014637c50e5d6a77cd63d5db6c209fe29d1b1 (diff) | |
parent | 91a6a6cfee8ad34ea4cc10a54c0765edfe437cdb (diff) |
Merge branch 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 core updates from Ingo Molnar:
"Note that in this cycle most of the x86 topics interacted at a level
that caused them to be merged into tip:x86/asm - but this should be a
temporary phenomenon, hopefully we'll back to the usual patterns in
the next merge window.
The main changes in this cycle were:
Hardware enablement:
- Add support for the Intel UMIP (User Mode Instruction Prevention)
CPU feature. This is a security feature that disables certain
instructions such as SGDT, SLDT, SIDT, SMSW and STR. (Ricardo Neri)
[ Note that this is disabled by default for now, there are some
smaller enhancements in the pipeline that I'll follow up with in
the next 1-2 days, which allows this to be enabled by default.]
- Add support for the AMD SEV (Secure Encrypted Virtualization) CPU
feature, on top of SME (Secure Memory Encryption) support that was
added in v4.14. (Tom Lendacky, Brijesh Singh)
- Enable new SSE/AVX/AVX512 CPU features: AVX512_VBMI2, GFNI, VAES,
VPCLMULQDQ, AVX512_VNNI, AVX512_BITALG. (Gayatri Kammela)
Other changes:
- A big series of entry code simplifications and enhancements (Andy
Lutomirski)
- Make the ORC unwinder default on x86 and various objtool
enhancements. (Josh Poimboeuf)
- 5-level paging enhancements (Kirill A. Shutemov)
- Micro-optimize the entry code a bit (Borislav Petkov)
- Improve the handling of interdependent CPU features in the early
FPU init code (Andi Kleen)
- Build system enhancements (Changbin Du, Masahiro Yamada)
- ... plus misc enhancements, fixes and cleanups"
* 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (118 commits)
x86/build: Make the boot image generation less verbose
selftests/x86: Add tests for the STR and SLDT instructions
selftests/x86: Add tests for User-Mode Instruction Prevention
x86/traps: Fix up general protection faults caused by UMIP
x86/umip: Enable User-Mode Instruction Prevention at runtime
x86/umip: Force a page fault when unable to copy emulated result to user
x86/umip: Add emulation code for UMIP instructions
x86/cpufeature: Add User-Mode Instruction Prevention definitions
x86/insn-eval: Add support to resolve 16-bit address encodings
x86/insn-eval: Handle 32-bit address encodings in virtual-8086 mode
x86/insn-eval: Add wrapper function for 32 and 64-bit addresses
x86/insn-eval: Add support to resolve 32-bit address encodings
x86/insn-eval: Compute linear address in several utility functions
resource: Fix resource_size.cocci warnings
X86/KVM: Clear encryption attribute when SEV is active
X86/KVM: Decrypt shared per-cpu variables when SEV is active
percpu: Introduce DEFINE_PER_CPU_DECRYPTED
x86: Add support for changing memory encryption attribute in early boot
x86/io: Unroll string I/O when SEV is active
x86/boot: Add early boot support when running with SEV active
...
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/ioport.h | 7 | ||||
-rw-r--r-- | include/linux/kexec.h | 2 | ||||
-rw-r--r-- | include/linux/mem_encrypt.h | 7 | ||||
-rw-r--r-- | include/linux/mm.h | 2 | ||||
-rw-r--r-- | include/linux/mmzone.h | 6 | ||||
-rw-r--r-- | include/linux/percpu-defs.h | 15 |
6 files changed, 32 insertions, 7 deletions
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 83c8d6530f0f..93b4183cf53d 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
@@ -271,11 +271,14 @@ extern int | |||
271 | walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages, | 271 | walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages, |
272 | void *arg, int (*func)(unsigned long, unsigned long, void *)); | 272 | void *arg, int (*func)(unsigned long, unsigned long, void *)); |
273 | extern int | 273 | extern int |
274 | walk_mem_res(u64 start, u64 end, void *arg, | ||
275 | int (*func)(struct resource *, void *)); | ||
276 | extern int | ||
274 | walk_system_ram_res(u64 start, u64 end, void *arg, | 277 | walk_system_ram_res(u64 start, u64 end, void *arg, |
275 | int (*func)(u64, u64, void *)); | 278 | int (*func)(struct resource *, void *)); |
276 | extern int | 279 | extern int |
277 | walk_iomem_res_desc(unsigned long desc, unsigned long flags, u64 start, u64 end, | 280 | walk_iomem_res_desc(unsigned long desc, unsigned long flags, u64 start, u64 end, |
278 | void *arg, int (*func)(u64, u64, void *)); | 281 | void *arg, int (*func)(struct resource *, void *)); |
279 | 282 | ||
280 | /* True if any part of r1 overlaps r2 */ | 283 | /* True if any part of r1 overlaps r2 */ |
281 | static inline bool resource_overlaps(struct resource *r1, struct resource *r2) | 284 | static inline bool resource_overlaps(struct resource *r1, struct resource *r2) |
diff --git a/include/linux/kexec.h b/include/linux/kexec.h index 1c08c925cefb..f16f6ceb3875 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h | |||
@@ -160,7 +160,7 @@ struct kexec_buf { | |||
160 | }; | 160 | }; |
161 | 161 | ||
162 | int __weak arch_kexec_walk_mem(struct kexec_buf *kbuf, | 162 | int __weak arch_kexec_walk_mem(struct kexec_buf *kbuf, |
163 | int (*func)(u64, u64, void *)); | 163 | int (*func)(struct resource *, void *)); |
164 | extern int kexec_add_buffer(struct kexec_buf *kbuf); | 164 | extern int kexec_add_buffer(struct kexec_buf *kbuf); |
165 | int kexec_locate_mem_hole(struct kexec_buf *kbuf); | 165 | int kexec_locate_mem_hole(struct kexec_buf *kbuf); |
166 | #endif /* CONFIG_KEXEC_FILE */ | 166 | #endif /* CONFIG_KEXEC_FILE */ |
diff --git a/include/linux/mem_encrypt.h b/include/linux/mem_encrypt.h index 265a9cd21cb4..b310a9c18113 100644 --- a/include/linux/mem_encrypt.h +++ b/include/linux/mem_encrypt.h | |||
@@ -23,11 +23,14 @@ | |||
23 | 23 | ||
24 | #define sme_me_mask 0ULL | 24 | #define sme_me_mask 0ULL |
25 | 25 | ||
26 | static inline bool sme_active(void) { return false; } | ||
27 | static inline bool sev_active(void) { return false; } | ||
28 | |||
26 | #endif /* CONFIG_ARCH_HAS_MEM_ENCRYPT */ | 29 | #endif /* CONFIG_ARCH_HAS_MEM_ENCRYPT */ |
27 | 30 | ||
28 | static inline bool sme_active(void) | 31 | static inline bool mem_encrypt_active(void) |
29 | { | 32 | { |
30 | return !!sme_me_mask; | 33 | return sme_me_mask; |
31 | } | 34 | } |
32 | 35 | ||
33 | static inline u64 sme_get_me_mask(void) | 36 | static inline u64 sme_get_me_mask(void) |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 43edf659453b..91b46f99b4d2 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -2496,7 +2496,7 @@ void vmemmap_populate_print_last(void); | |||
2496 | void vmemmap_free(unsigned long start, unsigned long end); | 2496 | void vmemmap_free(unsigned long start, unsigned long end); |
2497 | #endif | 2497 | #endif |
2498 | void register_page_bootmem_memmap(unsigned long section_nr, struct page *map, | 2498 | void register_page_bootmem_memmap(unsigned long section_nr, struct page *map, |
2499 | unsigned long size); | 2499 | unsigned long nr_pages); |
2500 | 2500 | ||
2501 | enum mf_flags { | 2501 | enum mf_flags { |
2502 | MF_COUNT_INCREASED = 1 << 0, | 2502 | MF_COUNT_INCREASED = 1 << 0, |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index c9c4a81b9767..a507f43ad221 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -1151,13 +1151,17 @@ struct mem_section { | |||
1151 | #define SECTION_ROOT_MASK (SECTIONS_PER_ROOT - 1) | 1151 | #define SECTION_ROOT_MASK (SECTIONS_PER_ROOT - 1) |
1152 | 1152 | ||
1153 | #ifdef CONFIG_SPARSEMEM_EXTREME | 1153 | #ifdef CONFIG_SPARSEMEM_EXTREME |
1154 | extern struct mem_section *mem_section[NR_SECTION_ROOTS]; | 1154 | extern struct mem_section **mem_section; |
1155 | #else | 1155 | #else |
1156 | extern struct mem_section mem_section[NR_SECTION_ROOTS][SECTIONS_PER_ROOT]; | 1156 | extern struct mem_section mem_section[NR_SECTION_ROOTS][SECTIONS_PER_ROOT]; |
1157 | #endif | 1157 | #endif |
1158 | 1158 | ||
1159 | static inline struct mem_section *__nr_to_section(unsigned long nr) | 1159 | static inline struct mem_section *__nr_to_section(unsigned long nr) |
1160 | { | 1160 | { |
1161 | #ifdef CONFIG_SPARSEMEM_EXTREME | ||
1162 | if (!mem_section) | ||
1163 | return NULL; | ||
1164 | #endif | ||
1161 | if (!mem_section[SECTION_NR_TO_ROOT(nr)]) | 1165 | if (!mem_section[SECTION_NR_TO_ROOT(nr)]) |
1162 | return NULL; | 1166 | return NULL; |
1163 | return &mem_section[SECTION_NR_TO_ROOT(nr)][nr & SECTION_ROOT_MASK]; | 1167 | return &mem_section[SECTION_NR_TO_ROOT(nr)][nr & SECTION_ROOT_MASK]; |
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h index 8f16299ca068..2d2096ba1cfe 100644 --- a/include/linux/percpu-defs.h +++ b/include/linux/percpu-defs.h | |||
@@ -173,6 +173,21 @@ | |||
173 | DEFINE_PER_CPU_SECTION(type, name, "..read_mostly") | 173 | DEFINE_PER_CPU_SECTION(type, name, "..read_mostly") |
174 | 174 | ||
175 | /* | 175 | /* |
176 | * Declaration/definition used for per-CPU variables that should be accessed | ||
177 | * as decrypted when memory encryption is enabled in the guest. | ||
178 | */ | ||
179 | #if defined(CONFIG_VIRTUALIZATION) && defined(CONFIG_AMD_MEM_ENCRYPT) | ||
180 | |||
181 | #define DECLARE_PER_CPU_DECRYPTED(type, name) \ | ||
182 | DECLARE_PER_CPU_SECTION(type, name, "..decrypted") | ||
183 | |||
184 | #define DEFINE_PER_CPU_DECRYPTED(type, name) \ | ||
185 | DEFINE_PER_CPU_SECTION(type, name, "..decrypted") | ||
186 | #else | ||
187 | #define DEFINE_PER_CPU_DECRYPTED(type, name) DEFINE_PER_CPU(type, name) | ||
188 | #endif | ||
189 | |||
190 | /* | ||
176 | * Intermodule exports for per-CPU variables. sparse forgets about | 191 | * Intermodule exports for per-CPU variables. sparse forgets about |
177 | * address space across EXPORT_SYMBOL(), change EXPORT_SYMBOL() to | 192 | * address space across EXPORT_SYMBOL(), change EXPORT_SYMBOL() to |
178 | * noop if __CHECKER__. | 193 | * noop if __CHECKER__. |