diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-23 11:51:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-23 11:51:55 -0400 |
commit | d7ef64a9f9987b29e3d911369a9d40122d5be2dd (patch) | |
tree | c674cbed424876b95ddb23ec99344574be0dab39 | |
parent | ff2a9941ca27ab18169d17b3803aca68b154951c (diff) | |
parent | 6ec5ff4bc3a90b7716eadc4c8a686e904131f03a (diff) |
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
-rw-r--r-- | arch/x86/kernel/amd_iommu.c | 5 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/amd.c | 9 | ||||
-rw-r--r-- | arch/x86/kernel/test_nx.c | 2 | ||||
-rw-r--r-- | arch/x86/mm/pf_in.c | 14 |
4 files changed, 11 insertions, 19 deletions
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c index 873e7e1ead7b..cd8cbeb5fa34 100644 --- a/arch/x86/kernel/amd_iommu.c +++ b/arch/x86/kernel/amd_iommu.c | |||
@@ -1538,13 +1538,11 @@ static void do_detach(struct device *dev) | |||
1538 | { | 1538 | { |
1539 | struct iommu_dev_data *dev_data; | 1539 | struct iommu_dev_data *dev_data; |
1540 | struct amd_iommu *iommu; | 1540 | struct amd_iommu *iommu; |
1541 | struct pci_dev *pdev; | ||
1542 | u16 devid; | 1541 | u16 devid; |
1543 | 1542 | ||
1544 | devid = get_device_id(dev); | 1543 | devid = get_device_id(dev); |
1545 | iommu = amd_iommu_rlookup_table[devid]; | 1544 | iommu = amd_iommu_rlookup_table[devid]; |
1546 | dev_data = get_dev_data(dev); | 1545 | dev_data = get_dev_data(dev); |
1547 | pdev = to_pci_dev(dev); | ||
1548 | 1546 | ||
1549 | /* decrease reference counters */ | 1547 | /* decrease reference counters */ |
1550 | dev_data->domain->dev_iommu[iommu->index] -= 1; | 1548 | dev_data->domain->dev_iommu[iommu->index] -= 1; |
@@ -1703,10 +1701,9 @@ static struct protection_domain *domain_for_device(struct device *dev) | |||
1703 | struct protection_domain *dom; | 1701 | struct protection_domain *dom; |
1704 | struct iommu_dev_data *dev_data, *alias_data; | 1702 | struct iommu_dev_data *dev_data, *alias_data; |
1705 | unsigned long flags; | 1703 | unsigned long flags; |
1706 | u16 devid, alias; | 1704 | u16 devid; |
1707 | 1705 | ||
1708 | devid = get_device_id(dev); | 1706 | devid = get_device_id(dev); |
1709 | alias = amd_iommu_alias_table[devid]; | ||
1710 | dev_data = get_dev_data(dev); | 1707 | dev_data = get_dev_data(dev); |
1711 | alias_data = get_dev_data(dev_data->alias); | 1708 | alias_data = get_dev_data(dev_data->alias); |
1712 | if (!alias_data) | 1709 | if (!alias_data) |
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index 6f9d1f6063e9..8f5cabb3c5b0 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c | |||
@@ -629,10 +629,13 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c) | |||
629 | * Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=33012 | 629 | * Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=33012 |
630 | */ | 630 | */ |
631 | u64 mask; | 631 | u64 mask; |
632 | int err; | ||
632 | 633 | ||
633 | rdmsrl(MSR_AMD64_MCx_MASK(4), mask); | 634 | err = rdmsrl_safe(MSR_AMD64_MCx_MASK(4), &mask); |
634 | mask |= (1 << 10); | 635 | if (err == 0) { |
635 | wrmsrl(MSR_AMD64_MCx_MASK(4), mask); | 636 | mask |= (1 << 10); |
637 | checking_wrmsrl(MSR_AMD64_MCx_MASK(4), mask); | ||
638 | } | ||
636 | } | 639 | } |
637 | } | 640 | } |
638 | 641 | ||
diff --git a/arch/x86/kernel/test_nx.c b/arch/x86/kernel/test_nx.c index 787a5e499dd1..3f92ce07e525 100644 --- a/arch/x86/kernel/test_nx.c +++ b/arch/x86/kernel/test_nx.c | |||
@@ -161,7 +161,7 @@ static int test_NX(void) | |||
161 | } | 161 | } |
162 | 162 | ||
163 | #endif | 163 | #endif |
164 | return 0; | 164 | return ret; |
165 | } | 165 | } |
166 | 166 | ||
167 | static void test_exit(void) | 167 | static void test_exit(void) |
diff --git a/arch/x86/mm/pf_in.c b/arch/x86/mm/pf_in.c index 38e6d174c497..9f0614daea85 100644 --- a/arch/x86/mm/pf_in.c +++ b/arch/x86/mm/pf_in.c | |||
@@ -414,22 +414,17 @@ unsigned long get_ins_reg_val(unsigned long ins_addr, struct pt_regs *regs) | |||
414 | unsigned char *p; | 414 | unsigned char *p; |
415 | struct prefix_bits prf; | 415 | struct prefix_bits prf; |
416 | int i; | 416 | int i; |
417 | unsigned long rv; | ||
418 | 417 | ||
419 | p = (unsigned char *)ins_addr; | 418 | p = (unsigned char *)ins_addr; |
420 | p += skip_prefix(p, &prf); | 419 | p += skip_prefix(p, &prf); |
421 | p += get_opcode(p, &opcode); | 420 | p += get_opcode(p, &opcode); |
422 | for (i = 0; i < ARRAY_SIZE(reg_rop); i++) | 421 | for (i = 0; i < ARRAY_SIZE(reg_rop); i++) |
423 | if (reg_rop[i] == opcode) { | 422 | if (reg_rop[i] == opcode) |
424 | rv = REG_READ; | ||
425 | goto do_work; | 423 | goto do_work; |
426 | } | ||
427 | 424 | ||
428 | for (i = 0; i < ARRAY_SIZE(reg_wop); i++) | 425 | for (i = 0; i < ARRAY_SIZE(reg_wop); i++) |
429 | if (reg_wop[i] == opcode) { | 426 | if (reg_wop[i] == opcode) |
430 | rv = REG_WRITE; | ||
431 | goto do_work; | 427 | goto do_work; |
432 | } | ||
433 | 428 | ||
434 | printk(KERN_ERR "mmiotrace: Not a register instruction, opcode " | 429 | printk(KERN_ERR "mmiotrace: Not a register instruction, opcode " |
435 | "0x%02x\n", opcode); | 430 | "0x%02x\n", opcode); |
@@ -474,16 +469,13 @@ unsigned long get_ins_imm_val(unsigned long ins_addr) | |||
474 | unsigned char *p; | 469 | unsigned char *p; |
475 | struct prefix_bits prf; | 470 | struct prefix_bits prf; |
476 | int i; | 471 | int i; |
477 | unsigned long rv; | ||
478 | 472 | ||
479 | p = (unsigned char *)ins_addr; | 473 | p = (unsigned char *)ins_addr; |
480 | p += skip_prefix(p, &prf); | 474 | p += skip_prefix(p, &prf); |
481 | p += get_opcode(p, &opcode); | 475 | p += get_opcode(p, &opcode); |
482 | for (i = 0; i < ARRAY_SIZE(imm_wop); i++) | 476 | for (i = 0; i < ARRAY_SIZE(imm_wop); i++) |
483 | if (imm_wop[i] == opcode) { | 477 | if (imm_wop[i] == opcode) |
484 | rv = IMM_WRITE; | ||
485 | goto do_work; | 478 | goto do_work; |
486 | } | ||
487 | 479 | ||
488 | printk(KERN_ERR "mmiotrace: Not an immediate instruction, opcode " | 480 | printk(KERN_ERR "mmiotrace: Not an immediate instruction, opcode " |
489 | "0x%02x\n", opcode); | 481 | "0x%02x\n", opcode); |