Commit d7ef64a9 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'x86-urgent-for-linus' of...

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

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86: Eliminate various 'set but not used' warnings
  x86, SMEP: Fix section mismatch warnings
  x86, amd: Use _safe() msr access for GartTlbWlk disable code
parents ff2a9941 6ec5ff4b
...@@ -1538,13 +1538,11 @@ static void do_detach(struct device *dev) ...@@ -1538,13 +1538,11 @@ static void do_detach(struct device *dev)
{ {
struct iommu_dev_data *dev_data; struct iommu_dev_data *dev_data;
struct amd_iommu *iommu; struct amd_iommu *iommu;
struct pci_dev *pdev;
u16 devid; u16 devid;
devid = get_device_id(dev); devid = get_device_id(dev);
iommu = amd_iommu_rlookup_table[devid]; iommu = amd_iommu_rlookup_table[devid];
dev_data = get_dev_data(dev); dev_data = get_dev_data(dev);
pdev = to_pci_dev(dev);
/* decrease reference counters */ /* decrease reference counters */
dev_data->domain->dev_iommu[iommu->index] -= 1; dev_data->domain->dev_iommu[iommu->index] -= 1;
...@@ -1703,10 +1701,9 @@ static struct protection_domain *domain_for_device(struct device *dev) ...@@ -1703,10 +1701,9 @@ static struct protection_domain *domain_for_device(struct device *dev)
struct protection_domain *dom; struct protection_domain *dom;
struct iommu_dev_data *dev_data, *alias_data; struct iommu_dev_data *dev_data, *alias_data;
unsigned long flags; unsigned long flags;
u16 devid, alias; u16 devid;
devid = get_device_id(dev); devid = get_device_id(dev);
alias = amd_iommu_alias_table[devid];
dev_data = get_dev_data(dev); dev_data = get_dev_data(dev);
alias_data = get_dev_data(dev_data->alias); alias_data = get_dev_data(dev_data->alias);
if (!alias_data) if (!alias_data)
......
...@@ -629,10 +629,13 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c) ...@@ -629,10 +629,13 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
* Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=33012 * Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=33012
*/ */
u64 mask; u64 mask;
int err;
rdmsrl(MSR_AMD64_MCx_MASK(4), mask); err = rdmsrl_safe(MSR_AMD64_MCx_MASK(4), &mask);
mask |= (1 << 10); if (err == 0) {
wrmsrl(MSR_AMD64_MCx_MASK(4), mask); mask |= (1 << 10);
checking_wrmsrl(MSR_AMD64_MCx_MASK(4), mask);
}
} }
} }
......
...@@ -161,7 +161,7 @@ static int test_NX(void) ...@@ -161,7 +161,7 @@ static int test_NX(void)
} }
#endif #endif
return 0; return ret;
} }
static void test_exit(void) static void test_exit(void)
......
...@@ -414,22 +414,17 @@ unsigned long get_ins_reg_val(unsigned long ins_addr, struct pt_regs *regs) ...@@ -414,22 +414,17 @@ unsigned long get_ins_reg_val(unsigned long ins_addr, struct pt_regs *regs)
unsigned char *p; unsigned char *p;
struct prefix_bits prf; struct prefix_bits prf;
int i; int i;
unsigned long rv;
p = (unsigned char *)ins_addr; p = (unsigned char *)ins_addr;
p += skip_prefix(p, &prf); p += skip_prefix(p, &prf);
p += get_opcode(p, &opcode); p += get_opcode(p, &opcode);
for (i = 0; i < ARRAY_SIZE(reg_rop); i++) for (i = 0; i < ARRAY_SIZE(reg_rop); i++)
if (reg_rop[i] == opcode) { if (reg_rop[i] == opcode)
rv = REG_READ;
goto do_work; goto do_work;
}
for (i = 0; i < ARRAY_SIZE(reg_wop); i++) for (i = 0; i < ARRAY_SIZE(reg_wop); i++)
if (reg_wop[i] == opcode) { if (reg_wop[i] == opcode)
rv = REG_WRITE;
goto do_work; goto do_work;
}
printk(KERN_ERR "mmiotrace: Not a register instruction, opcode " printk(KERN_ERR "mmiotrace: Not a register instruction, opcode "
"0x%02x\n", opcode); "0x%02x\n", opcode);
...@@ -474,16 +469,13 @@ unsigned long get_ins_imm_val(unsigned long ins_addr) ...@@ -474,16 +469,13 @@ unsigned long get_ins_imm_val(unsigned long ins_addr)
unsigned char *p; unsigned char *p;
struct prefix_bits prf; struct prefix_bits prf;
int i; int i;
unsigned long rv;
p = (unsigned char *)ins_addr; p = (unsigned char *)ins_addr;
p += skip_prefix(p, &prf); p += skip_prefix(p, &prf);
p += get_opcode(p, &opcode); p += get_opcode(p, &opcode);
for (i = 0; i < ARRAY_SIZE(imm_wop); i++) for (i = 0; i < ARRAY_SIZE(imm_wop); i++)
if (imm_wop[i] == opcode) { if (imm_wop[i] == opcode)
rv = IMM_WRITE;
goto do_work; goto do_work;
}
printk(KERN_ERR "mmiotrace: Not an immediate instruction, opcode " printk(KERN_ERR "mmiotrace: Not an immediate instruction, opcode "
"0x%02x\n", opcode); "0x%02x\n", opcode);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment