Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
x86: fix 27-rc crash on vsmp due to paravirt during module load
x86, oprofile: BUG scheduling while atomic
AMD IOMMU: protect completion wait loop with iommu lock
AMD IOMMU: set iommu sunc flag after command queuing

+20 -8
+16 -6
arch/x86/kernel/amd_iommu.c
··· 101 101 */ 102 102 static int iommu_completion_wait(struct amd_iommu *iommu) 103 103 { 104 - int ret, ready = 0; 104 + int ret = 0, ready = 0; 105 105 unsigned status = 0; 106 106 struct iommu_cmd cmd; 107 - unsigned long i = 0; 107 + unsigned long flags, i = 0; 108 108 109 109 memset(&cmd, 0, sizeof(cmd)); 110 110 cmd.data[0] = CMD_COMPL_WAIT_INT_MASK; ··· 112 112 113 113 iommu->need_sync = 0; 114 114 115 - ret = iommu_queue_command(iommu, &cmd); 115 + spin_lock_irqsave(&iommu->lock, flags); 116 + 117 + ret = __iommu_queue_command(iommu, &cmd); 116 118 117 119 if (ret) 118 - return ret; 120 + goto out; 119 121 120 122 while (!ready && (i < EXIT_LOOP_COUNT)) { 121 123 ++i; ··· 132 130 133 131 if (unlikely((i == EXIT_LOOP_COUNT) && printk_ratelimit())) 134 132 printk(KERN_WARNING "AMD IOMMU: Completion wait loop failed\n"); 133 + out: 134 + spin_unlock_irqrestore(&iommu->lock, flags); 135 135 136 136 return 0; 137 137 } ··· 144 140 static int iommu_queue_inv_dev_entry(struct amd_iommu *iommu, u16 devid) 145 141 { 146 142 struct iommu_cmd cmd; 143 + int ret; 147 144 148 145 BUG_ON(iommu == NULL); 149 146 ··· 152 147 CMD_SET_TYPE(&cmd, CMD_INV_DEV_ENTRY); 153 148 cmd.data[0] = devid; 154 149 150 + ret = iommu_queue_command(iommu, &cmd); 151 + 155 152 iommu->need_sync = 1; 156 153 157 - return iommu_queue_command(iommu, &cmd); 154 + return ret; 158 155 } 159 156 160 157 /* ··· 166 159 u64 address, u16 domid, int pde, int s) 167 160 { 168 161 struct iommu_cmd cmd; 162 + int ret; 169 163 170 164 memset(&cmd, 0, sizeof(cmd)); 171 165 address &= PAGE_MASK; ··· 179 171 if (pde) /* PDE bit - we wan't flush everything not only the PTEs */ 180 172 cmd.data[2] |= CMD_INV_IOMMU_PAGES_PDE_MASK; 181 173 174 + ret = iommu_queue_command(iommu, &cmd); 175 + 182 176 iommu->need_sync = 1; 183 177 184 - return iommu_queue_command(iommu, &cmd); 178 + return ret; 185 179 } 186 180 187 181 /*
+1 -1
arch/x86/kernel/vsmp_64.c
··· 61 61 native_restore_fl((flags | X86_EFLAGS_IF) & (~X86_EFLAGS_AC)); 62 62 } 63 63 64 - static unsigned __init vsmp_patch(u8 type, u16 clobbers, void *ibuf, 64 + static unsigned __init_or_module vsmp_patch(u8 type, u16 clobbers, void *ibuf, 65 65 unsigned long addr, unsigned len) 66 66 { 67 67 switch (type) {
+3 -1
arch/x86/oprofile/nmi_int.c
··· 295 295 296 296 static void nmi_shutdown(void) 297 297 { 298 - struct op_msrs *msrs = &get_cpu_var(cpu_msrs); 298 + struct op_msrs *msrs; 299 + 299 300 nmi_enabled = 0; 300 301 on_each_cpu(nmi_cpu_shutdown, NULL, 1); 301 302 unregister_die_notifier(&profile_exceptions_nb); 303 + msrs = &get_cpu_var(cpu_msrs); 302 304 model->shutdown(msrs); 303 305 free_msrs(); 304 306 put_cpu_var(cpu_msrs);