diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm64/configs/defconfig | 9 | ||||
-rw-r--r-- | arch/arm64/include/asm/dma-mapping.h | 11 | ||||
-rw-r--r-- | arch/arm64/include/asm/pgtable.h | 5 | ||||
-rw-r--r-- | arch/arm64/kernel/suspend.c | 14 | ||||
-rw-r--r-- | arch/parisc/include/asm/ldcw.h | 13 | ||||
-rw-r--r-- | arch/x86/kvm/mmu.c | 2 | ||||
-rw-r--r-- | arch/x86/kvm/vmx.c | 88 |
7 files changed, 82 insertions, 60 deletions
diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index dd301be89ecc..5376d908eabe 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig | |||
@@ -1,6 +1,7 @@ | |||
1 | # CONFIG_LOCALVERSION_AUTO is not set | 1 | # CONFIG_LOCALVERSION_AUTO is not set |
2 | CONFIG_SYSVIPC=y | 2 | CONFIG_SYSVIPC=y |
3 | CONFIG_POSIX_MQUEUE=y | 3 | CONFIG_POSIX_MQUEUE=y |
4 | CONFIG_FHANDLE=y | ||
4 | CONFIG_AUDIT=y | 5 | CONFIG_AUDIT=y |
5 | CONFIG_NO_HZ_IDLE=y | 6 | CONFIG_NO_HZ_IDLE=y |
6 | CONFIG_HIGH_RES_TIMERS=y | 7 | CONFIG_HIGH_RES_TIMERS=y |
@@ -13,14 +14,12 @@ CONFIG_TASK_IO_ACCOUNTING=y | |||
13 | CONFIG_IKCONFIG=y | 14 | CONFIG_IKCONFIG=y |
14 | CONFIG_IKCONFIG_PROC=y | 15 | CONFIG_IKCONFIG_PROC=y |
15 | CONFIG_LOG_BUF_SHIFT=14 | 16 | CONFIG_LOG_BUF_SHIFT=14 |
16 | CONFIG_RESOURCE_COUNTERS=y | ||
17 | CONFIG_MEMCG=y | 17 | CONFIG_MEMCG=y |
18 | CONFIG_MEMCG_SWAP=y | 18 | CONFIG_MEMCG_SWAP=y |
19 | CONFIG_MEMCG_KMEM=y | 19 | CONFIG_MEMCG_KMEM=y |
20 | CONFIG_CGROUP_HUGETLB=y | 20 | CONFIG_CGROUP_HUGETLB=y |
21 | # CONFIG_UTS_NS is not set | 21 | # CONFIG_UTS_NS is not set |
22 | # CONFIG_IPC_NS is not set | 22 | # CONFIG_IPC_NS is not set |
23 | # CONFIG_PID_NS is not set | ||
24 | # CONFIG_NET_NS is not set | 23 | # CONFIG_NET_NS is not set |
25 | CONFIG_SCHED_AUTOGROUP=y | 24 | CONFIG_SCHED_AUTOGROUP=y |
26 | CONFIG_BLK_DEV_INITRD=y | 25 | CONFIG_BLK_DEV_INITRD=y |
@@ -92,7 +91,6 @@ CONFIG_SERIAL_AMBA_PL011_CONSOLE=y | |||
92 | CONFIG_SERIAL_OF_PLATFORM=y | 91 | CONFIG_SERIAL_OF_PLATFORM=y |
93 | CONFIG_VIRTIO_CONSOLE=y | 92 | CONFIG_VIRTIO_CONSOLE=y |
94 | # CONFIG_HW_RANDOM is not set | 93 | # CONFIG_HW_RANDOM is not set |
95 | # CONFIG_HMC_DRV is not set | ||
96 | CONFIG_SPI=y | 94 | CONFIG_SPI=y |
97 | CONFIG_SPI_PL022=y | 95 | CONFIG_SPI_PL022=y |
98 | CONFIG_GPIO_PL061=y | 96 | CONFIG_GPIO_PL061=y |
@@ -133,6 +131,8 @@ CONFIG_EXT3_FS=y | |||
133 | CONFIG_EXT4_FS=y | 131 | CONFIG_EXT4_FS=y |
134 | CONFIG_FANOTIFY=y | 132 | CONFIG_FANOTIFY=y |
135 | CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y | 133 | CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y |
134 | CONFIG_QUOTA=y | ||
135 | CONFIG_AUTOFS4_FS=y | ||
136 | CONFIG_FUSE_FS=y | 136 | CONFIG_FUSE_FS=y |
137 | CONFIG_CUSE=y | 137 | CONFIG_CUSE=y |
138 | CONFIG_VFAT_FS=y | 138 | CONFIG_VFAT_FS=y |
@@ -152,14 +152,15 @@ CONFIG_MAGIC_SYSRQ=y | |||
152 | CONFIG_DEBUG_KERNEL=y | 152 | CONFIG_DEBUG_KERNEL=y |
153 | CONFIG_LOCKUP_DETECTOR=y | 153 | CONFIG_LOCKUP_DETECTOR=y |
154 | # CONFIG_SCHED_DEBUG is not set | 154 | # CONFIG_SCHED_DEBUG is not set |
155 | # CONFIG_DEBUG_PREEMPT is not set | ||
155 | # CONFIG_FTRACE is not set | 156 | # CONFIG_FTRACE is not set |
157 | CONFIG_KEYS=y | ||
156 | CONFIG_SECURITY=y | 158 | CONFIG_SECURITY=y |
157 | CONFIG_CRYPTO_ANSI_CPRNG=y | 159 | CONFIG_CRYPTO_ANSI_CPRNG=y |
158 | CONFIG_ARM64_CRYPTO=y | 160 | CONFIG_ARM64_CRYPTO=y |
159 | CONFIG_CRYPTO_SHA1_ARM64_CE=y | 161 | CONFIG_CRYPTO_SHA1_ARM64_CE=y |
160 | CONFIG_CRYPTO_SHA2_ARM64_CE=y | 162 | CONFIG_CRYPTO_SHA2_ARM64_CE=y |
161 | CONFIG_CRYPTO_GHASH_ARM64_CE=y | 163 | CONFIG_CRYPTO_GHASH_ARM64_CE=y |
162 | CONFIG_CRYPTO_AES_ARM64_CE=y | ||
163 | CONFIG_CRYPTO_AES_ARM64_CE_CCM=y | 164 | CONFIG_CRYPTO_AES_ARM64_CE_CCM=y |
164 | CONFIG_CRYPTO_AES_ARM64_CE_BLK=y | 165 | CONFIG_CRYPTO_AES_ARM64_CE_BLK=y |
165 | CONFIG_CRYPTO_AES_ARM64_NEON_BLK=y | 166 | CONFIG_CRYPTO_AES_ARM64_NEON_BLK=y |
diff --git a/arch/arm64/include/asm/dma-mapping.h b/arch/arm64/include/asm/dma-mapping.h index d34189bceff7..9ce3e680ae1c 100644 --- a/arch/arm64/include/asm/dma-mapping.h +++ b/arch/arm64/include/asm/dma-mapping.h | |||
@@ -52,13 +52,14 @@ static inline void set_dma_ops(struct device *dev, struct dma_map_ops *ops) | |||
52 | dev->archdata.dma_ops = ops; | 52 | dev->archdata.dma_ops = ops; |
53 | } | 53 | } |
54 | 54 | ||
55 | static inline int set_arch_dma_coherent_ops(struct device *dev) | 55 | static inline void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, |
56 | struct iommu_ops *iommu, bool coherent) | ||
56 | { | 57 | { |
57 | dev->archdata.dma_coherent = true; | 58 | dev->archdata.dma_coherent = coherent; |
58 | set_dma_ops(dev, &coherent_swiotlb_dma_ops); | 59 | if (coherent) |
59 | return 0; | 60 | set_dma_ops(dev, &coherent_swiotlb_dma_ops); |
60 | } | 61 | } |
61 | #define set_arch_dma_coherent_ops set_arch_dma_coherent_ops | 62 | #define arch_setup_dma_ops arch_setup_dma_ops |
62 | 63 | ||
63 | /* do not use this function in a driver */ | 64 | /* do not use this function in a driver */ |
64 | static inline bool is_device_dma_coherent(struct device *dev) | 65 | static inline bool is_device_dma_coherent(struct device *dev) |
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index df22314f57cf..210d632aa5ad 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h | |||
@@ -298,7 +298,6 @@ void pmdp_splitting_flush(struct vm_area_struct *vma, unsigned long address, | |||
298 | #define pfn_pmd(pfn,prot) (__pmd(((phys_addr_t)(pfn) << PAGE_SHIFT) | pgprot_val(prot))) | 298 | #define pfn_pmd(pfn,prot) (__pmd(((phys_addr_t)(pfn) << PAGE_SHIFT) | pgprot_val(prot))) |
299 | #define mk_pmd(page,prot) pfn_pmd(page_to_pfn(page),prot) | 299 | #define mk_pmd(page,prot) pfn_pmd(page_to_pfn(page),prot) |
300 | 300 | ||
301 | #define pmd_page(pmd) pfn_to_page(__phys_to_pfn(pmd_val(pmd) & PHYS_MASK)) | ||
302 | #define pud_write(pud) pte_write(pud_pte(pud)) | 301 | #define pud_write(pud) pte_write(pud_pte(pud)) |
303 | #define pud_pfn(pud) (((pud_val(pud) & PUD_MASK) & PHYS_MASK) >> PAGE_SHIFT) | 302 | #define pud_pfn(pud) (((pud_val(pud) & PUD_MASK) & PHYS_MASK) >> PAGE_SHIFT) |
304 | 303 | ||
@@ -401,7 +400,7 @@ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long addr) | |||
401 | return (pmd_t *)pud_page_vaddr(*pud) + pmd_index(addr); | 400 | return (pmd_t *)pud_page_vaddr(*pud) + pmd_index(addr); |
402 | } | 401 | } |
403 | 402 | ||
404 | #define pud_page(pud) pmd_page(pud_pmd(pud)) | 403 | #define pud_page(pud) pfn_to_page(__phys_to_pfn(pud_val(pud) & PHYS_MASK)) |
405 | 404 | ||
406 | #endif /* CONFIG_ARM64_PGTABLE_LEVELS > 2 */ | 405 | #endif /* CONFIG_ARM64_PGTABLE_LEVELS > 2 */ |
407 | 406 | ||
@@ -437,6 +436,8 @@ static inline pud_t *pud_offset(pgd_t *pgd, unsigned long addr) | |||
437 | return (pud_t *)pgd_page_vaddr(*pgd) + pud_index(addr); | 436 | return (pud_t *)pgd_page_vaddr(*pgd) + pud_index(addr); |
438 | } | 437 | } |
439 | 438 | ||
439 | #define pgd_page(pgd) pfn_to_page(__phys_to_pfn(pgd_val(pgd) & PHYS_MASK)) | ||
440 | |||
440 | #endif /* CONFIG_ARM64_PGTABLE_LEVELS > 3 */ | 441 | #endif /* CONFIG_ARM64_PGTABLE_LEVELS > 3 */ |
441 | 442 | ||
442 | #define pgd_ERROR(pgd) __pgd_error(__FILE__, __LINE__, pgd_val(pgd)) | 443 | #define pgd_ERROR(pgd) __pgd_error(__FILE__, __LINE__, pgd_val(pgd)) |
diff --git a/arch/arm64/kernel/suspend.c b/arch/arm64/kernel/suspend.c index 3771b72b6569..2d6b6065fe7f 100644 --- a/arch/arm64/kernel/suspend.c +++ b/arch/arm64/kernel/suspend.c | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <asm/debug-monitors.h> | 5 | #include <asm/debug-monitors.h> |
6 | #include <asm/pgtable.h> | 6 | #include <asm/pgtable.h> |
7 | #include <asm/memory.h> | 7 | #include <asm/memory.h> |
8 | #include <asm/mmu_context.h> | ||
8 | #include <asm/smp_plat.h> | 9 | #include <asm/smp_plat.h> |
9 | #include <asm/suspend.h> | 10 | #include <asm/suspend.h> |
10 | #include <asm/tlbflush.h> | 11 | #include <asm/tlbflush.h> |
@@ -98,7 +99,18 @@ int __cpu_suspend(unsigned long arg, int (*fn)(unsigned long)) | |||
98 | */ | 99 | */ |
99 | ret = __cpu_suspend_enter(arg, fn); | 100 | ret = __cpu_suspend_enter(arg, fn); |
100 | if (ret == 0) { | 101 | if (ret == 0) { |
101 | cpu_switch_mm(mm->pgd, mm); | 102 | /* |
103 | * We are resuming from reset with TTBR0_EL1 set to the | ||
104 | * idmap to enable the MMU; restore the active_mm mappings in | ||
105 | * TTBR0_EL1 unless the active_mm == &init_mm, in which case | ||
106 | * the thread entered __cpu_suspend with TTBR0_EL1 set to | ||
107 | * reserved TTBR0 page tables and should be restored as such. | ||
108 | */ | ||
109 | if (mm == &init_mm) | ||
110 | cpu_set_reserved_ttbr0(); | ||
111 | else | ||
112 | cpu_switch_mm(mm->pgd, mm); | ||
113 | |||
102 | flush_tlb_all(); | 114 | flush_tlb_all(); |
103 | 115 | ||
104 | /* | 116 | /* |
diff --git a/arch/parisc/include/asm/ldcw.h b/arch/parisc/include/asm/ldcw.h index d2d11b7055ba..8121aa6db2ff 100644 --- a/arch/parisc/include/asm/ldcw.h +++ b/arch/parisc/include/asm/ldcw.h | |||
@@ -33,11 +33,18 @@ | |||
33 | 33 | ||
34 | #endif /*!CONFIG_PA20*/ | 34 | #endif /*!CONFIG_PA20*/ |
35 | 35 | ||
36 | /* LDCW, the only atomic read-write operation PA-RISC has. *sigh*. */ | 36 | /* LDCW, the only atomic read-write operation PA-RISC has. *sigh*. |
37 | We don't explicitly expose that "*a" may be written as reload | ||
38 | fails to find a register in class R1_REGS when "a" needs to be | ||
39 | reloaded when generating 64-bit PIC code. Instead, we clobber | ||
40 | memory to indicate to the compiler that the assembly code reads | ||
41 | or writes to items other than those listed in the input and output | ||
42 | operands. This may pessimize the code somewhat but __ldcw is | ||
43 | usually used within code blocks surrounded by memory barriors. */ | ||
37 | #define __ldcw(a) ({ \ | 44 | #define __ldcw(a) ({ \ |
38 | unsigned __ret; \ | 45 | unsigned __ret; \ |
39 | __asm__ __volatile__(__LDCW " 0(%2),%0" \ | 46 | __asm__ __volatile__(__LDCW " 0(%1),%0" \ |
40 | : "=r" (__ret), "+m" (*(a)) : "r" (a)); \ | 47 | : "=r" (__ret) : "r" (a) : "memory"); \ |
41 | __ret; \ | 48 | __ret; \ |
42 | }) | 49 | }) |
43 | 50 | ||
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 10fbed126b11..f83fc6c5e0ba 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
@@ -4448,7 +4448,7 @@ void kvm_mmu_invalidate_mmio_sptes(struct kvm *kvm) | |||
4448 | * zap all shadow pages. | 4448 | * zap all shadow pages. |
4449 | */ | 4449 | */ |
4450 | if (unlikely(kvm_current_mmio_generation(kvm) == 0)) { | 4450 | if (unlikely(kvm_current_mmio_generation(kvm) == 0)) { |
4451 | printk_ratelimited(KERN_INFO "kvm: zapping shadow pages for mmio generation wraparound\n"); | 4451 | printk_ratelimited(KERN_DEBUG "kvm: zapping shadow pages for mmio generation wraparound\n"); |
4452 | kvm_mmu_invalidate_zap_all_pages(kvm); | 4452 | kvm_mmu_invalidate_zap_all_pages(kvm); |
4453 | } | 4453 | } |
4454 | } | 4454 | } |
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index feb852b04598..d4c58d884838 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -5840,53 +5840,10 @@ static __init int hardware_setup(void) | |||
5840 | memset(vmx_msr_bitmap_legacy, 0xff, PAGE_SIZE); | 5840 | memset(vmx_msr_bitmap_legacy, 0xff, PAGE_SIZE); |
5841 | memset(vmx_msr_bitmap_longmode, 0xff, PAGE_SIZE); | 5841 | memset(vmx_msr_bitmap_longmode, 0xff, PAGE_SIZE); |
5842 | 5842 | ||
5843 | vmx_disable_intercept_for_msr(MSR_FS_BASE, false); | ||
5844 | vmx_disable_intercept_for_msr(MSR_GS_BASE, false); | ||
5845 | vmx_disable_intercept_for_msr(MSR_KERNEL_GS_BASE, true); | ||
5846 | vmx_disable_intercept_for_msr(MSR_IA32_SYSENTER_CS, false); | ||
5847 | vmx_disable_intercept_for_msr(MSR_IA32_SYSENTER_ESP, false); | ||
5848 | vmx_disable_intercept_for_msr(MSR_IA32_SYSENTER_EIP, false); | ||
5849 | vmx_disable_intercept_for_msr(MSR_IA32_BNDCFGS, true); | ||
5850 | |||
5851 | memcpy(vmx_msr_bitmap_legacy_x2apic, | ||
5852 | vmx_msr_bitmap_legacy, PAGE_SIZE); | ||
5853 | memcpy(vmx_msr_bitmap_longmode_x2apic, | ||
5854 | vmx_msr_bitmap_longmode, PAGE_SIZE); | ||
5855 | |||
5856 | if (enable_apicv) { | ||
5857 | for (msr = 0x800; msr <= 0x8ff; msr++) | ||
5858 | vmx_disable_intercept_msr_read_x2apic(msr); | ||
5859 | |||
5860 | /* According SDM, in x2apic mode, the whole id reg is used. | ||
5861 | * But in KVM, it only use the highest eight bits. Need to | ||
5862 | * intercept it */ | ||
5863 | vmx_enable_intercept_msr_read_x2apic(0x802); | ||
5864 | /* TMCCT */ | ||
5865 | vmx_enable_intercept_msr_read_x2apic(0x839); | ||
5866 | /* TPR */ | ||
5867 | vmx_disable_intercept_msr_write_x2apic(0x808); | ||
5868 | /* EOI */ | ||
5869 | vmx_disable_intercept_msr_write_x2apic(0x80b); | ||
5870 | /* SELF-IPI */ | ||
5871 | vmx_disable_intercept_msr_write_x2apic(0x83f); | ||
5872 | } | ||
5873 | |||
5874 | if (enable_ept) { | ||
5875 | kvm_mmu_set_mask_ptes(0ull, | ||
5876 | (enable_ept_ad_bits) ? VMX_EPT_ACCESS_BIT : 0ull, | ||
5877 | (enable_ept_ad_bits) ? VMX_EPT_DIRTY_BIT : 0ull, | ||
5878 | 0ull, VMX_EPT_EXECUTABLE_MASK); | ||
5879 | ept_set_mmio_spte_mask(); | ||
5880 | kvm_enable_tdp(); | ||
5881 | } else | ||
5882 | kvm_disable_tdp(); | ||
5883 | |||
5884 | update_ple_window_actual_max(); | ||
5885 | |||
5886 | if (setup_vmcs_config(&vmcs_config) < 0) { | 5843 | if (setup_vmcs_config(&vmcs_config) < 0) { |
5887 | r = -EIO; | 5844 | r = -EIO; |
5888 | goto out7; | 5845 | goto out7; |
5889 | } | 5846 | } |
5890 | 5847 | ||
5891 | if (boot_cpu_has(X86_FEATURE_NX)) | 5848 | if (boot_cpu_has(X86_FEATURE_NX)) |
5892 | kvm_enable_efer_bits(EFER_NX); | 5849 | kvm_enable_efer_bits(EFER_NX); |
@@ -5945,6 +5902,49 @@ static __init int hardware_setup(void) | |||
5945 | if (nested) | 5902 | if (nested) |
5946 | nested_vmx_setup_ctls_msrs(); | 5903 | nested_vmx_setup_ctls_msrs(); |
5947 | 5904 | ||
5905 | vmx_disable_intercept_for_msr(MSR_FS_BASE, false); | ||
5906 | vmx_disable_intercept_for_msr(MSR_GS_BASE, false); | ||
5907 | vmx_disable_intercept_for_msr(MSR_KERNEL_GS_BASE, true); | ||
5908 | vmx_disable_intercept_for_msr(MSR_IA32_SYSENTER_CS, false); | ||
5909 | vmx_disable_intercept_for_msr(MSR_IA32_SYSENTER_ESP, false); | ||
5910 | vmx_disable_intercept_for_msr(MSR_IA32_SYSENTER_EIP, false); | ||
5911 | vmx_disable_intercept_for_msr(MSR_IA32_BNDCFGS, true); | ||
5912 | |||
5913 | memcpy(vmx_msr_bitmap_legacy_x2apic, | ||
5914 | vmx_msr_bitmap_legacy, PAGE_SIZE); | ||
5915 | memcpy(vmx_msr_bitmap_longmode_x2apic, | ||
5916 | vmx_msr_bitmap_longmode, PAGE_SIZE); | ||
5917 | |||
5918 | if (enable_apicv) { | ||
5919 | for (msr = 0x800; msr <= 0x8ff; msr++) | ||
5920 | vmx_disable_intercept_msr_read_x2apic(msr); | ||
5921 | |||
5922 | /* According SDM, in x2apic mode, the whole id reg is used. | ||
5923 | * But in KVM, it only use the highest eight bits. Need to | ||
5924 | * intercept it */ | ||
5925 | vmx_enable_intercept_msr_read_x2apic(0x802); | ||
5926 | /* TMCCT */ | ||
5927 | vmx_enable_intercept_msr_read_x2apic(0x839); | ||
5928 | /* TPR */ | ||
5929 | vmx_disable_intercept_msr_write_x2apic(0x808); | ||
5930 | /* EOI */ | ||
5931 | vmx_disable_intercept_msr_write_x2apic(0x80b); | ||
5932 | /* SELF-IPI */ | ||
5933 | vmx_disable_intercept_msr_write_x2apic(0x83f); | ||
5934 | } | ||
5935 | |||
5936 | if (enable_ept) { | ||
5937 | kvm_mmu_set_mask_ptes(0ull, | ||
5938 | (enable_ept_ad_bits) ? VMX_EPT_ACCESS_BIT : 0ull, | ||
5939 | (enable_ept_ad_bits) ? VMX_EPT_DIRTY_BIT : 0ull, | ||
5940 | 0ull, VMX_EPT_EXECUTABLE_MASK); | ||
5941 | ept_set_mmio_spte_mask(); | ||
5942 | kvm_enable_tdp(); | ||
5943 | } else | ||
5944 | kvm_disable_tdp(); | ||
5945 | |||
5946 | update_ple_window_actual_max(); | ||
5947 | |||
5948 | return alloc_kvm_area(); | 5948 | return alloc_kvm_area(); |
5949 | 5949 | ||
5950 | out7: | 5950 | out7: |